Frozen SDK supplementary library/header comment notices.

A conservative source superset preserves whole comment terms, including dlmalloc public dedication, LLVM library per-file attributions and API header terms. This does not assert each optional source/header is linked. The separate libc notices and full library licenses/credits accompany this file.


=== system/include/AL/alext.h ===
SHA256: 6d81667242487dd1664a74ea5974d8721d6348349878f72bde16f0cb3837d91a
// ALC_SOFT_pause_device

// ALC_SOFT_HRTF

// AL_EXT_float32

// AL_SOFT_loop_points

// AL_SOFT_source_length

// AL_EXT_source_distance_model

// AL_SOFT_source_spatialize

// OPENAL_ALEXT_H__


=== system/include/EGL/egl.h ===
SHA256: 672cba441808be819a403fea2dcb9a289e4b264aa5f45ac578c5ddafad67235a
/*
** Copyright (c) 2013-2017 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are 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 Materials.
**
** THE MATERIALS ARE 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
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/

/*
** This header is generated from the Khronos EGL XML API Registry.
** The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
**   http://www.khronos.org/registry/egl
**
** Khronos $Git commit SHA1: ad06e1c38e $ on $Git commit date: 2020-04-09 18:40:05 +0200 $
*/

/* Generated on date 20200505 */

/* Generated C header for:
 * API: egl
 * Versions considered: .*
 * Versions emitted: .*
 * Default extensions included: None
 * Additional extensions included: _nomatch_^
 * Extensions removed: _nomatch_^
 */

/* EGL_VERSION_1_0 */

/* EGL_VERSION_1_1 */

/* EGL_VERSION_1_2 */

/* EGL_VERSION_1_3 */

/* EGL_VERSION_1_4 */

/* EGL_VERSION_1_5 */


=== system/include/EGL/eglext.h ===
SHA256: 8e6b04acc69f690ddd77771de99c3497dedb08167b5cf17c130d724148230ec3
/*
** Copyright (c) 2013-2017 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are 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 Materials.
**
** THE MATERIALS ARE 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
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/

/*
** This header is generated from the Khronos EGL XML API Registry.
** The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
**   http://www.khronos.org/registry/egl
**
** Khronos $Git commit SHA1: ad06e1c38e $ on $Git commit date: 2020-04-09 18:40:05 +0200 $
*/

/* Generated C header for:
 * API: egl
 * Versions considered: .*
 * Versions emitted: _nomatch_^
 * Default extensions included: egl
 * Additional extensions included: _nomatch_^
 * Extensions removed: _nomatch_^
 */

/* EGL_KHR_cl_event */

/* EGL_KHR_cl_event2 */

/* EGL_KHR_client_get_all_proc_addresses */

/* EGL_KHR_config_attribs */

/* EGL_KHR_context_flush_control */

/* EGL_KHR_create_context */

/* EGL_KHR_create_context_no_error */

/* EGL_KHR_debug */

/* EGL_KHR_display_reference */

/* KHRONOS_SUPPORT_INT64 */

/* EGL_KHR_fence_sync */

/* EGL_KHR_get_all_proc_addresses */

/* EGL_KHR_gl_colorspace */

/* EGL_KHR_gl_renderbuffer_image */

/* EGL_KHR_gl_texture_2D_image */

/* EGL_KHR_gl_texture_3D_image */

/* EGL_KHR_gl_texture_cubemap_image */

/* EGL_KHR_image */

/* EGL_KHR_image_base */

/* EGL_KHR_image_pixmap */

/* EGL_KHR_lock_surface */

/* EGL_KHR_lock_surface2 */

/* EGL_KHR_lock_surface3 */

/* EGL_KHR_mutable_render_buffer */

/* EGL_KHR_no_config_context */

/* EGL_KHR_partial_update */

/* EGL_KHR_platform_android */

/* EGL_KHR_platform_gbm */

/* EGL_KHR_platform_wayland */

/* EGL_KHR_platform_x11 */

/* KHRONOS_SUPPORT_INT64 */

/* EGL_KHR_reusable_sync */

/* KHRONOS_SUPPORT_INT64 */

/* EGL_KHR_stream */

/* KHRONOS_SUPPORT_INT64 */

/* EGL_KHR_stream_attrib */

/* EGL_KHR_stream */

/* EGL_KHR_stream_consumer_gltexture */

/* EGL_KHR_stream */

/* EGL_KHR_stream_cross_process_fd */

/* EGL_KHR_stream */

/* EGL_KHR_stream_fifo */

/* EGL_KHR_stream */

/* EGL_KHR_stream_producer_aldatalocator */

/* EGL_KHR_stream */

/* EGL_KHR_stream_producer_eglsurface */

/* EGL_KHR_surfaceless_context */

/* EGL_KHR_swap_buffers_with_damage */

/* EGL_KHR_vg_parent_image */

/* EGL_KHR_wait_sync */

/* EGL_ANDROID_GLES_layers */

/* EGL_ANDROID_blob_cache */

/* EGL_ANDROID_create_native_client_buffer */

/* EGL_ANDROID_framebuffer_target */

/* EGL_ANDROID_front_buffer_auto_refresh */

/* EGL_ANDROID_get_frame_timestamps */

/* EGL_ANDROID_get_native_client_buffer */

/* EGL_ANDROID_image_native_buffer */

/* EGL_ANDROID_native_fence_sync */

/* EGL_ANDROID_presentation_time */

/* EGL_ANDROID_recordable */

/* EGL_ANGLE_d3d_share_handle_client_buffer */

/* EGL_ANGLE_device_d3d */

/* EGL_ANGLE_query_surface_pointer */

/* EGL_ANGLE_surface_d3d_texture_2d_share_handle */

/* EGL_ANGLE_window_fixed_size */

/* EGL_ARM_image_format */

/* EGL_ARM_implicit_external_sync */

/* EGL_ARM_pixmap_multisample_discard */

/* EGL_EXT_bind_to_front */

/* EGL_EXT_buffer_age */

/* EGL_EXT_client_extensions */

/* EGL_EXT_client_sync */

/* EGL_EXT_compositor */

/* EGL_EXT_create_context_robustness */

/* EGL_EXT_device_base */

/* EGL_EXT_device_drm */

/* EGL_EXT_device_enumeration */

/* EGL_EXT_device_openwf */

/* EGL_EXT_device_query */

/* EGL_EXT_gl_colorspace_bt2020_linear */

/* EGL_EXT_gl_colorspace_bt2020_pq */

/* EGL_EXT_gl_colorspace_display_p3 */

/* EGL_EXT_gl_colorspace_display_p3_linear */

/* EGL_EXT_gl_colorspace_display_p3_passthrough */

/* EGL_EXT_gl_colorspace_scrgb */

/* EGL_EXT_gl_colorspace_scrgb_linear */

/* EGL_EXT_image_dma_buf_import */

/* EGL_EXT_image_dma_buf_import_modifiers */

/* EGL_EXT_image_gl_colorspace */

/* EGL_EXT_image_implicit_sync_control */

/* EGL_EXT_multiview_window */

/* EGL_EXT_output_base */

/* EGL_EXT_output_drm */

/* EGL_EXT_output_openwf */

/* EGL_EXT_pixel_format_float */

/* EGL_EXT_platform_base */

/* EGL_EXT_platform_device */

/* EGL_EXT_platform_wayland */

/* EGL_EXT_platform_x11 */

/* EGL_EXT_protected_content */

/* EGL_EXT_protected_surface */

/* EGL_EXT_stream_consumer_egloutput */

/* EGL_EXT_surface_CTA861_3_metadata */

/* EGL_EXT_surface_SMPTE2086_metadata */

/* EGL_EXT_swap_buffers_with_damage */

/* EGL_EXT_sync_reuse */

/* EGL_EXT_yuv_surface */

/* EGL_HI_clientpixmap */

/* EGL_HI_colorformats */

/* EGL_IMG_context_priority */

/* EGL_IMG_image_plane_attribs */

/* EGL_MESA_drm_image */

/* EGL_MESA_image_dma_buf_export */

/* EGL_MESA_platform_gbm */

/* EGL_MESA_platform_surfaceless */

/* EGL_MESA_query_driver */

/* EGL_NOK_swap_region */

/* EGL_NOK_swap_region2 */

/* EGL_NOK_texture_from_pixmap */

/* EGL_NV_3dvision_surface */

/* EGL_NV_context_priority_realtime */

/* EGL_NV_coverage_sample */

/* EGL_NV_coverage_sample_resolve */

/* EGL_NV_cuda_event */

/* EGL_NV_depth_nonlinear */

/* EGL_NV_device_cuda */

/* EGL_NV_native_query */

/* EGL_NV_post_convert_rounding */

/* EGL_NV_post_sub_buffer */

/* EGL_NV_quadruple_buffer */

/* EGL_NV_robustness_video_memory_purge */

/* EGL_NV_stream_consumer_eglimage */

/* EGL_NV_stream_consumer_gltexture_yuv */

/* EGL_NV_stream_cross_display */

/* EGL_NV_stream_cross_object */

/* EGL_NV_stream_cross_partition */

/* EGL_NV_stream_cross_process */

/* EGL_NV_stream_cross_system */

/* EGL_NV_stream_dma */

/* EGL_NV_stream_fifo_next */

/* EGL_NV_stream_fifo_synchronous */

/* EGL_NV_stream_flush */

/* EGL_NV_stream_frame_limits */

/* EGL_NV_stream_metadata */

/* EGL_NV_stream_origin */

/* EGL_NV_stream_remote */

/* EGL_NV_stream_reset */

/* EGL_NV_stream_socket */

/* EGL_NV_stream_socket_inet */

/* EGL_NV_stream_socket_unix */

/* EGL_NV_stream_sync */

/* KHRONOS_SUPPORT_INT64 */

/* EGL_NV_sync */

/* KHRONOS_SUPPORT_INT64 */

/* EGL_NV_system_time */

/* EGL_NV_triple_buffer */

/* EGL_TIZEN_image_native_buffer */

/* EGL_TIZEN_image_native_surface */

/* EGL_WL_bind_wayland_display */

/* EGL_WL_create_wayland_buffer_from_image */


=== system/include/EGL/eglplatform.h ===
SHA256: f8ce08bc9834660f49dfa271ab5891bf86d61758d32f11170142f7e0bcadd45d
/*
** Copyright (c) 2007-2016 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are 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 Materials.
**
** THE MATERIALS ARE 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
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/

/* Platform-specific types and definitions for egl.h
 * $Revision: 30994 $ on $Date: 2015-04-30 13:36:48 -0700 (Thu, 30 Apr 2015) $
 *
 * Adopters may modify khrplatform.h and this file to suit their platform.
 * You are encouraged to submit all modifications to the Khronos group so that
 * they can be included in future versions of this file.  Please submit changes
 * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
 * by filing a bug against product "EGL" component "Registry".
 */

/* Macros used in EGL function prototype declarations.
 *
 * EGL functions should be prototyped as:
 *
 * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
 * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
 *
 * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
 */

/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
 * are aliases of window-system-dependent types, such as X Display * or
 * Windows Device Context. They must be defined in platform-specific
 * code below. The EGL-prefixed versions of Native*Type are the same
 * types, renamed in EGL 1.3 so all types in the API start with "EGL".
 *
 * Khronos STRONGLY RECOMMENDS that you use the default definitions
 * provided below, since these changes affect both binary and source
 * portability of applications using EGL running on different EGL
 * implementations.
 */

/* Win32 and WinCE */

/* Symbian */

/* X11 (tentative)  */

/* EGL 1.2 types, renamed for consistency in EGL 1.3 */

/* Define EGLint. This must be a signed integral type large enough to contain
 * all legal attribute names and values passed into and out of EGL, whether
 * their type is boolean, bitmask, enumerant (symbolic constant), integer,
 * handle, or other.  While in general a 32-bit integer will suffice, if
 * handles are 64 bit types, then EGLint should be defined as a signed 64-bit
 * integer type.
 */

/* C++ / C typecast macros for special EGL handle values */

/* __eglplatform_h */


=== system/include/GL/freeglut_std.h ===
SHA256: 2cdaeae8da32be30232cf2bd0205708b3511e93b28a8a793e149afb32edb5cb3
/*
 * freeglut_std.h
 *
 * The GLUT-compatible part of the freeglut library include file
 *
 * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
 * Written by Pawel W. Olszta, <olszta@sourceforge.net>
 * Creation date: Thu Dec 2 1999
 *
 * 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
 * PAWEL W. OLSZTA 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.
 */

/*
 * Under windows, we have to differentiate between static and dynamic libraries
 */

/* #pragma may not be supported by some compilers.
 * Discussion by FreeGLUT developers suggests that
 * Visual C++ specific code involving pragmas may
 * need to move to a separate header.  24th Dec 2003
 */

/* Define FREEGLUT_LIB_PRAGMAS to 1 to include library
 * pragmas or to 0 to exclude library pragmas.
 * The default behavior depends on the compiler/platform.
 */

/* Windows static library */

/* Link with Win32 static freeglut lib */

/* Windows shared library (DLL) */

/* Link with Win32 shared freeglut lib */

/* Drag in other Windows libraries as required by FreeGLUT */

/* link OpenGL Utility lib     */

/* link Microsoft OpenGL lib   */

/* link Windows GDI lib        */

/* link Windows MultiMedia lib */

/* link Windows user lib       */

/* Non-Windows definition of FGAPI and FGAPIENTRY  */

/*
 * The freeglut and GLUT API versions
 */

/*
 * Always include OpenGL and GLU headers
 */

/*
 * GLUT API macro definitions -- the special key codes:
 */

/*
 * GLUT API macro definitions -- mouse state definitions
 */

/*
 * GLUT API macro definitions -- the display mode definitions
 */

/*
 * GLUT API macro definitions -- windows and menu related definitions
 */

/*
 * GLUT API macro definitions -- fonts definitions
 *
 * Steve Baker suggested to make it binary compatible with GLUT:
 */

/*
     * I don't really know if it's a good idea... But here it goes:
     */

/*
     * Those pointers will be used by following definitions:
     */

/*
 * GLUT API macro definitions -- the glutGet parameters
 */

/*
 * GLUT API macro definitions -- the glutDeviceGet parameters
 */

/*
 * GLUT API macro definitions -- the glutLayerGet parameters
 */

/*
 * GLUT API macro definitions -- the glutVideoResizeGet parameters
 */

/*
 * GLUT API macro definitions -- the glutUseLayer parameters
 */

/*
 * GLUT API macro definitions -- the glutGetModifiers parameters
 */

/*
 * GLUT API macro definitions -- the glutSetCursor parameters
 */

/*
 * GLUT API macro definitions -- RGB color component specification definitions
 */

/*
 * GLUT API macro definitions -- additional keyboard and joystick definitions
 */

/*
 * GLUT API macro definitions -- game mode definitions
 */

/*
 * Initialization functions, see fglut_init.c
 */

/*
 * Process loop function, see freeglut_main.c
 */

/*
 * Window management functions, see freeglut_window.c
 */

/*
 * Display-connected functions, see freeglut_display.c
 */

/*
 * Mouse cursor functions, see freeglut_cursor.c
 */

/*
 * Overlay stuff, see freeglut_overlay.c
 */

/*
 * Menu stuff, see freeglut_menu.c
 */

/*
 * Global callback functions, see freeglut_callbacks.c
 */

/*
 * Window-specific callback functions, see freeglut_callbacks.c
 */

/*
 * State setting and retrieval functions, see freeglut_state.c
 */

/*
 * Font stuff, see freeglut_font.c
 */

/*
 * Geometry functions, see freeglut_geometry.c
 */

/*
 * Teapot rendering functions, found in freeglut_teapot.c
 */

/*
 * Game mode functions, see freeglut_gamemode.c
 */

/*
 * Video resize functions, see freeglut_videoresize.c
 */

/*
 * Colormap functions, see freeglut_misc.c
 */

/*
 * Misc keyboard and joystick functions, see freeglut_misc.c
 */

/*
 * Misc functions, see freeglut_misc.c
 */

/* Comment from glut.h of classic GLUT:

   Win32 has an annoying issue where there are multiple C run-time
   libraries (CRTs).  If the executable is linked with a different CRT
   from the GLUT DLL, the GLUT DLL will not share the same CRT static
   data seen by the executable.  In particular, atexit callbacks registered
   in the executable will not be called if GLUT calls its (different)
   exit routine).  GLUT is typically built with the
   "/MD" option (the CRT with multithreading DLL support), but the Visual
   C++ linker default is "/ML" (the single threaded CRT).

   One workaround to this issue is requiring users to always link with
   the same CRT as GLUT is compiled with.  That requires users supply a
   non-standard option.  GLUT 3.7 has its own built-in workaround where
   the executable's "exit" function pointer is covertly passed to GLUT.
   GLUT then calls the executable's exit function pointer to ensure that
   any "atexit" calls registered by the application are called if GLUT
   needs to exit.

   Note that the __glut*WithExit routines should NEVER be called directly.
   To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */

/* to get the prototype for exit() */

/*** END OF FILE ***/

/* __FREEGLUT_STD_H__ */


=== system/include/GL/gl.h ===
SHA256: a791b70287b4cd3b9789334c69ac8427ac6129b2d8605fafac9272035d45bf1e
/*
 * Mesa 3-D graphics library
 * Version:  7.6
 *
 * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
 * Copyright (C) 2009  VMware, Inc.  All Rights Reserved.
 *
 * 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
 * BRIAN PAUL 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.
 */

/**********************************************************************
 * Begin system-specific stuff. Do not do any of this when building
 * for SciTech SNAP, as this is all done before this header file is
 * included. 
 */

/* to get some BeOS-isms */

/* tag specify we're building mesa as a DLL */

/* tag specifying we're building for DLL runtime support */

/* for use with static link lib build of Win32 edition only */

/* _STATIC_MESA support */

/* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */

/* use native windows opengl32 */

/* WIN32 && !CYGWIN */

/*
 * WINDOWS: Include windows.h here to define APIENTRY.
 * It is also useful when applications include this file by
 * including only glut.h, since glut.h depends on windows.h.
 * Applications needing to include windows.h with parms other
 * than "WIN32_LEAN_AND_MEAN" may include windows.h before
 * glut.h or gl.h.
 */

/* "P" suffix to be used for a pointer to a function */

/* !__SCITECH_SNAP__ */

/*
 * End system-specific stuff.
 **********************************************************************/

/*
 * Datatypes
 */

/* 1-byte signed */

/* 2-byte signed */

/* 4-byte signed */

/* 1-byte unsigned */

/* 2-byte unsigned */

/* 4-byte unsigned */

/* 4-byte signed */

/* single precision float */

/* single precision float in [0,1] */

/* double precision float */

/* double precision float in [0,1] */

/*
 * Constants
 */

/* Boolean values */

/* Data types */

/* Primitives */

/* Vertex Arrays */

/* Matrix Mode */

/* Points */

/* Lines */

/* Polygons */

/* Display Lists */

/* Depth buffer */

/* Lighting */

/* User clipping planes */

/* Accumulation buffer */

/* Alpha testing */

/* Blending */

/* Render Mode */

/* Feedback */

/* Selection */

/* Fog */

/* Logic Ops */

/* Stencil */

/* Buffers, Pixel Drawing/Reading */

/*GL_FRONT					0x0404 */

/*GL_BACK					0x0405 */

/*GL_FRONT_AND_BACK				0x0408 */

/* Implementation limits */

/* Gets */

/* Evaluators */

/* Hints */

/* Scissor box */

/* Pixel Mode / Transfer */

/* Texture mapping */

/* Utility */

/* Errors */

/* glPush/PopAttrib bits */

/* OpenGL 1.1 */

/*
 * Miscellaneous
 */

/* 1.1 */

/* 1.1 */

/* 1.1 */

/* 1.1 */

/*
 * Depth Buffer
 */

/*
 * Accumulation Buffer
 */

/*
 * Transformation
 */

/*
 * Display Lists
 */

/*
 * Drawing Functions
 */

/* 1.1 */

/* 1.1 */

/*
 * Vertex Arrays  (1.1)
 */

/*
 * Lighting
 */

/*
 * Raster functions
 */

/*
 * Stenciling
 */

/*
 * Texture mapping
 */

/* 1.1 functions */

/*
 * Evaluators
 */

/*
 * Fog
 */

/*
 * Selection and Feedback
 */

/*
 * OpenGL 1.2
 */

/*
 * GL_ARB_imaging
 */

/*
 * OpenGL 1.3
 */

/* multitexture */

/* texture_cube_map */

/* texture_compression */

/* multisample */

/* transpose_matrix */

/* texture_env_combine */

/* texture_env_dot3 */

/* texture_border_clamp */

/*
 * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1)
 */

/* GL_ARB_multitexture */

/*
 * Define this token if you want "old-style" header file behaviour (extensions
 * defined in gl.h).  Otherwise, extensions will be included from glext.h.
 */

/* All extensions that used to be here are now found in glext.h */

/* GL_GLEXT_LEGACY */

/* GL_GLEXT_LEGACY */

/* GL_MESA_shader_debug */

/* GL_ARB_shader_objects */

/*
 * ???. GL_MESA_packed_depth_stencil
 * XXX obsolete
 */

/* GL_MESA_packed_depth_stencil */

/* GL_MESA_program_debug */

/* GL_MESA_texture_array uses the same enum values as GL_EXT_texture_array.
 */

/* GL_GLEXT_PROTOTYPES */

/* (temporarily) disabled because of collision with typedef in glext.h
 * that happens if apps include both gl.h and glext.h
 */

/* GL_ATI_blend_equation_separate */

/* GL_OES_EGL_image */

/**
 ** NOTE!!!!!  If you add new functions to this file, or update
 ** glext.h be sure to regenerate the gl_mangle.h file.  See comments
 ** in that file for details.
 **/

/**********************************************************************
 * Begin system-specific stuff
 */

/*
 * End system-specific stuff
 **********************************************************************/

/* __gl_h_ */


=== system/include/GL/glew.h ===
SHA256: ae723bf3ee69010552d56ef86b7dc149f1557c408f5de810b9ee572a329f088e
/* GLEW 1.10.0 emulation include header
 * this include file provides neccessary stuff to function with most GLEW programs.
 * library_glew.js is also provided to support extensions and error strings
 *
 * This file is based on GLEW (1.10.0) and linaro fork generated include files.
 *
 * What it lacks:
 * - Some constants and function declarations that are in GLEW 1.10.0 might be missing.
 * - The real glew-es fork also includes normal GL constants and function pointers, this does not.
 *
 * Authors:
 * - Jari Vetoniemi <mailroxas@gmail.com>
 */

/* linaro fork (glew-es) support */

/* report us up to GLEW_VERSION_2_1, when no GLEW_USE_LIB_ESXX is specified.
 * in source, it's possible to #undef and redefine these constants, for
 * better OpenGL path suitable for emscripten. */

/* linaro-fork (glew-es) version constants */

/* string codes */

/* error codes */

/* missing GL version */

/* Need at least OpenGL 1.1 */

/* Need at least GLX 1.2 */

/* linaro-fork (glew-es) error codes */

/* Need to be OpenGL ES version */

/* Need to be desktop OpenGL version */

/* missing EGL version */

/* need at least EGL 1.1 */

/* maps to glewGetExtension */

/* support GLEW constants, wrangling is done by SDL_opengl.h */

/* and from linaro glew-oes fork */

/* some of the missing constants in SDL_opengl.h
 * XXX: Most likely doesn't have all. */

/* GL_KHR_debug */

/* GL_ARB_shader_storage_buffer_object */

/* GL_ARB_shader_atomic_counters */

/* GL_ARB_shader_image_load_store */

/* API */

/* GLEW_MX */

//GLboolean glewExperimental;

// XXX Emscripten Added 'static' to work around a linkage issue. See https://github.com/emscripten-core/emscripten/issues/2025

/* __glew_h__ */


=== system/include/GL/glext.h ===
SHA256: 1410e1f22bd8d60078997190b1cbab4742d4e77e9cee0c02ff0f0ee3c0e737aa
/*
** Copyright (c) 2013-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are 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 Materials.
**
** THE MATERIALS ARE 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
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/

/*
** This header is generated from the Khronos OpenGL / OpenGL ES XML
** API Registry. The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
**   https://github.com/KhronosGroup/OpenGL-Registry
*/

/* Generated C header for:
 * API: gl
 * Profile: compatibility
 * Versions considered: .*
 * Versions emitted: 1\.[2-9]|[234]\.[0-9]
 * Default extensions included: gl
 * Additional extensions included: _nomatch_^
 * Extensions removed: _nomatch_^
 */

/* GL_VERSION_1_2 */

/* GL_VERSION_1_3 */

/* GL_VERSION_1_4 */

/* GL_VERSION_1_5 */

/* GL_VERSION_2_0 */

/* GL_VERSION_2_1 */

/* GL_VERSION_3_0 */

/* GL_VERSION_3_1 */

/* GL_VERSION_3_2 */

/* GL_VERSION_3_3 */

/* GL_VERSION_4_0 */

/* GL_VERSION_4_1 */

/* GL_VERSION_4_2 */

/* GL_VERSION_4_3 */

/* GL_VERSION_4_4 */

/* GL_VERSION_4_5 */

/* GL_VERSION_4_6 */

/* GL_ARB_ES2_compatibility */

/* GL_ARB_ES3_1_compatibility */

/* GL_ARB_ES3_2_compatibility */

/* GL_ARB_ES3_compatibility */

/* GL_ARB_arrays_of_arrays */

/* GL_ARB_base_instance */

/* GL_ARB_bindless_texture */

/* GL_ARB_blend_func_extended */

/* GL_ARB_buffer_storage */

/* GL_ARB_cl_event */

/* GL_ARB_clear_buffer_object */

/* GL_ARB_clear_texture */

/* GL_ARB_clip_control */

/* GL_ARB_color_buffer_float */

/* GL_ARB_compatibility */

/* GL_ARB_compressed_texture_pixel_storage */

/* GL_ARB_compute_shader */

/* GL_ARB_compute_variable_group_size */

/* GL_ARB_conditional_render_inverted */

/* GL_ARB_conservative_depth */

/* GL_ARB_copy_buffer */

/* GL_ARB_copy_image */

/* GL_ARB_cull_distance */

/* GL_ARB_debug_output */

/* GL_ARB_depth_buffer_float */

/* GL_ARB_depth_clamp */

/* GL_ARB_depth_texture */

/* GL_ARB_derivative_control */

/* GL_ARB_direct_state_access */

/* GL_ARB_draw_buffers */

/* GL_ARB_draw_buffers_blend */

/* GL_ARB_draw_elements_base_vertex */

/* GL_ARB_draw_indirect */

/* GL_ARB_draw_instanced */

/* GL_ARB_enhanced_layouts */

/* GL_ARB_explicit_attrib_location */

/* GL_ARB_explicit_uniform_location */

/* GL_ARB_fragment_coord_conventions */

/* GL_ARB_fragment_layer_viewport */

/* GL_ARB_fragment_program */

/* GL_ARB_fragment_program_shadow */

/* GL_ARB_fragment_shader */

/* GL_ARB_fragment_shader_interlock */

/* GL_ARB_framebuffer_no_attachments */

/* GL_ARB_framebuffer_object */

/* GL_ARB_framebuffer_sRGB */

/* GL_ARB_geometry_shader4 */

/* GL_ARB_get_program_binary */

/* GL_ARB_get_texture_sub_image */

/* GL_ARB_gl_spirv */

/* GL_ARB_gpu_shader5 */

/* GL_ARB_gpu_shader_fp64 */

/* GL_ARB_gpu_shader_int64 */

/* GL_ARB_half_float_pixel */

/* GL_ARB_half_float_vertex */

/* GL_ARB_imaging */

/* GL_ARB_indirect_parameters */

/* GL_ARB_instanced_arrays */

/* GL_ARB_internalformat_query */

/* GL_ARB_internalformat_query2 */

/* GL_ARB_invalidate_subdata */

/* GL_ARB_map_buffer_alignment */

/* GL_ARB_map_buffer_range */

/* GL_ARB_matrix_palette */

/* GL_ARB_multi_bind */

/* GL_ARB_multi_draw_indirect */

/* GL_ARB_multisample */

/* GL_ARB_multitexture */

/* GL_ARB_occlusion_query */

/* GL_ARB_occlusion_query2 */

/* GL_ARB_parallel_shader_compile */

/* GL_ARB_pipeline_statistics_query */

/* GL_ARB_pixel_buffer_object */

/* GL_ARB_point_parameters */

/* GL_ARB_point_sprite */

/* GL_ARB_polygon_offset_clamp */

/* GL_ARB_post_depth_coverage */

/* GL_ARB_program_interface_query */

/* GL_ARB_provoking_vertex */

/* GL_ARB_query_buffer_object */

/* GL_ARB_robust_buffer_access_behavior */

/* GL_ARB_robustness */

/* GL_ARB_robustness_isolation */

/* GL_ARB_sample_locations */

/* GL_ARB_sample_shading */

/* GL_ARB_sampler_objects */

/* GL_ARB_seamless_cube_map */

/* GL_ARB_seamless_cubemap_per_texture */

/* GL_ARB_separate_shader_objects */

/* GL_ARB_shader_atomic_counter_ops */

/* GL_ARB_shader_atomic_counters */

/* GL_ARB_shader_ballot */

/* GL_ARB_shader_bit_encoding */

/* GL_ARB_shader_clock */

/* GL_ARB_shader_draw_parameters */

/* GL_ARB_shader_group_vote */

/* GL_ARB_shader_image_load_store */

/* GL_ARB_shader_image_size */

/* GL_ARB_shader_objects */

/* GL_ARB_shader_precision */

/* GL_ARB_shader_stencil_export */

/* GL_ARB_shader_storage_buffer_object */

/* GL_ARB_shader_subroutine */

/* GL_ARB_shader_texture_image_samples */

/* GL_ARB_shader_texture_lod */

/* GL_ARB_shader_viewport_layer_array */

/* GL_ARB_shading_language_100 */

/* GL_ARB_shading_language_420pack */

/* GL_ARB_shading_language_include */

/* GL_ARB_shading_language_packing */

/* GL_ARB_shadow */

/* GL_ARB_shadow_ambient */

/* GL_ARB_sparse_buffer */

/* GL_ARB_sparse_texture */

/* GL_ARB_sparse_texture2 */

/* GL_ARB_sparse_texture_clamp */

/* GL_ARB_spirv_extensions */

/* GL_ARB_stencil_texturing */

/* GL_ARB_sync */

/* GL_ARB_tessellation_shader */

/* GL_ARB_texture_barrier */

/* GL_ARB_texture_border_clamp */

/* GL_ARB_texture_buffer_object */

/* GL_ARB_texture_buffer_object_rgb32 */

/* GL_ARB_texture_buffer_range */

/* GL_ARB_texture_compression */

/* GL_ARB_texture_compression_bptc */

/* GL_ARB_texture_compression_rgtc */

/* GL_ARB_texture_cube_map */

/* GL_ARB_texture_cube_map_array */

/* GL_ARB_texture_env_add */

/* GL_ARB_texture_env_combine */

/* GL_ARB_texture_env_crossbar */

/* GL_ARB_texture_env_dot3 */

/* GL_ARB_texture_filter_anisotropic */

/* GL_ARB_texture_filter_minmax */

/* GL_ARB_texture_float */

/* GL_ARB_texture_gather */

/* GL_ARB_texture_mirror_clamp_to_edge */

/* GL_ARB_texture_mirrored_repeat */

/* GL_ARB_texture_multisample */

/* GL_ARB_texture_non_power_of_two */

/* GL_ARB_texture_query_levels */

/* GL_ARB_texture_query_lod */

/* GL_ARB_texture_rectangle */

/* GL_ARB_texture_rg */

/* GL_ARB_texture_rgb10_a2ui */

/* GL_ARB_texture_stencil8 */

/* GL_ARB_texture_storage */

/* GL_ARB_texture_storage_multisample */

/* GL_ARB_texture_swizzle */

/* GL_ARB_texture_view */

/* GL_ARB_timer_query */

/* GL_ARB_transform_feedback2 */

/* GL_ARB_transform_feedback3 */

/* GL_ARB_transform_feedback_instanced */

/* GL_ARB_transform_feedback_overflow_query */

/* GL_ARB_transpose_matrix */

/* GL_ARB_uniform_buffer_object */

/* GL_ARB_vertex_array_bgra */

/* GL_ARB_vertex_array_object */

/* GL_ARB_vertex_attrib_64bit */

/* GL_ARB_vertex_attrib_binding */

/* GL_ARB_vertex_blend */

/* GL_ARB_vertex_buffer_object */

/* GL_ARB_vertex_program */

/* GL_ARB_vertex_shader */

/* GL_ARB_vertex_type_10f_11f_11f_rev */

/* GL_ARB_vertex_type_2_10_10_10_rev */

/* GL_ARB_viewport_array */

/* GL_ARB_window_pos */

/* GL_KHR_blend_equation_advanced */

/* GL_KHR_blend_equation_advanced_coherent */

/* GL_KHR_context_flush_control */

/* GL_KHR_debug */

/* GL_KHR_no_error */

/* GL_KHR_parallel_shader_compile */

/* GL_KHR_robust_buffer_access_behavior */

/* GL_KHR_robustness */

/* GL_KHR_shader_subgroup */

/* GL_KHR_texture_compression_astc_hdr */

/* GL_KHR_texture_compression_astc_ldr */

/* GL_KHR_texture_compression_astc_sliced_3d */

/* GL_OES_byte_coordinates */

/* GL_OES_compressed_paletted_texture */

/* GL_OES_fixed_point */

/* GL_OES_query_matrix */

/* GL_OES_read_format */

/* GL_OES_single_precision */

/* GL_3DFX_multisample */

/* GL_3DFX_tbuffer */

/* GL_3DFX_texture_compression_FXT1 */

/* GL_AMD_blend_minmax_factor */

/* GL_AMD_conservative_depth */

/* GL_AMD_debug_output */

/* GL_AMD_depth_clamp_separate */

/* GL_AMD_draw_buffers_blend */

/* GL_AMD_framebuffer_multisample_advanced */

/* GL_AMD_framebuffer_sample_positions */

/* GL_AMD_gcn_shader */

/* GL_AMD_gpu_shader_half_float */

/* GL_AMD_gpu_shader_int16 */

/* GL_AMD_gpu_shader_int64 */

/* GL_AMD_interleaved_elements */

/* GL_AMD_multi_draw_indirect */

/* GL_AMD_name_gen_delete */

/* GL_AMD_occlusion_query_event */

/* GL_AMD_performance_monitor */

/* GL_AMD_pinned_memory */

/* GL_AMD_query_buffer_object */

/* GL_AMD_sample_positions */

/* GL_AMD_seamless_cubemap_per_texture */

/* GL_AMD_shader_atomic_counter_ops */

/* GL_AMD_shader_ballot */

/* GL_AMD_shader_explicit_vertex_parameter */

/* GL_AMD_shader_gpu_shader_half_float_fetch */

/* GL_AMD_shader_image_load_store_lod */

/* GL_AMD_shader_stencil_export */

/* GL_AMD_shader_trinary_minmax */

/* GL_AMD_sparse_texture */

/* GL_AMD_stencil_operation_extended */

/* GL_AMD_texture_gather_bias_lod */

/* GL_AMD_texture_texture4 */

/* GL_AMD_transform_feedback3_lines_triangles */

/* GL_AMD_transform_feedback4 */

/* GL_AMD_vertex_shader_layer */

/* GL_AMD_vertex_shader_tessellator */

/* GL_AMD_vertex_shader_viewport_index */

/* GL_APPLE_aux_depth_stencil */

/* GL_APPLE_client_storage */

/* GL_APPLE_element_array */

/* GL_APPLE_fence */

/* GL_APPLE_float_pixels */

/* GL_APPLE_flush_buffer_range */

/* GL_APPLE_object_purgeable */

/* GL_APPLE_rgb_422 */

/* GL_APPLE_row_bytes */

/* GL_APPLE_specular_vector */

/* GL_APPLE_texture_range */

/* GL_APPLE_transform_hint */

/* GL_APPLE_vertex_array_object */

/* GL_APPLE_vertex_array_range */

/* GL_APPLE_vertex_program_evaluators */

/* GL_APPLE_ycbcr_422 */

/* GL_ATI_draw_buffers */

/* GL_ATI_element_array */

/* GL_ATI_envmap_bumpmap */

/* GL_ATI_fragment_shader */

/* GL_ATI_map_object_buffer */

/* GL_ATI_meminfo */

/* GL_ATI_pixel_format_float */

/* GL_ATI_pn_triangles */

/* GL_ATI_separate_stencil */

/* GL_ATI_text_fragment_shader */

/* GL_ATI_texture_env_combine3 */

/* GL_ATI_texture_float */

/* GL_ATI_texture_mirror_once */

/* GL_ATI_vertex_array_object */

/* GL_ATI_vertex_attrib_array_object */

/* GL_ATI_vertex_streams */

/* GL_EXT_422_pixels */

/* GL_EXT_EGL_image_storage */

/* GL_EXT_EGL_sync */

/* GL_EXT_abgr */

/* GL_EXT_bgra */

/* GL_EXT_bindable_uniform */

/* GL_EXT_blend_color */

/* GL_EXT_blend_equation_separate */

/* GL_EXT_blend_func_separate */

/* GL_EXT_blend_logic_op */

/* GL_EXT_blend_minmax */

/* GL_EXT_blend_subtract */

/* GL_EXT_clip_volume_hint */

/* GL_EXT_cmyka */

/* GL_EXT_color_subtable */

/* GL_EXT_compiled_vertex_array */

/* GL_EXT_convolution */

/* GL_EXT_coordinate_frame */

/* GL_EXT_copy_texture */

/* GL_EXT_cull_vertex */

/* GL_EXT_debug_label */

/* GL_EXT_debug_marker */

/* GL_EXT_depth_bounds_test */

/* GL_EXT_direct_state_access */

/* GL_EXT_draw_buffers2 */

/* GL_EXT_draw_instanced */

/* GL_EXT_draw_range_elements */

/* GL_EXT_external_buffer */

/* GL_EXT_fog_coord */

/* GL_EXT_framebuffer_blit */

/* GL_EXT_framebuffer_multisample */

/* GL_EXT_framebuffer_multisample_blit_scaled */

/* GL_EXT_framebuffer_object */

/* GL_EXT_framebuffer_sRGB */

/* GL_EXT_geometry_shader4 */

/* GL_EXT_gpu_program_parameters */

/* GL_EXT_gpu_shader4 */

/* GL_EXT_histogram */

/* GL_EXT_index_array_formats */

/* GL_EXT_index_func */

/* GL_EXT_index_material */

/* GL_EXT_index_texture */

/* GL_EXT_light_texture */

/* GL_EXT_memory_object */

/* GL_EXT_memory_object_fd */

/* GL_EXT_memory_object_win32 */

/* GL_EXT_misc_attribute */

/* GL_EXT_multi_draw_arrays */

/* GL_EXT_multisample */

/* GL_EXT_multiview_tessellation_geometry_shader */

/* GL_EXT_multiview_texture_multisample */

/* GL_EXT_multiview_timer_query */

/* GL_EXT_packed_depth_stencil */

/* GL_EXT_packed_float */

/* GL_EXT_packed_pixels */

/* GL_EXT_paletted_texture */

/* GL_EXT_pixel_buffer_object */

/* GL_EXT_pixel_transform */

/* GL_EXT_pixel_transform_color_table */

/* GL_EXT_point_parameters */

/* GL_EXT_polygon_offset */

/* GL_EXT_polygon_offset_clamp */

/* GL_EXT_post_depth_coverage */

/* GL_EXT_provoking_vertex */

/* GL_EXT_raster_multisample */

/* GL_EXT_rescale_normal */

/* GL_EXT_secondary_color */

/* GL_EXT_semaphore */

/* GL_EXT_semaphore_fd */

/* GL_EXT_semaphore_win32 */

/* GL_EXT_separate_shader_objects */

/* GL_EXT_separate_specular_color */

/* GL_EXT_shader_framebuffer_fetch */

/* GL_EXT_shader_framebuffer_fetch_non_coherent */

/* GL_EXT_shader_image_load_formatted */

/* GL_EXT_shader_image_load_store */

/* GL_EXT_shader_integer_mix */

/* GL_EXT_shadow_funcs */

/* GL_EXT_shared_texture_palette */

/* GL_EXT_sparse_texture2 */

/* GL_EXT_stencil_clear_tag */

/* GL_EXT_stencil_two_side */

/* GL_EXT_stencil_wrap */

/* GL_EXT_subtexture */

/* GL_EXT_texture */

/* GL_EXT_texture3D */

/* GL_EXT_texture_array */

/* GL_EXT_texture_buffer_object */

/* GL_EXT_texture_compression_latc */

/* GL_EXT_texture_compression_rgtc */

/* GL_EXT_texture_compression_s3tc */

/* GL_EXT_texture_cube_map */

/* GL_EXT_texture_env_add */

/* GL_EXT_texture_env_combine */

/* GL_EXT_texture_env_dot3 */

/* GL_EXT_texture_filter_anisotropic */

/* GL_EXT_texture_filter_minmax */

/* GL_EXT_texture_integer */

/* GL_EXT_texture_lod_bias */

/* GL_EXT_texture_mirror_clamp */

/* GL_EXT_texture_object */

/* GL_EXT_texture_perturb_normal */

/* GL_EXT_texture_sRGB */

/* GL_EXT_texture_sRGB_R8 */

/* GL_EXT_texture_sRGB_decode */

/* GL_EXT_texture_shadow_lod */

/* GL_EXT_texture_shared_exponent */

/* GL_EXT_texture_snorm */

/* GL_EXT_texture_swizzle */

/* GL_EXT_timer_query */

/* GL_EXT_transform_feedback */

/* GL_EXT_vertex_array */

/* GL_EXT_vertex_array_bgra */

/* GL_EXT_vertex_attrib_64bit */

/* GL_EXT_vertex_shader */

/* GL_EXT_vertex_weighting */

/* GL_EXT_win32_keyed_mutex */

/* GL_EXT_window_rectangles */

/* GL_EXT_x11_sync_object */

/* GL_GREMEDY_frame_terminator */

/* GL_GREMEDY_string_marker */

/* GL_HP_convolution_border_modes */

/* GL_HP_image_transform */

/* GL_HP_occlusion_test */

/* GL_HP_texture_lighting */

/* GL_IBM_cull_vertex */

/* GL_IBM_multimode_draw_arrays */

/* GL_IBM_rasterpos_clip */

/* GL_IBM_static_data */

/* GL_IBM_texture_mirrored_repeat */

/* GL_IBM_vertex_array_lists */

/* GL_INGR_blend_func_separate */

/* GL_INGR_color_clamp */

/* GL_INGR_interlace_read */

/* GL_INTEL_blackhole_render */

/* GL_INTEL_conservative_rasterization */

/* GL_INTEL_fragment_shader_ordering */

/* GL_INTEL_framebuffer_CMAA */

/* GL_INTEL_map_texture */

/* GL_INTEL_parallel_arrays */

/* GL_INTEL_performance_query */

/* GL_MESAX_texture_stack */

/* GL_MESA_framebuffer_flip_x */

/* GL_MESA_framebuffer_flip_y */

/* GL_MESA_framebuffer_swap_xy */

/* GL_MESA_pack_invert */

/* GL_MESA_program_binary_formats */

/* GL_MESA_resize_buffers */

/* GL_MESA_shader_integer_functions */

/* GL_MESA_tile_raster_order */

/* GL_MESA_window_pos */

/* GL_MESA_ycbcr_texture */

/* GL_NVX_blend_equation_advanced_multi_draw_buffers */

/* GL_NVX_conditional_render */

/* GL_NVX_gpu_memory_info */

/* GL_NVX_gpu_multicast2 */

/* GL_NVX_linked_gpu_multicast */

/* GL_NVX_progress_fence */

/* GL_NV_alpha_to_coverage_dither_control */

/* GL_NV_bindless_multi_draw_indirect */

/* GL_NV_bindless_multi_draw_indirect_count */

/* GL_NV_bindless_texture */

/* GL_NV_blend_equation_advanced */

/* GL_NV_blend_equation_advanced_coherent */

/* GL_NV_blend_minmax_factor */

/* GL_NV_blend_square */

/* GL_NV_clip_space_w_scaling */

/* GL_NV_command_list */

/* GL_NV_compute_program5 */

/* GL_NV_compute_shader_derivatives */

/* GL_NV_conditional_render */

/* GL_NV_conservative_raster */

/* GL_NV_conservative_raster_dilate */

/* GL_NV_conservative_raster_pre_snap */

/* GL_NV_conservative_raster_pre_snap_triangles */

/* GL_NV_conservative_raster_underestimation */

/* GL_NV_copy_depth_to_color */

/* GL_NV_copy_image */

/* GL_NV_deep_texture3D */

/* GL_NV_depth_buffer_float */

/* GL_NV_depth_clamp */

/* GL_NV_draw_texture */

/* GL_NV_draw_vulkan_image */

/* GL_NV_evaluators */

/* GL_NV_explicit_multisample */

/* GL_NV_fence */

/* GL_NV_fill_rectangle */

/* GL_NV_float_buffer */

/* GL_NV_fog_distance */

/* GL_NV_fragment_coverage_to_color */

/* GL_NV_fragment_program */

/* GL_NV_fragment_program2 */

/* GL_NV_fragment_program4 */

/* GL_NV_fragment_program_option */

/* GL_NV_fragment_shader_barycentric */

/* GL_NV_fragment_shader_interlock */

/* GL_NV_framebuffer_mixed_samples */

/* GL_NV_framebuffer_multisample_coverage */

/* GL_NV_geometry_program4 */

/* GL_NV_geometry_shader4 */

/* GL_NV_geometry_shader_passthrough */

/* GL_NV_gpu_multicast */

/* GL_NV_gpu_program4 */

/* GL_NV_gpu_program5 */

/* GL_NV_gpu_program5_mem_extended */

/* GL_NV_gpu_shader5 */

/* GL_NV_half_float */

/* GL_NV_internalformat_sample_query */

/* GL_NV_light_max_exponent */

/* GL_NV_memory_attachment */

/* GL_NV_mesh_shader */

/* GL_NV_multisample_coverage */

/* GL_NV_multisample_filter_hint */

/* GL_NV_occlusion_query */

/* GL_NV_packed_depth_stencil */

/* GL_NV_parameter_buffer_object */

/* GL_NV_parameter_buffer_object2 */

/* GL_NV_path_rendering */

/* GL_NV_path_rendering_shared_edge */

/* GL_NV_pixel_data_range */

/* GL_NV_point_sprite */

/* GL_NV_present_video */

/* GL_NV_primitive_restart */

/* GL_NV_query_resource */

/* GL_NV_query_resource_tag */

/* GL_NV_register_combiners */

/* GL_NV_register_combiners2 */

/* GL_NV_representative_fragment_test */

/* GL_NV_robustness_video_memory_purge */

/* GL_NV_sample_locations */

/* GL_NV_sample_mask_override_coverage */

/* GL_NV_scissor_exclusive */

/* GL_NV_shader_atomic_counters */

/* GL_NV_shader_atomic_float */

/* GL_NV_shader_atomic_float64 */

/* GL_NV_shader_atomic_fp16_vector */

/* GL_NV_shader_atomic_int64 */

/* GL_NV_shader_buffer_load */

/* GL_NV_shader_buffer_store */

/* GL_NV_shader_storage_buffer_object */

/* GL_NV_shader_subgroup_partitioned */

/* GL_NV_shader_texture_footprint */

/* GL_NV_shader_thread_group */

/* GL_NV_shader_thread_shuffle */

/* GL_NV_shading_rate_image */

/* GL_NV_stereo_view_rendering */

/* GL_NV_tessellation_program5 */

/* GL_NV_texgen_emboss */

/* GL_NV_texgen_reflection */

/* GL_NV_texture_barrier */

/* GL_NV_texture_compression_vtc */

/* GL_NV_texture_env_combine4 */

/* GL_NV_texture_expand_normal */

/* GL_NV_texture_multisample */

/* GL_NV_texture_rectangle */

/* GL_NV_texture_rectangle_compressed */

/* GL_NV_texture_shader */

/* GL_NV_texture_shader2 */

/* GL_NV_texture_shader3 */

/* GL_NV_transform_feedback */

/* GL_NV_transform_feedback2 */

/* GL_NV_uniform_buffer_unified_memory */

/* GL_NV_vdpau_interop */

/* GL_NV_vdpau_interop2 */

/* GL_NV_vertex_array_range */

/* GL_NV_vertex_array_range2 */

/* GL_NV_vertex_attrib_integer_64bit */

/* GL_NV_vertex_buffer_unified_memory */

/* GL_NV_vertex_program */

/* GL_NV_vertex_program1_1 */

/* GL_NV_vertex_program2 */

/* GL_NV_vertex_program2_option */

/* GL_NV_vertex_program3 */

/* GL_NV_vertex_program4 */

/* GL_NV_video_capture */

/* GL_NV_viewport_array2 */

/* GL_NV_viewport_swizzle */

/* GL_OML_interlace */

/* GL_OML_resample */

/* GL_OML_subsample */

/* GL_OVR_multiview */

/* GL_OVR_multiview2 */

/* GL_PGI_misc_hints */

/* GL_PGI_vertex_hints */

/* GL_REND_screen_coordinates */

/* GL_S3_s3tc */

/* GL_SGIS_detail_texture */

/* GL_SGIS_fog_function */

/* GL_SGIS_generate_mipmap */

/* GL_SGIS_multisample */

/* GL_SGIS_pixel_texture */

/* GL_SGIS_point_line_texgen */

/* GL_SGIS_point_parameters */

/* GL_SGIS_sharpen_texture */

/* GL_SGIS_texture4D */

/* GL_SGIS_texture_border_clamp */

/* GL_SGIS_texture_color_mask */

/* GL_SGIS_texture_edge_clamp */

/* GL_SGIS_texture_filter4 */

/* GL_SGIS_texture_lod */

/* GL_SGIS_texture_select */

/* GL_SGIX_async */

/* GL_SGIX_async_histogram */

/* GL_SGIX_async_pixel */

/* GL_SGIX_blend_alpha_minmax */

/* GL_SGIX_calligraphic_fragment */

/* GL_SGIX_clipmap */

/* GL_SGIX_convolution_accuracy */

/* GL_SGIX_depth_pass_instrument */

/* GL_SGIX_depth_texture */

/* GL_SGIX_flush_raster */

/* GL_SGIX_fog_offset */

/* GL_SGIX_fragment_lighting */

/* GL_SGIX_framezoom */

/* GL_SGIX_igloo_interface */

/* GL_SGIX_instruments */

/* GL_SGIX_interlace */

/* GL_SGIX_ir_instrument1 */

/* GL_SGIX_list_priority */

/* GL_SGIX_pixel_texture */

/* GL_SGIX_pixel_tiles */

/* GL_SGIX_polynomial_ffd */

/* GL_SGIX_reference_plane */

/* GL_SGIX_resample */

/* GL_SGIX_scalebias_hint */

/* GL_SGIX_shadow */

/* GL_SGIX_shadow_ambient */

/* GL_SGIX_sprite */

/* GL_SGIX_subsample */

/* GL_SGIX_tag_sample_buffer */

/* GL_SGIX_texture_add_env */

/* GL_SGIX_texture_coordinate_clamp */

/* GL_SGIX_texture_lod_bias */

/* GL_SGIX_texture_multi_buffer */

/* GL_SGIX_texture_scale_bias */

/* GL_SGIX_vertex_preclip */

/* GL_SGIX_ycrcb */

/* GL_SGIX_ycrcb_subsample */

/* GL_SGIX_ycrcba */

/* GL_SGI_color_matrix */

/* GL_SGI_color_table */

/* GL_SGI_texture_color_table */

/* GL_SUNX_constant_data */

/* GL_SUN_convolution_border_modes */

/* GL_SUN_global_alpha */

/* GL_SUN_mesh_array */

/* GL_SUN_slice_accum */

/* GL_SUN_triangle_list */

/* GL_SUN_vertex */

/* GL_WIN_phong_shading */

/* GL_WIN_specular_fog */


=== system/include/GL/glfw.h ===
SHA256: 9ae9d1bf271e97fca3ebb58ded350af3b27c2d21b9c08af5d14539009f49500a
/************************************************************************
 * GLFW - An OpenGL framework
 * API version: 2.7
 * WWW:         http://www.glfw.org/
 *------------------------------------------------------------------------
 * Copyright (c) 2002-2006 Marcus Geelnard
 * Copyright (c) 2006-2010 Camilla Berglund
 *
 * This software is provided 'as-is', without any express or implied
 * warranty. In no event will the authors be held liable for any damages
 * arising from the use of this software.
 *
 * Permission is granted to anyone to use this software for any purpose,
 * including commercial applications, and to alter it and redistribute it
 * freely, subject to the following restrictions:
 *
 * 1. The origin of this software must not be misrepresented; you must not
 *    claim that you wrote the original software. If you use this software
 *    in a product, an acknowledgment in the product documentation would
 *    be appreciated but is not required.
 *
 * 2. Altered source versions must be plainly marked as such, and must not
 *    be misrepresented as being the original software.
 *
 * 3. This notice may not be removed or altered from any source
 *    distribution.
 *
 *************************************************************************/

/*************************************************************************
 * Global definitions
 *************************************************************************/

/* We need a NULL pointer from time to time */

/* NULL */

/* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */

/* Please report any probles that you find with your compiler, which may
 * be solved in this section! There are several compilers that I have not
 * been able to test this file with yet.
 *
 * First: If we are we on Windows, we want a single define for it (_WIN32)
 * (Note: For Cygwin the compiler flag -mwin32 should be used, but to
 * make sure that things run smoothly for Cygwin users, we add __CYGWIN__
 * to the list of "valid Win32 identifiers", which removes the need for
 * -mwin32)
 */

/* _WIN32 */

/* In order for extension support to be portable, we need to define an
 * OpenGL function call method. We use the keyword APIENTRY, which is
 * defined for Win32. (Note: Windows also needs this for <GL/gl.h>)
 */

/* APIENTRY */

/* The following three defines are here solely to make some Windows-based
 * <GL/gl.h> files happy. Theoretically we could include <windows.h>, but
 * it has the major drawback of severely polluting our namespace.
 */

/* Under Windows, we need WINGDIAPI defined */

/* Microsoft Visual C++, Borland C++ Builder and Pelles C */

/* LCC-Win32 */

/* Others (e.g. MinGW, Cygwin) */

/* WINGDIAPI */

/* Some <GL/glu.h> files also need CALLBACK defined */

/* Microsoft Visual C++ */

/* Other Windows compilers */

/* CALLBACK */

/* Microsoft Visual C++, Borland C++ and Pelles C <GL*glu.h> needs wchar_t */

/* _WCHAR_T_DEFINED */

/* ---------------- GLFW related system specific defines ----------------- */

/* We are building a Win32 DLL */

/* We are calling a Win32 DLL */

/* We are either building/calling a static lib or we are non-win32 */

/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */

/* Include standard OpenGL headers: GLFW uses GL_FALSE/GL_TRUE, and it is
 * convenient for the user to only have to include <GL/glfw.h>. This also
 * solves the problem with Windows <GL/gl.h> and <GL/glu.h> needing some
 * special defines which normally requires the user to include <windows.h>
 * (which is not a nice solution for portable programs).
 */

/*************************************************************************
 * GLFW version
 *************************************************************************/

/*************************************************************************
 * Input handling definitions
 *************************************************************************/

/* Key and button state/action definitions */

/* Keyboard key definitions: 8-bit ISO-8859-1 (Latin 1) encoding is used
 * for printable keys (such as A-Z, 0-9 etc), and values above 256
 * represent special (non-printable) keys (e.g. F1, Page Up etc).
 */

/* Mouse button definitions */

/* Mouse button aliases */

/* Joystick identifiers */

/*************************************************************************
 * Other definitions
 *************************************************************************/

/* glfwOpenWindow modes */

/* glfwGetWindowParam tokens */

/* The following constants are used for both glfwGetWindowParam
 * and glfwOpenWindowHint
 */

/* GLFW_OPENGL_PROFILE tokens */

/* glfwEnable/glfwDisable tokens */

/* glfwWaitThread wait modes */

/* glfwGetJoystickParam tokens */

/* glfwReadImage/glfwLoadTexture2D flags */

/* Only for glfwReadImage */

/* Only for glfwLoadTexture2D */

/* Time spans longer than this (seconds) are considered to be infinity */

/*************************************************************************
 * Typedefs
 *************************************************************************/

/* The video mode structure used by glfwGetVideoModes() */

/* Image/texture information */

/* Thread ID */

/* Mutex object */

/* Condition variable object */

/* Function pointer types */

/*************************************************************************
 * Prototypes
 *************************************************************************/

// Redirect GLFW2 symbols when they have different signatures under GLFW3.

// This avoids the problem of JS symbols having different signatures in

// different configurations.

/* GLFW initialization, termination and version querying */

/* Window handling */

/* Video mode functions */

/* Input handling */

/* Joystick input */

/* Time */

/* Extension support */

/* Threading support */

/* Enable/disable functions */

/* Image/texture I/O support */

/* __glfw_h_ */


=== system/include/GL/glu.h ===
SHA256: 84187ce0fd0153769675cb7f3301583eb27393f66b57c5604999a1d805a9184c
/*
 * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
 * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
 *
 * 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 including the dates of first publication and
 * either this permission notice or a reference to
 * http://oss.sgi.com/projects/FreeB/
 * 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
 * SILICON GRAPHICS, INC. 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.
 *
 * Except as contained in this notice, the name of Silicon Graphics, Inc.
 * shall not be used in advertising or otherwise to promote the sale, use or
 * other dealings in this Software without prior written authorization from
 * Silicon Graphics, Inc.
 */

/* tag specifying we're building for DLL runtime support */

/* for use with static link lib build of Win32 edition only */

/* _STATIC_MESA support */

/*************************************************************/

/* Extensions */

/* Boolean */

/* Version */

/* StringName */

/* ErrorCode */

/* NurbsDisplay */

/*      GLU_FILL */

/* NurbsCallback */

/* NurbsError */

/* NurbsProperty */

/* NurbsSampling */

/* NurbsTrim */

/* QuadricDrawStyle */

/* QuadricCallback */

/*      GLU_ERROR */

/* QuadricNormal */

/* QuadricOrientation */

/* TessCallback */

/* TessContour */

/* TessProperty */

/* TessError */

/* TessWinding */

/*************************************************************/

/* Internal convenience typedefs */

/* __glu_h__ */


=== system/include/GL/glut.h ===
SHA256: e3ffcfd1147cd45a9ddb49ab9791e8fc6269f52732f0c02f10f2daf9cc0e730b
/*
 * glut.h
 *
 * The freeglut library include file
 *
 * 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
 * PAWEL W. OLSZTA 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.
 */

/*** END OF FILE ***/

/* __GLUT_H__ */


=== system/include/GLES/gl.h ===
SHA256: 835b4aaadb86782cb8b42901b0f716c830de57bfda28e43e587459cb10a6b4e3
/*
** Copyright (c) 2013-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are 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 Materials.
**
** THE MATERIALS ARE 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
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/

/*
** This header is generated from the Khronos OpenGL / OpenGL ES XML
** API Registry. The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
**   https://github.com/KhronosGroup/OpenGL-Registry
*/

/* Generated on date 20200423 */

/* Generated C header for:
 * API: gles1
 * Profile: common
 * Versions considered: .*
 * Versions emitted: .*
 * Default extensions included: None
 * Additional extensions included: ^(GL_OES_read_format|GL_OES_compressed_paletted_texture|GL_OES_point_size_array|GL_OES_point_sprite)$
 * Extensions removed: _nomatch_^
 */

/* GL_VERSION_ES_CM_1_0 */

/* GL_OES_compressed_paletted_texture */

/* GL_OES_point_size_array */

/* GL_OES_point_sprite */

/* GL_OES_read_format */


=== system/include/GLES/glext.h ===
SHA256: 91f6ce75a2288fc9b9272ba9c9c81cfcc9fc6e95653af007bc14562f5a9c04c7
/*
** Copyright (c) 2013-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are 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 Materials.
**
** THE MATERIALS ARE 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
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/

/*
** This header is generated from the Khronos OpenGL / OpenGL ES XML
** API Registry. The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
**   https://github.com/KhronosGroup/OpenGL-Registry
*/

/* Generated on date 20200423 */

/* Generated C header for:
 * API: gles1
 * Profile: common
 * Versions considered: .*
 * Versions emitted: _nomatch_^
 * Default extensions included: gles1
 * Additional extensions included: _nomatch_^
 * Extensions removed: ^(GL_OES_read_format|GL_OES_compressed_paletted_texture|GL_OES_point_size_array|GL_OES_point_sprite)$
 */

/* GL_KHR_debug */

/* GL_OES_EGL_image */

/* GL_OES_EGL_image_external */

/* GL_OES_blend_equation_separate */

/* GL_OES_blend_func_separate */

/* GL_OES_blend_subtract */

/* GL_OES_byte_coordinates */

/* GL_OES_compressed_ETC1_RGB8_sub_texture */

/* GL_OES_compressed_ETC1_RGB8_texture */

/* GL_OES_depth24 */

/* GL_OES_depth32 */

/* GL_OES_draw_texture */

/* GL_OES_element_index_uint */

/* GL_OES_extended_matrix_palette */

/* GL_OES_fbo_render_mipmap */

/* GL_OES_fixed_point */

/* GL_OES_framebuffer_object */

/* GL_OES_mapbuffer */

/* GL_OES_matrix_get */

/* GL_OES_matrix_palette */

/* GL_OES_packed_depth_stencil */

/* GL_OES_query_matrix */

/* GL_OES_required_internalformat */

/* GL_OES_rgb8_rgba8 */

/* GL_OES_single_precision */

/* GL_OES_stencil1 */

/* GL_OES_stencil4 */

/* GL_OES_stencil8 */

/* GL_OES_stencil_wrap */

/* GL_OES_surfaceless_context */

/* GL_OES_texture_cube_map */

/* GL_OES_texture_env_crossbar */

/* GL_OES_texture_mirrored_repeat */

/* GL_OES_texture_npot */

/* GL_OES_vertex_array_object */

/* GL_AMD_compressed_3DC_texture */

/* GL_AMD_compressed_ATC_texture */

/* GL_APPLE_copy_texture_levels */

/* GL_APPLE_framebuffer_multisample */

/* GL_APPLE_sync */

/* GL_APPLE_texture_2D_limited_npot */

/* GL_APPLE_texture_format_BGRA8888 */

/* GL_APPLE_texture_max_level */

/* GL_ARM_rgba8 */

/* GL_EXT_blend_minmax */

/* GL_EXT_debug_marker */

/* GL_EXT_discard_framebuffer */

/* GL_EXT_map_buffer_range */

/* GL_EXT_multi_draw_arrays */

/* GL_EXT_multisampled_render_to_texture */

/* GL_EXT_read_format_bgra */

/* GL_EXT_robustness */

/* GL_EXT_sRGB */

/* GL_EXT_texture_compression_dxt1 */

/* GL_EXT_texture_filter_anisotropic */

/* GL_EXT_texture_format_BGRA8888 */

/* GL_EXT_texture_lod_bias */

/* GL_EXT_texture_storage */

/* GL_IMG_multisampled_render_to_texture */

/* GL_IMG_read_format */

/* GL_IMG_texture_compression_pvrtc */

/* GL_IMG_texture_env_enhanced_fixed_function */

/* GL_IMG_user_clip_plane */

/* GL_NV_fence */

/* GL_QCOM_driver_control */

/* GL_QCOM_extended_get */

/* GL_QCOM_extended_get2 */

/* GL_QCOM_perfmon_global_mode */

/* GL_QCOM_tiled_rendering */

/* GL_QCOM_writeonly_rendering */


=== system/include/GLES/glplatform.h ===
SHA256: 857bf0685ecb0dddf692157ea9ef98c95e9f58b5ed0c41b26fd3fe51ed1a3624
/*
** Copyright (c) 2017 The Khronos Group Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/

/* Platform-specific types and definitions for OpenGL ES 1.X  gl.h
 *
 * Adopters may modify khrplatform.h and this file to suit their platform.
 * Please contribute modifications back to Khronos as pull requests on the
 * public github repository:
 *      https://github.com/KhronosGroup/OpenGL-Registry
 */

/* __glplatform_h_ */


=== system/include/GLES2/gl2.h ===
SHA256: dae3d3950274a40baf1283508d8b65e9e1ffda946c9a8924293b11df88d92833
/*
** Copyright (c) 2013-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are 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 Materials.
**
** THE MATERIALS ARE 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
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/

/*
** This header is generated from the Khronos OpenGL / OpenGL ES XML
** API Registry. The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
**   https://github.com/KhronosGroup/OpenGL-Registry
*/

/* Generated on date 20200423 */

/* Generated C header for:
 * API: gles2
 * Profile: common
 * Versions considered: 2\.[0-9]
 * Versions emitted: .*
 * Default extensions included: None
 * Additional extensions included: _nomatch_^
 * Extensions removed: _nomatch_^
 */

/* GL_ES_VERSION_2_0 */


=== system/include/GLES2/gl2ext.h ===
SHA256: f68d70cad8416567e507c0d3f145be231f6ba4706cb0510ac2a8d9fab17d20c8
/*
** Copyright (c) 2013-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are 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 Materials.
**
** THE MATERIALS ARE 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
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/

/*
** This header is generated from the Khronos OpenGL / OpenGL ES XML
** API Registry. The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
**   https://github.com/KhronosGroup/OpenGL-Registry
*/

/* Generated on date 20200423 */

/* Generated C header for:
 * API: gles2
 * Profile: common
 * Versions considered: 2\.[0-9]
 * Versions emitted: _nomatch_^
 * Default extensions included: gles2
 * Additional extensions included: _nomatch_^
 * Extensions removed: _nomatch_^
 */

/* GL_KHR_blend_equation_advanced */

/* GL_KHR_blend_equation_advanced_coherent */

/* GL_KHR_context_flush_control */

/* GL_KHR_debug */

/* GL_KHR_no_error */

/* GL_KHR_parallel_shader_compile */

/* GL_KHR_robust_buffer_access_behavior */

/* GL_KHR_robustness */

/* GL_KHR_shader_subgroup */

/* GL_KHR_texture_compression_astc_hdr */

/* GL_KHR_texture_compression_astc_ldr */

/* GL_KHR_texture_compression_astc_sliced_3d */

/* GL_OES_EGL_image */

/* GL_OES_EGL_image_external */

/* GL_OES_EGL_image_external_essl3 */

/* GL_OES_compressed_ETC1_RGB8_sub_texture */

/* GL_OES_compressed_ETC1_RGB8_texture */

/* GL_OES_compressed_paletted_texture */

/* GL_OES_copy_image */

/* GL_OES_depth24 */

/* GL_OES_depth32 */

/* GL_OES_depth_texture */

/* GL_OES_draw_buffers_indexed */

/* GL_OES_draw_elements_base_vertex */

/* GL_OES_element_index_uint */

/* GL_OES_fbo_render_mipmap */

/* GL_OES_fragment_precision_high */

/* GL_OES_geometry_point_size */

/* GL_OES_geometry_shader */

/* GL_OES_get_program_binary */

/* GL_OES_gpu_shader5 */

/* GL_OES_mapbuffer */

/* GL_OES_packed_depth_stencil */

/* GL_OES_primitive_bounding_box */

/* GL_OES_required_internalformat */

/* GL_OES_rgb8_rgba8 */

/* GL_OES_sample_shading */

/* GL_OES_sample_variables */

/* GL_OES_shader_image_atomic */

/* GL_OES_shader_io_blocks */

/* GL_OES_shader_multisample_interpolation */

/* GL_OES_standard_derivatives */

/* GL_OES_stencil1 */

/* GL_OES_stencil4 */

/* GL_OES_surfaceless_context */

/* GL_OES_tessellation_point_size */

/* GL_OES_tessellation_shader */

/* GL_OES_texture_3D */

/* GL_OES_texture_border_clamp */

/* GL_OES_texture_buffer */

/* GL_OES_texture_compression_astc */

/* GL_OES_texture_cube_map_array */

/* GL_OES_texture_float */

/* GL_OES_texture_float_linear */

/* GL_OES_texture_half_float */

/* GL_OES_texture_half_float_linear */

/* GL_OES_texture_npot */

/* GL_OES_texture_stencil8 */

/* GL_OES_texture_storage_multisample_2d_array */

/* GL_OES_texture_view */

/* GL_OES_vertex_array_object */

/* GL_OES_vertex_half_float */

/* GL_OES_vertex_type_10_10_10_2 */

/* GL_OES_viewport_array */

/* GL_AMD_compressed_3DC_texture */

/* GL_AMD_compressed_ATC_texture */

/* GL_AMD_framebuffer_multisample_advanced */

/* GL_AMD_performance_monitor */

/* GL_AMD_program_binary_Z400 */

/* GL_ANDROID_extension_pack_es31a */

/* GL_ANGLE_depth_texture */

/* GL_ANGLE_framebuffer_blit */

/* GL_ANGLE_framebuffer_multisample */

/* GL_ANGLE_instanced_arrays */

/* GL_ANGLE_pack_reverse_row_order */

/* GL_ANGLE_program_binary */

/* GL_ANGLE_texture_compression_dxt3 */

/* GL_ANGLE_texture_compression_dxt5 */

/* GL_ANGLE_texture_usage */

/* GL_ANGLE_translated_shader_source */

/* GL_APPLE_clip_distance */

/* GL_APPLE_color_buffer_packed_float */

/* GL_APPLE_copy_texture_levels */

/* GL_APPLE_framebuffer_multisample */

/* GL_APPLE_rgb_422 */

/* GL_APPLE_sync */

/* GL_APPLE_texture_format_BGRA8888 */

/* GL_APPLE_texture_max_level */

/* GL_APPLE_texture_packed_float */

/* GL_ARM_mali_program_binary */

/* GL_ARM_mali_shader_binary */

/* GL_ARM_rgba8 */

/* GL_ARM_shader_framebuffer_fetch */

/* GL_ARM_shader_framebuffer_fetch_depth_stencil */

/* GL_ARM_texture_unnormalized_coordinates */

/* GL_DMP_program_binary */

/* GL_DMP_shader_binary */

/* GL_EXT_EGL_image_array */

/* GL_EXT_EGL_image_storage */

/* GL_EXT_YUV_target */

/* GL_EXT_base_instance */

/* GL_EXT_blend_func_extended */

/* GL_EXT_blend_minmax */

/* GL_EXT_buffer_storage */

/* GL_EXT_clear_texture */

/* GL_EXT_clip_control */

/* GL_EXT_clip_cull_distance */

/* GL_EXT_color_buffer_float */

/* GL_EXT_color_buffer_half_float */

/* GL_EXT_conservative_depth */

/* GL_EXT_copy_image */

/* GL_EXT_debug_label */

/* GL_EXT_debug_marker */

/* GL_EXT_depth_clamp */

/* GL_EXT_discard_framebuffer */

/* GL_EXT_disjoint_timer_query */

/* GL_EXT_draw_buffers */

/* GL_EXT_draw_buffers_indexed */

/* GL_EXT_draw_elements_base_vertex */

/* GL_EXT_draw_instanced */

/* GL_EXT_draw_transform_feedback */

/* GL_EXT_external_buffer */

/* GL_EXT_float_blend */

/* GL_EXT_geometry_point_size */

/* GL_EXT_geometry_shader */

/* GL_EXT_gpu_shader5 */

/* GL_EXT_instanced_arrays */

/* GL_EXT_map_buffer_range */

/* GL_EXT_memory_object */

/* GL_EXT_memory_object_fd */

/* GL_EXT_memory_object_win32 */

/* GL_EXT_multi_draw_arrays */

/* GL_EXT_multi_draw_indirect */

/* GL_EXT_multisampled_compatibility */

/* GL_EXT_multisampled_render_to_texture */

/* GL_EXT_multiview_draw_buffers */

/* GL_EXT_multiview_tessellation_geometry_shader */

/* GL_EXT_multiview_texture_multisample */

/* GL_EXT_multiview_timer_query */

/* GL_EXT_occlusion_query_boolean */

/* GL_EXT_polygon_offset_clamp */

/* GL_EXT_post_depth_coverage */

/* GL_EXT_primitive_bounding_box */

/* GL_EXT_protected_textures */

/* GL_EXT_pvrtc_sRGB */

/* GL_EXT_raster_multisample */

/* GL_EXT_read_format_bgra */

/* GL_EXT_render_snorm */

/* GL_EXT_robustness */

/* GL_EXT_sRGB */

/* GL_EXT_sRGB_write_control */

/* GL_EXT_semaphore */

/* GL_EXT_semaphore_fd */

/* GL_EXT_semaphore_win32 */

/* GL_EXT_separate_shader_objects */

/* GL_EXT_shader_framebuffer_fetch */

/* GL_EXT_shader_framebuffer_fetch_non_coherent */

/* GL_EXT_shader_group_vote */

/* GL_EXT_shader_implicit_conversions */

/* GL_EXT_shader_integer_mix */

/* GL_EXT_shader_io_blocks */

/* GL_EXT_shader_non_constant_global_initializers */

/* GL_EXT_shader_pixel_local_storage */

/* GL_EXT_shader_pixel_local_storage2 */

/* GL_EXT_shader_texture_lod */

/* GL_EXT_shadow_samplers */

/* GL_EXT_sparse_texture */

/* GL_EXT_sparse_texture2 */

/* GL_EXT_tessellation_point_size */

/* GL_EXT_tessellation_shader */

/* GL_EXT_texture_border_clamp */

/* GL_EXT_texture_buffer */

/* GL_EXT_texture_compression_astc_decode_mode */

/* GL_EXT_texture_compression_bptc */

/* GL_EXT_texture_compression_dxt1 */

/* GL_EXT_texture_compression_rgtc */

/* GL_EXT_texture_compression_s3tc */

/* GL_EXT_texture_compression_s3tc_srgb */

/* GL_EXT_texture_cube_map_array */

/* GL_EXT_texture_filter_anisotropic */

/* GL_EXT_texture_filter_minmax */

/* GL_EXT_texture_format_BGRA8888 */

/* GL_EXT_texture_format_sRGB_override */

/* GL_EXT_texture_mirror_clamp_to_edge */

/* GL_EXT_texture_norm16 */

/* GL_EXT_texture_query_lod */

/* GL_EXT_texture_rg */

/* GL_EXT_texture_sRGB_R8 */

/* GL_EXT_texture_sRGB_RG8 */

/* GL_EXT_texture_sRGB_decode */

/* GL_EXT_texture_shadow_lod */

/* GL_EXT_texture_storage */

/* GL_EXT_texture_type_2_10_10_10_REV */

/* GL_EXT_texture_view */

/* GL_EXT_unpack_subimage */

/* GL_EXT_win32_keyed_mutex */

/* GL_EXT_window_rectangles */

/* GL_FJ_shader_binary_GCCSO */

/* GL_IMG_bindless_texture */

/* GL_IMG_framebuffer_downsample */

/* GL_IMG_multisampled_render_to_texture */

/* GL_IMG_program_binary */

/* GL_IMG_read_format */

/* GL_IMG_shader_binary */

/* GL_IMG_texture_compression_pvrtc */

/* GL_IMG_texture_compression_pvrtc2 */

/* GL_IMG_texture_filter_cubic */

/* GL_INTEL_blackhole_render */

/* GL_INTEL_conservative_rasterization */

/* GL_INTEL_framebuffer_CMAA */

/* GL_INTEL_performance_query */

/* GL_MESA_framebuffer_flip_x */

/* GL_MESA_framebuffer_flip_y */

/* GL_MESA_framebuffer_swap_xy */

/* GL_MESA_program_binary_formats */

/* GL_MESA_shader_integer_functions */

/* GL_NVX_blend_equation_advanced_multi_draw_buffers */

/* GL_NV_bindless_texture */

/* GL_NV_blend_equation_advanced */

/* GL_NV_blend_equation_advanced_coherent */

/* GL_NV_blend_minmax_factor */

/* GL_NV_clip_space_w_scaling */

/* GL_NV_compute_shader_derivatives */

/* GL_NV_conditional_render */

/* GL_NV_conservative_raster */

/* GL_NV_conservative_raster_pre_snap */

/* GL_NV_conservative_raster_pre_snap_triangles */

/* GL_NV_copy_buffer */

/* GL_NV_coverage_sample */

/* GL_NV_depth_nonlinear */

/* GL_NV_draw_buffers */

/* GL_NV_draw_instanced */

/* GL_NV_draw_vulkan_image */

/* GL_NV_explicit_attrib_location */

/* GL_NV_fbo_color_attachments */

/* GL_NV_fence */

/* GL_NV_fill_rectangle */

/* GL_NV_fragment_coverage_to_color */

/* GL_NV_fragment_shader_barycentric */

/* GL_NV_fragment_shader_interlock */

/* GL_NV_framebuffer_blit */

/* GL_NV_framebuffer_mixed_samples */

/* GL_NV_framebuffer_multisample */

/* GL_NV_generate_mipmap_sRGB */

/* GL_NV_geometry_shader_passthrough */

/* GL_NV_gpu_shader5 */

/* GL_NV_image_formats */

/* GL_NV_instanced_arrays */

/* GL_NV_internalformat_sample_query */

/* GL_NV_memory_attachment */

/* GL_NV_mesh_shader */

/* GL_NV_non_square_matrices */

/* GL_NV_path_rendering */

/* GL_NV_path_rendering_shared_edge */

/* GL_NV_pixel_buffer_object */

/* GL_NV_polygon_mode */

/* GL_NV_read_buffer */

/* GL_NV_read_buffer_front */

/* GL_NV_read_depth */

/* GL_NV_read_depth_stencil */

/* GL_NV_read_stencil */

/* GL_NV_representative_fragment_test */

/* GL_NV_sRGB_formats */

/* GL_NV_sample_locations */

/* GL_NV_sample_mask_override_coverage */

/* GL_NV_scissor_exclusive */

/* GL_NV_shader_atomic_fp16_vector */

/* GL_NV_shader_noperspective_interpolation */

/* GL_NV_shader_subgroup_partitioned */

/* GL_NV_shader_texture_footprint */

/* GL_NV_shading_rate_image */

/* GL_NV_shadow_samplers_array */

/* GL_NV_shadow_samplers_cube */

/* GL_NV_stereo_view_rendering */

/* GL_NV_texture_border_clamp */

/* GL_NV_texture_compression_s3tc_update */

/* GL_NV_texture_npot_2D_mipmap */

/* GL_NV_viewport_array */

/* GL_NV_viewport_array2 */

/* GL_NV_viewport_swizzle */

/* GL_OVR_multiview */

/* GL_OVR_multiview2 */

/* GL_OVR_multiview_multisampled_render_to_texture */

/* GL_QCOM_YUV_texture_gather */

/* GL_QCOM_alpha_test */

/* GL_QCOM_binning_control */

/* GL_QCOM_driver_control */

/* GL_QCOM_extended_get */

/* GL_QCOM_extended_get2 */

/* GL_QCOM_framebuffer_foveated */

/* GL_QCOM_motion_estimation */

/* GL_QCOM_perfmon_global_mode */

/* GL_QCOM_shader_framebuffer_fetch_noncoherent */

/* GL_QCOM_shader_framebuffer_fetch_rate */

/* GL_QCOM_shading_rate */

/* GL_QCOM_texture_foveated */

/* GL_QCOM_texture_foveated_subsampled_layout */

/* GL_QCOM_tiled_rendering */

/* GL_QCOM_writeonly_rendering */

/* GL_VIV_shader_binary */


=== system/include/GLES2/gl2platform.h ===
SHA256: 8f25443c4c5b3c8e702c3510f12b6ec8c23c2e3c1ca1c71bb07d148653696d9a
/*
** Copyright (c) 2017 The Khronos Group Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/

/* Platform-specific types and definitions for OpenGL ES 2.X  gl2.h
 *
 * Adopters may modify khrplatform.h and this file to suit their platform.
 * Please contribute modifications back to Khronos as pull requests on the
 * public github repository:
 *      https://github.com/KhronosGroup/OpenGL-Registry
 */

/* __gl2platform_h_ */


=== system/include/GLES3/gl2ext.h ===
SHA256: 18ba10ef3a2c89b88f66a8d872cb7e713c4fa23bfec024674281aba33d638060
/* N.B. This file <GLES3/gl2ext.h> should not exist, see here:
   https://www.khronos.org/registry/gles/ : "OpenGL ES Extension Header File (this header is defined
   to contain all defined extension interfaces for OpenGL ES 2.0 and all later versions, since later
   versions are backwards-compatible with OpenGL ES 2.0)."

   However, we do provide this file for compatibility, since some other platforms seem to have
   it, and there's existing code in the wild that do #include <GLES3/gl2ext.h>.
   Please #include <GLES3/gl2ext.h> instead. */


=== system/include/GLES3/gl3.h ===
SHA256: dbd72f53c24558d98bfb00e7b4e26ed9999f0afacd40340db18ef2b2da5a2fb2
/*
** Copyright (c) 2013-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are 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 Materials.
**
** THE MATERIALS ARE 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
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/

/*
** This header is generated from the Khronos OpenGL / OpenGL ES XML
** API Registry. The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
**   https://github.com/KhronosGroup/OpenGL-Registry
*/

/* Generated on date 20200423 */

/* Generated C header for:
 * API: gles2
 * Profile: common
 * Versions considered: 2\.[0-9]|3\.0
 * Versions emitted: .*
 * Default extensions included: None
 * Additional extensions included: _nomatch_^
 * Extensions removed: _nomatch_^
 */

/* GL_ES_VERSION_2_0 */

/* GL_ES_VERSION_3_0 */


=== system/include/GLES3/gl31.h ===
SHA256: 20e3b0fabf52b5e5d4a7a355c7bc59e99268332de475beaf1660193d94d1ce09
/*
** Copyright (c) 2013-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are 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 Materials.
**
** THE MATERIALS ARE 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
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/

/*
** This header is generated from the Khronos OpenGL / OpenGL ES XML
** API Registry. The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
**   https://github.com/KhronosGroup/OpenGL-Registry
*/

/* Generated on date 20191013 */

/* Generated C header for:
 * API: gles2
 * Profile: common
 * Versions considered: 2\.[0-9]|3\.[01]
 * Versions emitted: .*
 * Default extensions included: None
 * Additional extensions included: _nomatch_^
 * Extensions removed: _nomatch_^
 */

/* GL_ES_VERSION_2_0 */

/* GL_ES_VERSION_3_0 */

/* GL_ES_VERSION_3_1 */


=== system/include/GLES3/gl32.h ===
SHA256: c1fc8c7937e815d5ca07d69f8c9ce3eb99fb38f2d72e6c749e24c0cb2de2a468
/*
** Copyright (c) 2013-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are 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 Materials.
**
** THE MATERIALS ARE 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
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/

/*
** This header is generated from the Khronos OpenGL / OpenGL ES XML
** API Registry. The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
**   https://github.com/KhronosGroup/OpenGL-Registry
*/

/* Generated on date 20191013 */

/* Generated C header for:
 * API: gles2
 * Profile: common
 * Versions considered: 2\.[0-9]|3\.[012]
 * Versions emitted: .*
 * Default extensions included: None
 * Additional extensions included: _nomatch_^
 * Extensions removed: _nomatch_^
 */

/* GL_ES_VERSION_2_0 */

/* GL_ES_VERSION_3_0 */

/* GL_ES_VERSION_3_1 */

/* GL_ES_VERSION_3_2 */


=== system/include/GLES3/gl3platform.h ===
SHA256: b4595aafef1eb9b4705cf8a69e29aadb8eb8e3dd3baf8b34ab702c9174dcb549
/*
** Copyright (c) 2017 The Khronos Group Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/

/* Platform-specific types and definitions for OpenGL ES 3.X  gl3.h
 *
 * Adopters may modify khrplatform.h and this file to suit their platform.
 * Please contribute modifications back to Khronos as pull requests on the
 * public github repository:
 *      https://github.com/KhronosGroup/OpenGL-Registry
 */

/* __gl3platform_h_ */


=== system/include/GLFW/glfw3.h ===
SHA256: 0992a30f01ebaa41c32f3f0588e942961abb8a9a52ca8764bd32ee4d7d71a46d
/*************************************************************************
 * GLFW 3.3 - www.glfw.org
 * A library for OpenGL, window and input
 *------------------------------------------------------------------------
 * Copyright (c) 2002-2006 Marcus Geelnard
 * Copyright (c) 2006-2019 Camilla Löwy <elmindreda@glfw.org>
 *
 * This software is provided 'as-is', without any express or implied
 * warranty. In no event will the authors be held liable for any damages
 * arising from the use of this software.
 *
 * Permission is granted to anyone to use this software for any purpose,
 * including commercial applications, and to alter it and redistribute it
 * freely, subject to the following restrictions:
 *
 * 1. The origin of this software must not be misrepresented; you must not
 *    claim that you wrote the original software. If you use this software
 *    in a product, an acknowledgment in the product documentation would
 *    be appreciated but is not required.
 *
 * 2. Altered source versions must be plainly marked as such, and must not
 *    be misrepresented as being the original software.
 *
 * 3. This notice may not be removed or altered from any source
 *    distribution.
 *
 *************************************************************************/

/*************************************************************************
 * Doxygen documentation
 *************************************************************************/

/*! @file glfw3.h
 *  @brief The header of the GLFW 3 API.
 *
 *  This is the header file of the GLFW 3 API.  It defines all its types and
 *  declares all its functions.
 *
 *  For more information about how to use this file, see @ref build_include.
 */

/*! @defgroup context Context reference
 *  @brief Functions and types related to OpenGL and OpenGL ES contexts.
 *
 *  This is the reference documentation for OpenGL and OpenGL ES context related
 *  functions.  For more task-oriented information, see the @ref context_guide.
 */

/*! @defgroup vulkan Vulkan support reference
 *  @brief Functions and types related to Vulkan.
 *
 *  This is the reference documentation for Vulkan related functions and types.
 *  For more task-oriented information, see the @ref vulkan_guide.
 */

/*! @defgroup init Initialization, version and error reference
 *  @brief Functions and types related to initialization and error handling.
 *
 *  This is the reference documentation for initialization and termination of
 *  the library, version management and error handling.  For more task-oriented
 *  information, see the @ref intro_guide.
 */

/*! @defgroup input Input reference
 *  @brief Functions and types related to input handling.
 *
 *  This is the reference documentation for input related functions and types.
 *  For more task-oriented information, see the @ref input_guide.
 */

/*! @defgroup monitor Monitor reference
 *  @brief Functions and types related to monitors.
 *
 *  This is the reference documentation for monitor related functions and types.
 *  For more task-oriented information, see the @ref monitor_guide.
 */

/*! @defgroup window Window reference
 *  @brief Functions and types related to windows.
 *
 *  This is the reference documentation for window related functions and types,
 *  including creation, deletion and event polling.  For more task-oriented
 *  information, see the @ref window_guide.
 */

/*************************************************************************
 * Compiler- and platform-specific preprocessor work
 *************************************************************************/

/* If we are we on Windows, we want a single define for it.
 */

/* _WIN32 */

/* Include because most Windows GLU headers need wchar_t and
 * the macOS OpenGL header blocks the definition of ptrdiff_t by glext.h.
 * Include it unconditionally to avoid surprising side-effects.
 */

/* Include because it is needed by Vulkan and related functions.
 * Include it unconditionally to avoid surprising side-effects.
 */

/* Vulkan header */

/* The Vulkan header may have indirectly included windows.h (because of
 * VK_USE_PLATFORM_WIN32_KHR) so we offer our replacement symbols after it.
 */

/* It is customary to use APIENTRY for OpenGL function pointer declarations on
 * all platforms.  Additionally, the Windows OpenGL header needs APIENTRY.
 */

/* APIENTRY */

/* Some Windows OpenGL headers need this.
 */

/* WINGDIAPI */

/* Some Windows GLU headers need this.
 */

/* CALLBACK */

/* Include the chosen OpenGL or OpenGL ES headers.
 */

/*GLFW_INCLUDE_GLEXT*/

/*__APPLE__*/

/*__APPLE__*/

/*__APPLE__*/

/*__APPLE__*/

/*legacy*/

/*legacy*/

/*legacy*/

/*legacy*/

/*legacy*/

/*non-standard*/

/*non-standard*/

/*non-standard*/

/*__APPLE__*/

/*__APPLE__*/

/* OpenGL and OpenGL ES headers */

/* GLFW_DLL must be defined by applications that are linking against the DLL
  * version of the GLFW library.  _GLFW_BUILD_DLL is defined by the GLFW
  * configuration header when compiling the DLL version of the library.
  */

/* GLFWAPI is used to declare public API functions for export
 * from the DLL / shared library / dynamic library.
 */

/* We are building GLFW as a Win32 DLL */

/* We are calling a GLFW Win32 DLL */

/* We are building GLFW as a Unix shared library */

/*************************************************************************
 * GLFW API tokens
 *************************************************************************/

/*! @name GLFW version macros
 *  @{ */

/*! @brief The major version number of the GLFW header.
 *
 *  The major version number of the GLFW header.  This is incremented when the
 *  API is changed in non-compatible ways.
 *  @ingroup init
 */

/*! @brief The minor version number of the GLFW header.
 *
 *  The minor version number of the GLFW header.  This is incremented when
 *  features are added to the API but it remains backward-compatible.
 *  @ingroup init
 */

/*! @brief The revision number of the GLFW header.
 *
 *  The revision number of the GLFW header.  This is incremented when a bug fix
 *  release is made that does not contain any API changes.
 *  @ingroup init
 */

/*! @} */

/*! @brief One.
 *
 *  This is only semantic sugar for the number 1.  You can instead use `1` or
 *  `true` or `_True` or `GL_TRUE` or `VK_TRUE` or anything else that is equal
 *  to one.
 *
 *  @ingroup init
 */

/*! @brief Zero.
 *
 *  This is only semantic sugar for the number 0.  You can instead use `0` or
 *  `false` or `_False` or `GL_FALSE` or `VK_FALSE` or anything else that is
 *  equal to zero.
 *
 *  @ingroup init
 */

/*! @name Key and button actions
 *  @{ */

/*! @brief The key or mouse button was released.
 *
 *  The key or mouse button was released.
 *
 *  @ingroup input
 */

/*! @brief The key or mouse button was pressed.
 *
 *  The key or mouse button was pressed.
 *
 *  @ingroup input
 */

/*! @brief The key was held down until it repeated.
 *
 *  The key was held down until it repeated.
 *
 *  @ingroup input
 */

/*! @} */

/*! @defgroup hat_state Joystick hat states
 *  @brief Joystick hat states.
 *
 *  See [joystick hat input](@ref joystick_hat) for how these are used.
 *
 *  @ingroup input
 *  @{ */

/*! @} */

/*! @defgroup keys Keyboard keys
 *  @brief Keyboard key IDs.
 *
 *  See [key input](@ref input_key) for how these are used.
 *
 *  These key codes are inspired by the _USB HID Usage Tables v1.12_ (p. 53-60),
 *  but re-arranged to map to 7-bit ASCII for printable keys (function keys are
 *  put in the 256+ range).
 *
 *  The naming of the key codes follow these rules:
 *   - The US keyboard layout is used
 *   - Names of printable alpha-numeric characters are used (e.g. "A", "R",
 *     "3", etc.)
 *   - For non-alphanumeric characters, Unicode:ish names are used (e.g.
 *     "COMMA", "LEFT_SQUARE_BRACKET", etc.). Note that some names do not
 *     correspond to the Unicode standard (usually for brevity)
 *   - Keys that lack a clear US mapping are named "WORLD_x"
 *   - For non-printable keys, custom names are used (e.g. "F4",
 *     "BACKSPACE", etc.)
 *
 *  @ingroup input
 *  @{
 */

/* The unknown key */

/* Printable keys */

/* ' */

/* , */

/* - */

/* . */

/* / */

/* ; */

/* = */

/* [ */

/* \ */

/* ] */

/* ` */

/* non-US #1 */

/* non-US #2 */

/* Function keys */

/*! @} */

/*! @defgroup mods Modifier key flags
 *  @brief Modifier key flags.
 *
 *  See [key input](@ref input_key) for how these are used.
 *
 *  @ingroup input
 *  @{ */

/*! @brief If this bit is set one or more Shift keys were held down.
 *
 *  If this bit is set one or more Shift keys were held down.
 */

/*! @brief If this bit is set one or more Control keys were held down.
 *
 *  If this bit is set one or more Control keys were held down.
 */

/*! @brief If this bit is set one or more Alt keys were held down.
 *
 *  If this bit is set one or more Alt keys were held down.
 */

/*! @brief If this bit is set one or more Super keys were held down.
 *
 *  If this bit is set one or more Super keys were held down.
 */

/*! @brief If this bit is set the Caps Lock key is enabled.
 *
 *  If this bit is set the Caps Lock key is enabled and the @ref
 *  GLFW_LOCK_KEY_MODS input mode is set.
 */

/*! @brief If this bit is set the Num Lock key is enabled.
 *
 *  If this bit is set the Num Lock key is enabled and the @ref
 *  GLFW_LOCK_KEY_MODS input mode is set.
 */

/*! @} */

/*! @defgroup buttons Mouse buttons
 *  @brief Mouse button IDs.
 *
 *  See [mouse button input](@ref input_mouse_button) for how these are used.
 *
 *  @ingroup input
 *  @{ */

/*! @} */

/*! @defgroup joysticks Joysticks
 *  @brief Joystick IDs.
 *
 *  See [joystick input](@ref joystick) for how these are used.
 *
 *  @ingroup input
 *  @{ */

/*! @} */

/*! @defgroup gamepad_buttons Gamepad buttons
 *  @brief Gamepad buttons.
 *
 *  See @ref gamepad for how these are used.
 *
 *  @ingroup input
 *  @{ */

/*! @} */

/*! @defgroup gamepad_axes Gamepad axes
 *  @brief Gamepad axes.
 *
 *  See @ref gamepad for how these are used.
 *
 *  @ingroup input
 *  @{ */

/*! @} */

/*! @defgroup errors Error codes
 *  @brief Error codes.
 *
 *  See [error handling](@ref error_handling) for how these are used.
 *
 *  @ingroup init
 *  @{ */

/*! @brief No error has occurred.
 *
 *  No error has occurred.
 *
 *  @analysis Yay.
 */

/*! @brief GLFW has not been initialized.
 *
 *  This occurs if a GLFW function was called that must not be called unless the
 *  library is [initialized](@ref intro_init).
 *
 *  @analysis Application programmer error.  Initialize GLFW before calling any
 *  function that requires initialization.
 */

/*! @brief No context is current for this thread.
 *
 *  This occurs if a GLFW function was called that needs and operates on the
 *  current OpenGL or OpenGL ES context but no context is current on the calling
 *  thread.  One such function is @ref glfwSwapInterval.
 *
 *  @analysis Application programmer error.  Ensure a context is current before
 *  calling functions that require a current context.
 */

/*! @brief One of the arguments to the function was an invalid enum value.
 *
 *  One of the arguments to the function was an invalid enum value, for example
 *  requesting @ref GLFW_RED_BITS with @ref glfwGetWindowAttrib.
 *
 *  @analysis Application programmer error.  Fix the offending call.
 */

/*! @brief One of the arguments to the function was an invalid value.
 *
 *  One of the arguments to the function was an invalid value, for example
 *  requesting a non-existent OpenGL or OpenGL ES version like 2.7.
 *
 *  Requesting a valid but unavailable OpenGL or OpenGL ES version will instead
 *  result in a @ref GLFW_VERSION_UNAVAILABLE error.
 *
 *  @analysis Application programmer error.  Fix the offending call.
 */

/*! @brief A memory allocation failed.
 *
 *  A memory allocation failed.
 *
 *  @analysis A bug in GLFW or the underlying operating system.  Report the bug
 *  to our [issue tracker](https://github.com/glfw/glfw/issues).
 */

/*! @brief GLFW could not find support for the requested API on the system.
 *
 *  GLFW could not find support for the requested API on the system.
 *
 *  @analysis The installed graphics driver does not support the requested
 *  API, or does not support it via the chosen context creation backend.
 *  Below are a few examples.
 *
 *  @par
 *  Some pre-installed Windows graphics drivers do not support OpenGL.  AMD only
 *  supports OpenGL ES via EGL, while Nvidia and Intel only support it via
 *  a WGL or GLX extension.  macOS does not provide OpenGL ES at all.  The Mesa
 *  EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary
 *  driver.  Older graphics drivers do not support Vulkan.
 */

/*! @brief The requested OpenGL or OpenGL ES version is not available.
 *
 *  The requested OpenGL or OpenGL ES version (including any requested context
 *  or framebuffer hints) is not available on this machine.
 *
 *  @analysis The machine does not support your requirements.  If your
 *  application is sufficiently flexible, downgrade your requirements and try
 *  again.  Otherwise, inform the user that their machine does not match your
 *  requirements.
 *
 *  @par
 *  Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0
 *  comes out before the 4.x series gets that far, also fail with this error and
 *  not @ref GLFW_INVALID_VALUE, because GLFW cannot know what future versions
 *  will exist.
 */

/*! @brief A platform-specific error occurred that does not match any of the
 *  more specific categories.
 *
 *  A platform-specific error occurred that does not match any of the more
 *  specific categories.
 *
 *  @analysis A bug or configuration error in GLFW, the underlying operating
 *  system or its drivers, or a lack of required resources.  Report the issue to
 *  our [issue tracker](https://github.com/glfw/glfw/issues).
 */

/*! @brief The requested format is not supported or available.
 *
 *  If emitted during window creation, the requested pixel format is not
 *  supported.
 *
 *  If emitted when querying the clipboard, the contents of the clipboard could
 *  not be converted to the requested format.
 *
 *  @analysis If emitted during window creation, one or more
 *  [hard constraints](@ref window_hints_hard) did not match any of the
 *  available pixel formats.  If your application is sufficiently flexible,
 *  downgrade your requirements and try again.  Otherwise, inform the user that
 *  their machine does not match your requirements.
 *
 *  @par
 *  If emitted when querying the clipboard, ignore the error or report it to
 *  the user, as appropriate.
 */

/*! @brief The specified window does not have an OpenGL or OpenGL ES context.
 *
 *  A window that does not have an OpenGL or OpenGL ES context was passed to
 *  a function that requires it to have one.
 *
 *  @analysis Application programmer error.  Fix the offending call.
 */

/*! @} */

/*! @addtogroup window
 *  @{ */

/*! @brief Input focus window hint and attribute
 *
 *  Input focus [window hint](@ref GLFW_FOCUSED_hint) or
 *  [window attribute](@ref GLFW_FOCUSED_attrib).
 */

/*! @brief Window iconification window attribute
 *
 *  Window iconification [window attribute](@ref GLFW_ICONIFIED_attrib).
 */

/*! @brief Window resize-ability window hint and attribute
 *
 *  Window resize-ability [window hint](@ref GLFW_RESIZABLE_hint) and
 *  [window attribute](@ref GLFW_RESIZABLE_attrib).
 */

/*! @brief Window visibility window hint and attribute
 *
 *  Window visibility [window hint](@ref GLFW_VISIBLE_hint) and
 *  [window attribute](@ref GLFW_VISIBLE_attrib).
 */

/*! @brief Window decoration window hint and attribute
 *
 *  Window decoration [window hint](@ref GLFW_DECORATED_hint) and
 *  [window attribute](@ref GLFW_DECORATED_attrib).
 */

/*! @brief Window auto-iconification window hint and attribute
 *
 *  Window auto-iconification [window hint](@ref GLFW_AUTO_ICONIFY_hint) and
 *  [window attribute](@ref GLFW_AUTO_ICONIFY_attrib).
 */

/*! @brief Window decoration window hint and attribute
 *
 *  Window decoration [window hint](@ref GLFW_FLOATING_hint) and
 *  [window attribute](@ref GLFW_FLOATING_attrib).
 */

/*! @brief Window maximization window hint and attribute
 *
 *  Window maximization [window hint](@ref GLFW_MAXIMIZED_hint) and
 *  [window attribute](@ref GLFW_MAXIMIZED_attrib).
 */

/*! @brief Cursor centering window hint
 *
 *  Cursor centering [window hint](@ref GLFW_CENTER_CURSOR_hint).
 */

/*! @brief Window framebuffer transparency hint and attribute
 *
 *  Window framebuffer transparency
 *  [window hint](@ref GLFW_TRANSPARENT_FRAMEBUFFER_hint) and
 *  [window attribute](@ref GLFW_TRANSPARENT_FRAMEBUFFER_attrib).
 */

/*! @brief Mouse cursor hover window attribute.
 *
 *  Mouse cursor hover [window attribute](@ref GLFW_HOVERED_attrib).
 */

/*! @brief Input focus on calling show window hint and attribute
 *
 *  Input focus [window hint](@ref GLFW_FOCUS_ON_SHOW_hint) or
 *  [window attribute](@ref GLFW_FOCUS_ON_SHOW_attrib).
 */

/*! @brief Framebuffer bit depth hint.
 *
 *  Framebuffer bit depth [hint](@ref GLFW_RED_BITS).
 */

/*! @brief Framebuffer bit depth hint.
 *
 *  Framebuffer bit depth [hint](@ref GLFW_GREEN_BITS).
 */

/*! @brief Framebuffer bit depth hint.
 *
 *  Framebuffer bit depth [hint](@ref GLFW_BLUE_BITS).
 */

/*! @brief Framebuffer bit depth hint.
 *
 *  Framebuffer bit depth [hint](@ref GLFW_ALPHA_BITS).
 */

/*! @brief Framebuffer bit depth hint.
 *
 *  Framebuffer bit depth [hint](@ref GLFW_DEPTH_BITS).
 */

/*! @brief Framebuffer bit depth hint.
 *
 *  Framebuffer bit depth [hint](@ref GLFW_STENCIL_BITS).
 */

/*! @brief Framebuffer bit depth hint.
 *
 *  Framebuffer bit depth [hint](@ref GLFW_ACCUM_RED_BITS).
 */

/*! @brief Framebuffer bit depth hint.
 *
 *  Framebuffer bit depth [hint](@ref GLFW_ACCUM_GREEN_BITS).
 */

/*! @brief Framebuffer bit depth hint.
 *
 *  Framebuffer bit depth [hint](@ref GLFW_ACCUM_BLUE_BITS).
 */

/*! @brief Framebuffer bit depth hint.
 *
 *  Framebuffer bit depth [hint](@ref GLFW_ACCUM_ALPHA_BITS).
 */

/*! @brief Framebuffer auxiliary buffer hint.
 *
 *  Framebuffer auxiliary buffer [hint](@ref GLFW_AUX_BUFFERS).
 */

/*! @brief OpenGL stereoscopic rendering hint.
 *
 *  OpenGL stereoscopic rendering [hint](@ref GLFW_STEREO).
 */

/*! @brief Framebuffer MSAA samples hint.
 *
 *  Framebuffer MSAA samples [hint](@ref GLFW_SAMPLES).
 */

/*! @brief Framebuffer sRGB hint.
 *
 *  Framebuffer sRGB [hint](@ref GLFW_SRGB_CAPABLE).
 */

/*! @brief Monitor refresh rate hint.
 *
 *  Monitor refresh rate [hint](@ref GLFW_REFRESH_RATE).
 */

/*! @brief Framebuffer double buffering hint.
 *
 *  Framebuffer double buffering [hint](@ref GLFW_DOUBLEBUFFER).
 */

/*! @brief Context client API hint and attribute.
 *
 *  Context client API [hint](@ref GLFW_CLIENT_API_hint) and
 *  [attribute](@ref GLFW_CLIENT_API_attrib).
 */

/*! @brief Context client API major version hint and attribute.
 *
 *  Context client API major version [hint](@ref GLFW_CONTEXT_VERSION_MAJOR_hint)
 *  and [attribute](@ref GLFW_CONTEXT_VERSION_MAJOR_attrib).
 */

/*! @brief Context client API minor version hint and attribute.
 *
 *  Context client API minor version [hint](@ref GLFW_CONTEXT_VERSION_MINOR_hint)
 *  and [attribute](@ref GLFW_CONTEXT_VERSION_MINOR_attrib).
 */

/*! @brief Context client API revision number attribute.
 *
 *  Context client API revision number
 *  [attribute](@ref GLFW_CONTEXT_REVISION_attrib).
 */

/*! @brief Context robustness hint and attribute.
 *
 *  Context client API revision number [hint](@ref GLFW_CONTEXT_ROBUSTNESS_hint)
 *  and [attribute](@ref GLFW_CONTEXT_ROBUSTNESS_attrib).
 */

/*! @brief OpenGL forward-compatibility hint and attribute.
 *
 *  OpenGL forward-compatibility [hint](@ref GLFW_OPENGL_FORWARD_COMPAT_hint)
 *  and [attribute](@ref GLFW_OPENGL_FORWARD_COMPAT_attrib).
 */

/*! @brief Debug mode context hint and attribute.
 *
 *  Debug mode context [hint](@ref GLFW_OPENGL_DEBUG_CONTEXT_hint) and
 *  [attribute](@ref GLFW_OPENGL_DEBUG_CONTEXT_attrib).
 */

/*! @brief OpenGL profile hint and attribute.
 *
 *  OpenGL profile [hint](@ref GLFW_OPENGL_PROFILE_hint) and
 *  [attribute](@ref GLFW_OPENGL_PROFILE_attrib).
 */

/*! @brief Context flush-on-release hint and attribute.
 *
 *  Context flush-on-release [hint](@ref GLFW_CONTEXT_RELEASE_BEHAVIOR_hint) and
 *  [attribute](@ref GLFW_CONTEXT_RELEASE_BEHAVIOR_attrib).
 */

/*! @brief Context error suppression hint and attribute.
 *
 *  Context error suppression [hint](@ref GLFW_CONTEXT_NO_ERROR_hint) and
 *  [attribute](@ref GLFW_CONTEXT_NO_ERROR_attrib).
 */

/*! @brief Context creation API hint and attribute.
 *
 *  Context creation API [hint](@ref GLFW_CONTEXT_CREATION_API_hint) and
 *  [attribute](@ref GLFW_CONTEXT_CREATION_API_attrib).
 */

/*! @brief Window content area scaling window
 *  [window hint](@ref GLFW_SCALE_TO_MONITOR).
 */

/*! @brief macOS specific
 *  [window hint](@ref GLFW_COCOA_RETINA_FRAMEBUFFER_hint).
 */

/*! @brief macOS specific
 *  [window hint](@ref GLFW_COCOA_FRAME_NAME_hint).
 */

/*! @brief macOS specific
 *  [window hint](@ref GLFW_COCOA_GRAPHICS_SWITCHING_hint).
 */

/*! @brief X11 specific
 *  [window hint](@ref GLFW_X11_CLASS_NAME_hint).
 */

/*! @brief X11 specific
 *  [window hint](@ref GLFW_X11_CLASS_NAME_hint).
 */

/*! @} */

/*! @defgroup shapes Standard cursor shapes
 *  @brief Standard system cursor shapes.
 *
 *  See [standard cursor creation](@ref cursor_standard) for how these are used.
 *
 *  @ingroup input
 *  @{ */

/*! @brief The regular arrow cursor shape.
 *
 *  The regular arrow cursor.
 */

/*! @brief The text input I-beam cursor shape.
 *
 *  The text input I-beam cursor shape.
 */

/*! @brief The crosshair shape.
 *
 *  The crosshair shape.
 */

/*! @brief The hand shape.
 *
 *  The hand shape.
 */

/*! @brief The horizontal resize arrow shape.
 *
 *  The horizontal resize arrow shape.
 */

/*! @brief The vertical resize arrow shape.
 *
 *  The vertical resize arrow shape.
 */

/*! @} */

/*! @addtogroup init
 *  @{ */

/*! @brief Joystick hat buttons init hint.
 *
 *  Joystick hat buttons [init hint](@ref GLFW_JOYSTICK_HAT_BUTTONS).
 */

/*! @brief macOS specific init hint.
 *
 *  macOS specific [init hint](@ref GLFW_COCOA_CHDIR_RESOURCES_hint).
 */

/*! @brief macOS specific init hint.
 *
 *  macOS specific [init hint](@ref GLFW_COCOA_MENUBAR_hint).
 */

/*! @} */

/*************************************************************************
 * GLFW API types
 *************************************************************************/

/*! @brief Client API function pointer type.
 *
 *  Generic function pointer used for returning client API function pointers
 *  without forcing a cast from a regular pointer.
 *
 *  @sa @ref context_glext
 *  @sa @ref glfwGetProcAddress
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup context
 */

/*! @brief Vulkan API function pointer type.
 *
 *  Generic function pointer used for returning Vulkan API function pointers
 *  without forcing a cast from a regular pointer.
 *
 *  @sa @ref vulkan_proc
 *  @sa @ref glfwGetInstanceProcAddress
 *
 *  @since Added in version 3.2.
 *
 *  @ingroup vulkan
 */

/*! @brief Opaque monitor object.
 *
 *  Opaque monitor object.
 *
 *  @see @ref monitor_object
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup monitor
 */

/*! @brief Opaque window object.
 *
 *  Opaque window object.
 *
 *  @see @ref window_object
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup window
 */

/*! @brief Opaque cursor object.
 *
 *  Opaque cursor object.
 *
 *  @see @ref cursor_object
 *
 *  @since Added in version 3.1.
 *
 *  @ingroup input
 */

/*! @brief The function pointer type for error callbacks.
 *
 *  This is the function pointer type for error callbacks.  An error callback
 *  function has the following signature:
 *  @code
 *  void callback_name(int error_code, const char* description)
 *  @endcode
 *
 *  @param[in] error_code An [error code](@ref errors).  Future releases may add
 *  more error codes.
 *  @param[in] description A UTF-8 encoded string describing the error.
 *
 *  @pointer_lifetime The error description string is valid until the callback
 *  function returns.
 *
 *  @sa @ref error_handling
 *  @sa @ref glfwSetErrorCallback
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup init
 */

/*! @brief The function pointer type for window position callbacks.
 *
 *  This is the function pointer type for window position callbacks.  A window
 *  position callback function has the following signature:
 *  @code
 *  void callback_name(GLFWwindow* window, int xpos, int ypos)
 *  @endcode
 *
 *  @param[in] window The window that was moved.
 *  @param[in] xpos The new x-coordinate, in screen coordinates, of the
 *  upper-left corner of the content area of the window.
 *  @param[in] ypos The new y-coordinate, in screen coordinates, of the
 *  upper-left corner of the content area of the window.
 *
 *  @sa @ref window_pos
 *  @sa @ref glfwSetWindowPosCallback
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup window
 */

/*! @brief The function pointer type for window size callbacks.
 *
 *  This is the function pointer type for window size callbacks.  A window size
 *  callback function has the following signature:
 *  @code
 *  void callback_name(GLFWwindow* window, int width, int height)
 *  @endcode
 *
 *  @param[in] window The window that was resized.
 *  @param[in] width The new width, in screen coordinates, of the window.
 *  @param[in] height The new height, in screen coordinates, of the window.
 *
 *  @sa @ref window_size
 *  @sa @ref glfwSetWindowSizeCallback
 *
 *  @since Added in version 1.0.
 *  @glfw3 Added window handle parameter.
 *
 *  @ingroup window
 */

/*! @brief The function pointer type for window close callbacks.
 *
 *  This is the function pointer type for window close callbacks.  A window
 *  close callback function has the following signature:
 *  @code
 *  void function_name(GLFWwindow* window)
 *  @endcode
 *
 *  @param[in] window The window that the user attempted to close.
 *
 *  @sa @ref window_close
 *  @sa @ref glfwSetWindowCloseCallback
 *
 *  @since Added in version 2.5.
 *  @glfw3 Added window handle parameter.
 *
 *  @ingroup window
 */

/*! @brief The function pointer type for window content refresh callbacks.
 *
 *  This is the function pointer type for window content refresh callbacks.
 *  A window content refresh callback function has the following signature:
 *  @code
 *  void function_name(GLFWwindow* window);
 *  @endcode
 *
 *  @param[in] window The window whose content needs to be refreshed.
 *
 *  @sa @ref window_refresh
 *  @sa @ref glfwSetWindowRefreshCallback
 *
 *  @since Added in version 2.5.
 *  @glfw3 Added window handle parameter.
 *
 *  @ingroup window
 */

/*! @brief The function pointer type for window focus callbacks.
 *
 *  This is the function pointer type for window focus callbacks.  A window
 *  focus callback function has the following signature:
 *  @code
 *  void function_name(GLFWwindow* window, int focused)
 *  @endcode
 *
 *  @param[in] window The window that gained or lost input focus.
 *  @param[in] focused `GLFW_TRUE` if the window was given input focus, or
 *  `GLFW_FALSE` if it lost it.
 *
 *  @sa @ref window_focus
 *  @sa @ref glfwSetWindowFocusCallback
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup window
 */

/*! @brief The function pointer type for window iconify callbacks.
 *
 *  This is the function pointer type for window iconify callbacks.  A window
 *  iconify callback function has the following signature:
 *  @code
 *  void function_name(GLFWwindow* window, int iconified)
 *  @endcode
 *
 *  @param[in] window The window that was iconified or restored.
 *  @param[in] iconified `GLFW_TRUE` if the window was iconified, or
 *  `GLFW_FALSE` if it was restored.
 *
 *  @sa @ref window_iconify
 *  @sa @ref glfwSetWindowIconifyCallback
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup window
 */

/*! @brief The function pointer type for window maximize callbacks.
 *
 *  This is the function pointer type for window maximize callbacks.  A window
 *  maximize callback function has the following signature:
 *  @code
 *  void function_name(GLFWwindow* window, int maximized)
 *  @endcode
 *
 *  @param[in] window The window that was maximized or restored.
 *  @param[in] maximized `GLFW_TRUE` if the window was maximized, or
 *  `GLFW_FALSE` if it was restored.
 *
 *  @sa @ref window_maximize
 *  @sa glfwSetWindowMaximizeCallback
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup window
 */

/*! @brief The function pointer type for framebuffer size callbacks.
 *
 *  This is the function pointer type for framebuffer size callbacks.
 *  A framebuffer size callback function has the following signature:
 *  @code
 *  void function_name(GLFWwindow* window, int width, int height)
 *  @endcode
 *
 *  @param[in] window The window whose framebuffer was resized.
 *  @param[in] width The new width, in pixels, of the framebuffer.
 *  @param[in] height The new height, in pixels, of the framebuffer.
 *
 *  @sa @ref window_fbsize
 *  @sa @ref glfwSetFramebufferSizeCallback
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup window
 */

/*! @brief The function pointer type for window content scale callbacks.
 *
 *  This is the function pointer type for window content scale callbacks.
 *  A window content scale callback function has the following signature:
 *  @code
 *  void function_name(GLFWwindow* window, float xscale, float yscale)
 *  @endcode
 *
 *  @param[in] window The window whose content scale changed.
 *  @param[in] xscale The new x-axis content scale of the window.
 *  @param[in] yscale The new y-axis content scale of the window.
 *
 *  @sa @ref window_scale
 *  @sa @ref glfwSetWindowContentScaleCallback
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup window
 */

/*! @brief The function pointer type for mouse button callbacks.
 *
 *  This is the function pointer type for mouse button callback functions.
 *  A mouse button callback function has the following signature:
 *  @code
 *  void function_name(GLFWwindow* window, int button, int action, int mods)
 *  @endcode
 *
 *  @param[in] window The window that received the event.
 *  @param[in] button The [mouse button](@ref buttons) that was pressed or
 *  released.
 *  @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`.  Future releases
 *  may add more actions.
 *  @param[in] mods Bit field describing which [modifier keys](@ref mods) were
 *  held down.
 *
 *  @sa @ref input_mouse_button
 *  @sa @ref glfwSetMouseButtonCallback
 *
 *  @since Added in version 1.0.
 *  @glfw3 Added window handle and modifier mask parameters.
 *
 *  @ingroup input
 */

/*! @brief The function pointer type for cursor position callbacks.
 *
 *  This is the function pointer type for cursor position callbacks.  A cursor
 *  position callback function has the following signature:
 *  @code
 *  void function_name(GLFWwindow* window, double xpos, double ypos);
 *  @endcode
 *
 *  @param[in] window The window that received the event.
 *  @param[in] xpos The new cursor x-coordinate, relative to the left edge of
 *  the content area.
 *  @param[in] ypos The new cursor y-coordinate, relative to the top edge of the
 *  content area.
 *
 *  @sa @ref cursor_pos
 *  @sa @ref glfwSetCursorPosCallback
 *
 *  @since Added in version 3.0.  Replaces `GLFWmouseposfun`.
 *
 *  @ingroup input
 */

/*! @brief The function pointer type for cursor enter/leave callbacks.
 *
 *  This is the function pointer type for cursor enter/leave callbacks.
 *  A cursor enter/leave callback function has the following signature:
 *  @code
 *  void function_name(GLFWwindow* window, int entered)
 *  @endcode
 *
 *  @param[in] window The window that received the event.
 *  @param[in] entered `GLFW_TRUE` if the cursor entered the window's content
 *  area, or `GLFW_FALSE` if it left it.
 *
 *  @sa @ref cursor_enter
 *  @sa @ref glfwSetCursorEnterCallback
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup input
 */

/*! @brief The function pointer type for scroll callbacks.
 *
 *  This is the function pointer type for scroll callbacks.  A scroll callback
 *  function has the following signature:
 *  @code
 *  void function_name(GLFWwindow* window, double xoffset, double yoffset)
 *  @endcode
 *
 *  @param[in] window The window that received the event.
 *  @param[in] xoffset The scroll offset along the x-axis.
 *  @param[in] yoffset The scroll offset along the y-axis.
 *
 *  @sa @ref scrolling
 *  @sa @ref glfwSetScrollCallback
 *
 *  @since Added in version 3.0.  Replaces `GLFWmousewheelfun`.
 *
 *  @ingroup input
 */

/*! @brief The function pointer type for keyboard key callbacks.
 *
 *  This is the function pointer type for keyboard key callbacks.  A keyboard
 *  key callback function has the following signature:
 *  @code
 *  void function_name(GLFWwindow* window, int key, int scancode, int action, int mods)
 *  @endcode
 *
 *  @param[in] window The window that received the event.
 *  @param[in] key The [keyboard key](@ref keys) that was pressed or released.
 *  @param[in] scancode The system-specific scancode of the key.
 *  @param[in] action `GLFW_PRESS`, `GLFW_RELEASE` or `GLFW_REPEAT`.  Future
 *  releases may add more actions.
 *  @param[in] mods Bit field describing which [modifier keys](@ref mods) were
 *  held down.
 *
 *  @sa @ref input_key
 *  @sa @ref glfwSetKeyCallback
 *
 *  @since Added in version 1.0.
 *  @glfw3 Added window handle, scancode and modifier mask parameters.
 *
 *  @ingroup input
 */

/*! @brief The function pointer type for Unicode character callbacks.
 *
 *  This is the function pointer type for Unicode character callbacks.
 *  A Unicode character callback function has the following signature:
 *  @code
 *  void function_name(GLFWwindow* window, unsigned int codepoint)
 *  @endcode
 *
 *  @param[in] window The window that received the event.
 *  @param[in] codepoint The Unicode code point of the character.
 *
 *  @sa @ref input_char
 *  @sa @ref glfwSetCharCallback
 *
 *  @since Added in version 2.4.
 *  @glfw3 Added window handle parameter.
 *
 *  @ingroup input
 */

/*! @brief The function pointer type for Unicode character with modifiers
 *  callbacks.
 *
 *  This is the function pointer type for Unicode character with modifiers
 *  callbacks.  It is called for each input character, regardless of what
 *  modifier keys are held down.  A Unicode character with modifiers callback
 *  function has the following signature:
 *  @code
 *  void function_name(GLFWwindow* window, unsigned int codepoint, int mods)
 *  @endcode
 *
 *  @param[in] window The window that received the event.
 *  @param[in] codepoint The Unicode code point of the character.
 *  @param[in] mods Bit field describing which [modifier keys](@ref mods) were
 *  held down.
 *
 *  @sa @ref input_char
 *  @sa @ref glfwSetCharModsCallback
 *
 *  @deprecated Scheduled for removal in version 4.0.
 *
 *  @since Added in version 3.1.
 *
 *  @ingroup input
 */

/*! @brief The function pointer type for path drop callbacks.
 *
 *  This is the function pointer type for path drop callbacks.  A path drop
 *  callback function has the following signature:
 *  @code
 *  void function_name(GLFWwindow* window, int path_count, const char* paths[])
 *  @endcode
 *
 *  @param[in] window The window that received the event.
 *  @param[in] path_count The number of dropped paths.
 *  @param[in] paths The UTF-8 encoded file and/or directory path names.
 *
 *  @pointer_lifetime The path array and its strings are valid until the
 *  callback function returns.
 *
 *  @sa @ref path_drop
 *  @sa @ref glfwSetDropCallback
 *
 *  @since Added in version 3.1.
 *
 *  @ingroup input
 */

/*! @brief The function pointer type for monitor configuration callbacks.
 *
 *  This is the function pointer type for monitor configuration callbacks.
 *  A monitor callback function has the following signature:
 *  @code
 *  void function_name(GLFWmonitor* monitor, int event)
 *  @endcode
 *
 *  @param[in] monitor The monitor that was connected or disconnected.
 *  @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`.  Future
 *  releases may add more events.
 *
 *  @sa @ref monitor_event
 *  @sa @ref glfwSetMonitorCallback
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup monitor
 */

/*! @brief The function pointer type for joystick configuration callbacks.
 *
 *  This is the function pointer type for joystick configuration callbacks.
 *  A joystick configuration callback function has the following signature:
 *  @code
 *  void function_name(int jid, int event)
 *  @endcode
 *
 *  @param[in] jid The joystick that was connected or disconnected.
 *  @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`.  Future
 *  releases may add more events.
 *
 *  @sa @ref joystick_event
 *  @sa @ref glfwSetJoystickCallback
 *
 *  @since Added in version 3.2.
 *
 *  @ingroup input
 */

/*! @brief Video mode type.
 *
 *  This describes a single video mode.
 *
 *  @sa @ref monitor_modes
 *  @sa @ref glfwGetVideoMode
 *  @sa @ref glfwGetVideoModes
 *
 *  @since Added in version 1.0.
 *  @glfw3 Added refresh rate member.
 *
 *  @ingroup monitor
 */

/*! The width, in screen coordinates, of the video mode.
     */

/*! The height, in screen coordinates, of the video mode.
     */

/*! The bit depth of the red channel of the video mode.
     */

/*! The bit depth of the green channel of the video mode.
     */

/*! The bit depth of the blue channel of the video mode.
     */

/*! The refresh rate, in Hz, of the video mode.
     */

/*! @brief Gamma ramp.
 *
 *  This describes the gamma ramp for a monitor.
 *
 *  @sa @ref monitor_gamma
 *  @sa @ref glfwGetGammaRamp
 *  @sa @ref glfwSetGammaRamp
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup monitor
 */

/*! An array of value describing the response of the red channel.
     */

/*! An array of value describing the response of the green channel.
     */

/*! An array of value describing the response of the blue channel.
     */

/*! The number of elements in each array.
     */

/*! @brief Image data.
 *
 *  This describes a single 2D image.  See the documentation for each related
 *  function what the expected pixel format is.
 *
 *  @sa @ref cursor_custom
 *  @sa @ref window_icon
 *
 *  @since Added in version 2.1.
 *  @glfw3 Removed format and bytes-per-pixel members.
 *
 *  @ingroup window
 */

/*! The width, in pixels, of this image.
     */

/*! The height, in pixels, of this image.
     */

/*! The pixel data of this image, arranged left-to-right, top-to-bottom.
     */

/*! @brief Gamepad input state
 *
 *  This describes the input state of a gamepad.
 *
 *  @sa @ref gamepad
 *  @sa @ref glfwGetGamepadState
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup input
 */

/*! The states of each [gamepad button](@ref gamepad_buttons), `GLFW_PRESS`
     *  or `GLFW_RELEASE`.
     */

/*! The states of each [gamepad axis](@ref gamepad_axes), in the range -1.0
     *  to 1.0 inclusive.
     */

/*************************************************************************
 * GLFW API functions
 *************************************************************************/

/*! @brief Initializes the GLFW library.
 *
 *  This function initializes the GLFW library.  Before most GLFW functions can
 *  be used, GLFW must be initialized, and before an application terminates GLFW
 *  should be terminated in order to free any resources allocated during or
 *  after initialization.
 *
 *  If this function fails, it calls @ref glfwTerminate before returning.  If it
 *  succeeds, you should call @ref glfwTerminate before the application exits.
 *
 *  Additional calls to this function after successful initialization but before
 *  termination will return `GLFW_TRUE` immediately.
 *
 *  @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_PLATFORM_ERROR.
 *
 *  @remark @macos This function will change the current directory of the
 *  application to the `Contents/Resources` subdirectory of the application's
 *  bundle, if present.  This can be disabled with the @ref
 *  GLFW_COCOA_CHDIR_RESOURCES init hint.
 *
 *  @remark @x11 This function will set the `LC_CTYPE` category of the
 *  application locale according to the current environment if that category is
 *  still "C".  This is because the "C" locale breaks Unicode text input.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref intro_init
 *  @sa @ref glfwTerminate
 *
 *  @since Added in version 1.0.
 *
 *  @ingroup init
 */

/*! @brief Terminates the GLFW library.
 *
 *  This function destroys all remaining windows and cursors, restores any
 *  modified gamma ramps and frees any other allocated resources.  Once this
 *  function is called, you must again call @ref glfwInit successfully before
 *  you will be able to use most GLFW functions.
 *
 *  If GLFW has been successfully initialized, this function should be called
 *  before the application exits.  If initialization fails, there is no need to
 *  call this function, as it is called by @ref glfwInit before it returns
 *  failure.
 *
 *  This function has no effect if GLFW is not initialized.
 *
 *  @errors Possible errors include @ref GLFW_PLATFORM_ERROR.
 *
 *  @remark This function may be called before @ref glfwInit.
 *
 *  @warning The contexts of any remaining windows must not be current on any
 *  other thread when this function is called.
 *
 *  @reentrancy This function must not be called from a callback.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref intro_init
 *  @sa @ref glfwInit
 *
 *  @since Added in version 1.0.
 *
 *  @ingroup init
 */

/*! @brief Sets the specified init hint to the desired value.
 *
 *  This function sets hints for the next initialization of GLFW.
 *
 *  The values you set hints to are never reset by GLFW, but they only take
 *  effect during initialization.  Once GLFW has been initialized, any values
 *  you set will be ignored until the library is terminated and initialized
 *  again.
 *
 *  Some hints are platform specific.  These may be set on any platform but they
 *  will only affect their specific platform.  Other platforms will ignore them.
 *  Setting these hints requires no platform specific headers or functions.
 *
 *  @param[in] hint The [init hint](@ref init_hints) to set.
 *  @param[in] value The new value of the init hint.
 *
 *  @errors Possible errors include @ref GLFW_INVALID_ENUM and @ref
 *  GLFW_INVALID_VALUE.
 *
 *  @remarks This function may be called before @ref glfwInit.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa init_hints
 *  @sa glfwInit
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup init
 */

/*! @brief Retrieves the version of the GLFW library.
 *
 *  This function retrieves the major, minor and revision numbers of the GLFW
 *  library.  It is intended for when you are using GLFW as a shared library and
 *  want to ensure that you are using the minimum required version.
 *
 *  Any or all of the version arguments may be `NULL`.
 *
 *  @param[out] major Where to store the major version number, or `NULL`.
 *  @param[out] minor Where to store the minor version number, or `NULL`.
 *  @param[out] rev Where to store the revision number, or `NULL`.
 *
 *  @errors None.
 *
 *  @remark This function may be called before @ref glfwInit.
 *
 *  @thread_safety This function may be called from any thread.
 *
 *  @sa @ref intro_version
 *  @sa @ref glfwGetVersionString
 *
 *  @since Added in version 1.0.
 *
 *  @ingroup init
 */

/*! @brief Returns a string describing the compile-time configuration.
 *
 *  This function returns the compile-time generated
 *  [version string](@ref intro_version_string) of the GLFW library binary.  It
 *  describes the version, platform, compiler and any platform-specific
 *  compile-time options.  It should not be confused with the OpenGL or OpenGL
 *  ES version string, queried with `glGetString`.
 *
 *  __Do not use the version string__ to parse the GLFW library version.  The
 *  @ref glfwGetVersion function provides the version of the running library
 *  binary in numerical format.
 *
 *  @return The ASCII encoded GLFW version string.
 *
 *  @errors None.
 *
 *  @remark This function may be called before @ref glfwInit.
 *
 *  @pointer_lifetime The returned string is static and compile-time generated.
 *
 *  @thread_safety This function may be called from any thread.
 *
 *  @sa @ref intro_version
 *  @sa @ref glfwGetVersion
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup init
 */

/*! @brief Returns and clears the last error for the calling thread.
 *
 *  This function returns and clears the [error code](@ref errors) of the last
 *  error that occurred on the calling thread, and optionally a UTF-8 encoded
 *  human-readable description of it.  If no error has occurred since the last
 *  call, it returns @ref GLFW_NO_ERROR (zero) and the description pointer is
 *  set to `NULL`.
 *
 *  @param[in] description Where to store the error description pointer, or `NULL`.
 *  @return The last error code for the calling thread, or @ref GLFW_NO_ERROR
 *  (zero).
 *
 *  @errors None.
 *
 *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
 *  should not free it yourself.  It is guaranteed to be valid only until the
 *  next error occurs or the library is terminated.
 *
 *  @remark This function may be called before @ref glfwInit.
 *
 *  @thread_safety This function may be called from any thread.
 *
 *  @sa @ref error_handling
 *  @sa @ref glfwSetErrorCallback
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup init
 */

/*! @brief Sets the error callback.
 *
 *  This function sets the error callback, which is called with an error code
 *  and a human-readable description each time a GLFW error occurs.
 *
 *  The error code is set before the callback is called.  Calling @ref
 *  glfwGetError from the error callback will return the same value as the error
 *  code argument.
 *
 *  The error callback is called on the thread where the error occurred.  If you
 *  are using GLFW from multiple threads, your error callback needs to be
 *  written accordingly.
 *
 *  Because the description string may have been generated specifically for that
 *  error, it is not guaranteed to be valid after the callback has returned.  If
 *  you wish to use it after the callback returns, you need to make a copy.
 *
 *  Once set, the error callback remains set even after the library has been
 *  terminated.
 *
 *  @param[in] callback The new callback, or `NULL` to remove the currently set
 *  callback.
 *  @return The previously set callback, or `NULL` if no callback was set.
 *
 *  @callback_signature
 *  @code
 *  void callback_name(int error_code, const char* description)
 *  @endcode
 *  For more information about the callback parameters, see the
 *  [callback pointer type](@ref GLFWerrorfun).
 *
 *  @errors None.
 *
 *  @remark This function may be called before @ref glfwInit.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref error_handling
 *  @sa @ref glfwGetError
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup init
 */

/*! @brief Returns the currently connected monitors.
 *
 *  This function returns an array of handles for all currently connected
 *  monitors.  The primary monitor is always first in the returned array.  If no
 *  monitors were found, this function returns `NULL`.
 *
 *  @param[out] count Where to store the number of monitors in the returned
 *  array.  This is set to zero if an error occurred.
 *  @return An array of monitor handles, or `NULL` if no monitors were found or
 *  if an [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
 *  should not free it yourself.  It is guaranteed to be valid only until the
 *  monitor configuration changes or the library is terminated.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref monitor_monitors
 *  @sa @ref monitor_event
 *  @sa @ref glfwGetPrimaryMonitor
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup monitor
 */

/*! @brief Returns the primary monitor.
 *
 *  This function returns the primary monitor.  This is usually the monitor
 *  where elements like the task bar or global menu bar are located.
 *
 *  @return The primary monitor, or `NULL` if no monitors were found or if an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @remark The primary monitor is always first in the array returned by @ref
 *  glfwGetMonitors.
 *
 *  @sa @ref monitor_monitors
 *  @sa @ref glfwGetMonitors
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup monitor
 */

/*! @brief Returns the position of the monitor's viewport on the virtual screen.
 *
 *  This function returns the position, in screen coordinates, of the upper-left
 *  corner of the specified monitor.
 *
 *  Any or all of the position arguments may be `NULL`.  If an error occurs, all
 *  non-`NULL` position arguments will be set to zero.
 *
 *  @param[in] monitor The monitor to query.
 *  @param[out] xpos Where to store the monitor x-coordinate, or `NULL`.
 *  @param[out] ypos Where to store the monitor y-coordinate, or `NULL`.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref monitor_properties
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup monitor
 */

/*! @brief Retrieves the work area of the monitor.
 *
 *  This function returns the position, in screen coordinates, of the upper-left
 *  corner of the work area of the specified monitor along with the work area
 *  size in screen coordinates. The work area is defined as the area of the
 *  monitor not occluded by the operating system task bar where present. If no
 *  task bar exists then the work area is the monitor resolution in screen
 *  coordinates.
 *
 *  Any or all of the position and size arguments may be `NULL`.  If an error
 *  occurs, all non-`NULL` position and size arguments will be set to zero.
 *
 *  @param[in] monitor The monitor to query.
 *  @param[out] xpos Where to store the monitor x-coordinate, or `NULL`.
 *  @param[out] ypos Where to store the monitor y-coordinate, or `NULL`.
 *  @param[out] width Where to store the monitor width, or `NULL`.
 *  @param[out] height Where to store the monitor height, or `NULL`.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref monitor_workarea
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup monitor
 */

/*! @brief Returns the physical size of the monitor.
 *
 *  This function returns the size, in millimetres, of the display area of the
 *  specified monitor.
 *
 *  Some systems do not provide accurate monitor size information, either
 *  because the monitor
 *  [EDID](https://en.wikipedia.org/wiki/Extended_display_identification_data)
 *  data is incorrect or because the driver does not report it accurately.
 *
 *  Any or all of the size arguments may be `NULL`.  If an error occurs, all
 *  non-`NULL` size arguments will be set to zero.
 *
 *  @param[in] monitor The monitor to query.
 *  @param[out] widthMM Where to store the width, in millimetres, of the
 *  monitor's display area, or `NULL`.
 *  @param[out] heightMM Where to store the height, in millimetres, of the
 *  monitor's display area, or `NULL`.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @remark @win32 On Windows 8 and earlier the physical size is calculated from
 *  the current resolution and system DPI instead of querying the monitor EDID data.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref monitor_properties
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup monitor
 */

/*! @brief Retrieves the content scale for the specified monitor.
 *
 *  This function retrieves the content scale for the specified monitor.  The
 *  content scale is the ratio between the current DPI and the platform's
 *  default DPI.  This is especially important for text and any UI elements.  If
 *  the pixel dimensions of your UI scaled by this look appropriate on your
 *  machine then it should appear at a reasonable size on other machines
 *  regardless of their DPI and scaling settings.  This relies on the system DPI
 *  and scaling settings being somewhat correct.
 *
 *  The content scale may depend on both the monitor resolution and pixel
 *  density and on user settings.  It may be very different from the raw DPI
 *  calculated from the physical size and current resolution.
 *
 *  @param[in] monitor The monitor to query.
 *  @param[out] xscale Where to store the x-axis content scale, or `NULL`.
 *  @param[out] yscale Where to store the y-axis content scale, or `NULL`.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref monitor_scale
 *  @sa @ref glfwGetWindowContentScale
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup monitor
 */

/*! @brief Returns the name of the specified monitor.
 *
 *  This function returns a human-readable name, encoded as UTF-8, of the
 *  specified monitor.  The name typically reflects the make and model of the
 *  monitor and is not guaranteed to be unique among the connected monitors.
 *
 *  @param[in] monitor The monitor to query.
 *  @return The UTF-8 encoded name of the monitor, or `NULL` if an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
 *  should not free it yourself.  It is valid until the specified monitor is
 *  disconnected or the library is terminated.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref monitor_properties
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup monitor
 */

/*! @brief Sets the user pointer of the specified monitor.
 *
 *  This function sets the user-defined pointer of the specified monitor.  The
 *  current value is retained until the monitor is disconnected.  The initial
 *  value is `NULL`.
 *
 *  This function may be called from the monitor callback, even for a monitor
 *  that is being disconnected.
 *
 *  @param[in] monitor The monitor whose pointer to set.
 *  @param[in] pointer The new value.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function may be called from any thread.  Access is not
 *  synchronized.
 *
 *  @sa @ref monitor_userptr
 *  @sa @ref glfwGetMonitorUserPointer
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup monitor
 */

/*! @brief Returns the user pointer of the specified monitor.
 *
 *  This function returns the current value of the user-defined pointer of the
 *  specified monitor.  The initial value is `NULL`.
 *
 *  This function may be called from the monitor callback, even for a monitor
 *  that is being disconnected.
 *
 *  @param[in] monitor The monitor whose pointer to return.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function may be called from any thread.  Access is not
 *  synchronized.
 *
 *  @sa @ref monitor_userptr
 *  @sa @ref glfwSetMonitorUserPointer
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup monitor
 */

/*! @brief Sets the monitor configuration callback.
 *
 *  This function sets the monitor configuration callback, or removes the
 *  currently set callback.  This is called when a monitor is connected to or
 *  disconnected from the system.
 *
 *  @param[in] callback The new callback, or `NULL` to remove the currently set
 *  callback.
 *  @return The previously set callback, or `NULL` if no callback was set or the
 *  library had not been [initialized](@ref intro_init).
 *
 *  @callback_signature
 *  @code
 *  void function_name(GLFWmonitor* monitor, int event)
 *  @endcode
 *  For more information about the callback parameters, see the
 *  [function pointer type](@ref GLFWmonitorfun).
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref monitor_event
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup monitor
 */

/*! @brief Returns the available video modes for the specified monitor.
 *
 *  This function returns an array of all video modes supported by the specified
 *  monitor.  The returned array is sorted in ascending order, first by color
 *  bit depth (the sum of all channel depths), then by resolution area (the
 *  product of width and height), then resolution width and finally by refresh
 *  rate.
 *
 *  @param[in] monitor The monitor to query.
 *  @param[out] count Where to store the number of video modes in the returned
 *  array.  This is set to zero if an error occurred.
 *  @return An array of video modes, or `NULL` if an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
 *  should not free it yourself.  It is valid until the specified monitor is
 *  disconnected, this function is called again for that monitor or the library
 *  is terminated.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref monitor_modes
 *  @sa @ref glfwGetVideoMode
 *
 *  @since Added in version 1.0.
 *  @glfw3 Changed to return an array of modes for a specific monitor.
 *
 *  @ingroup monitor
 */

/*! @brief Returns the current mode of the specified monitor.
 *
 *  This function returns the current video mode of the specified monitor.  If
 *  you have created a full screen window for that monitor, the return value
 *  will depend on whether that window is iconified.
 *
 *  @param[in] monitor The monitor to query.
 *  @return The current mode of the monitor, or `NULL` if an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
 *  should not free it yourself.  It is valid until the specified monitor is
 *  disconnected or the library is terminated.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref monitor_modes
 *  @sa @ref glfwGetVideoModes
 *
 *  @since Added in version 3.0.  Replaces `glfwGetDesktopMode`.
 *
 *  @ingroup monitor
 */

/*! @brief Generates a gamma ramp and sets it for the specified monitor.
 *
 *  This function generates an appropriately sized gamma ramp from the specified
 *  exponent and then calls @ref glfwSetGammaRamp with it.  The value must be
 *  a finite number greater than zero.
 *
 *  The software controlled gamma ramp is applied _in addition_ to the hardware
 *  gamma correction, which today is usually an approximation of sRGB gamma.
 *  This means that setting a perfectly linear ramp, or gamma 1.0, will produce
 *  the default (usually sRGB-like) behavior.
 *
 *  For gamma correct rendering with OpenGL or OpenGL ES, see the @ref
 *  GLFW_SRGB_CAPABLE hint.
 *
 *  @param[in] monitor The monitor whose gamma ramp to set.
 *  @param[in] gamma The desired exponent.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
 *
 *  @remark @wayland Gamma handling is a privileged protocol, this function
 *  will thus never be implemented and emits @ref GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref monitor_gamma
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup monitor
 */

/*! @brief Returns the current gamma ramp for the specified monitor.
 *
 *  This function returns the current gamma ramp of the specified monitor.
 *
 *  @param[in] monitor The monitor to query.
 *  @return The current gamma ramp, or `NULL` if an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @remark @wayland Gamma handling is a privileged protocol, this function
 *  will thus never be implemented and emits @ref GLFW_PLATFORM_ERROR while
 *  returning `NULL`.
 *
 *  @pointer_lifetime The returned structure and its arrays are allocated and
 *  freed by GLFW.  You should not free them yourself.  They are valid until the
 *  specified monitor is disconnected, this function is called again for that
 *  monitor or the library is terminated.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref monitor_gamma
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup monitor
 */

/*! @brief Sets the current gamma ramp for the specified monitor.
 *
 *  This function sets the current gamma ramp for the specified monitor.  The
 *  original gamma ramp for that monitor is saved by GLFW the first time this
 *  function is called and is restored by @ref glfwTerminate.
 *
 *  The software controlled gamma ramp is applied _in addition_ to the hardware
 *  gamma correction, which today is usually an approximation of sRGB gamma.
 *  This means that setting a perfectly linear ramp, or gamma 1.0, will produce
 *  the default (usually sRGB-like) behavior.
 *
 *  For gamma correct rendering with OpenGL or OpenGL ES, see the @ref
 *  GLFW_SRGB_CAPABLE hint.
 *
 *  @param[in] monitor The monitor whose gamma ramp to set.
 *  @param[in] ramp The gamma ramp to use.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @remark The size of the specified gamma ramp should match the size of the
 *  current ramp for that monitor.
 *
 *  @remark @win32 The gamma ramp size must be 256.
 *
 *  @remark @wayland Gamma handling is a privileged protocol, this function
 *  will thus never be implemented and emits @ref GLFW_PLATFORM_ERROR.
 *
 *  @pointer_lifetime The specified gamma ramp is copied before this function
 *  returns.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref monitor_gamma
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup monitor
 */

/*! @brief Resets all window hints to their default values.
 *
 *  This function resets all window hints to their
 *  [default values](@ref window_hints_values).
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_hints
 *  @sa @ref glfwWindowHint
 *  @sa @ref glfwWindowHintString
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup window
 */

/*! @brief Sets the specified window hint to the desired value.
 *
 *  This function sets hints for the next call to @ref glfwCreateWindow.  The
 *  hints, once set, retain their values until changed by a call to this
 *  function or @ref glfwDefaultWindowHints, or until the library is terminated.
 *
 *  Only integer value hints can be set with this function.  String value hints
 *  are set with @ref glfwWindowHintString.
 *
 *  This function does not check whether the specified hint values are valid.
 *  If you set hints to invalid values this will instead be reported by the next
 *  call to @ref glfwCreateWindow.
 *
 *  Some hints are platform specific.  These may be set on any platform but they
 *  will only affect their specific platform.  Other platforms will ignore them.
 *  Setting these hints requires no platform specific headers or functions.
 *
 *  @param[in] hint The [window hint](@ref window_hints) to set.
 *  @param[in] value The new value of the window hint.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_INVALID_ENUM.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_hints
 *  @sa @ref glfwWindowHintString
 *  @sa @ref glfwDefaultWindowHints
 *
 *  @since Added in version 3.0.  Replaces `glfwOpenWindowHint`.
 *
 *  @ingroup window
 */

/*! @brief Sets the specified window hint to the desired value.
 *
 *  This function sets hints for the next call to @ref glfwCreateWindow.  The
 *  hints, once set, retain their values until changed by a call to this
 *  function or @ref glfwDefaultWindowHints, or until the library is terminated.
 *
 *  Only string type hints can be set with this function.  Integer value hints
 *  are set with @ref glfwWindowHint.
 *
 *  This function does not check whether the specified hint values are valid.
 *  If you set hints to invalid values this will instead be reported by the next
 *  call to @ref glfwCreateWindow.
 *
 *  Some hints are platform specific.  These may be set on any platform but they
 *  will only affect their specific platform.  Other platforms will ignore them.
 *  Setting these hints requires no platform specific headers or functions.
 *
 *  @param[in] hint The [window hint](@ref window_hints) to set.
 *  @param[in] value The new value of the window hint.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_INVALID_ENUM.
 *
 *  @pointer_lifetime The specified string is copied before this function
 *  returns.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_hints
 *  @sa @ref glfwWindowHint
 *  @sa @ref glfwDefaultWindowHints
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup window
 */

/*! @brief Creates a window and its associated context.
 *
 *  This function creates a window and its associated OpenGL or OpenGL ES
 *  context.  Most of the options controlling how the window and its context
 *  should be created are specified with [window hints](@ref window_hints).
 *
 *  Successful creation does not change which context is current.  Before you
 *  can use the newly created context, you need to
 *  [make it current](@ref context_current).  For information about the `share`
 *  parameter, see @ref context_sharing.
 *
 *  The created window, framebuffer and context may differ from what you
 *  requested, as not all parameters and hints are
 *  [hard constraints](@ref window_hints_hard).  This includes the size of the
 *  window, especially for full screen windows.  To query the actual attributes
 *  of the created window, framebuffer and context, see @ref
 *  glfwGetWindowAttrib, @ref glfwGetWindowSize and @ref glfwGetFramebufferSize.
 *
 *  To create a full screen window, you need to specify the monitor the window
 *  will cover.  If no monitor is specified, the window will be windowed mode.
 *  Unless you have a way for the user to choose a specific monitor, it is
 *  recommended that you pick the primary monitor.  For more information on how
 *  to query connected monitors, see @ref monitor_monitors.
 *
 *  For full screen windows, the specified size becomes the resolution of the
 *  window's _desired video mode_.  As long as a full screen window is not
 *  iconified, the supported video mode most closely matching the desired video
 *  mode is set for the specified monitor.  For more information about full
 *  screen windows, including the creation of so called _windowed full screen_
 *  or _borderless full screen_ windows, see @ref window_windowed_full_screen.
 *
 *  Once you have created the window, you can switch it between windowed and
 *  full screen mode with @ref glfwSetWindowMonitor.  This will not affect its
 *  OpenGL or OpenGL ES context.
 *
 *  By default, newly created windows use the placement recommended by the
 *  window system.  To create the window at a specific position, make it
 *  initially invisible using the [GLFW_VISIBLE](@ref GLFW_VISIBLE_hint) window
 *  hint, set its [position](@ref window_pos) and then [show](@ref window_hide)
 *  it.
 *
 *  As long as at least one full screen window is not iconified, the screensaver
 *  is prohibited from starting.
 *
 *  Window systems put limits on window sizes.  Very large or very small window
 *  dimensions may be overridden by the window system on creation.  Check the
 *  actual [size](@ref window_size) after creation.
 *
 *  The [swap interval](@ref buffer_swap) is not set during window creation and
 *  the initial value may vary depending on driver settings and defaults.
 *
 *  @param[in] width The desired width, in screen coordinates, of the window.
 *  This must be greater than zero.
 *  @param[in] height The desired height, in screen coordinates, of the window.
 *  This must be greater than zero.
 *  @param[in] title The initial, UTF-8 encoded window title.
 *  @param[in] monitor The monitor to use for full screen mode, or `NULL` for
 *  windowed mode.
 *  @param[in] share The window whose context to share resources with, or `NULL`
 *  to not share resources.
 *  @return The handle of the created window, or `NULL` if an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_INVALID_ENUM, @ref GLFW_INVALID_VALUE, @ref GLFW_API_UNAVAILABLE, @ref
 *  GLFW_VERSION_UNAVAILABLE, @ref GLFW_FORMAT_UNAVAILABLE and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @remark @win32 Window creation will fail if the Microsoft GDI software
 *  OpenGL implementation is the only one available.
 *
 *  @remark @win32 If the executable has an icon resource named `GLFW_ICON,` it
 *  will be set as the initial icon for the window.  If no such icon is present,
 *  the `IDI_APPLICATION` icon will be used instead.  To set a different icon,
 *  see @ref glfwSetWindowIcon.
 *
 *  @remark @win32 The context to share resources with must not be current on
 *  any other thread.
 *
 *  @remark @macos The OS only supports forward-compatible core profile contexts
 *  for OpenGL versions 3.2 and later.  Before creating an OpenGL context of
 *  version 3.2 or later you must set the
 *  [GLFW_OPENGL_FORWARD_COMPAT](@ref GLFW_OPENGL_FORWARD_COMPAT_hint) and
 *  [GLFW_OPENGL_PROFILE](@ref GLFW_OPENGL_PROFILE_hint) hints accordingly.
 *  OpenGL 3.0 and 3.1 contexts are not supported at all on macOS.
 *
 *  @remark @macos The GLFW window has no icon, as it is not a document
 *  window, but the dock icon will be the same as the application bundle's icon.
 *  For more information on bundles, see the
 *  [Bundle Programming Guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/)
 *  in the Mac Developer Library.
 *
 *  @remark @macos The first time a window is created the menu bar is created.
 *  If GLFW finds a `MainMenu.nib` it is loaded and assumed to contain a menu
 *  bar.  Otherwise a minimal menu bar is created manually with common commands
 *  like Hide, Quit and About.  The About entry opens a minimal about dialog
 *  with information from the application's bundle.  Menu bar creation can be
 *  disabled entirely with the @ref GLFW_COCOA_MENUBAR init hint.
 *
 *  @remark @macos On OS X 10.10 and later the window frame will not be rendered
 *  at full resolution on Retina displays unless the
 *  [GLFW_COCOA_RETINA_FRAMEBUFFER](@ref GLFW_COCOA_RETINA_FRAMEBUFFER_hint)
 *  hint is `GLFW_TRUE` and the `NSHighResolutionCapable` key is enabled in the
 *  application bundle's `Info.plist`.  For more information, see
 *  [High Resolution Guidelines for OS X](https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html)
 *  in the Mac Developer Library.  The GLFW test and example programs use
 *  a custom `Info.plist` template for this, which can be found as
 *  `CMake/MacOSXBundleInfo.plist.in` in the source tree.
 *
 *  @remark @macos When activating frame autosaving with
 *  [GLFW_COCOA_FRAME_NAME](@ref GLFW_COCOA_FRAME_NAME_hint), the specified
 *  window size and position may be overridden by previously saved values.
 *
 *  @remark @x11 Some window managers will not respect the placement of
 *  initially hidden windows.
 *
 *  @remark @x11 Due to the asynchronous nature of X11, it may take a moment for
 *  a window to reach its requested state.  This means you may not be able to
 *  query the final size, position or other attributes directly after window
 *  creation.
 *
 *  @remark @x11 The class part of the `WM_CLASS` window property will by
 *  default be set to the window title passed to this function.  The instance
 *  part will use the contents of the `RESOURCE_NAME` environment variable, if
 *  present and not empty, or fall back to the window title.  Set the
 *  [GLFW_X11_CLASS_NAME](@ref GLFW_X11_CLASS_NAME_hint) and
 *  [GLFW_X11_INSTANCE_NAME](@ref GLFW_X11_INSTANCE_NAME_hint) window hints to
 *  override this.
 *
 *  @remark @wayland Compositors should implement the xdg-decoration protocol
 *  for GLFW to decorate the window properly.  If this protocol isn't
 *  supported, or if the compositor prefers client-side decorations, a very
 *  simple fallback frame will be drawn using the wp_viewporter protocol.  A
 *  compositor can still emit close, maximize or fullscreen events, using for
 *  instance a keybind mechanism.  If neither of these protocols is supported,
 *  the window won't be decorated.
 *
 *  @remark @wayland A full screen window will not attempt to change the mode,
 *  no matter what the requested size or refresh rate.
 *
 *  @remark @wayland Screensaver inhibition requires the idle-inhibit protocol
 *  to be implemented in the user's compositor.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_creation
 *  @sa @ref glfwDestroyWindow
 *
 *  @since Added in version 3.0.  Replaces `glfwOpenWindow`.
 *
 *  @ingroup window
 */

/*! @brief Destroys the specified window and its context.
 *
 *  This function destroys the specified window and its context.  On calling
 *  this function, no further callbacks will be called for that window.
 *
 *  If the context of the specified window is current on the main thread, it is
 *  detached before being destroyed.
 *
 *  @param[in] window The window to destroy.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @note The context of the specified window must not be current on any other
 *  thread when this function is called.
 *
 *  @reentrancy This function must not be called from a callback.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_creation
 *  @sa @ref glfwCreateWindow
 *
 *  @since Added in version 3.0.  Replaces `glfwCloseWindow`.
 *
 *  @ingroup window
 */

/*! @brief Checks the close flag of the specified window.
 *
 *  This function returns the value of the close flag of the specified window.
 *
 *  @param[in] window The window to query.
 *  @return The value of the close flag.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function may be called from any thread.  Access is not
 *  synchronized.
 *
 *  @sa @ref window_close
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup window
 */

/*! @brief Sets the close flag of the specified window.
 *
 *  This function sets the value of the close flag of the specified window.
 *  This can be used to override the user's attempt to close the window, or
 *  to signal that it should be closed.
 *
 *  @param[in] window The window whose flag to change.
 *  @param[in] value The new value.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function may be called from any thread.  Access is not
 *  synchronized.
 *
 *  @sa @ref window_close
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup window
 */

/*! @brief Sets the title of the specified window.
 *
 *  This function sets the window title, encoded as UTF-8, of the specified
 *  window.
 *
 *  @param[in] window The window whose title to change.
 *  @param[in] title The UTF-8 encoded window title.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @remark @macos The window title will not be updated until the next time you
 *  process events.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_title
 *
 *  @since Added in version 1.0.
 *  @glfw3 Added window handle parameter.
 *
 *  @ingroup window
 */

/*! @brief Sets the icon for the specified window.
 *
 *  This function sets the icon of the specified window.  If passed an array of
 *  candidate images, those of or closest to the sizes desired by the system are
 *  selected.  If no images are specified, the window reverts to its default
 *  icon.
 *
 *  The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight
 *  bits per channel with the red channel first.  They are arranged canonically
 *  as packed sequential rows, starting from the top-left corner.
 *
 *  The desired image sizes varies depending on platform and system settings.
 *  The selected images will be rescaled as needed.  Good sizes include 16x16,
 *  32x32 and 48x48.
 *
 *  @param[in] window The window whose icon to set.
 *  @param[in] count The number of images in the specified array, or zero to
 *  revert to the default window icon.
 *  @param[in] images The images to create the icon from.  This is ignored if
 *  count is zero.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
 *
 *  @pointer_lifetime The specified image data is copied before this function
 *  returns.
 *
 *  @remark @macos The GLFW window has no icon, as it is not a document
 *  window, so this function does nothing.  The dock icon will be the same as
 *  the application bundle's icon.  For more information on bundles, see the
 *  [Bundle Programming Guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/)
 *  in the Mac Developer Library.
 *
 *  @remark @wayland There is no existing protocol to change an icon, the
 *  window will thus inherit the one defined in the application's desktop file.
 *  This function always emits @ref GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_icon
 *
 *  @since Added in version 3.2.
 *
 *  @ingroup window
 */

/*! @brief Retrieves the position of the content area of the specified window.
 *
 *  This function retrieves the position, in screen coordinates, of the
 *  upper-left corner of the content area of the specified window.
 *
 *  Any or all of the position arguments may be `NULL`.  If an error occurs, all
 *  non-`NULL` position arguments will be set to zero.
 *
 *  @param[in] window The window to query.
 *  @param[out] xpos Where to store the x-coordinate of the upper-left corner of
 *  the content area, or `NULL`.
 *  @param[out] ypos Where to store the y-coordinate of the upper-left corner of
 *  the content area, or `NULL`.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @remark @wayland There is no way for an application to retrieve the global
 *  position of its windows, this function will always emit @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_pos
 *  @sa @ref glfwSetWindowPos
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup window
 */

/*! @brief Sets the position of the content area of the specified window.
 *
 *  This function sets the position, in screen coordinates, of the upper-left
 *  corner of the content area of the specified windowed mode window.  If the
 *  window is a full screen window, this function does nothing.
 *
 *  __Do not use this function__ to move an already visible window unless you
 *  have very good reasons for doing so, as it will confuse and annoy the user.
 *
 *  The window manager may put limits on what positions are allowed.  GLFW
 *  cannot and should not override these limits.
 *
 *  @param[in] window The window to query.
 *  @param[in] xpos The x-coordinate of the upper-left corner of the content area.
 *  @param[in] ypos The y-coordinate of the upper-left corner of the content area.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @remark @wayland There is no way for an application to set the global
 *  position of its windows, this function will always emit @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_pos
 *  @sa @ref glfwGetWindowPos
 *
 *  @since Added in version 1.0.
 *  @glfw3 Added window handle parameter.
 *
 *  @ingroup window
 */

/*! @brief Retrieves the size of the content area of the specified window.
 *
 *  This function retrieves the size, in screen coordinates, of the content area
 *  of the specified window.  If you wish to retrieve the size of the
 *  framebuffer of the window in pixels, see @ref glfwGetFramebufferSize.
 *
 *  Any or all of the size arguments may be `NULL`.  If an error occurs, all
 *  non-`NULL` size arguments will be set to zero.
 *
 *  @param[in] window The window whose size to retrieve.
 *  @param[out] width Where to store the width, in screen coordinates, of the
 *  content area, or `NULL`.
 *  @param[out] height Where to store the height, in screen coordinates, of the
 *  content area, or `NULL`.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_size
 *  @sa @ref glfwSetWindowSize
 *
 *  @since Added in version 1.0.
 *  @glfw3 Added window handle parameter.
 *
 *  @ingroup window
 */

/*! @brief Sets the size limits of the specified window.
 *
 *  This function sets the size limits of the content area of the specified
 *  window.  If the window is full screen, the size limits only take effect
 *  once it is made windowed.  If the window is not resizable, this function
 *  does nothing.
 *
 *  The size limits are applied immediately to a windowed mode window and may
 *  cause it to be resized.
 *
 *  The maximum dimensions must be greater than or equal to the minimum
 *  dimensions and all must be greater than or equal to zero.
 *
 *  @param[in] window The window to set limits for.
 *  @param[in] minwidth The minimum width, in screen coordinates, of the content
 *  area, or `GLFW_DONT_CARE`.
 *  @param[in] minheight The minimum height, in screen coordinates, of the
 *  content area, or `GLFW_DONT_CARE`.
 *  @param[in] maxwidth The maximum width, in screen coordinates, of the content
 *  area, or `GLFW_DONT_CARE`.
 *  @param[in] maxheight The maximum height, in screen coordinates, of the
 *  content area, or `GLFW_DONT_CARE`.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
 *
 *  @remark If you set size limits and an aspect ratio that conflict, the
 *  results are undefined.
 *
 *  @remark @wayland The size limits will not be applied until the window is
 *  actually resized, either by the user or by the compositor.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_sizelimits
 *  @sa @ref glfwSetWindowAspectRatio
 *
 *  @since Added in version 3.2.
 *
 *  @ingroup window
 */

/*! @brief Sets the aspect ratio of the specified window.
 *
 *  This function sets the required aspect ratio of the content area of the
 *  specified window.  If the window is full screen, the aspect ratio only takes
 *  effect once it is made windowed.  If the window is not resizable, this
 *  function does nothing.
 *
 *  The aspect ratio is specified as a numerator and a denominator and both
 *  values must be greater than zero.  For example, the common 16:9 aspect ratio
 *  is specified as 16 and 9, respectively.
 *
 *  If the numerator and denominator is set to `GLFW_DONT_CARE` then the aspect
 *  ratio limit is disabled.
 *
 *  The aspect ratio is applied immediately to a windowed mode window and may
 *  cause it to be resized.
 *
 *  @param[in] window The window to set limits for.
 *  @param[in] numer The numerator of the desired aspect ratio, or
 *  `GLFW_DONT_CARE`.
 *  @param[in] denom The denominator of the desired aspect ratio, or
 *  `GLFW_DONT_CARE`.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
 *
 *  @remark If you set size limits and an aspect ratio that conflict, the
 *  results are undefined.
 *
 *  @remark @wayland The aspect ratio will not be applied until the window is
 *  actually resized, either by the user or by the compositor.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_sizelimits
 *  @sa @ref glfwSetWindowSizeLimits
 *
 *  @since Added in version 3.2.
 *
 *  @ingroup window
 */

/*! @brief Sets the size of the content area of the specified window.
 *
 *  This function sets the size, in screen coordinates, of the content area of
 *  the specified window.
 *
 *  For full screen windows, this function updates the resolution of its desired
 *  video mode and switches to the video mode closest to it, without affecting
 *  the window's context.  As the context is unaffected, the bit depths of the
 *  framebuffer remain unchanged.
 *
 *  If you wish to update the refresh rate of the desired video mode in addition
 *  to its resolution, see @ref glfwSetWindowMonitor.
 *
 *  The window manager may put limits on what sizes are allowed.  GLFW cannot
 *  and should not override these limits.
 *
 *  @param[in] window The window to resize.
 *  @param[in] width The desired width, in screen coordinates, of the window
 *  content area.
 *  @param[in] height The desired height, in screen coordinates, of the window
 *  content area.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @remark @wayland A full screen window will not attempt to change the mode,
 *  no matter what the requested size.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_size
 *  @sa @ref glfwGetWindowSize
 *  @sa @ref glfwSetWindowMonitor
 *
 *  @since Added in version 1.0.
 *  @glfw3 Added window handle parameter.
 *
 *  @ingroup window
 */

/*! @brief Retrieves the size of the framebuffer of the specified window.
 *
 *  This function retrieves the size, in pixels, of the framebuffer of the
 *  specified window.  If you wish to retrieve the size of the window in screen
 *  coordinates, see @ref glfwGetWindowSize.
 *
 *  Any or all of the size arguments may be `NULL`.  If an error occurs, all
 *  non-`NULL` size arguments will be set to zero.
 *
 *  @param[in] window The window whose framebuffer to query.
 *  @param[out] width Where to store the width, in pixels, of the framebuffer,
 *  or `NULL`.
 *  @param[out] height Where to store the height, in pixels, of the framebuffer,
 *  or `NULL`.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_fbsize
 *  @sa @ref glfwSetFramebufferSizeCallback
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup window
 */

/*! @brief Retrieves the size of the frame of the window.
 *
 *  This function retrieves the size, in screen coordinates, of each edge of the
 *  frame of the specified window.  This size includes the title bar, if the
 *  window has one.  The size of the frame may vary depending on the
 *  [window-related hints](@ref window_hints_wnd) used to create it.
 *
 *  Because this function retrieves the size of each window frame edge and not
 *  the offset along a particular coordinate axis, the retrieved values will
 *  always be zero or positive.
 *
 *  Any or all of the size arguments may be `NULL`.  If an error occurs, all
 *  non-`NULL` size arguments will be set to zero.
 *
 *  @param[in] window The window whose frame size to query.
 *  @param[out] left Where to store the size, in screen coordinates, of the left
 *  edge of the window frame, or `NULL`.
 *  @param[out] top Where to store the size, in screen coordinates, of the top
 *  edge of the window frame, or `NULL`.
 *  @param[out] right Where to store the size, in screen coordinates, of the
 *  right edge of the window frame, or `NULL`.
 *  @param[out] bottom Where to store the size, in screen coordinates, of the
 *  bottom edge of the window frame, or `NULL`.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_size
 *
 *  @since Added in version 3.1.
 *
 *  @ingroup window
 */

/*! @brief Retrieves the content scale for the specified window.
 *
 *  This function retrieves the content scale for the specified window.  The
 *  content scale is the ratio between the current DPI and the platform's
 *  default DPI.  This is especially important for text and any UI elements.  If
 *  the pixel dimensions of your UI scaled by this look appropriate on your
 *  machine then it should appear at a reasonable size on other machines
 *  regardless of their DPI and scaling settings.  This relies on the system DPI
 *  and scaling settings being somewhat correct.
 *
 *  On systems where each monitors can have its own content scale, the window
 *  content scale will depend on which monitor the system considers the window
 *  to be on.
 *
 *  @param[in] window The window to query.
 *  @param[out] xscale Where to store the x-axis content scale, or `NULL`.
 *  @param[out] yscale Where to store the y-axis content scale, or `NULL`.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_scale
 *  @sa @ref glfwSetWindowContentScaleCallback
 *  @sa @ref glfwGetMonitorContentScale
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup window
 */

/*! @brief Returns the opacity of the whole window.
 *
 *  This function returns the opacity of the window, including any decorations.
 *
 *  The opacity (or alpha) value is a positive finite number between zero and
 *  one, where zero is fully transparent and one is fully opaque.  If the system
 *  does not support whole window transparency, this function always returns one.
 *
 *  The initial opacity value for newly created windows is one.
 *
 *  @param[in] window The window to query.
 *  @return The opacity value of the specified window.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_transparency
 *  @sa @ref glfwSetWindowOpacity
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup window
 */

/*! @brief Sets the opacity of the whole window.
 *
 *  This function sets the opacity of the window, including any decorations.
 *
 *  The opacity (or alpha) value is a positive finite number between zero and
 *  one, where zero is fully transparent and one is fully opaque.
 *
 *  The initial opacity value for newly created windows is one.
 *
 *  A window created with framebuffer transparency may not use whole window
 *  transparency.  The results of doing this are undefined.
 *
 *  @param[in] window The window to set the opacity for.
 *  @param[in] opacity The desired opacity of the specified window.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_transparency
 *  @sa @ref glfwGetWindowOpacity
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup window
 */

/*! @brief Iconifies the specified window.
 *
 *  This function iconifies (minimizes) the specified window if it was
 *  previously restored.  If the window is already iconified, this function does
 *  nothing.
 *
 *  If the specified window is a full screen window, GLFW restores the original
 *  video mode of the monitor.  The window's desired video mode is set again
 *  when the window is restored.
 *
 *  @param[in] window The window to iconify.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_iconify
 *  @sa @ref glfwRestoreWindow
 *  @sa @ref glfwMaximizeWindow
 *
 *  @since Added in version 2.1.
 *  @glfw3 Added window handle parameter.
 *
 *  @ingroup window
 */

/*! @brief Restores the specified window.
 *
 *  This function restores the specified window if it was previously iconified
 *  (minimized) or maximized.  If the window is already restored, this function
 *  does nothing.
 *
 *  If the specified window is an iconified full screen window, its desired
 *  video mode is set again for its monitor when the window is restored.
 *
 *  @param[in] window The window to restore.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_iconify
 *  @sa @ref glfwIconifyWindow
 *  @sa @ref glfwMaximizeWindow
 *
 *  @since Added in version 2.1.
 *  @glfw3 Added window handle parameter.
 *
 *  @ingroup window
 */

/*! @brief Maximizes the specified window.
 *
 *  This function maximizes the specified window if it was previously not
 *  maximized.  If the window is already maximized, this function does nothing.
 *
 *  If the specified window is a full screen window, this function does nothing.
 *
 *  @param[in] window The window to maximize.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @par Thread Safety
 *  This function may only be called from the main thread.
 *
 *  @sa @ref window_iconify
 *  @sa @ref glfwIconifyWindow
 *  @sa @ref glfwRestoreWindow
 *
 *  @since Added in GLFW 3.2.
 *
 *  @ingroup window
 */

/*! @brief Makes the specified window visible.
 *
 *  This function makes the specified window visible if it was previously
 *  hidden.  If the window is already visible or is in full screen mode, this
 *  function does nothing.
 *
 *  By default, windowed mode windows are focused when shown
 *  Set the [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) window hint
 *  to change this behavior for all newly created windows, or change the
 *  behavior for an existing window with @ref glfwSetWindowAttrib.
 *
 *  @param[in] window The window to make visible.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @remark @wayland Because Wayland wants every frame of the desktop to be
 *  complete, this function does not immediately make the window visible.
 *  Instead it will become visible the next time the window framebuffer is
 *  updated after this call.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_hide
 *  @sa @ref glfwHideWindow
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup window
 */

/*! @brief Hides the specified window.
 *
 *  This function hides the specified window if it was previously visible.  If
 *  the window is already hidden or is in full screen mode, this function does
 *  nothing.
 *
 *  @param[in] window The window to hide.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_hide
 *  @sa @ref glfwShowWindow
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup window
 */

/*! @brief Brings the specified window to front and sets input focus.
 *
 *  This function brings the specified window to front and sets input focus.
 *  The window should already be visible and not iconified.
 *
 *  By default, both windowed and full screen mode windows are focused when
 *  initially created.  Set the [GLFW_FOCUSED](@ref GLFW_FOCUSED_hint) to
 *  disable this behavior.
 *
 *  Also by default, windowed mode windows are focused when shown
 *  with @ref glfwShowWindow. Set the
 *  [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) to disable this behavior.
 *
 *  __Do not use this function__ to steal focus from other applications unless
 *  you are certain that is what the user wants.  Focus stealing can be
 *  extremely disruptive.
 *
 *  For a less disruptive way of getting the user's attention, see
 *  [attention requests](@ref window_attention).
 *
 *  @param[in] window The window to give input focus.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @remark @wayland It is not possible for an application to bring its windows
 *  to front, this function will always emit @ref GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_focus
 *  @sa @ref window_attention
 *
 *  @since Added in version 3.2.
 *
 *  @ingroup window
 */

/*! @brief Requests user attention to the specified window.
 *
 *  This function requests user attention to the specified window.  On
 *  platforms where this is not supported, attention is requested to the
 *  application as a whole.
 *
 *  Once the user has given attention, usually by focusing the window or
 *  application, the system will end the request automatically.
 *
 *  @param[in] window The window to request attention to.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @remark @macos Attention is requested to the application as a whole, not the
 *  specific window.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_attention
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup window
 */

/*! @brief Returns the monitor that the window uses for full screen mode.
 *
 *  This function returns the handle of the monitor that the specified window is
 *  in full screen on.
 *
 *  @param[in] window The window to query.
 *  @return The monitor, or `NULL` if the window is in windowed mode or an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_monitor
 *  @sa @ref glfwSetWindowMonitor
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup window
 */

/*! @brief Sets the mode, monitor, video mode and placement of a window.
 *
 *  This function sets the monitor that the window uses for full screen mode or,
 *  if the monitor is `NULL`, makes it windowed mode.
 *
 *  When setting a monitor, this function updates the width, height and refresh
 *  rate of the desired video mode and switches to the video mode closest to it.
 *  The window position is ignored when setting a monitor.
 *
 *  When the monitor is `NULL`, the position, width and height are used to
 *  place the window content area.  The refresh rate is ignored when no monitor
 *  is specified.
 *
 *  If you only wish to update the resolution of a full screen window or the
 *  size of a windowed mode window, see @ref glfwSetWindowSize.
 *
 *  When a window transitions from full screen to windowed mode, this function
 *  restores any previous window settings such as whether it is decorated,
 *  floating, resizable, has size or aspect ratio limits, etc.
 *
 *  @param[in] window The window whose monitor, size or video mode to set.
 *  @param[in] monitor The desired monitor, or `NULL` to set windowed mode.
 *  @param[in] xpos The desired x-coordinate of the upper-left corner of the
 *  content area.
 *  @param[in] ypos The desired y-coordinate of the upper-left corner of the
 *  content area.
 *  @param[in] width The desired with, in screen coordinates, of the content
 *  area or video mode.
 *  @param[in] height The desired height, in screen coordinates, of the content
 *  area or video mode.
 *  @param[in] refreshRate The desired refresh rate, in Hz, of the video mode,
 *  or `GLFW_DONT_CARE`.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @remark The OpenGL or OpenGL ES context will not be destroyed or otherwise
 *  affected by any resizing or mode switching, although you may need to update
 *  your viewport if the framebuffer size has changed.
 *
 *  @remark @wayland The desired window position is ignored, as there is no way
 *  for an application to set this property.
 *
 *  @remark @wayland Setting the window to full screen will not attempt to
 *  change the mode, no matter what the requested size or refresh rate.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_monitor
 *  @sa @ref window_full_screen
 *  @sa @ref glfwGetWindowMonitor
 *  @sa @ref glfwSetWindowSize
 *
 *  @since Added in version 3.2.
 *
 *  @ingroup window
 */

/*! @brief Returns an attribute of the specified window.
 *
 *  This function returns the value of an attribute of the specified window or
 *  its OpenGL or OpenGL ES context.
 *
 *  @param[in] window The window to query.
 *  @param[in] attrib The [window attribute](@ref window_attribs) whose value to
 *  return.
 *  @return The value of the attribute, or zero if an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
 *
 *  @remark Framebuffer related hints are not window attributes.  See @ref
 *  window_attribs_fb for more information.
 *
 *  @remark Zero is a valid value for many window and context related
 *  attributes so you cannot use a return value of zero as an indication of
 *  errors.  However, this function should not fail as long as it is passed
 *  valid arguments and the library has been [initialized](@ref intro_init).
 *
 *  @remark @wayland The Wayland protocol provides no way to check whether a
 *  window is iconfied, so @ref GLFW_ICONIFIED always returns `GLFW_FALSE`.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_attribs
 *  @sa @ref glfwSetWindowAttrib
 *
 *  @since Added in version 3.0.  Replaces `glfwGetWindowParam` and
 *  `glfwGetGLVersion`.
 *
 *  @ingroup window
 */

/*! @brief Sets an attribute of the specified window.
 *
 *  This function sets the value of an attribute of the specified window.
 *
 *  The supported attributes are [GLFW_DECORATED](@ref GLFW_DECORATED_attrib),
 *  [GLFW_RESIZABLE](@ref GLFW_RESIZABLE_attrib),
 *  [GLFW_FLOATING](@ref GLFW_FLOATING_attrib),
 *  [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib) and
 *  [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_attrib).
 *
 *  Some of these attributes are ignored for full screen windows.  The new
 *  value will take effect if the window is later made windowed.
 *
 *  Some of these attributes are ignored for windowed mode windows.  The new
 *  value will take effect if the window is later made full screen.
 *
 *  @param[in] window The window to set the attribute for.
 *  @param[in] attrib A supported window attribute.
 *  @param[in] value `GLFW_TRUE` or `GLFW_FALSE`.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_INVALID_ENUM, @ref GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
 *
 *  @remark Calling @ref glfwGetWindowAttrib will always return the latest
 *  value, even if that value is ignored by the current mode of the window.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_attribs
 *  @sa @ref glfwGetWindowAttrib
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup window
 */

/*! @brief Sets the user pointer of the specified window.
 *
 *  This function sets the user-defined pointer of the specified window.  The
 *  current value is retained until the window is destroyed.  The initial value
 *  is `NULL`.
 *
 *  @param[in] window The window whose pointer to set.
 *  @param[in] pointer The new value.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function may be called from any thread.  Access is not
 *  synchronized.
 *
 *  @sa @ref window_userptr
 *  @sa @ref glfwGetWindowUserPointer
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup window
 */

/*! @brief Returns the user pointer of the specified window.
 *
 *  This function returns the current value of the user-defined pointer of the
 *  specified window.  The initial value is `NULL`.
 *
 *  @param[in] window The window whose pointer to return.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function may be called from any thread.  Access is not
 *  synchronized.
 *
 *  @sa @ref window_userptr
 *  @sa @ref glfwSetWindowUserPointer
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup window
 */

/*! @brief Sets the position callback for the specified window.
 *
 *  This function sets the position callback of the specified window, which is
 *  called when the window is moved.  The callback is provided with the
 *  position, in screen coordinates, of the upper-left corner of the content
 *  area of the window.
 *
 *  @param[in] window The window whose callback to set.
 *  @param[in] callback The new callback, or `NULL` to remove the currently set
 *  callback.
 *  @return The previously set callback, or `NULL` if no callback was set or the
 *  library had not been [initialized](@ref intro_init).
 *
 *  @callback_signature
 *  @code
 *  void function_name(GLFWwindow* window, int xpos, int ypos)
 *  @endcode
 *  For more information about the callback parameters, see the
 *  [function pointer type](@ref GLFWwindowposfun).
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @remark @wayland This callback will never be called, as there is no way for
 *  an application to know its global position.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_pos
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup window
 */

/*! @brief Sets the size callback for the specified window.
 *
 *  This function sets the size callback of the specified window, which is
 *  called when the window is resized.  The callback is provided with the size,
 *  in screen coordinates, of the content area of the window.
 *
 *  @param[in] window The window whose callback to set.
 *  @param[in] callback The new callback, or `NULL` to remove the currently set
 *  callback.
 *  @return The previously set callback, or `NULL` if no callback was set or the
 *  library had not been [initialized](@ref intro_init).
 *
 *  @callback_signature
 *  @code
 *  void function_name(GLFWwindow* window, int width, int height)
 *  @endcode
 *  For more information about the callback parameters, see the
 *  [function pointer type](@ref GLFWwindowsizefun).
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_size
 *
 *  @since Added in version 1.0.
 *  @glfw3 Added window handle parameter and return value.
 *
 *  @ingroup window
 */

/*! @brief Sets the close callback for the specified window.
 *
 *  This function sets the close callback of the specified window, which is
 *  called when the user attempts to close the window, for example by clicking
 *  the close widget in the title bar.
 *
 *  The close flag is set before this callback is called, but you can modify it
 *  at any time with @ref glfwSetWindowShouldClose.
 *
 *  The close callback is not triggered by @ref glfwDestroyWindow.
 *
 *  @param[in] window The window whose callback to set.
 *  @param[in] callback The new callback, or `NULL` to remove the currently set
 *  callback.
 *  @return The previously set callback, or `NULL` if no callback was set or the
 *  library had not been [initialized](@ref intro_init).
 *
 *  @callback_signature
 *  @code
 *  void function_name(GLFWwindow* window)
 *  @endcode
 *  For more information about the callback parameters, see the
 *  [function pointer type](@ref GLFWwindowclosefun).
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @remark @macos Selecting Quit from the application menu will trigger the
 *  close callback for all windows.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_close
 *
 *  @since Added in version 2.5.
 *  @glfw3 Added window handle parameter and return value.
 *
 *  @ingroup window
 */

/*! @brief Sets the refresh callback for the specified window.
 *
 *  This function sets the refresh callback of the specified window, which is
 *  called when the content area of the window needs to be redrawn, for example
 *  if the window has been exposed after having been covered by another window.
 *
 *  On compositing window systems such as Aero, Compiz, Aqua or Wayland, where
 *  the window contents are saved off-screen, this callback may be called only
 *  very infrequently or never at all.
 *
 *  @param[in] window The window whose callback to set.
 *  @param[in] callback The new callback, or `NULL` to remove the currently set
 *  callback.
 *  @return The previously set callback, or `NULL` if no callback was set or the
 *  library had not been [initialized](@ref intro_init).
 *
 *  @callback_signature
 *  @code
 *  void function_name(GLFWwindow* window);
 *  @endcode
 *  For more information about the callback parameters, see the
 *  [function pointer type](@ref GLFWwindowrefreshfun).
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_refresh
 *
 *  @since Added in version 2.5.
 *  @glfw3 Added window handle parameter and return value.
 *
 *  @ingroup window
 */

/*! @brief Sets the focus callback for the specified window.
 *
 *  This function sets the focus callback of the specified window, which is
 *  called when the window gains or loses input focus.
 *
 *  After the focus callback is called for a window that lost input focus,
 *  synthetic key and mouse button release events will be generated for all such
 *  that had been pressed.  For more information, see @ref glfwSetKeyCallback
 *  and @ref glfwSetMouseButtonCallback.
 *
 *  @param[in] window The window whose callback to set.
 *  @param[in] callback The new callback, or `NULL` to remove the currently set
 *  callback.
 *  @return The previously set callback, or `NULL` if no callback was set or the
 *  library had not been [initialized](@ref intro_init).
 *
 *  @callback_signature
 *  @code
 *  void function_name(GLFWwindow* window, int focused)
 *  @endcode
 *  For more information about the callback parameters, see the
 *  [function pointer type](@ref GLFWwindowfocusfun).
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_focus
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup window
 */

/*! @brief Sets the iconify callback for the specified window.
 *
 *  This function sets the iconification callback of the specified window, which
 *  is called when the window is iconified or restored.
 *
 *  @param[in] window The window whose callback to set.
 *  @param[in] callback The new callback, or `NULL` to remove the currently set
 *  callback.
 *  @return The previously set callback, or `NULL` if no callback was set or the
 *  library had not been [initialized](@ref intro_init).
 *
 *  @callback_signature
 *  @code
 *  void function_name(GLFWwindow* window, int iconified)
 *  @endcode
 *  For more information about the callback parameters, see the
 *  [function pointer type](@ref GLFWwindowiconifyfun).
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @remark @wayland The XDG-shell protocol has no event for iconification, so
 *  this callback will never be called.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_iconify
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup window
 */

/*! @brief Sets the maximize callback for the specified window.
 *
 *  This function sets the maximization callback of the specified window, which
 *  is called when the window is maximized or restored.
 *
 *  @param[in] window The window whose callback to set.
 *  @param[in] callback The new callback, or `NULL` to remove the currently set
 *  callback.
 *  @return The previously set callback, or `NULL` if no callback was set or the
 *  library had not been [initialized](@ref intro_init).
 *
 *  @callback_signature
 *  @code
 *  void function_name(GLFWwindow* window, int maximized)
 *  @endcode
 *  For more information about the callback parameters, see the
 *  [function pointer type](@ref GLFWwindowmaximizefun).
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_maximize
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup window
 */

/*! @brief Sets the framebuffer resize callback for the specified window.
 *
 *  This function sets the framebuffer resize callback of the specified window,
 *  which is called when the framebuffer of the specified window is resized.
 *
 *  @param[in] window The window whose callback to set.
 *  @param[in] callback The new callback, or `NULL` to remove the currently set
 *  callback.
 *  @return The previously set callback, or `NULL` if no callback was set or the
 *  library had not been [initialized](@ref intro_init).
 *
 *  @callback_signature
 *  @code
 *  void function_name(GLFWwindow* window, int width, int height)
 *  @endcode
 *  For more information about the callback parameters, see the
 *  [function pointer type](@ref GLFWframebuffersizefun).
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_fbsize
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup window
 */

/*! @brief Sets the window content scale callback for the specified window.
 *
 *  This function sets the window content scale callback of the specified window,
 *  which is called when the content scale of the specified window changes.
 *
 *  @param[in] window The window whose callback to set.
 *  @param[in] callback The new callback, or `NULL` to remove the currently set
 *  callback.
 *  @return The previously set callback, or `NULL` if no callback was set or the
 *  library had not been [initialized](@ref intro_init).
 *
 *  @callback_signature
 *  @code
 *  void function_name(GLFWwindow* window, float xscale, float yscale)
 *  @endcode
 *  For more information about the callback parameters, see the
 *  [function pointer type](@ref GLFWwindowcontentscalefun).
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref window_scale
 *  @sa @ref glfwGetWindowContentScale
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup window
 */

/*! @brief Processes all pending events.
 *
 *  This function processes only those events that are already in the event
 *  queue and then returns immediately.  Processing events will cause the window
 *  and input callbacks associated with those events to be called.
 *
 *  On some platforms, a window move, resize or menu operation will cause event
 *  processing to block.  This is due to how event processing is designed on
 *  those platforms.  You can use the
 *  [window refresh callback](@ref window_refresh) to redraw the contents of
 *  your window when necessary during such operations.
 *
 *  Do not assume that callbacks you set will _only_ be called in response to
 *  event processing functions like this one.  While it is necessary to poll for
 *  events, window systems that require GLFW to register callbacks of its own
 *  can pass events to GLFW in response to many window system function calls.
 *  GLFW will pass those events on to the application callbacks before
 *  returning.
 *
 *  Event processing is not required for joystick input to work.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @reentrancy This function must not be called from a callback.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref events
 *  @sa @ref glfwWaitEvents
 *  @sa @ref glfwWaitEventsTimeout
 *
 *  @since Added in version 1.0.
 *
 *  @ingroup window
 */

/*! @brief Waits until events are queued and processes them.
 *
 *  This function puts the calling thread to sleep until at least one event is
 *  available in the event queue.  Once one or more events are available,
 *  it behaves exactly like @ref glfwPollEvents, i.e. the events in the queue
 *  are processed and the function then returns immediately.  Processing events
 *  will cause the window and input callbacks associated with those events to be
 *  called.
 *
 *  Since not all events are associated with callbacks, this function may return
 *  without a callback having been called even if you are monitoring all
 *  callbacks.
 *
 *  On some platforms, a window move, resize or menu operation will cause event
 *  processing to block.  This is due to how event processing is designed on
 *  those platforms.  You can use the
 *  [window refresh callback](@ref window_refresh) to redraw the contents of
 *  your window when necessary during such operations.
 *
 *  Do not assume that callbacks you set will _only_ be called in response to
 *  event processing functions like this one.  While it is necessary to poll for
 *  events, window systems that require GLFW to register callbacks of its own
 *  can pass events to GLFW in response to many window system function calls.
 *  GLFW will pass those events on to the application callbacks before
 *  returning.
 *
 *  Event processing is not required for joystick input to work.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @reentrancy This function must not be called from a callback.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref events
 *  @sa @ref glfwPollEvents
 *  @sa @ref glfwWaitEventsTimeout
 *
 *  @since Added in version 2.5.
 *
 *  @ingroup window
 */

/*! @brief Waits with timeout until events are queued and processes them.
 *
 *  This function puts the calling thread to sleep until at least one event is
 *  available in the event queue, or until the specified timeout is reached.  If
 *  one or more events are available, it behaves exactly like @ref
 *  glfwPollEvents, i.e. the events in the queue are processed and the function
 *  then returns immediately.  Processing events will cause the window and input
 *  callbacks associated with those events to be called.
 *
 *  The timeout value must be a positive finite number.
 *
 *  Since not all events are associated with callbacks, this function may return
 *  without a callback having been called even if you are monitoring all
 *  callbacks.
 *
 *  On some platforms, a window move, resize or menu operation will cause event
 *  processing to block.  This is due to how event processing is designed on
 *  those platforms.  You can use the
 *  [window refresh callback](@ref window_refresh) to redraw the contents of
 *  your window when necessary during such operations.
 *
 *  Do not assume that callbacks you set will _only_ be called in response to
 *  event processing functions like this one.  While it is necessary to poll for
 *  events, window systems that require GLFW to register callbacks of its own
 *  can pass events to GLFW in response to many window system function calls.
 *  GLFW will pass those events on to the application callbacks before
 *  returning.
 *
 *  Event processing is not required for joystick input to work.
 *
 *  @param[in] timeout The maximum amount of time, in seconds, to wait.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
 *
 *  @reentrancy This function must not be called from a callback.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref events
 *  @sa @ref glfwPollEvents
 *  @sa @ref glfwWaitEvents
 *
 *  @since Added in version 3.2.
 *
 *  @ingroup window
 */

/*! @brief Posts an empty event to the event queue.
 *
 *  This function posts an empty event from the current thread to the event
 *  queue, causing @ref glfwWaitEvents or @ref glfwWaitEventsTimeout to return.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function may be called from any thread.
 *
 *  @sa @ref events
 *  @sa @ref glfwWaitEvents
 *  @sa @ref glfwWaitEventsTimeout
 *
 *  @since Added in version 3.1.
 *
 *  @ingroup window
 */

/*! @brief Returns the value of an input option for the specified window.
 *
 *  This function returns the value of an input option for the specified window.
 *  The mode must be one of @ref GLFW_CURSOR, @ref GLFW_STICKY_KEYS,
 *  @ref GLFW_STICKY_MOUSE_BUTTONS, @ref GLFW_LOCK_KEY_MODS or
 *  @ref GLFW_RAW_MOUSE_MOTION.
 *
 *  @param[in] window The window to query.
 *  @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS`,
 *  `GLFW_STICKY_MOUSE_BUTTONS`, `GLFW_LOCK_KEY_MODS` or
 *  `GLFW_RAW_MOUSE_MOTION`.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_INVALID_ENUM.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref glfwSetInputMode
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup input
 */

/*! @brief Sets an input option for the specified window.
 *
 *  This function sets an input mode option for the specified window.  The mode
 *  must be one of @ref GLFW_CURSOR, @ref GLFW_STICKY_KEYS,
 *  @ref GLFW_STICKY_MOUSE_BUTTONS, @ref GLFW_LOCK_KEY_MODS or
 *  @ref GLFW_RAW_MOUSE_MOTION.
 *
 *  If the mode is `GLFW_CURSOR`, the value must be one of the following cursor
 *  modes:
 *  - `GLFW_CURSOR_NORMAL` makes the cursor visible and behaving normally.
 *  - `GLFW_CURSOR_HIDDEN` makes the cursor invisible when it is over the
 *    content area of the window but does not restrict the cursor from leaving.
 *  - `GLFW_CURSOR_DISABLED` hides and grabs the cursor, providing virtual
 *    and unlimited cursor movement.  This is useful for implementing for
 *    example 3D camera controls.
 *
 *  If the mode is `GLFW_STICKY_KEYS`, the value must be either `GLFW_TRUE` to
 *  enable sticky keys, or `GLFW_FALSE` to disable it.  If sticky keys are
 *  enabled, a key press will ensure that @ref glfwGetKey returns `GLFW_PRESS`
 *  the next time it is called even if the key had been released before the
 *  call.  This is useful when you are only interested in whether keys have been
 *  pressed but not when or in which order.
 *
 *  If the mode is `GLFW_STICKY_MOUSE_BUTTONS`, the value must be either
 *  `GLFW_TRUE` to enable sticky mouse buttons, or `GLFW_FALSE` to disable it.
 *  If sticky mouse buttons are enabled, a mouse button press will ensure that
 *  @ref glfwGetMouseButton returns `GLFW_PRESS` the next time it is called even
 *  if the mouse button had been released before the call.  This is useful when
 *  you are only interested in whether mouse buttons have been pressed but not
 *  when or in which order.
 *
 *  If the mode is `GLFW_LOCK_KEY_MODS`, the value must be either `GLFW_TRUE` to
 *  enable lock key modifier bits, or `GLFW_FALSE` to disable them.  If enabled,
 *  callbacks that receive modifier bits will also have the @ref
 *  GLFW_MOD_CAPS_LOCK bit set when the event was generated with Caps Lock on,
 *  and the @ref GLFW_MOD_NUM_LOCK bit when Num Lock was on.
 *
 *  If the mode is `GLFW_RAW_MOUSE_MOTION`, the value must be either `GLFW_TRUE`
 *  to enable raw (unscaled and unaccelerated) mouse motion when the cursor is
 *  disabled, or `GLFW_FALSE` to disable it.  If raw motion is not supported,
 *  attempting to set this will emit @ref GLFW_PLATFORM_ERROR.  Call @ref
 *  glfwRawMouseMotionSupported to check for support.
 *
 *  @param[in] window The window whose input mode to set.
 *  @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS`,
 *  `GLFW_STICKY_MOUSE_BUTTONS`, `GLFW_LOCK_KEY_MODS` or
 *  `GLFW_RAW_MOUSE_MOTION`.
 *  @param[in] value The new value of the specified input mode.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref glfwGetInputMode
 *
 *  @since Added in version 3.0.  Replaces `glfwEnable` and `glfwDisable`.
 *
 *  @ingroup input
 */

/*! @brief Returns whether raw mouse motion is supported.
 *
 *  This function returns whether raw mouse motion is supported on the current
 *  system.  This status does not change after GLFW has been initialized so you
 *  only need to check this once.  If you attempt to enable raw motion on
 *  a system that does not support it, @ref GLFW_PLATFORM_ERROR will be emitted.
 *
 *  Raw mouse motion is closer to the actual motion of the mouse across
 *  a surface.  It is not affected by the scaling and acceleration applied to
 *  the motion of the desktop cursor.  That processing is suitable for a cursor
 *  while raw motion is better for controlling for example a 3D camera.  Because
 *  of this, raw mouse motion is only provided when the cursor is disabled.
 *
 *  @return `GLFW_TRUE` if raw mouse motion is supported on the current machine,
 *  or `GLFW_FALSE` otherwise.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref raw_mouse_motion
 *  @sa @ref glfwSetInputMode
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup input
 */

/*! @brief Returns the layout-specific name of the specified printable key.
 *
 *  This function returns the name of the specified printable key, encoded as
 *  UTF-8.  This is typically the character that key would produce without any
 *  modifier keys, intended for displaying key bindings to the user.  For dead
 *  keys, it is typically the diacritic it would add to a character.
 *
 *  __Do not use this function__ for [text input](@ref input_char).  You will
 *  break text input for many languages even if it happens to work for yours.
 *
 *  If the key is `GLFW_KEY_UNKNOWN`, the scancode is used to identify the key,
 *  otherwise the scancode is ignored.  If you specify a non-printable key, or
 *  `GLFW_KEY_UNKNOWN` and a scancode that maps to a non-printable key, this
 *  function returns `NULL` but does not emit an error.
 *
 *  This behavior allows you to always pass in the arguments in the
 *  [key callback](@ref input_key) without modification.
 *
 *  The printable keys are:
 *  - `GLFW_KEY_APOSTROPHE`
 *  - `GLFW_KEY_COMMA`
 *  - `GLFW_KEY_MINUS`
 *  - `GLFW_KEY_PERIOD`
 *  - `GLFW_KEY_SLASH`
 *  - `GLFW_KEY_SEMICOLON`
 *  - `GLFW_KEY_EQUAL`
 *  - `GLFW_KEY_LEFT_BRACKET`
 *  - `GLFW_KEY_RIGHT_BRACKET`
 *  - `GLFW_KEY_BACKSLASH`
 *  - `GLFW_KEY_WORLD_1`
 *  - `GLFW_KEY_WORLD_2`
 *  - `GLFW_KEY_0` to `GLFW_KEY_9`
 *  - `GLFW_KEY_A` to `GLFW_KEY_Z`
 *  - `GLFW_KEY_KP_0` to `GLFW_KEY_KP_9`
 *  - `GLFW_KEY_KP_DECIMAL`
 *  - `GLFW_KEY_KP_DIVIDE`
 *  - `GLFW_KEY_KP_MULTIPLY`
 *  - `GLFW_KEY_KP_SUBTRACT`
 *  - `GLFW_KEY_KP_ADD`
 *  - `GLFW_KEY_KP_EQUAL`
 *
 *  Names for printable keys depend on keyboard layout, while names for
 *  non-printable keys are the same across layouts but depend on the application
 *  language and should be localized along with other user interface text.
 *
 *  @param[in] key The key to query, or `GLFW_KEY_UNKNOWN`.
 *  @param[in] scancode The scancode of the key to query.
 *  @return The UTF-8 encoded, layout-specific name of the key, or `NULL`.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @remark The contents of the returned string may change when a keyboard
 *  layout change event is received.
 *
 *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
 *  should not free it yourself.  It is valid until the library is terminated.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref input_key_name
 *
 *  @since Added in version 3.2.
 *
 *  @ingroup input
 */

/*! @brief Returns the platform-specific scancode of the specified key.
 *
 *  This function returns the platform-specific scancode of the specified key.
 *
 *  If the key is `GLFW_KEY_UNKNOWN` or does not exist on the keyboard this
 *  method will return `-1`.
 *
 *  @param[in] key Any [named key](@ref keys).
 *  @return The platform-specific scancode for the key, or `-1` if an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function may be called from any thread.
 *
 *  @sa @ref input_key
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup input
 */

/*! @brief Returns the last reported state of a keyboard key for the specified
 *  window.
 *
 *  This function returns the last state reported for the specified key to the
 *  specified window.  The returned state is one of `GLFW_PRESS` or
 *  `GLFW_RELEASE`.  The action `GLFW_REPEAT` is only reported to the key callback.
 *
 *  If the @ref GLFW_STICKY_KEYS input mode is enabled, this function returns
 *  `GLFW_PRESS` the first time you call it for a key that was pressed, even if
 *  that key has already been released.
 *
 *  The key functions deal with physical keys, with [key tokens](@ref keys)
 *  named after their use on the standard US keyboard layout.  If you want to
 *  input text, use the Unicode character callback instead.
 *
 *  The [modifier key bit masks](@ref mods) are not key tokens and cannot be
 *  used with this function.
 *
 *  __Do not use this function__ to implement [text input](@ref input_char).
 *
 *  @param[in] window The desired window.
 *  @param[in] key The desired [keyboard key](@ref keys).  `GLFW_KEY_UNKNOWN` is
 *  not a valid key for this function.
 *  @return One of `GLFW_PRESS` or `GLFW_RELEASE`.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_INVALID_ENUM.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref input_key
 *
 *  @since Added in version 1.0.
 *  @glfw3 Added window handle parameter.
 *
 *  @ingroup input
 */

/*! @brief Returns the last reported state of a mouse button for the specified
 *  window.
 *
 *  This function returns the last state reported for the specified mouse button
 *  to the specified window.  The returned state is one of `GLFW_PRESS` or
 *  `GLFW_RELEASE`.
 *
 *  If the @ref GLFW_STICKY_MOUSE_BUTTONS input mode is enabled, this function
 *  returns `GLFW_PRESS` the first time you call it for a mouse button that was
 *  pressed, even if that mouse button has already been released.
 *
 *  @param[in] window The desired window.
 *  @param[in] button The desired [mouse button](@ref buttons).
 *  @return One of `GLFW_PRESS` or `GLFW_RELEASE`.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_INVALID_ENUM.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref input_mouse_button
 *
 *  @since Added in version 1.0.
 *  @glfw3 Added window handle parameter.
 *
 *  @ingroup input
 */

/*! @brief Retrieves the position of the cursor relative to the content area of
 *  the window.
 *
 *  This function returns the position of the cursor, in screen coordinates,
 *  relative to the upper-left corner of the content area of the specified
 *  window.
 *
 *  If the cursor is disabled (with `GLFW_CURSOR_DISABLED`) then the cursor
 *  position is unbounded and limited only by the minimum and maximum values of
 *  a `double`.
 *
 *  The coordinate can be converted to their integer equivalents with the
 *  `floor` function.  Casting directly to an integer type works for positive
 *  coordinates, but fails for negative ones.
 *
 *  Any or all of the position arguments may be `NULL`.  If an error occurs, all
 *  non-`NULL` position arguments will be set to zero.
 *
 *  @param[in] window The desired window.
 *  @param[out] xpos Where to store the cursor x-coordinate, relative to the
 *  left edge of the content area, or `NULL`.
 *  @param[out] ypos Where to store the cursor y-coordinate, relative to the to
 *  top edge of the content area, or `NULL`.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref cursor_pos
 *  @sa @ref glfwSetCursorPos
 *
 *  @since Added in version 3.0.  Replaces `glfwGetMousePos`.
 *
 *  @ingroup input
 */

/*! @brief Sets the position of the cursor, relative to the content area of the
 *  window.
 *
 *  This function sets the position, in screen coordinates, of the cursor
 *  relative to the upper-left corner of the content area of the specified
 *  window.  The window must have input focus.  If the window does not have
 *  input focus when this function is called, it fails silently.
 *
 *  __Do not use this function__ to implement things like camera controls.  GLFW
 *  already provides the `GLFW_CURSOR_DISABLED` cursor mode that hides the
 *  cursor, transparently re-centers it and provides unconstrained cursor
 *  motion.  See @ref glfwSetInputMode for more information.
 *
 *  If the cursor mode is `GLFW_CURSOR_DISABLED` then the cursor position is
 *  unconstrained and limited only by the minimum and maximum values of
 *  a `double`.
 *
 *  @param[in] window The desired window.
 *  @param[in] xpos The desired x-coordinate, relative to the left edge of the
 *  content area.
 *  @param[in] ypos The desired y-coordinate, relative to the top edge of the
 *  content area.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @remark @wayland This function will only work when the cursor mode is
 *  `GLFW_CURSOR_DISABLED`, otherwise it will do nothing.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref cursor_pos
 *  @sa @ref glfwGetCursorPos
 *
 *  @since Added in version 3.0.  Replaces `glfwSetMousePos`.
 *
 *  @ingroup input
 */

/*! @brief Creates a custom cursor.
 *
 *  Creates a new custom cursor image that can be set for a window with @ref
 *  glfwSetCursor.  The cursor can be destroyed with @ref glfwDestroyCursor.
 *  Any remaining cursors are destroyed by @ref glfwTerminate.
 *
 *  The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight
 *  bits per channel with the red channel first.  They are arranged canonically
 *  as packed sequential rows, starting from the top-left corner.
 *
 *  The cursor hotspot is specified in pixels, relative to the upper-left corner
 *  of the cursor image.  Like all other coordinate systems in GLFW, the X-axis
 *  points to the right and the Y-axis points down.
 *
 *  @param[in] image The desired cursor image.
 *  @param[in] xhot The desired x-coordinate, in pixels, of the cursor hotspot.
 *  @param[in] yhot The desired y-coordinate, in pixels, of the cursor hotspot.
 *  @return The handle of the created cursor, or `NULL` if an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
 *
 *  @pointer_lifetime The specified image data is copied before this function
 *  returns.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref cursor_object
 *  @sa @ref glfwDestroyCursor
 *  @sa @ref glfwCreateStandardCursor
 *
 *  @since Added in version 3.1.
 *
 *  @ingroup input
 */

/*! @brief Creates a cursor with a standard shape.
 *
 *  Returns a cursor with a [standard shape](@ref shapes), that can be set for
 *  a window with @ref glfwSetCursor.
 *
 *  @param[in] shape One of the [standard shapes](@ref shapes).
 *  @return A new cursor ready to use or `NULL` if an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref cursor_object
 *  @sa @ref glfwCreateCursor
 *
 *  @since Added in version 3.1.
 *
 *  @ingroup input
 */

/*! @brief Destroys a cursor.
 *
 *  This function destroys a cursor previously created with @ref
 *  glfwCreateCursor.  Any remaining cursors will be destroyed by @ref
 *  glfwTerminate.
 *
 *  If the specified cursor is current for any window, that window will be
 *  reverted to the default cursor.  This does not affect the cursor mode.
 *
 *  @param[in] cursor The cursor object to destroy.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @reentrancy This function must not be called from a callback.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref cursor_object
 *  @sa @ref glfwCreateCursor
 *
 *  @since Added in version 3.1.
 *
 *  @ingroup input
 */

/*! @brief Sets the cursor for the window.
 *
 *  This function sets the cursor image to be used when the cursor is over the
 *  content area of the specified window.  The set cursor will only be visible
 *  when the [cursor mode](@ref cursor_mode) of the window is
 *  `GLFW_CURSOR_NORMAL`.
 *
 *  On some platforms, the set cursor may not be visible unless the window also
 *  has input focus.
 *
 *  @param[in] window The window to set the cursor for.
 *  @param[in] cursor The cursor to set, or `NULL` to switch back to the default
 *  arrow cursor.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref cursor_object
 *
 *  @since Added in version 3.1.
 *
 *  @ingroup input
 */

/*! @brief Sets the key callback.
 *
 *  This function sets the key callback of the specified window, which is called
 *  when a key is pressed, repeated or released.
 *
 *  The key functions deal with physical keys, with layout independent
 *  [key tokens](@ref keys) named after their values in the standard US keyboard
 *  layout.  If you want to input text, use the
 *  [character callback](@ref glfwSetCharCallback) instead.
 *
 *  When a window loses input focus, it will generate synthetic key release
 *  events for all pressed keys.  You can tell these events from user-generated
 *  events by the fact that the synthetic ones are generated after the focus
 *  loss event has been processed, i.e. after the
 *  [window focus callback](@ref glfwSetWindowFocusCallback) has been called.
 *
 *  The scancode of a key is specific to that platform or sometimes even to that
 *  machine.  Scancodes are intended to allow users to bind keys that don't have
 *  a GLFW key token.  Such keys have `key` set to `GLFW_KEY_UNKNOWN`, their
 *  state is not saved and so it cannot be queried with @ref glfwGetKey.
 *
 *  Sometimes GLFW needs to generate synthetic key events, in which case the
 *  scancode may be zero.
 *
 *  @param[in] window The window whose callback to set.
 *  @param[in] callback The new key callback, or `NULL` to remove the currently
 *  set callback.
 *  @return The previously set callback, or `NULL` if no callback was set or the
 *  library had not been [initialized](@ref intro_init).
 *
 *  @callback_signature
 *  @code
 *  void function_name(GLFWwindow* window, int key, int scancode, int action, int mods)
 *  @endcode
 *  For more information about the callback parameters, see the
 *  [function pointer type](@ref GLFWkeyfun).
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref input_key
 *
 *  @since Added in version 1.0.
 *  @glfw3 Added window handle parameter and return value.
 *
 *  @ingroup input
 */

/*! @brief Sets the Unicode character callback.
 *
 *  This function sets the character callback of the specified window, which is
 *  called when a Unicode character is input.
 *
 *  The character callback is intended for Unicode text input.  As it deals with
 *  characters, it is keyboard layout dependent, whereas the
 *  [key callback](@ref glfwSetKeyCallback) is not.  Characters do not map 1:1
 *  to physical keys, as a key may produce zero, one or more characters.  If you
 *  want to know whether a specific physical key was pressed or released, see
 *  the key callback instead.
 *
 *  The character callback behaves as system text input normally does and will
 *  not be called if modifier keys are held down that would prevent normal text
 *  input on that platform, for example a Super (Command) key on macOS or Alt key
 *  on Windows.
 *
 *  @param[in] window The window whose callback to set.
 *  @param[in] callback The new callback, or `NULL` to remove the currently set
 *  callback.
 *  @return The previously set callback, or `NULL` if no callback was set or the
 *  library had not been [initialized](@ref intro_init).
 *
 *  @callback_signature
 *  @code
 *  void function_name(GLFWwindow* window, unsigned int codepoint)
 *  @endcode
 *  For more information about the callback parameters, see the
 *  [function pointer type](@ref GLFWcharfun).
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref input_char
 *
 *  @since Added in version 2.4.
 *  @glfw3 Added window handle parameter and return value.
 *
 *  @ingroup input
 */

/*! @brief Sets the Unicode character with modifiers callback.
 *
 *  This function sets the character with modifiers callback of the specified
 *  window, which is called when a Unicode character is input regardless of what
 *  modifier keys are used.
 *
 *  The character with modifiers callback is intended for implementing custom
 *  Unicode character input.  For regular Unicode text input, see the
 *  [character callback](@ref glfwSetCharCallback).  Like the character
 *  callback, the character with modifiers callback deals with characters and is
 *  keyboard layout dependent.  Characters do not map 1:1 to physical keys, as
 *  a key may produce zero, one or more characters.  If you want to know whether
 *  a specific physical key was pressed or released, see the
 *  [key callback](@ref glfwSetKeyCallback) instead.
 *
 *  @param[in] window The window whose callback to set.
 *  @param[in] callback The new callback, or `NULL` to remove the currently set
 *  callback.
 *  @return The previously set callback, or `NULL` if no callback was set or an
 *  [error](@ref error_handling) occurred.
 *
 *  @callback_signature
 *  @code
 *  void function_name(GLFWwindow* window, unsigned int codepoint, int mods)
 *  @endcode
 *  For more information about the callback parameters, see the
 *  [function pointer type](@ref GLFWcharmodsfun).
 *
 *  @deprecated Scheduled for removal in version 4.0.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref input_char
 *
 *  @since Added in version 3.1.
 *
 *  @ingroup input
 */

/*! @brief Sets the mouse button callback.
 *
 *  This function sets the mouse button callback of the specified window, which
 *  is called when a mouse button is pressed or released.
 *
 *  When a window loses input focus, it will generate synthetic mouse button
 *  release events for all pressed mouse buttons.  You can tell these events
 *  from user-generated events by the fact that the synthetic ones are generated
 *  after the focus loss event has been processed, i.e. after the
 *  [window focus callback](@ref glfwSetWindowFocusCallback) has been called.
 *
 *  @param[in] window The window whose callback to set.
 *  @param[in] callback The new callback, or `NULL` to remove the currently set
 *  callback.
 *  @return The previously set callback, or `NULL` if no callback was set or the
 *  library had not been [initialized](@ref intro_init).
 *
 *  @callback_signature
 *  @code
 *  void function_name(GLFWwindow* window, int button, int action, int mods)
 *  @endcode
 *  For more information about the callback parameters, see the
 *  [function pointer type](@ref GLFWmousebuttonfun).
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref input_mouse_button
 *
 *  @since Added in version 1.0.
 *  @glfw3 Added window handle parameter and return value.
 *
 *  @ingroup input
 */

/*! @brief Sets the cursor position callback.
 *
 *  This function sets the cursor position callback of the specified window,
 *  which is called when the cursor is moved.  The callback is provided with the
 *  position, in screen coordinates, relative to the upper-left corner of the
 *  content area of the window.
 *
 *  @param[in] window The window whose callback to set.
 *  @param[in] callback The new callback, or `NULL` to remove the currently set
 *  callback.
 *  @return The previously set callback, or `NULL` if no callback was set or the
 *  library had not been [initialized](@ref intro_init).
 *
 *  @callback_signature
 *  @code
 *  void function_name(GLFWwindow* window, double xpos, double ypos);
 *  @endcode
 *  For more information about the callback parameters, see the
 *  [function pointer type](@ref GLFWcursorposfun).
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref cursor_pos
 *
 *  @since Added in version 3.0.  Replaces `glfwSetMousePosCallback`.
 *
 *  @ingroup input
 */

/*! @brief Sets the cursor enter/leave callback.
 *
 *  This function sets the cursor boundary crossing callback of the specified
 *  window, which is called when the cursor enters or leaves the content area of
 *  the window.
 *
 *  @param[in] window The window whose callback to set.
 *  @param[in] callback The new callback, or `NULL` to remove the currently set
 *  callback.
 *  @return The previously set callback, or `NULL` if no callback was set or the
 *  library had not been [initialized](@ref intro_init).
 *
 *  @callback_signature
 *  @code
 *  void function_name(GLFWwindow* window, int entered)
 *  @endcode
 *  For more information about the callback parameters, see the
 *  [function pointer type](@ref GLFWcursorenterfun).
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref cursor_enter
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup input
 */

/*! @brief Sets the scroll callback.
 *
 *  This function sets the scroll callback of the specified window, which is
 *  called when a scrolling device is used, such as a mouse wheel or scrolling
 *  area of a touchpad.
 *
 *  The scroll callback receives all scrolling input, like that from a mouse
 *  wheel or a touchpad scrolling area.
 *
 *  @param[in] window The window whose callback to set.
 *  @param[in] callback The new scroll callback, or `NULL` to remove the
 *  currently set callback.
 *  @return The previously set callback, or `NULL` if no callback was set or the
 *  library had not been [initialized](@ref intro_init).
 *
 *  @callback_signature
 *  @code
 *  void function_name(GLFWwindow* window, double xoffset, double yoffset)
 *  @endcode
 *  For more information about the callback parameters, see the
 *  [function pointer type](@ref GLFWscrollfun).
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref scrolling
 *
 *  @since Added in version 3.0.  Replaces `glfwSetMouseWheelCallback`.
 *
 *  @ingroup input
 */

/*! @brief Sets the path drop callback.
 *
 *  This function sets the path drop callback of the specified window, which is
 *  called when one or more dragged paths are dropped on the window.
 *
 *  Because the path array and its strings may have been generated specifically
 *  for that event, they are not guaranteed to be valid after the callback has
 *  returned.  If you wish to use them after the callback returns, you need to
 *  make a deep copy.
 *
 *  @param[in] window The window whose callback to set.
 *  @param[in] callback The new file drop callback, or `NULL` to remove the
 *  currently set callback.
 *  @return The previously set callback, or `NULL` if no callback was set or the
 *  library had not been [initialized](@ref intro_init).
 *
 *  @callback_signature
 *  @code
 *  void function_name(GLFWwindow* window, int path_count, const char* paths[])
 *  @endcode
 *  For more information about the callback parameters, see the
 *  [function pointer type](@ref GLFWdropfun).
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @remark @wayland File drop is currently unimplemented.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref path_drop
 *
 *  @since Added in version 3.1.
 *
 *  @ingroup input
 */

/*! @brief Returns whether the specified joystick is present.
 *
 *  This function returns whether the specified joystick is present.
 *
 *  There is no need to call this function before other functions that accept
 *  a joystick ID, as they all check for presence before performing any other
 *  work.
 *
 *  @param[in] jid The [joystick](@ref joysticks) to query.
 *  @return `GLFW_TRUE` if the joystick is present, or `GLFW_FALSE` otherwise.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref joystick
 *
 *  @since Added in version 3.0.  Replaces `glfwGetJoystickParam`.
 *
 *  @ingroup input
 */

/*! @brief Returns the values of all axes of the specified joystick.
 *
 *  This function returns the values of all axes of the specified joystick.
 *  Each element in the array is a value between -1.0 and 1.0.
 *
 *  If the specified joystick is not present this function will return `NULL`
 *  but will not generate an error.  This can be used instead of first calling
 *  @ref glfwJoystickPresent.
 *
 *  @param[in] jid The [joystick](@ref joysticks) to query.
 *  @param[out] count Where to store the number of axis values in the returned
 *  array.  This is set to zero if the joystick is not present or an error
 *  occurred.
 *  @return An array of axis values, or `NULL` if the joystick is not present or
 *  an [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
 *
 *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
 *  should not free it yourself.  It is valid until the specified joystick is
 *  disconnected or the library is terminated.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref joystick_axis
 *
 *  @since Added in version 3.0.  Replaces `glfwGetJoystickPos`.
 *
 *  @ingroup input
 */

/*! @brief Returns the state of all buttons of the specified joystick.
 *
 *  This function returns the state of all buttons of the specified joystick.
 *  Each element in the array is either `GLFW_PRESS` or `GLFW_RELEASE`.
 *
 *  For backward compatibility with earlier versions that did not have @ref
 *  glfwGetJoystickHats, the button array also includes all hats, each
 *  represented as four buttons.  The hats are in the same order as returned by
 *  __glfwGetJoystickHats__ and are in the order _up_, _right_, _down_ and
 *  _left_.  To disable these extra buttons, set the @ref
 *  GLFW_JOYSTICK_HAT_BUTTONS init hint before initialization.
 *
 *  If the specified joystick is not present this function will return `NULL`
 *  but will not generate an error.  This can be used instead of first calling
 *  @ref glfwJoystickPresent.
 *
 *  @param[in] jid The [joystick](@ref joysticks) to query.
 *  @param[out] count Where to store the number of button states in the returned
 *  array.  This is set to zero if the joystick is not present or an error
 *  occurred.
 *  @return An array of button states, or `NULL` if the joystick is not present
 *  or an [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
 *
 *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
 *  should not free it yourself.  It is valid until the specified joystick is
 *  disconnected or the library is terminated.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref joystick_button
 *
 *  @since Added in version 2.2.
 *  @glfw3 Changed to return a dynamic array.
 *
 *  @ingroup input
 */

/*! @brief Returns the state of all hats of the specified joystick.
 *
 *  This function returns the state of all hats of the specified joystick.
 *  Each element in the array is one of the following values:
 *
 *  Name                  | Value
 *  ----                  | -----
 *  `GLFW_HAT_CENTERED`   | 0
 *  `GLFW_HAT_UP`         | 1
 *  `GLFW_HAT_RIGHT`      | 2
 *  `GLFW_HAT_DOWN`       | 4
 *  `GLFW_HAT_LEFT`       | 8
 *  `GLFW_HAT_RIGHT_UP`   | `GLFW_HAT_RIGHT` \| `GLFW_HAT_UP`
 *  `GLFW_HAT_RIGHT_DOWN` | `GLFW_HAT_RIGHT` \| `GLFW_HAT_DOWN`
 *  `GLFW_HAT_LEFT_UP`    | `GLFW_HAT_LEFT` \| `GLFW_HAT_UP`
 *  `GLFW_HAT_LEFT_DOWN`  | `GLFW_HAT_LEFT` \| `GLFW_HAT_DOWN`
 *
 *  The diagonal directions are bitwise combinations of the primary (up, right,
 *  down and left) directions and you can test for these individually by ANDing
 *  it with the corresponding direction.
 *
 *  @code
 *  if (hats[2] & GLFW_HAT_RIGHT)
 *  {
 *      // State of hat 2 could be right-up, right or right-down
 *  }
 *  @endcode
 *
 *  If the specified joystick is not present this function will return `NULL`
 *  but will not generate an error.  This can be used instead of first calling
 *  @ref glfwJoystickPresent.
 *
 *  @param[in] jid The [joystick](@ref joysticks) to query.
 *  @param[out] count Where to store the number of hat states in the returned
 *  array.  This is set to zero if the joystick is not present or an error
 *  occurred.
 *  @return An array of hat states, or `NULL` if the joystick is not present
 *  or an [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
 *
 *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
 *  should not free it yourself.  It is valid until the specified joystick is
 *  disconnected, this function is called again for that joystick or the library
 *  is terminated.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref joystick_hat
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup input
 */

/*! @brief Returns the name of the specified joystick.
 *
 *  This function returns the name, encoded as UTF-8, of the specified joystick.
 *  The returned string is allocated and freed by GLFW.  You should not free it
 *  yourself.
 *
 *  If the specified joystick is not present this function will return `NULL`
 *  but will not generate an error.  This can be used instead of first calling
 *  @ref glfwJoystickPresent.
 *
 *  @param[in] jid The [joystick](@ref joysticks) to query.
 *  @return The UTF-8 encoded name of the joystick, or `NULL` if the joystick
 *  is not present or an [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
 *
 *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
 *  should not free it yourself.  It is valid until the specified joystick is
 *  disconnected or the library is terminated.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref joystick_name
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup input
 */

/*! @brief Returns the SDL compatible GUID of the specified joystick.
 *
 *  This function returns the SDL compatible GUID, as a UTF-8 encoded
 *  hexadecimal string, of the specified joystick.  The returned string is
 *  allocated and freed by GLFW.  You should not free it yourself.
 *
 *  The GUID is what connects a joystick to a gamepad mapping.  A connected
 *  joystick will always have a GUID even if there is no gamepad mapping
 *  assigned to it.
 *
 *  If the specified joystick is not present this function will return `NULL`
 *  but will not generate an error.  This can be used instead of first calling
 *  @ref glfwJoystickPresent.
 *
 *  The GUID uses the format introduced in SDL 2.0.5.  This GUID tries to
 *  uniquely identify the make and model of a joystick but does not identify
 *  a specific unit, e.g. all wired Xbox 360 controllers will have the same
 *  GUID on that platform.  The GUID for a unit may vary between platforms
 *  depending on what hardware information the platform specific APIs provide.
 *
 *  @param[in] jid The [joystick](@ref joysticks) to query.
 *  @return The UTF-8 encoded GUID of the joystick, or `NULL` if the joystick
 *  is not present or an [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
 *
 *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
 *  should not free it yourself.  It is valid until the specified joystick is
 *  disconnected or the library is terminated.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref gamepad
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup input
 */

/*! @brief Sets the user pointer of the specified joystick.
 *
 *  This function sets the user-defined pointer of the specified joystick.  The
 *  current value is retained until the joystick is disconnected.  The initial
 *  value is `NULL`.
 *
 *  This function may be called from the joystick callback, even for a joystick
 *  that is being disconnected.
 *
 *  @param[in] jid The joystick whose pointer to set.
 *  @param[in] pointer The new value.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function may be called from any thread.  Access is not
 *  synchronized.
 *
 *  @sa @ref joystick_userptr
 *  @sa @ref glfwGetJoystickUserPointer
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup input
 */

/*! @brief Returns the user pointer of the specified joystick.
 *
 *  This function returns the current value of the user-defined pointer of the
 *  specified joystick.  The initial value is `NULL`.
 *
 *  This function may be called from the joystick callback, even for a joystick
 *  that is being disconnected.
 *
 *  @param[in] jid The joystick whose pointer to return.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function may be called from any thread.  Access is not
 *  synchronized.
 *
 *  @sa @ref joystick_userptr
 *  @sa @ref glfwSetJoystickUserPointer
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup input
 */

/*! @brief Returns whether the specified joystick has a gamepad mapping.
 *
 *  This function returns whether the specified joystick is both present and has
 *  a gamepad mapping.
 *
 *  If the specified joystick is present but does not have a gamepad mapping
 *  this function will return `GLFW_FALSE` but will not generate an error.  Call
 *  @ref glfwJoystickPresent to check if a joystick is present regardless of
 *  whether it has a mapping.
 *
 *  @param[in] jid The [joystick](@ref joysticks) to query.
 *  @return `GLFW_TRUE` if a joystick is both present and has a gamepad mapping,
 *  or `GLFW_FALSE` otherwise.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_INVALID_ENUM.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref gamepad
 *  @sa @ref glfwGetGamepadState
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup input
 */

/*! @brief Sets the joystick configuration callback.
 *
 *  This function sets the joystick configuration callback, or removes the
 *  currently set callback.  This is called when a joystick is connected to or
 *  disconnected from the system.
 *
 *  For joystick connection and disconnection events to be delivered on all
 *  platforms, you need to call one of the [event processing](@ref events)
 *  functions.  Joystick disconnection may also be detected and the callback
 *  called by joystick functions.  The function will then return whatever it
 *  returns if the joystick is not present.
 *
 *  @param[in] callback The new callback, or `NULL` to remove the currently set
 *  callback.
 *  @return The previously set callback, or `NULL` if no callback was set or the
 *  library had not been [initialized](@ref intro_init).
 *
 *  @callback_signature
 *  @code
 *  void function_name(int jid, int event)
 *  @endcode
 *  For more information about the callback parameters, see the
 *  [function pointer type](@ref GLFWjoystickfun).
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref joystick_event
 *
 *  @since Added in version 3.2.
 *
 *  @ingroup input
 */

/*! @brief Adds the specified SDL_GameControllerDB gamepad mappings.
 *
 *  This function parses the specified ASCII encoded string and updates the
 *  internal list with any gamepad mappings it finds.  This string may
 *  contain either a single gamepad mapping or many mappings separated by
 *  newlines.  The parser supports the full format of the `gamecontrollerdb.txt`
 *  source file including empty lines and comments.
 *
 *  See @ref gamepad_mapping for a description of the format.
 *
 *  If there is already a gamepad mapping for a given GUID in the internal list,
 *  it will be replaced by the one passed to this function.  If the library is
 *  terminated and re-initialized the internal list will revert to the built-in
 *  default.
 *
 *  @param[in] string The string containing the gamepad mappings.
 *  @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_INVALID_VALUE.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref gamepad
 *  @sa @ref glfwJoystickIsGamepad
 *  @sa @ref glfwGetGamepadName
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup input
 */

/*! @brief Returns the human-readable gamepad name for the specified joystick.
 *
 *  This function returns the human-readable name of the gamepad from the
 *  gamepad mapping assigned to the specified joystick.
 *
 *  If the specified joystick is not present or does not have a gamepad mapping
 *  this function will return `NULL` but will not generate an error.  Call
 *  @ref glfwJoystickPresent to check whether it is present regardless of
 *  whether it has a mapping.
 *
 *  @param[in] jid The [joystick](@ref joysticks) to query.
 *  @return The UTF-8 encoded name of the gamepad, or `NULL` if the
 *  joystick is not present, does not have a mapping or an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref GLFW_INVALID_ENUM.
 *
 *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
 *  should not free it yourself.  It is valid until the specified joystick is
 *  disconnected, the gamepad mappings are updated or the library is terminated.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref gamepad
 *  @sa @ref glfwJoystickIsGamepad
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup input
 */

/*! @brief Retrieves the state of the specified joystick remapped as a gamepad.
 *
 *  This function retrieves the state of the specified joystick remapped to
 *  an Xbox-like gamepad.
 *
 *  If the specified joystick is not present or does not have a gamepad mapping
 *  this function will return `GLFW_FALSE` but will not generate an error.  Call
 *  @ref glfwJoystickPresent to check whether it is present regardless of
 *  whether it has a mapping.
 *
 *  The Guide button may not be available for input as it is often hooked by the
 *  system or the Steam client.
 *
 *  Not all devices have all the buttons or axes provided by @ref
 *  GLFWgamepadstate.  Unavailable buttons and axes will always report
 *  `GLFW_RELEASE` and 0.0 respectively.
 *
 *  @param[in] jid The [joystick](@ref joysticks) to query.
 *  @param[out] state The gamepad input state of the joystick.
 *  @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if no joystick is
 *  connected, it has no gamepad mapping or an [error](@ref error_handling)
 *  occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_INVALID_ENUM.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref gamepad
 *  @sa @ref glfwUpdateGamepadMappings
 *  @sa @ref glfwJoystickIsGamepad
 *
 *  @since Added in version 3.3.
 *
 *  @ingroup input
 */

/*! @brief Sets the clipboard to the specified string.
 *
 *  This function sets the system clipboard to the specified, UTF-8 encoded
 *  string.
 *
 *  @param[in] window Deprecated.  Any valid window or `NULL`.
 *  @param[in] string A UTF-8 encoded string.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @pointer_lifetime The specified string is copied before this function
 *  returns.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref clipboard
 *  @sa @ref glfwGetClipboardString
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup input
 */

/*! @brief Returns the contents of the clipboard as a string.
 *
 *  This function returns the contents of the system clipboard, if it contains
 *  or is convertible to a UTF-8 encoded string.  If the clipboard is empty or
 *  if its contents cannot be converted, `NULL` is returned and a @ref
 *  GLFW_FORMAT_UNAVAILABLE error is generated.
 *
 *  @param[in] window Deprecated.  Any valid window or `NULL`.
 *  @return The contents of the clipboard as a UTF-8 encoded string, or `NULL`
 *  if an [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_FORMAT_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR.
 *
 *  @pointer_lifetime The returned string is allocated and freed by GLFW.  You
 *  should not free it yourself.  It is valid until the next call to @ref
 *  glfwGetClipboardString or @ref glfwSetClipboardString, or until the library
 *  is terminated.
 *
 *  @thread_safety This function must only be called from the main thread.
 *
 *  @sa @ref clipboard
 *  @sa @ref glfwSetClipboardString
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup input
 */

/*! @brief Returns the GLFW time.
 *
 *  This function returns the current GLFW time, in seconds.  Unless the time
 *  has been set using @ref glfwSetTime it measures time elapsed since GLFW was
 *  initialized.
 *
 *  This function and @ref glfwSetTime are helper functions on top of @ref
 *  glfwGetTimerFrequency and @ref glfwGetTimerValue.
 *
 *  The resolution of the timer is system dependent, but is usually on the order
 *  of a few micro- or nanoseconds.  It uses the highest-resolution monotonic
 *  time source on each supported platform.
 *
 *  @return The current time, in seconds, or zero if an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function may be called from any thread.  Reading and
 *  writing of the internal base time is not atomic, so it needs to be
 *  externally synchronized with calls to @ref glfwSetTime.
 *
 *  @sa @ref time
 *
 *  @since Added in version 1.0.
 *
 *  @ingroup input
 */

/*! @brief Sets the GLFW time.
 *
 *  This function sets the current GLFW time, in seconds.  The value must be
 *  a positive finite number less than or equal to 18446744073.0, which is
 *  approximately 584.5 years.
 *
 *  This function and @ref glfwGetTime are helper functions on top of @ref
 *  glfwGetTimerFrequency and @ref glfwGetTimerValue.
 *
 *  @param[in] time The new value, in seconds.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_INVALID_VALUE.
 *
 *  @remark The upper limit of GLFW time is calculated as
 *  floor((2<sup>64</sup> - 1) / 10<sup>9</sup>) and is due to implementations
 *  storing nanoseconds in 64 bits.  The limit may be increased in the future.
 *
 *  @thread_safety This function may be called from any thread.  Reading and
 *  writing of the internal base time is not atomic, so it needs to be
 *  externally synchronized with calls to @ref glfwGetTime.
 *
 *  @sa @ref time
 *
 *  @since Added in version 2.2.
 *
 *  @ingroup input
 */

/*! @brief Returns the current value of the raw timer.
 *
 *  This function returns the current value of the raw timer, measured in
 *  1&nbsp;/&nbsp;frequency seconds.  To get the frequency, call @ref
 *  glfwGetTimerFrequency.
 *
 *  @return The value of the timer, or zero if an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function may be called from any thread.
 *
 *  @sa @ref time
 *  @sa @ref glfwGetTimerFrequency
 *
 *  @since Added in version 3.2.
 *
 *  @ingroup input
 */

/*! @brief Returns the frequency, in Hz, of the raw timer.
 *
 *  This function returns the frequency, in Hz, of the raw timer.
 *
 *  @return The frequency of the timer, in Hz, or zero if an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function may be called from any thread.
 *
 *  @sa @ref time
 *  @sa @ref glfwGetTimerValue
 *
 *  @since Added in version 3.2.
 *
 *  @ingroup input
 */

/*! @brief Makes the context of the specified window current for the calling
 *  thread.
 *
 *  This function makes the OpenGL or OpenGL ES context of the specified window
 *  current on the calling thread.  A context must only be made current on
 *  a single thread at a time and each thread can have only a single current
 *  context at a time.
 *
 *  When moving a context between threads, you must make it non-current on the
 *  old thread before making it current on the new one.
 *
 *  By default, making a context non-current implicitly forces a pipeline flush.
 *  On machines that support `GL_KHR_context_flush_control`, you can control
 *  whether a context performs this flush by setting the
 *  [GLFW_CONTEXT_RELEASE_BEHAVIOR](@ref GLFW_CONTEXT_RELEASE_BEHAVIOR_hint)
 *  hint.
 *
 *  The specified window must have an OpenGL or OpenGL ES context.  Specifying
 *  a window without a context will generate a @ref GLFW_NO_WINDOW_CONTEXT
 *  error.
 *
 *  @param[in] window The window whose context to make current, or `NULL` to
 *  detach the current context.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function may be called from any thread.
 *
 *  @sa @ref context_current
 *  @sa @ref glfwGetCurrentContext
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup context
 */

/*! @brief Returns the window whose context is current on the calling thread.
 *
 *  This function returns the window whose OpenGL or OpenGL ES context is
 *  current on the calling thread.
 *
 *  @return The window whose context is current, or `NULL` if no window's
 *  context is current.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function may be called from any thread.
 *
 *  @sa @ref context_current
 *  @sa @ref glfwMakeContextCurrent
 *
 *  @since Added in version 3.0.
 *
 *  @ingroup context
 */

/*! @brief Swaps the front and back buffers of the specified window.
 *
 *  This function swaps the front and back buffers of the specified window when
 *  rendering with OpenGL or OpenGL ES.  If the swap interval is greater than
 *  zero, the GPU driver waits the specified number of screen updates before
 *  swapping the buffers.
 *
 *  The specified window must have an OpenGL or OpenGL ES context.  Specifying
 *  a window without a context will generate a @ref GLFW_NO_WINDOW_CONTEXT
 *  error.
 *
 *  This function does not apply to Vulkan.  If you are rendering with Vulkan,
 *  see `vkQueuePresentKHR` instead.
 *
 *  @param[in] window The window whose buffers to swap.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR.
 *
 *  @remark __EGL:__ The context of the specified window must be current on the
 *  calling thread.
 *
 *  @thread_safety This function may be called from any thread.
 *
 *  @sa @ref buffer_swap
 *  @sa @ref glfwSwapInterval
 *
 *  @since Added in version 1.0.
 *  @glfw3 Added window handle parameter.
 *
 *  @ingroup window
 */

/*! @brief Sets the swap interval for the current context.
 *
 *  This function sets the swap interval for the current OpenGL or OpenGL ES
 *  context, i.e. the number of screen updates to wait from the time @ref
 *  glfwSwapBuffers was called before swapping the buffers and returning.  This
 *  is sometimes called _vertical synchronization_, _vertical retrace
 *  synchronization_ or just _vsync_.
 *
 *  A context that supports either of the `WGL_EXT_swap_control_tear` and
 *  `GLX_EXT_swap_control_tear` extensions also accepts _negative_ swap
 *  intervals, which allows the driver to swap immediately even if a frame
 *  arrives a little bit late.  You can check for these extensions with @ref
 *  glfwExtensionSupported.
 *
 *  A context must be current on the calling thread.  Calling this function
 *  without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error.
 *
 *  This function does not apply to Vulkan.  If you are rendering with Vulkan,
 *  see the present mode of your swapchain instead.
 *
 *  @param[in] interval The minimum number of screen updates to wait for
 *  until the buffers are swapped by @ref glfwSwapBuffers.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_NO_CURRENT_CONTEXT and @ref GLFW_PLATFORM_ERROR.
 *
 *  @remark This function is not called during context creation, leaving the
 *  swap interval set to whatever is the default on that platform.  This is done
 *  because some swap interval extensions used by GLFW do not allow the swap
 *  interval to be reset to zero once it has been set to a non-zero value.
 *
 *  @remark Some GPU drivers do not honor the requested swap interval, either
 *  because of a user setting that overrides the application's request or due to
 *  bugs in the driver.
 *
 *  @thread_safety This function may be called from any thread.
 *
 *  @sa @ref buffer_swap
 *  @sa @ref glfwSwapBuffers
 *
 *  @since Added in version 1.0.
 *
 *  @ingroup context
 */

/*! @brief Returns whether the specified extension is available.
 *
 *  This function returns whether the specified
 *  [API extension](@ref context_glext) is supported by the current OpenGL or
 *  OpenGL ES context.  It searches both for client API extension and context
 *  creation API extensions.
 *
 *  A context must be current on the calling thread.  Calling this function
 *  without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error.
 *
 *  As this functions retrieves and searches one or more extension strings each
 *  call, it is recommended that you cache its results if it is going to be used
 *  frequently.  The extension strings will not change during the lifetime of
 *  a context, so there is no danger in doing this.
 *
 *  This function does not apply to Vulkan.  If you are using Vulkan, see @ref
 *  glfwGetRequiredInstanceExtensions, `vkEnumerateInstanceExtensionProperties`
 *  and `vkEnumerateDeviceExtensionProperties` instead.
 *
 *  @param[in] extension The ASCII encoded name of the extension.
 *  @return `GLFW_TRUE` if the extension is available, or `GLFW_FALSE`
 *  otherwise.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_NO_CURRENT_CONTEXT, @ref GLFW_INVALID_VALUE and @ref
 *  GLFW_PLATFORM_ERROR.
 *
 *  @thread_safety This function may be called from any thread.
 *
 *  @sa @ref context_glext
 *  @sa @ref glfwGetProcAddress
 *
 *  @since Added in version 1.0.
 *
 *  @ingroup context
 */

/*! @brief Returns the address of the specified function for the current
 *  context.
 *
 *  This function returns the address of the specified OpenGL or OpenGL ES
 *  [core or extension function](@ref context_glext), if it is supported
 *  by the current context.
 *
 *  A context must be current on the calling thread.  Calling this function
 *  without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error.
 *
 *  This function does not apply to Vulkan.  If you are rendering with Vulkan,
 *  see @ref glfwGetInstanceProcAddress, `vkGetInstanceProcAddr` and
 *  `vkGetDeviceProcAddr` instead.
 *
 *  @param[in] procname The ASCII encoded name of the function.
 *  @return The address of the function, or `NULL` if an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_NO_CURRENT_CONTEXT and @ref GLFW_PLATFORM_ERROR.
 *
 *  @remark The address of a given function is not guaranteed to be the same
 *  between contexts.
 *
 *  @remark This function may return a non-`NULL` address despite the
 *  associated version or extension not being available.  Always check the
 *  context version or extension string first.
 *
 *  @pointer_lifetime The returned function pointer is valid until the context
 *  is destroyed or the library is terminated.
 *
 *  @thread_safety This function may be called from any thread.
 *
 *  @sa @ref context_glext
 *  @sa @ref glfwExtensionSupported
 *
 *  @since Added in version 1.0.
 *
 *  @ingroup context
 */

/*! @brief Returns whether the Vulkan loader and an ICD have been found.
 *
 *  This function returns whether the Vulkan loader and any minimally functional
 *  ICD have been found.
 *
 *  The availability of a Vulkan loader and even an ICD does not by itself guarantee that
 *  surface creation or even instance creation is possible.  Call @ref
 *  glfwGetRequiredInstanceExtensions to check whether the extensions necessary for Vulkan
 *  surface creation are available and @ref glfwGetPhysicalDevicePresentationSupport to
 *  check whether a queue family of a physical device supports image presentation.
 *
 *  @return `GLFW_TRUE` if Vulkan is minimally available, or `GLFW_FALSE`
 *  otherwise.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
 *
 *  @thread_safety This function may be called from any thread.
 *
 *  @sa @ref vulkan_support
 *
 *  @since Added in version 3.2.
 *
 *  @ingroup vulkan
 */

/*! @brief Returns the Vulkan instance extensions required by GLFW.
 *
 *  This function returns an array of names of Vulkan instance extensions required
 *  by GLFW for creating Vulkan surfaces for GLFW windows.  If successful, the
 *  list will always contain `VK_KHR_surface`, so if you don't require any
 *  additional extensions you can pass this list directly to the
 *  `VkInstanceCreateInfo` struct.
 *
 *  If Vulkan is not available on the machine, this function returns `NULL` and
 *  generates a @ref GLFW_API_UNAVAILABLE error.  Call @ref glfwVulkanSupported
 *  to check whether Vulkan is at least minimally available.
 *
 *  If Vulkan is available but no set of extensions allowing window surface
 *  creation was found, this function returns `NULL`.  You may still use Vulkan
 *  for off-screen rendering and compute work.
 *
 *  @param[out] count Where to store the number of extensions in the returned
 *  array.  This is set to zero if an error occurred.
 *  @return An array of ASCII encoded extension names, or `NULL` if an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_API_UNAVAILABLE.
 *
 *  @remark Additional extensions may be required by future versions of GLFW.
 *  You should check if any extensions you wish to enable are already in the
 *  returned array, as it is an error to specify an extension more than once in
 *  the `VkInstanceCreateInfo` struct.
 *
 *  @pointer_lifetime The returned array is allocated and freed by GLFW.  You
 *  should not free it yourself.  It is guaranteed to be valid only until the
 *  library is terminated.
 *
 *  @thread_safety This function may be called from any thread.
 *
 *  @sa @ref vulkan_ext
 *  @sa @ref glfwCreateWindowSurface
 *
 *  @since Added in version 3.2.
 *
 *  @ingroup vulkan
 */

/*! @brief Returns the address of the specified Vulkan instance function.
 *
 *  This function returns the address of the specified Vulkan core or extension
 *  function for the specified instance.  If instance is set to `NULL` it can
 *  return any function exported from the Vulkan loader, including at least the
 *  following functions:
 *
 *  - `vkEnumerateInstanceExtensionProperties`
 *  - `vkEnumerateInstanceLayerProperties`
 *  - `vkCreateInstance`
 *  - `vkGetInstanceProcAddr`
 *
 *  If Vulkan is not available on the machine, this function returns `NULL` and
 *  generates a @ref GLFW_API_UNAVAILABLE error.  Call @ref glfwVulkanSupported
 *  to check whether Vulkan is at least minimally available.
 *
 *  This function is equivalent to calling `vkGetInstanceProcAddr` with
 *  a platform-specific query of the Vulkan loader as a fallback.
 *
 *  @param[in] instance The Vulkan instance to query, or `NULL` to retrieve
 *  functions related to instance creation.
 *  @param[in] procname The ASCII encoded name of the function.
 *  @return The address of the function, or `NULL` if an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 *  GLFW_API_UNAVAILABLE.
 *
 *  @pointer_lifetime The returned function pointer is valid until the library
 *  is terminated.
 *
 *  @thread_safety This function may be called from any thread.
 *
 *  @sa @ref vulkan_proc
 *
 *  @since Added in version 3.2.
 *
 *  @ingroup vulkan
 */

/*! @brief Returns whether the specified queue family can present images.
 *
 *  This function returns whether the specified queue family of the specified
 *  physical device supports presentation to the platform GLFW was built for.
 *
 *  If Vulkan or the required window surface creation instance extensions are
 *  not available on the machine, or if the specified instance was not created
 *  with the required extensions, this function returns `GLFW_FALSE` and
 *  generates a @ref GLFW_API_UNAVAILABLE error.  Call @ref glfwVulkanSupported
 *  to check whether Vulkan is at least minimally available and @ref
 *  glfwGetRequiredInstanceExtensions to check what instance extensions are
 *  required.
 *
 *  @param[in] instance The instance that the physical device belongs to.
 *  @param[in] device The physical device that the queue family belongs to.
 *  @param[in] queuefamily The index of the queue family to query.
 *  @return `GLFW_TRUE` if the queue family supports presentation, or
 *  `GLFW_FALSE` otherwise.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_API_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR.
 *
 *  @remark @macos This function currently always returns `GLFW_TRUE`, as the
 *  `VK_MVK_macos_surface` and `VK_EXT_metal_surface` extensions do not provide
 *  a `vkGetPhysicalDevice*PresentationSupport` type function.
 *
 *  @thread_safety This function may be called from any thread.  For
 *  synchronization details of Vulkan objects, see the Vulkan specification.
 *
 *  @sa @ref vulkan_present
 *
 *  @since Added in version 3.2.
 *
 *  @ingroup vulkan
 */

/*! @brief Creates a Vulkan surface for the specified window.
 *
 *  This function creates a Vulkan surface for the specified window.
 *
 *  If the Vulkan loader or at least one minimally functional ICD were not found,
 *  this function returns `VK_ERROR_INITIALIZATION_FAILED` and generates a @ref
 *  GLFW_API_UNAVAILABLE error.  Call @ref glfwVulkanSupported to check whether
 *  Vulkan is at least minimally available.
 *
 *  If the required window surface creation instance extensions are not
 *  available or if the specified instance was not created with these extensions
 *  enabled, this function returns `VK_ERROR_EXTENSION_NOT_PRESENT` and
 *  generates a @ref GLFW_API_UNAVAILABLE error.  Call @ref
 *  glfwGetRequiredInstanceExtensions to check what instance extensions are
 *  required.
 *
 *  The window surface cannot be shared with another API so the window must
 *  have been created with the [client api hint](@ref GLFW_CLIENT_API_attrib)
 *  set to `GLFW_NO_API` otherwise it generates a @ref GLFW_INVALID_VALUE error
 *  and returns `VK_ERROR_NATIVE_WINDOW_IN_USE_KHR`.
 *
 *  The window surface must be destroyed before the specified Vulkan instance.
 *  It is the responsibility of the caller to destroy the window surface.  GLFW
 *  does not destroy it for you.  Call `vkDestroySurfaceKHR` to destroy the
 *  surface.
 *
 *  @param[in] instance The Vulkan instance to create the surface in.
 *  @param[in] window The window to create the surface for.
 *  @param[in] allocator The allocator to use, or `NULL` to use the default
 *  allocator.
 *  @param[out] surface Where to store the handle of the surface.  This is set
 *  to `VK_NULL_HANDLE` if an error occurred.
 *  @return `VK_SUCCESS` if successful, or a Vulkan error code if an
 *  [error](@ref error_handling) occurred.
 *
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
 *  GLFW_API_UNAVAILABLE, @ref GLFW_PLATFORM_ERROR and @ref GLFW_INVALID_VALUE
 *
 *  @remark If an error occurs before the creation call is made, GLFW returns
 *  the Vulkan error code most appropriate for the error.  Appropriate use of
 *  @ref glfwVulkanSupported and @ref glfwGetRequiredInstanceExtensions should
 *  eliminate almost all occurrences of these errors.
 *
 *  @remark @macos GLFW prefers the `VK_EXT_metal_surface` extension, with the
 *  `VK_MVK_macos_surface` extension as a fallback.  The name of the selected
 *  extension, if any, is included in the array returned by @ref
 *  glfwGetRequiredInstanceExtensions.
 *
 *  @remark @macos This function creates and sets a `CAMetalLayer` instance for
 *  the window content view, which is required for MoltenVK to function.
 *
 *  @thread_safety This function may be called from any thread.  For
 *  synchronization details of Vulkan objects, see the Vulkan specification.
 *
 *  @sa @ref vulkan_surface
 *  @sa @ref glfwGetRequiredInstanceExtensions
 *
 *  @since Added in version 3.2.
 *
 *  @ingroup vulkan
 */

/*VK_VERSION_1_0*/

/*************************************************************************
 * Global definition cleanup
 *************************************************************************/

/* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */

/* Some OpenGL related headers need GLAPIENTRY, but it is unconditionally
 * defined by some gl.h variants (OpenBSD) so define it after if needed.
 */

/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */

/* _glfw3_h_ */


=== system/include/KHR/khrplatform.h ===
SHA256: e206a6931f98ffe1c5c7ece69c4f94bbe1c9279243f40cbe7782848a0d3fa2de
/*
** Copyright (c) 2008-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are 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 Materials.
**
** THE MATERIALS ARE 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
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/

/* Khronos platform-specific types and definitions.
 *
 * The master copy of khrplatform.h is maintained in the Khronos EGL
 * Registry repository at https://github.com/KhronosGroup/EGL-Registry
 * The last semantic modification to khrplatform.h was at commit ID:
 *      67a3e0864c2d75ea5287b9f3d2eb74a745936692
 *
 * Adopters may modify this file to suit their platform. Adopters are
 * encouraged to submit platform specific modifications to the Khronos
 * group so that they can be included in future versions of this file.
 * Please submit changes by filing pull requests or issues on
 * the EGL Registry repository linked above.
 *
 *
 * See the Implementer's Guidelines for information about where this file
 * should be located on your system and for more details of its use:
 *    http://www.khronos.org/registry/implementers_guide.pdf
 *
 * This file should be included as
 *        #include <KHR/khrplatform.h>
 * by Khronos client API header files that use its types and defines.
 *
 * The types in khrplatform.h should only be used to define API-specific types.
 *
 * Types defined in khrplatform.h:
 *    khronos_int8_t              signed   8  bit
 *    khronos_uint8_t             unsigned 8  bit
 *    khronos_int16_t             signed   16 bit
 *    khronos_uint16_t            unsigned 16 bit
 *    khronos_int32_t             signed   32 bit
 *    khronos_uint32_t            unsigned 32 bit
 *    khronos_int64_t             signed   64 bit
 *    khronos_uint64_t            unsigned 64 bit
 *    khronos_intptr_t            signed   same number of bits as a pointer
 *    khronos_uintptr_t           unsigned same number of bits as a pointer
 *    khronos_ssize_t             signed   size
 *    khronos_usize_t             unsigned size
 *    khronos_float_t             signed   32 bit floating point
 *    khronos_time_ns_t           unsigned 64 bit time in nanoseconds
 *    khronos_utime_nanoseconds_t unsigned time interval or absolute time in
 *                                         nanoseconds
 *    khronos_stime_nanoseconds_t signed time interval in nanoseconds
 *    khronos_boolean_enum_t      enumerated boolean type. This should
 *      only be used as a base type when a client API's boolean type is
 *      an enum. Client APIs which use an integer or other type for
 *      booleans cannot use this as the base type for their boolean.
 *
 * Tokens defined in khrplatform.h:
 *
 *    KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
 *
 *    KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
 *    KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
 *
 * Calling convention macros defined in this file:
 *    KHRONOS_APICALL
 *    KHRONOS_APIENTRY
 *    KHRONOS_APIATTRIBUTES
 *
 * These may be used in function prototypes as:
 *
 *      KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
 *                                  int arg1,
 *                                  int arg2) KHRONOS_APIATTRIBUTES;
 */

/*-------------------------------------------------------------------------
 * Definition of KHRONOS_APICALL
 *-------------------------------------------------------------------------
 * This precedes the return type of the function in the function prototype.
 */

/* If the preprocessor constant KHRONOS_STATIC is defined, make the
     * header compatible with static linking. */

/*-------------------------------------------------------------------------
 * Definition of KHRONOS_APIENTRY
 *-------------------------------------------------------------------------
 * This follows the return type of the function  and precedes the function
 * name in the function prototype.
 */

/* Win32 but not WinCE */

/*-------------------------------------------------------------------------
 * Definition of KHRONOS_APIATTRIBUTES
 *-------------------------------------------------------------------------
 * This follows the closing parenthesis of the function prototype arguments.
 */

/*-------------------------------------------------------------------------
 * basic type definitions
 *-----------------------------------------------------------------------*/

/*
 * Using <stdint.h>
 */

/*
 * Using <inttypes.h>
 */

/*
 * Win32
 */

/*
 * Sun or Digital
 */

/* __arch64__ */

/*
 * Hypothetical platform with no float or int64 support
 */

/*
 * Generic fallback
 */

/*
 * Types that are (so far) the same on all platforms
 */

/*
 * Types that differ between LLP64 and LP64 architectures - in LLP64,
 * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
 * to be the only LLP64 architecture in current use.
 */

/*
 * Float type
 */

/* Time types
 *
 * These types can be used to represent a time interval in nanoseconds or
 * an absolute Unadjusted System Time.  Unadjusted System Time is the number
 * of nanoseconds since some arbitrary system event (e.g. since the last
 * time the system booted).  The Unadjusted System Time is an unsigned
 * 64 bit value that wraps back to 0 every 584 years.  Time intervals
 * may be either signed or unsigned.
 */

/*
 * Dummy value used to pad enum types to 32 bits.
 */

/*
 * Enumerated boolean type
 *
 * Values other than zero should be considered to be true.  Therefore
 * comparisons should not be made against KHRONOS_TRUE.
 */

/* __khrplatform_h_ */


=== system/include/SDL/SDL.h ===
SHA256: 3176350b09e53e1353f33744843732de9ff71b061877762862c8d7e1881cbc38
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL.h
 *  
 *  Main include header for the SDL library
 */

/**
 *  \mainpage Simple DirectMedia Layer (SDL)
 *  
 *  http://www.libsdl.org/
 *  
 *  \section intro_sec Introduction
 *  
 *  This is the Simple DirectMedia Layer, a general API that provides low
 *  level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
 *  and 2D framebuffer across multiple platforms.
 *  
 *  SDL is written in C, but works with C++ natively, and has bindings to
 *  several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
 *  Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP,
 *  Pike, Pliant, Python, Ruby, and Smalltalk.
 *  
 *  This library is distributed under GNU LGPL version 2, which can be
 *  found in the file  "COPYING".  This license allows you to use SDL
 *  freely in commercial programs as long as you link with the dynamic
 *  library.
 *  
 *  The best way to learn how to use SDL is to check out the header files in
 *  the "include" subdirectory and the programs in the "test" subdirectory.
 *  The header files and test programs are well commented and always up to date.
 *  More documentation is available in HTML format in "docs/index.html", and
 *  a documentation wiki is available online at:
 *  	http://www.libsdl.org/cgi/docwiki.cgi
 *  
 *  The test programs in the "test" subdirectory are in the public domain.
 *  
 *  Frequently asked questions are answered online:
 *  	http://www.libsdl.org/faq.php
 *  
 *  If you need help with the library, or just want to discuss SDL related
 *  issues, you can join the developers mailing list:
 *  	http://www.libsdl.org/mailing-list.php
 *  
 *  Enjoy!
 *  	Sam Lantinga				(slouken@libsdl.org)
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* As of version 0.5, SDL is loaded dynamically into the application */

/**
 *  \name SDL_INIT_*
 *  
 *  These are the flags which may be passed to SDL_Init().  You should
 *  specify the subsystems which you will be using in your application.
 */

/*@{*/

/**< Don't catch fatal signals */

/*@}*/

/**
 *  This function initializes  the subsystems specified by \c flags
 *  Unless the ::SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
 *  signal handlers for some commonly ignored fatal signals (like SIGSEGV).
 */

/**
 *  This function initializes specific SDL subsystems
 */

/**
 *  This function cleans up specific SDL subsystems
 */

/**
 *  This function returns a mask of the specified subsystems which have
 *  previously been initialized.
 *  
 *  If \c flags is 0, it returns a mask of all initialized subsystems.
 */

/**
 *  This function cleans up all initialized subsystems. You should
 *  call it upon all exit conditions.
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_H */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_assert.h ===
SHA256: cc320917085b89b6e228817f4891ace9dd02cd21f87324844712d29e34f9cd8b
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* SDL_ASSERT_LEVEL */

/*
These are macros and not first class functions so that the debugger breaks
on the assertion line and not in some random guts of SDL, and so each
assert can have unique static variables associated with it.
*/

/* Don't include intrin.h here because it contains C++ code */

/* How do we trigger breakpoints on this platform? */

/* C99 supports __func__ as a standard. */

/*
sizeof (x) makes the compiler still parse the expression even without
assertions enabled, so the code is always checked at compile time, but
doesn't actually generate code for it, so there are no side effects or
expensive checks at run time, just the constant size of what x WOULD be,
which presumably gets optimized out as unused.
This also solves the problem of...

    int somevalue = blah();
    SDL_assert(somevalue == 1);

...which would cause compiles to complain that somevalue is unused if we
disable assertions.
*/

/**< Retry the assert immediately. */

/**< Make the debugger trigger a breakpoint. */

/**< Terminate the program. */

/**< Ignore the assert. */

/**< Ignore the assert from now on. */

/* Never call this directly. Use the SDL_assert* macros. */

/* the do {} while(0) avoids dangling else problems:
    if (x) SDL_assert(y); else blah();
       ... without the do/while, the "else" could attach to this macro's "if".
   We try to handle just the minimum we need here in a macro...the loop,
   the static vars, and break points. The heavy lifting is handled in
   SDL_ReportAssertion(), in SDL_assert.c.
*/

/* go again. */

/* not retrying. */

/* enabled assertions support code */

/* Enable various levels of assertions. */

/* assertions disabled */

/* release settings. */

/* normal settings. */

/* paranoid settings. */

/**
 *  \brief Set an application-defined assertion handler.
 *
 *  This allows an app to show its own assertion UI and/or force the
 *  response to an assertion failure. If the app doesn't provide this, SDL
 *  will try to do the right thing, popping up a system-specific GUI dialog,
 *  and probably minimizing any fullscreen windows.
 *
 *  This callback may fire from any thread, but it runs wrapped in a mutex, so
 *  it will only fire from one thread at a time.
 *
 *  Setting the callback to NULL restores SDL's original internal handler.
 *
 *  This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
 *
 *  \return SDL_assert_state value of how to handle the assertion failure.
 *  
 *  \param handler Callback function, called when an assertion fails.
 *  \param userdata A pointer passed to the callback as-is.
 */

/**
 *  \brief Get a list of all assertion failures.
 *
 *  Get all assertions triggered since last call to SDL_ResetAssertionReport(),
 *  or the start of the program.
 *
 *  The proper way to examine this data looks something like this:
 *
 *  <code>
 *  const SDL_assert_data *item = SDL_GetAssertionReport();
 *  while (item) {
 *      printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\n",
 *             item->condition, item->function, item->filename,
 *             item->linenum, item->trigger_count,
 *             item->always_ignore ? "yes" : "no");
 *      item = item->next;
 *  }
 *  </code>
 *
 *  \return List of all assertions.
 *  \sa SDL_ResetAssertionReport
 */

/**
 *  \brief Reset the list of all assertion failures.
 *
 *  Reset list of all assertions triggered.
 *
 *  \sa SDL_GetAssertionReport
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_assert_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_atomic.h ===
SHA256: 61bd0f565b03a34c82a2c42c6701b9666d2af91704768d18da5832f723f03b2c
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 * \file SDL_atomic.h
 * 
 * Atomic operations.
 * 
 * IMPORTANT:
 * If you are not an expert in concurrent lockless programming, you should
 * only be using the atomic lock and reference counting functions in this
 * file.  In all other cases you should be protecting your data structures
 * with full mutexes.
 * 
 * The list of "safe" functions to use are:
 *  SDL_AtomicLock()
 *  SDL_AtomicUnlock()
 *  SDL_AtomicIncRef()
 *  SDL_AtomicDecRef()
 * 
 * Seriously, here be dragons!
 * ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 *
 * You can find out a little more about lockless programming and the 
 * subtle issues that can arise here:
 * http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx
 *
 * There's also lots of good information here:
 * http://www.1024cores.net/home/lock-free-algorithms
 *
 * These operations may or may not actually be implemented using
 * processor specific atomic operations. When possible they are
 * implemented as true processor specific atomic operations. When that
 * is not possible the are implemented using locks that *do* use the
 * available atomic operations.
 *
 * All of the atomic operations that modify memory are full memory barriers.
 */

/* Need to do this here because intrin.h has C++ code in it */

/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 * \name SDL AtomicLock
 * 
 * The atomic locks are efficient spinlocks using CPU instructions,
 * but are vulnerable to starvation and can spin forever if a thread
 * holding a lock has been terminated.  For this reason you should
 * minimize the code executed inside an atomic lock and never do
 * expensive things like API or system calls while holding them.
 *
 * The atomic locks are not safe to lock recursively.
 *
 * Porting Note:
 * The spin lock functions and type are required and can not be
 * emulated because they are used in the atomic emulation code.
 */

/*@{*/

/**
 * \brief Try to lock a spin lock by setting it to a non-zero value.
 * 
 * \param lock Points to the lock.
 *
 * \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held.
 */

/**
 * \brief Lock a spin lock by setting it to a non-zero value.
 * 
 * \param lock Points to the lock.
 */

/**
 * \brief Unlock a spin lock by setting it to 0. Always returns immediately
 *
 * \param lock Points to the lock.
 */

/*@}*/

/*SDL AtomicLock*/

/**
 * The compiler barrier prevents the compiler from reordering
 * reads and writes to globally visible variables across the call.
 */

/* Platform specific optimized versions of the atomic functions,
 * you can disable these by defining SDL_DISABLE_ATOMIC_INLINE
 */

/* !SDL_DISABLE_ATOMIC_INLINE */

/**
 * \brief A type representing an atomic integer value.  It is a struct
 *        so people don't accidentally use numeric operations on it.
 */

/**
 * \brief Set an atomic variable to a new value if it is currently an old value.
 *
 * \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
 *
 * \note If you don't know what this function is for, you shouldn't use it!
*/

/**
 * \brief Set an atomic variable to a value.
 *
 * \return The previous value of the atomic variable.
 */

/**
 * \brief Get the value of an atomic variable
 */

/**
 * \brief Add to an atomic variable.
 *
 * \return The previous value of the atomic variable.
 *
 * \note This same style can be used for any number operation
 */

/**
 * \brief Increment an atomic variable used as a reference count.
 */

/**
 * \brief Decrement an atomic variable used as a reference count.
 *
 * \return SDL_TRUE if the variable reached zero after decrementing,
 *         SDL_FALSE otherwise
 */

/**
 * \brief Set a pointer to a new value if it is currently an old value.
 *
 * \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
 *
 * \note If you don't know what this function is for, you shouldn't use it!
*/

/**
 * \brief Set a pointer to a value atomically.
 *
 * \return The previous value of the pointer.
 */

/**
 * \brief Get the value of a pointer atomically.
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_atomic_h_ */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_audio.h ===
SHA256: 9ba4f3f07568efccb3008473bba0764207909c319046da717910f89d02b3a030
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_audio.h
 *  
 *  Access to the raw audio mixing buffer for the SDL library.
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 *  \brief Audio format flags.
 *  
 *  These are what the 16 bits in SDL_AudioFormat currently mean...
 *  (Unspecified bits are always zero).
 *  
 *  \verbatim
    ++-----------------------sample is signed if set
    ||
    ||       ++-----------sample is bigendian if set
    ||       ||
    ||       ||          ++---sample is float if set
    ||       ||          ||
    ||       ||          || +---sample bit size---+
    ||       ||          || |                     |
    15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
    \endverbatim
 *  
 *  There are macros in SDL 1.3 and later to query these bits.
 */

/**
 *  \name Audio flags
 */

/*@{*/

/** 
 *  \name Audio format flags
 *
 *  Defaults to LSB byte order.
 */

/*@{*/

/**< Unsigned 8-bit samples */

/**< Signed 8-bit samples */

/**< Unsigned 16-bit samples */

/**< Signed 16-bit samples */

/**< As above, but big-endian byte order */

/**< As above, but big-endian byte order */

/*@}*/

/**
 *  \name int32 support
 *  
 *  New to SDL 1.3.
 */

/*@{*/

/**< 32-bit integer samples */

/**< As above, but big-endian byte order */

/*@}*/

/**
 *  \name float32 support
 *  
 *  New to SDL 1.3.
 */

/*@{*/

/**< 32-bit floating point samples */

/**< As above, but big-endian byte order */

/*@}*/

/**
 *  \name Native audio byte ordering
 */

/*@{*/

/*@}*/

/** 
 *  \name Allow change flags
 *  
 *  Which audio format changes are allowed when opening a device.
 */

/*@{*/

/*@}*/

/*@}*/

/*Audio flags*/

/**
 *  This function is called when the audio device needs more data.
 *
 *  \param userdata An application-specific parameter saved in
 *                  the SDL_AudioSpec structure
 *  \param stream A pointer to the audio data buffer.
 *  \param len    The length of that buffer in bytes.
 *
 *  Once the callback returns, the buffer will no longer be valid.
 *  Stereo samples are stored in a LRLRLR ordering.
 */

/**
 *  The calculated values in this structure are calculated by SDL_OpenAudio().
 */

/**< DSP frequency -- samples per second */

/**< Audio data format */

/**< Number of channels: 1 mono, 2 stereo */

/**< Audio buffer silence value (calculated) */

/**< Audio buffer size in samples (power of 2) */

/**< Necessary for some compile environments */

/**< Audio buffer size in bytes (calculated) */

/**
 *  A structure to hold a set of audio conversion filters and buffers.
 */

/**< Set to 1 if conversion possible */

/**< Source audio format */

/**< Target audio format */

/**< Rate conversion increment */

/**< Buffer to hold entire audio data */

/**< Length of original audio buffer */

/**< Length of converted audio buffer */

/**< buffer must be len*len_mult big */

/**< Given len, final size is len*len_ratio */

/**< Filter list */

/**< Current audio conversion function */

/* Function prototypes */

/**
 *  \name Driver discovery functions
 *  
 *  These functions return the list of built in audio drivers, in the
 *  order that they are normally initialized by default.
 */

/*@{*/

/*@}*/

/**
 *  \name Initialization and cleanup
 *  
 *  \internal These functions are used internally, and should not be used unless
 *            you have a specific need to specify the audio driver you want to 
 *            use.  You should normally use SDL_Init() or SDL_InitSubSystem().
 */

/*@{*/

/*@}*/

/**
 *  This function returns the name of the current audio driver, or NULL
 *  if no driver has been initialized.
 */

/**
 *  This function opens the audio device with the desired parameters, and
 *  returns 0 if successful, placing the actual hardware parameters in the
 *  structure pointed to by \c obtained.  If \c obtained is NULL, the audio
 *  data passed to the callback function will be guaranteed to be in the
 *  requested format, and will be automatically converted to the hardware
 *  audio format if necessary.  This function returns -1 if it failed 
 *  to open the audio device, or couldn't set up the audio thread.
 *  
 *  When filling in the desired audio spec structure,
 *    - \c desired->freq should be the desired audio frequency in samples-per-
 *      second.
 *    - \c desired->format should be the desired audio format.
 *    - \c desired->samples is the desired size of the audio buffer, in 
 *      samples.  This number should be a power of two, and may be adjusted by 
 *      the audio driver to a value more suitable for the hardware.  Good values
 *      seem to range between 512 and 8096 inclusive, depending on the 
 *      application and CPU speed.  Smaller values yield faster response time, 
 *      but can lead to underflow if the application is doing heavy processing 
 *      and cannot fill the audio buffer in time.  A stereo sample consists of 
 *      both right and left channels in LR ordering.
 *      Note that the number of samples is directly related to time by the
 *      following formula:  \code ms = (samples*1000)/freq \endcode
 *    - \c desired->size is the size in bytes of the audio buffer, and is
 *      calculated by SDL_OpenAudio().
 *    - \c desired->silence is the value used to set the buffer to silence,
 *      and is calculated by SDL_OpenAudio().
 *    - \c desired->callback should be set to a function that will be called
 *      when the audio device is ready for more data.  It is passed a pointer
 *      to the audio buffer, and the length in bytes of the audio buffer.
 *      This function usually runs in a separate thread, and so you should
 *      protect data structures that it accesses by calling SDL_LockAudio()
 *      and SDL_UnlockAudio() in your code.
 *    - \c desired->userdata is passed as the first parameter to your callback
 *      function.
 *  
 *  The audio device starts out playing silence when it's opened, and should
 *  be enabled for playing by calling \c SDL_PauseAudio(0) when you are ready
 *  for your audio callback function to be called.  Since the audio driver
 *  may modify the requested size of the audio buffer, you should allocate
 *  any local mixing buffers after you open the audio device.
 */

/**
 *  SDL Audio Device IDs.
 *  
 *  A successful call to SDL_OpenAudio() is always device id 1, and legacy
 *  SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls
 *  always returns devices >= 2 on success. The legacy calls are good both
 *  for backwards compatibility and when you don't care about multiple,
 *  specific, or capture devices.
 */

/**
 *  Get the number of available devices exposed by the current driver.
 *  Only valid after a successfully initializing the audio subsystem.
 *  Returns -1 if an explicit list of devices can't be determined; this is
 *  not an error. For example, if SDL is set up to talk to a remote audio
 *  server, it can't list every one available on the Internet, but it will
 *  still allow a specific host to be specified to SDL_OpenAudioDevice().
 *  
 *  In many common cases, when this function returns a value <= 0, it can still
 *  successfully open the default device (NULL for first argument of
 *  SDL_OpenAudioDevice()).
 */

/**
 *  Get the human-readable name of a specific audio device.
 *  Must be a value between 0 and (number of audio devices-1).
 *  Only valid after a successfully initializing the audio subsystem.
 *  The values returned by this function reflect the latest call to
 *  SDL_GetNumAudioDevices(); recall that function to redetect available
 *  hardware.
 *  
 *  The string returned by this function is UTF-8 encoded, read-only, and
 *  managed internally. You are not to free it. If you need to keep the
 *  string for any length of time, you should make your own copy of it, as it
 *  will be invalid next time any of several other SDL functions is called.
 */

/**
 *  Open a specific audio device. Passing in a device name of NULL requests
 *  the most reasonable default (and is equivalent to calling SDL_OpenAudio()).
 *  
 *  The device name is a UTF-8 string reported by SDL_GetAudioDeviceName(), but
 *  some drivers allow arbitrary and driver-specific strings, such as a
 *  hostname/IP address for a remote audio server, or a filename in the
 *  diskaudio driver.
 *  
 *  \return 0 on error, a valid device ID that is >= 2 on success.
 *  
 *  SDL_OpenAudio(), unlike this function, always acts on device ID 1.
 */

/**
 *  \name Audio state
 *  
 *  Get the current audio state.
 */

/*@{*/

/*@}*/

/*Audio State*/

/**
 *  \name Pause audio functions
 *  
 *  These functions pause and unpause the audio callback processing.
 *  They should be called with a parameter of 0 after opening the audio
 *  device to start playing sound.  This is so you can safely initialize
 *  data for your callback function after opening the audio device.
 *  Silence will be written to the audio device during the pause.
 */

/*@{*/

/*@}*/

/*Pause audio functions*/

/**
 *  This function loads a WAVE from the data source, automatically freeing
 *  that source if \c freesrc is non-zero.  For example, to load a WAVE file,
 *  you could do:
 *  \code
 *  	SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
 *  \endcode
 *
 *  If this function succeeds, it returns the given SDL_AudioSpec,
 *  filled with the audio data format of the wave data, and sets
 *  \c *audio_buf to a malloc()'d buffer containing the audio data,
 *  and sets \c *audio_len to the length of that audio buffer, in bytes.
 *  You need to free the audio buffer with SDL_FreeWAV() when you are 
 *  done with it.
 *
 *  This function returns NULL and sets the SDL error message if the 
 *  wave file cannot be opened, uses an unknown data format, or is 
 *  corrupt.  Currently raw and MS-ADPCM WAVE files are supported.
 */

/** 
 *  Loads a WAV from a file.
 *  Compatibility convenience function.
 */

/**
 *  This function frees data previously allocated with SDL_LoadWAV_RW()
 */

/**
 *  This function takes a source format and rate and a destination format
 *  and rate, and initializes the \c cvt structure with information needed
 *  by SDL_ConvertAudio() to convert a buffer of audio data from one format
 *  to the other.
 *  
 *  \return -1 if the format conversion is not supported, 0 if there's
 *  no conversion needed, or 1 if the audio filter is set up.
 */

/**
 *  Once you have initialized the \c cvt structure using SDL_BuildAudioCVT(),
 *  created an audio buffer \c cvt->buf, and filled it with \c cvt->len bytes of
 *  audio data in the source format, this function will convert it in-place
 *  to the desired format.
 *  
 *  The data conversion may expand the size of the audio data, so the buffer
 *  \c cvt->buf should be allocated after the \c cvt structure is initialized by
 *  SDL_BuildAudioCVT(), and should be \c cvt->len*cvt->len_mult bytes long.
 */

/**
 *  This takes two audio buffers of the playing audio format and mixes
 *  them, performing addition, volume adjustment, and overflow clipping.
 *  The volume ranges from 0 - 128, and should be set to ::SDL_MIX_MAXVOLUME
 *  for full audio volume.  Note this does not change hardware volume.
 *  This is provided for convenience -- you can mix your own audio data.
 */

/**
 *  This works like SDL_MixAudio(), but you specify the audio format instead of
 *  using the format of audio device 1. Thus it can be used when no audio
 *  device is open at all.
 */

/**
 *  \name Audio lock functions
 *  
 *  The lock manipulated by these functions protects the callback function.
 *  During a SDL_LockAudio()/SDL_UnlockAudio() pair, you can be guaranteed that 
 *  the callback function is not running.  Do not call these from the callback
 *  function or you will cause deadlock.
 */

/*@{*/

/*@}*/

/*Audio lock functions*/

/**
 *  This function shuts down audio processing and closes the audio device.
 */

/**
 * \return 1 if audio device is still functioning, zero if not, -1 on error.
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_audio_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_blendmode.h ===
SHA256: 3cfef032da546372528eea71119734d2b9a815bf0c2ce5f129a9f2d7f2d95a74
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_blendmode.h
 *  
 *  Header file declaring the SDL_BlendMode enumeration
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 *  \brief The blend mode used in SDL_RenderCopy() and drawing operations.
 */

/**< No blending */

/**< dst = (src * A) + (dst * (1-A)) */

/**< dst = (src * A) + dst */

/**< dst = src * dst */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_video_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_clipboard.h ===
SHA256: a00abf531101fadb806bba018054047cdf0f3f029f39c64ca6b5f6311ea21230
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 * \file SDL_clipboard.h
 *
 * Include file for SDL clipboard handling
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* Function prototypes */

/**
 * \brief Put UTF-8 text into the clipboard
 *
 * \sa SDL_GetClipboardText()
 */

/**
 * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free()
 *
 * \sa SDL_SetClipboardText()
 */

/**
 * \brief Returns whether the clipboard has text
 *
 * \sa SDL_GetClipboardText()
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_clipboard_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_compat.h ===
SHA256: 8c09919c243bf18eb463bb67f6567a4ac2ac50abcdc775b73b556224b478cb00
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \defgroup Compatibility SDL 1.2 Compatibility API
 */

/*@{*/

/**
 *  \file SDL_compat.h
 *
 *  This file contains functions for backwards compatibility with SDL 1.2.
 */

/**
 *  \def SDL_NO_COMPAT
 *
 *  #define SDL_NO_COMPAT to prevent SDL_compat.h from being included.
 *  SDL_NO_COMPAT is intended to make it easier to covert SDL 1.2 code to
 *  SDL 1.3/2.0.
 */

/*@}*/

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 *  \addtogroup Compatibility
 */

/*@{*/

/* Platform */

/**
 *  \name Surface flags
 */

/*@{*/

/**< \note Not used */

/**< \note Not used */

/**< \note Not used */

/**< \note Not used */

/**< \note Not used */

/*@}*/

/*Surface flags*/

/**
 *  \name Overlay formats
 *
 *  The most common video overlay formats.
 *  
 *  For an explanation of these pixel formats, see:
 *  http://www.webartz.com/fourcc/indexyuv.htm
 *  
 *  For information on the relationship between color spaces, see:
 *  http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
 */

/*@{*/

/**< Planar mode: Y + V + U  (3 planes) */

/**< Planar mode: Y + U + V  (3 planes) */

/**< Packed mode: Y0+U0+Y1+V0 (1 plane) */

/**< Packed mode: U0+Y0+V0+Y1 (1 plane) */

/**< Packed mode: Y0+V0+Y1+U0 (1 plane) */

/*@}*/

/*Overlay formats*/

/**
 *  The YUV hardware video overlay.
 */

/**< Read-only */

/**< Read-only */

/**< Read-only */

/**< Read-only */

/**< Read-write */

/** 
     *  \name Hardware-specific surface info
     */

/*@{*/

/*@}*/

/*Hardware-specific surface info*/

/** 
     *  \name Special flags
     */

/*@{*/

/**< Flag: This overlay hardware accelerated? */

/*@}*/

/*Special flags*/

/**
 *  \name Obsolete or renamed key codes
 */

/*@{*/

/** 
 *  \name Renamed keys
 *
 *  These key constants were renamed for clarity or consistency. 
 */

/*@{*/

/*@}*/

/*Renamed keys*/

/**
 *  \name META modifier
 *  
 *  The META modifier is equivalent to the GUI modifier from the USB standard.
 */

/*@{*/

/*@}*/

/*META modifier*/

/** 
 *  \name Not in USB
 *
 *  These keys don't appear in the USB specification (or at least not under 
 *  those names). I'm unsure if the following assignments make sense or if these
 *  codes should be defined as actual additional SDLK_ constants.
 */

/*@{*/

/*@}*/

/*Not in USB*/

/*@}*/

/*Obsolete or renamed key codes*/

/* The timeslice and timer resolution are no longer relevant */

/*@}*/

/*Compatibility*/

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_compat_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_config.h ===
SHA256: 9d05efb316fb326fba6b04e1db7e3cc8eff77ee51862a0e052657346d7c7395b
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_config.h
 *
 *  SDL_config.h for any platform that doesn't build using the configure system.
 */

/* Add any platform that doesn't build using the configure system. */

/* platform config */

/* _SDL_config_h */


=== system/include/SDL/SDL_config_android.h ===
SHA256: d57bed2adccbb5e828b7c99368085c074490fcf1fecd33c6a99facb429535fdd
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_config_android.h
 *  
 *  This is a configuration that can be used to build SDL for Android
 */

/* C library functions */

/* Enable various audio drivers */

/* Enable various input drivers */

/* Enable various shared object loading systems */

/* Enable various threading systems */

/* Enable various timer systems */

/* Enable various video drivers */

/* Enable OpenGL ES */

/* _SDL_config_minimal_h */


=== system/include/SDL/SDL_config_emscripten.h ===
SHA256: 2898f4710e4d4adf0ff19c68da18528369222f5ce632d92f2acfbdd549787d2e
/* C library functions */

/* _SDL_config_emscripten_h */


=== system/include/SDL/SDL_config_iphoneos.h ===
SHA256: bd8a3543eebb495ca16e59261a44b2192c13f63acfe89b22d4d550a23cb035f0
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/* C library functions */

/* enable iPhone version of Core Audio driver */

/* Enable the dummy audio driver (src/audio/dummy/\*.c) */

/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */

/* Enable Unix style SO loading */

/* Technically this works, but it violates the iPhone developer agreement */

/* #define SDL_LOADSO_DLOPEN 1 */

/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */

/* Enable various threading systems */

/* Enable various timer systems */

/* Supported video drivers */

/* enable OpenGL ES */

/* Enable system power support */

/* enable iPhone keyboard support */

/* Set max recognized G-force from accelerometer
   See src/joystick/uikit/SDLUIAccelerationDelegate.m for notes on why this is needed
 */

/* _SDL_config_iphoneos_h */


=== system/include/SDL/SDL_config_macosx.h ===
SHA256: b0e56e73274c3a4226685a0fdf0ff1cbd1275fb76de4ff9d66b95932e4d60c1a
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */

/* This is a set of defines to configure the SDL features */

/* Useful headers */

/* If we specified an SDK or have a post-PowerPC chip, then alloca.h exists. */

/* C library functions */

/* Enable various audio drivers */

/* Enable various input drivers */

/* Enable various shared object loading systems */

/* Enable various threading systems */

/* Enable various timer systems */

/* Enable various video drivers */

/* Enable OpenGL support */

/* Enable system power support */

/* Enable assembly routines */

/* _SDL_config_macosx_h */


=== system/include/SDL/SDL_config_minimal.h ===
SHA256: 0360456423a203d3e24eec237d053f5cfcf293d081cd7a1bcc264fd1b7e72343
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_config_minimal.h
 *  
 *  This is the minimal configuration that can be used to build SDL.
 */

/* !_STDINT_H_ && !HAVE_STDINT_H */

/* Enable the dummy audio driver (src/audio/dummy/\*.c) */

/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */

/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */

/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */

/* Enable the stub thread support (src/thread/generic/\*.c) */

/* Enable the stub timer support (src/timer/dummy/\*.c) */

/* Enable the dummy video driver (src/video/dummy/\*.c) */

/* _SDL_config_minimal_h */


=== system/include/SDL/SDL_config_nintendods.h ===
SHA256: 149c8aa11f52e5fde270310e48b99cf2fa1f187fd52b701b1378978515fdc14a
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/* This is a set of defines to configure the SDL features */

/* LiF: __PTRDIFF_TYPE__ was causing errors of conflicting typedefs with the
   <stdint.h> shipping with devkitARM.  copied a similar ifdef from it. */

/* !_STDINT_H_ && !HAVE_STDINT_H */

/* Useful headers */

/* C library functions */

/* DS isn't that sophisticated */

/* Enable various audio drivers */

/*#define SDL_AUDIO_DRIVER_DUMMY	1 TODO: uncomment this later*/

/* Enable various input drivers */

/*#define SDL_JOYSTICK_DUMMY	1 TODO: uncomment this later*/

/* DS has no dynamic linking afaik */

/* Enable various threading systems */

/*#define SDL_THREAD_NDS	1*/

/* Enable various timer systems */

/* Enable various video drivers */

/* Enable system power support */

/* Enable haptic support */

/* _SDL_config_nintendods_h */


=== system/include/SDL/SDL_config_pandora.h ===
SHA256: e11c8c59ce89c350b8ad98cbdfa5abece2d068a36eb21b95f5cb96d34e7704d5
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/* This is a set of defines to configure the SDL features */

/* General platform specific identifiers */

/* _SDL_config_h */


=== system/include/SDL/SDL_config_windows.h ===
SHA256: 0ced4a8a345be288a9fd6d92dadab6d37f2f8ca05d2a07955188ffbcb8a3815d
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/* This is a set of defines to configure the SDL features */

/* Older Visual C++ headers don't have the Win64-compatible typedefs... */

/* !__GNUC__ && !_MSC_VER */

/* __GNUC__ || _MSC_VER */

/* !_STDINT_H_ && !HAVE_STDINT_H */

/* Enabled for SDL 1.2 (binary compatibility) */

//#define HAVE_LIBC     1

/* Useful headers */

/* C library functions */

/* Enable various audio drivers */

/* Enable various input drivers */

/* Enable various shared object loading systems */

/* Enable various threading systems */

/* Enable various timer systems */

/* Enable various video drivers */

/* Enable OpenGL support */

/* Enable system power support */

/* Enable assembly routines (Win64 doesn't have inline asm) */

/* _SDL_config_windows_h */


=== system/include/SDL/SDL_config_wiz.h ===
SHA256: 7e19cd9a7e69d310a3805337dd494588dae5de9eb4db036b3c857a41c6845a16
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/* This is a set of defines to configure the SDL features */

/* General platform specific identifiers */

/* _SDL_config_h */


=== system/include/SDL/SDL_copying.h ===
SHA256: 78a79ebcbe99ee5726bdd26de8b58e806932cd9760204f2d747376a4696277d5
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/


=== system/include/SDL/SDL_cpuinfo.h ===
SHA256: 86498d2fcda05930c9e1363ddeea7a7f9dab40d682fb3eec03028c4e14f86db4
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_cpuinfo.h
 *  
 *  CPU feature detection for SDL.
 */

/* Need to do this here because intrin.h has C++ code in it */

/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* This is a guess for the cacheline size used for padding.
 * Most x86 processors have a 64 byte cache line.
 * The 64-bit PowerPC processors have a 128 byte cache line.
 * We'll use the larger value to be generally safe.
 */

/**
 *  This function returns the number of CPU cores available.
 */

/**
 *  This function returns the L1 cache line size of the CPU
 *
 *  This is useful for determining multi-threaded structure padding
 *  or SIMD prefetch sizes.
 */

/**
 *  This function returns true if the CPU has the RDTSC instruction.
 */

/**
 *  This function returns true if the CPU has AltiVec features.
 */

/**
 *  This function returns true if the CPU has MMX features.
 */

/**
 *  This function returns true if the CPU has 3DNow! features.
 */

/**
 *  This function returns true if the CPU has SSE features.
 */

/**
 *  This function returns true if the CPU has SSE2 features.
 */

/**
 *  This function returns true if the CPU has SSE3 features.
 */

/**
 *  This function returns true if the CPU has SSE4.1 features.
 */

/**
 *  This function returns true if the CPU has SSE4.2 features.
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_cpuinfo_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_endian.h ===
SHA256: 5688c93a4c5dee278e475efc624826de89b4ddcbb8b78369ad1401ab21688b03
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_endian.h
 *  
 *  Functions for reading and writing endian-specific values
 */

/**
 *  \name The two types of endianness
 */

/*@{*/

/*@}*/

/* Not defined in SDL_config.h? */

/* __linux __ */

/* __linux __ */

/* !SDL_BYTEORDER */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 *  \file SDL_endian.h
 *  
 *  Uses inline functions for compilers that support them, and static
 *  functions for those that do not.  Because these functions become
 *  static for compilers that do not support inline functions, this
 *  header should only be included in files that actually use them.
 */

/* broken gcc version */

/* Separate into high and low 32-bit values and swap them */

/**
 *  \name Swap to native
 *  Byteswap item from the specified endianness to the native endianness.
 */

/*@{*/

/*@}*/

/*Swap to native*/

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_endian_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_error.h ===
SHA256: 0b443c9213bb41b2b4683cf04214f00f457344f03d16832cd991a537b9eadcc3
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_error.h
 *  
 *  Simple error message routines for SDL.
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* Public functions */

/**
 *  \name Internal error functions
 *  
 *  \internal 
 *  Private error reporting function - used internally.
 */

/*@{*/

/*@}*/

/*Internal error functions*/

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_error_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_events.h ===
SHA256: 699d8cee5cb431948ba74df8f24a8ed0f3a333605f66497e5dcfc22b0c9c1cda
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  Portions of these headers taken from SDL2 (where noted)
  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_events.h
 *  
 *  Include file for SDL event handling.
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* General keyboard/mouse state definitions */

/**
 * \brief The types of events that can be delivered.
 */

/**< Unused (do not remove) */

/* Application events */

/**< User-requested quit */

/* Window events */

/**< Window state change */

/**< System specific event */

/* Keyboard events */

/**< Key pressed */

/**< Key released */

/**< Keyboard text editing (composition) */

/**< Keyboard text input */

/* Mouse events */

/**< Mouse moved */

/**< Mouse button pressed */

/**< Mouse button released */

/**< Mouse wheel motion */

/* Tablet or multiple mice input device events */

/**< Input moved */

/**< Input button pressed */

/**< Input button released */

/**< Input wheel motion */

/**< Input pen entered proximity */

/**< Input pen left proximity */

/* Joystick events */

/**< Joystick axis motion */

/**< Joystick trackball motion */

/**< Joystick hat position change */

/**< Joystick button pressed */

/**< Joystick button released */

/* Touch events */

/* Gesture events */

/* Clipboard events */

/**< The clipboard changed */

/* Obsolete events */

/**< SDL 1.2 events for compatibility */

/** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
     *  and should be allocated with SDL_RegisterEvents()
     */

/**
     *  This last event is only for bounding internal arrays
     */

/**
 *  \brief Window state change event data (event.window.*)
 */

/**< ::SDL_WINDOWEVENT */

/**< The associated window */

/**< ::SDL_WindowEventID */

/**< event dependent data */

/**< event dependent data */

/**
 *  \brief Keyboard button event structure (event.key.*)
 */

/**< ::SDL_KEYDOWN or ::SDL_KEYUP */

/**< The window with keyboard focus, if any */

/**< ::SDL_PRESSED or ::SDL_RELEASED */

/**< Non-zero if this is a key repeat */

/**< The key that was pressed or released */

/**
 *  \brief Keyboard text editing event structure (event.edit.*)
 */

/**< ::SDL_TEXTEDITING */

/**< The window with keyboard focus, if any */

/**< The editing text */

/**< The start cursor of selected editing text */

/**< The length of selected editing text */

/**
 *  \brief Keyboard text input event structure (event.text.*)
 */

/**< ::SDL_TEXTINPUT */

/**< The window with keyboard focus, if any */

/**< The input text */

/**
 *  \brief Mouse motion event structure (event.motion.*)
 */

/*================================= IMPORTANT ================================
   The version of SDL_MouseMotionEvent that comes in these (emscripten)
   headers is taken from the finalized version of SDL2
  ============================================================================*/

/**< ::SDL_MOUSEMOTION */

/**< The window with mouse focus, if any */

/**< The mouse instance id, or SDL_TOUCH_MOUSEID */

/**< The current button state */

/**< X coordinate, relative to window */

/**< Y coordinate, relative to window */

/**< The relative motion in the X direction */

/**< The relative motion in the Y direction */

/**
 *  \brief Mouse button event structure (event.button.*)
 */

/*================================= IMPORTANT ================================
   The version of SDL_MouseButtonEvent that comes in these (emscripten)
   headers is taken from the finalized version of SDL2
  ============================================================================*/

/**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */

/**< The window with mouse focus, if any */

/**< The mouse instance id, or SDL_TOUCH_MOUSEID */

/**< The mouse button index */

/**< ::SDL_PRESSED or ::SDL_RELEASED */

/**< X coordinate, relative to window */

/**< Y coordinate, relative to window */

/**
 *  \brief Mouse wheel event structure (event.wheel.*)
 */

/**< ::SDL_MOUSEWHEEL */

/**< The window with mouse focus, if any */

/**< The mouse instance id, or SDL_TOUCH_MOUSEID */

/**< The amount scrolled horizontally */

/**< The amount scrolled vertically */

/**
 *  \brief Joystick axis motion event structure (event.jaxis.*)
 */

/**< ::SDL_JOYAXISMOTION */

/**< The joystick device index */

/**< The joystick axis index */

/**< The axis value (range: -32768 to 32767) */

/**
 *  \brief Joystick trackball motion event structure (event.jball.*)
 */

/**< ::SDL_JOYBALLMOTION */

/**< The joystick device index */

/**< The joystick trackball index */

/**< The relative motion in the X direction */

/**< The relative motion in the Y direction */

/**
 *  \brief Joystick hat position change event structure (event.jhat.*)
 */

/**< ::SDL_JOYHATMOTION */

/**< The joystick device index */

/**< The joystick hat index */

/**< The hat position value.
                         *   \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP
                         *   \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT
                         *   \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN
                         *   
                         *   Note that zero means the POV is centered.
                         */

/**
 *  \brief Joystick button event structure (event.jbutton.*)
 */

/**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */

/**< The joystick device index */

/**< The joystick button index */

/**< ::SDL_PRESSED or ::SDL_RELEASED */

/**
 *  \brief Touch finger motion/finger event structure (event.tfinger.*)
 */

/*================================= IMPORTANT ================================
   The version of SDL_TouchFingerEvent that comes in these (emscripten)
   headers is taken from the finalized version of SDL2
  ============================================================================*/

/**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */

/**< The touch device id */

/**< Normalized in the range 0...1 */

/**< Normalized in the range 0...1 */

/**< Normalized in the range 0...1 */

/**< Normalized in the range 0...1 */

/**< Normalized in the range 0...1 */

/**
 *  \brief Touch finger motion/finger event structure (event.tmotion.*)
 */

/**< ::SDL_TOUCHBUTTONUP OR SDL_TOUCHBUTTONDOWN */

/**< The window with mouse focus, if any */

/**< The touch device index */

/**< The current button state */

/**< The button changing state */

/**
 *  \brief Multiple Finger Gesture Event (event.mgesture.*)
 */

/**< ::SDL_MULTIGESTURE */

/**< The window with mouse focus, if any */

/**< The touch device index */

//currently 0...1. Change to screen coords?

/* (event.dgesture.*) */

/**< ::SDL_DOLLARGESTURE */

/**< The window with mouse focus, if any */

/**< The touch device index */

/*
    //TODO: Enable to give location?
    float x;  //currently 0...1. Change to screen coords?
    float y;  
  */

/**
 *  \brief The "quit requested" event
 */

/**< ::SDL_QUIT */

/**
 *  \brief A user-defined event type (event.user.*)
 */

/**< ::SDL_USEREVENT through ::SDL_NUMEVENTS-1 */

/**< The associated window if any */

/**< User defined event code */

/**< User defined data pointer */

/**< User defined data pointer */

/**
 *  \brief A video driver dependent system event (event.syswm.*)
 *  
 *  \note If you want to use this event, you should include SDL_syswm.h.
 */

/**< ::SDL_SYSWMEVENT */

/**< driver dependent data, defined in SDL_syswm.h */

/**
 *  \addtogroup Compatibility 
 */

/*@{*/

/**
 *  \name Typedefs for backwards compatibility
 */

/*@{*/

/*@}*/

/*@}*/

/*Compatibility*/

/**
 *  \brief General event structure
 */

/**< Event type, shared with all events */

/**< Window event data */

/**< Keyboard event data */

/**< Text editing event data */

/**< Text input event data */

/**< Mouse motion event data */

/**< Mouse button event data */

/**< Mouse wheel event data */

/**< Joystick axis event data */

/**< Joystick ball event data */

/**< Joystick hat event data */

/**< Joystick button event data */

/**< Quit request event data */

/**< Custom event data */

/**< System dependent window event data */

/**< SDL2 Touch finger event data */

/**< Touch button event data */

/**< Multi Finger Gesture data */

/**< Multi Finger Gesture data */

/** Temporarily here for backwards compatibility */

/*@{*/

/*@}*/

/* Function prototypes */

/**
 *  Pumps the event loop, gathering events from the input devices.
 *  
 *  This function updates the event queue and internal input device state.
 *  
 *  This should only be run in the thread that sets the video mode.
 */

/*@{*/

/**
 *  Checks the event queue for messages and optionally returns them.
 *  
 *  If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to
 *  the back of the event queue.
 *  
 *  If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front
 *  of the event queue, within the specified minimum and maximum type,
 *  will be returned and will not be removed from the queue.
 *  
 *  If \c action is ::SDL_GETEVENT, up to \c numevents events at the front 
 *  of the event queue, within the specified minimum and maximum type,
 *  will be returned and will be removed from the queue.
 *  
 *  \return The number of events actually stored, or -1 if there was an error.
 *  
 *  This function is thread-safe.
 */

/*@}*/

/**
 *  Checks to see if certain event types are in the event queue.
 */

/**
 *  This function clears events from the event queue
 */

/**
 *  \brief Polls for currently pending events.
 *  
 *  \return 1 if there are any pending events, or 0 if there are none available.
 *  
 *  \param event If not NULL, the next event is removed from the queue and 
 *               stored in that area.
 */

/**
 *  \brief Waits indefinitely for the next available event.
 *  
 *  \return 1, or 0 if there was an error while waiting for events.
 *   
 *  \param event If not NULL, the next event is removed from the queue and 
 *               stored in that area.
 */

/**
 *  \brief Waits until the specified timeout (in milliseconds) for the next 
 *         available event.
 *  
 *  \return 1, or 0 if there was an error while waiting for events.
 *  
 *  \param event If not NULL, the next event is removed from the queue and 
 *               stored in that area.
 */

/**
 *  \brief Add an event to the event queue.
 *  
 *  \return 1 on success, 0 if the event was filtered, or -1 if the event queue 
 *          was full or there was some other error.
 */

/**
 *  Sets up a filter to process all events before they change internal state and
 *  are posted to the internal event queue.
 *  
 *  The filter is protypted as:
 *  \code
 *      int SDL_EventFilter(void *userdata, SDL_Event * event);
 *  \endcode
 *
 *  If the filter returns 1, then the event will be added to the internal queue.
 *  If it returns 0, then the event will be dropped from the queue, but the 
 *  internal state will still be updated.  This allows selective filtering of
 *  dynamically arriving events.
 *  
 *  \warning  Be very careful of what you do in the event filter function, as 
 *            it may run in a different thread!
 *  
 *  There is one caveat when dealing with the ::SDL_QUITEVENT event type.  The
 *  event filter is only called when the window manager desires to close the
 *  application window.  If the event filter returns 1, then the window will
 *  be closed, otherwise the window will remain open if possible.
 *
 *  If the quit event is generated by an interrupt signal, it will bypass the
 *  internal queue and be delivered to the application at the next event poll.
 */

/**
 *  Return the current event filter - can be used to "chain" filters.
 *  If there is no event filter set, this function returns SDL_FALSE.
 */

/**
 *  Add a function which is called when an event is added to the queue.
 */

/**
 *  Remove an event watch function added with SDL_AddEventWatch()
 */

/**
 *  Run the filter function on the current event queue, removing any
 *  events for which the filter returns 0.
 */

/**
 *  An Emscripten-specific extension to SDL: Some browser APIs require that they are called from within an event handler function.
 *  Allow recording a callback that will be called for each received event. This is used in place of SDL_PollEvent.
 *  Your application will be called whenever there are events available.
 */

/*@{*/

/**
 *  This function allows you to set the state of processing certain events.
 *   - If \c state is set to ::SDL_IGNORE, that event will be automatically 
 *     dropped from the event queue and will not event be filtered.
 *   - If \c state is set to ::SDL_ENABLE, that event will be processed 
 *     normally.
 *   - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the 
 *     current processing state of the specified event.
 */

/*@}*/

/**
 *  This function allocates a set of user-defined events, and returns
 *  the beginning event number for that set of events.
 *
 *  If there aren't enough user-defined events left, this function
 *  returns (Uint32)-1
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_events_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_gesture.h ===
SHA256: 11da618901e19c051362b58b1abf86d41edb72aca8b6a9c03da5900892ddad60
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_gesture.h
 *  
 *  Include file for SDL gesture event handling.
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* Function prototypes */

/**
 *  \brief Begin Recording a gesture on the specified touch, or all touches (-1)
 *
 *
 */

/**
 *  \brief Save all currently loaded Dollar Gesture templates
 *
 *
 */

/**
 *  \brief Save a currently loaded Dollar Gesture template
 *
 *
 */

/**
 *  \brief Load Dollar Gesture templates from a file
 *
 *
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_gesture_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_gfxPrimitives.h ===
SHA256: a1b6bac17877ed1a52419f0787c8c60622b66129340041c13d44c44af7a30971
/* 

SDL_gfxPrimitives.h: graphics primitives for SDL

Copyright (C) 2001-2011  Andreas Schiffler

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

   1. The origin of this software must not be misrepresented; you must not
   claim that you wrote the original software. If you use this software
   in a product, an acknowledgment in the product documentation would be
   appreciated but is not required.

   2. Altered source versions must be plainly marked as such, and must not be
   misrepresented as being the original software.

   3. This notice may not be removed or altered from any source
   distribution.

Andreas Schiffler -- aschiffler at ferzkopp dot net

*/

/* Set up for C function definitions, even when using C++ */

/* ----- Versioning */

/* ---- Function Prototypes */

/* Note: all ___Color routines expect the color to be in format 0xRRGGBBAA */

/* Pixel */

/* Horizontal line */

/* Vertical line */

/* Rectangle */

/* Rounded-Corner Rectangle */

/* Filled rectangle (Box) */

/* Rounded-Corner Filled rectangle (Box) */

/* Line */

/* AA Line */

/* Thick Line */

/* Circle */

/* Arc */

/* AA Circle */

/* Filled Circle */

/* Ellipse */

/* AA Ellipse */

/* Filled Ellipse */

/* Pie */

/* Filled Pie */

/* Trigon */

/* AA-Trigon */

/* Filled Trigon */

/* Polygon */

/* AA-Polygon */

/* Filled Polygon */

/* (Note: These MT versions are required for multi-threaded operation.) */

/* Bezier */

/* Characters/Strings */

/* Ends C function definitions when using C++ */

/* _SDL_gfxPrimitives_h */


=== system/include/SDL/SDL_haptic.h ===
SHA256: 89af6d8e041cea42435bdd36534c74f3113481ac3485f6022d89985300eb6547
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_haptic.h
 *  
 *  \brief The SDL Haptic subsystem allows you to control haptic (force feedback)
 *         devices.
 * 
 *  The basic usage is as follows:
 *   - Initialize the Subsystem (::SDL_INIT_HAPTIC).
 *   - Open a Haptic Device.
 *    - SDL_HapticOpen() to open from index.
 *    - SDL_HapticOpenFromJoystick() to open from an existing joystick.
 *   - Create an effect (::SDL_HapticEffect).
 *   - Upload the effect with SDL_HapticNewEffect().
 *   - Run the effect with SDL_HapticRunEffect().
 *   - (optional) Free the effect with SDL_HapticDestroyEffect().
 *   - Close the haptic device with SDL_HapticClose().
 *
 * \par Simple rumble example:
 * \code
 *    SDL_Haptic *haptic;
 *
 *    // Open the device
 *    haptic = SDL_HapticOpen( 0 );
 *    if (haptic == NULL)
 *       return -1;
 *
 *    // Initialize simple rumble
 *    if (SDL_HapticRumbleInit( haptic ) != 0)
 *       return -1;
 *
 *    // Play effect at 50% strength for 2 seconds
 *    if (SDL_HapticRumblePlay( haptic, 0.5, 2000 ) != 0)
 *       return -1;
 *    SDL_Delay( 2000 );
 *
 *    // Clean up
 *    SDL_HapticClose( haptic );
 * \endcode
 *
 * \par Complete example:
 * \code
 * int test_haptic( SDL_Joystick * joystick ) {
 *    SDL_Haptic *haptic;
 *    SDL_HapticEffect effect;
 *    int effect_id;
 *
 *    // Open the device
 *    haptic = SDL_HapticOpenFromJoystick( joystick );
 *    if (haptic == NULL) return -1; // Most likely joystick isn't haptic
 *
 *    // See if it can do sine waves
 *    if ((SDL_HapticQuery(haptic) & SDL_HAPTIC_SINE)==0) {
 *       SDL_HapticClose(haptic); // No sine effect
 *       return -1;
 *    }
 *
 *    // Create the effect
 *    memset( &effect, 0, sizeof(SDL_HapticEffect) ); // 0 is safe default
 *    effect.type = SDL_HAPTIC_SINE;
 *    effect.periodic.direction.type = SDL_HAPTIC_POLAR; // Polar coordinates
 *    effect.periodic.direction.dir[0] = 18000; // Force comes from south
 *    effect.periodic.period = 1000; // 1000 ms
 *    effect.periodic.magnitude = 20000; // 20000/32767 strength
 *    effect.periodic.length = 5000; // 5 seconds long
 *    effect.periodic.attack_length = 1000; // Takes 1 second to get max strength
 *    effect.periodic.fade_length = 1000; // Takes 1 second to fade away
 *
 *    // Upload the effect
 *    effect_id = SDL_HapticNewEffect( haptic, &effect );
 *
 *    // Test the effect
 *    SDL_HapticRunEffect( haptic, effect_id, 1 );
 *    SDL_Delay( 5000); // Wait for the effect to finish
 *
 *    // We destroy the effect, although closing the device also does this
 *    SDL_HapticDestroyEffect( haptic, effect_id );
 *
 *    // Close the device
 *    SDL_HapticClose(haptic);
 *
 *    return 0; // Success
 * }
 * \endcode
 *
 * You can also find out more information on my blog:
 * http://bobbens.dyndns.org/journal/2010/sdl_haptic/
 *
 * \author Edgar Simo Serra
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* __cplusplus */

/**
 *  \typedef SDL_Haptic
 *  
 *  \brief The haptic structure used to identify an SDL haptic.
 *  
 *  \sa SDL_HapticOpen
 *  \sa SDL_HapticOpenFromJoystick
 *  \sa SDL_HapticClose
 */

/**
 *  \name Haptic features
 *  
 *  Different haptic features a device can have.
 */

/*@{*/

/**
 *  \name Haptic effects
 */

/*@{*/

/**
 *  \brief Constant effect supported.
 *
 *  Constant haptic effect.
 *  
 *  \sa SDL_HapticCondition
 */

/**
 *  \brief Sine wave effect supported.
 *  
 *  Periodic haptic effect that simulates sine waves.
 *  
 *  \sa SDL_HapticPeriodic
 */

/**
 *  \brief Square wave effect supported.
 *  
 *  Periodic haptic effect that simulates square waves.
 * 
 *  \sa SDL_HapticPeriodic
 */

/**
 *  \brief Triangle wave effect supported.
 *  
 *  Periodic haptic effect that simulates triangular waves.
 *  
 *  \sa SDL_HapticPeriodic
 */

/**
 *  \brief Sawtoothup wave effect supported.
 *  
 *  Periodic haptic effect that simulates saw tooth up waves.
 *  
 *  \sa SDL_HapticPeriodic
 */

/**
 *  \brief Sawtoothdown wave effect supported.
 *  
 *  Periodic haptic effect that simulates saw tooth down waves.
 *  
 *  \sa SDL_HapticPeriodic
 */

/**
 *  \brief Ramp effect supported.
 *  
 *  Ramp haptic effect.
 *  
 *  \sa SDL_HapticRamp
 */

/**
 *  \brief Spring effect supported - uses axes position.
 *  
 *  Condition haptic effect that simulates a spring.  Effect is based on the
 *  axes position.
 *
 *  \sa SDL_HapticCondition
 */

/**
 *  \brief Damper effect supported - uses axes velocity.
 *  
 *  Condition haptic effect that simulates dampening.  Effect is based on the
 *  axes velocity.
 *  
 *  \sa SDL_HapticCondition
 */

/**
 *  \brief Inertia effect supported - uses axes acceleration.
 *  
 *  Condition haptic effect that simulates inertia.  Effect is based on the axes
 *  acceleration.
 *
 *  \sa SDL_HapticCondition
 */

/**
 *  \brief Friction effect supported - uses axes movement.
 *  
 *  Condition haptic effect that simulates friction.  Effect is based on the 
 *  axes movement.
 *  
 *  \sa SDL_HapticCondition
 */

/**
 *  \brief Custom effect is supported.
 *  
 *  User defined custom haptic effect.
 */

/*@}*/

/*Haptic effects*/

/* These last few are features the device has, not effects */

/**
 *  \brief Device can set global gain.
 *  
 *  Device supports setting the global gain.
 *  
 *  \sa SDL_HapticSetGain
 */

/**
 *  \brief Device can set autocenter.
 *  
 *  Device supports setting autocenter.
 *  
 *  \sa SDL_HapticSetAutocenter
 */

/**
 *  \brief Device can be queried for effect status.
 *  
 *  Device can be queried for effect status.
 *  
 *  \sa SDL_HapticGetEffectStatus
 */

/**
 *  \brief Device can be paused.
 *  
 *  \sa SDL_HapticPause
 *  \sa SDL_HapticUnpause
 */

/**
 * \name Direction encodings
 */

/*@{*/

/**
 *  \brief Uses polar coordinates for the direction.
 *  
 *  \sa SDL_HapticDirection
 */

/**
 *  \brief Uses cartesian coordinates for the direction.
 *  
 *  \sa SDL_HapticDirection
 */

/**
 *  \brief Uses spherical coordinates for the direction.
 *  
 *  \sa SDL_HapticDirection
 */

/*@}*/

/*Direction encodings*/

/*@}*/

/*Haptic features*/

/*
 * Misc defines.
 */

/**
 * \brief Used to play a device an infinite number of times.
 *
 * \sa SDL_HapticRunEffect
 */

/**
 *  \brief Structure that represents a haptic direction.
 *  
 *  Directions can be specified by:
 *   - ::SDL_HAPTIC_POLAR : Specified by polar coordinates.
 *   - ::SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates.
 *   - ::SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates.
 *
 *  Cardinal directions of the haptic device are relative to the positioning
 *  of the device.  North is considered to be away from the user.
 *
 *  The following diagram represents the cardinal directions:
 *  \verbatim
                 .--.
                 |__| .-------.
                 |=.| |.-----.|
                 |--| ||     ||
                 |  | |'-----'|
                 |__|~')_____('
                   [ COMPUTER ]
    
    
                     North (0,-1)
                         ^
                         |
                         |
    (1,0)  West <----[ HAPTIC ]----> East (-1,0)
                         |
                         |
                         v
                      South (0,1)
    
    
                      [ USER ]
                        \|||/
                        (o o)
                  ---ooO-(_)-Ooo---
    \endverbatim
 *  
 *  If type is ::SDL_HAPTIC_POLAR, direction is encoded by hundredths of a 
 *  degree starting north and turning clockwise.  ::SDL_HAPTIC_POLAR only uses
 *  the first \c dir parameter.  The cardinal directions would be:
 *   - North: 0 (0 degrees)
 *   - East: 9000 (90 degrees)
 *   - South: 18000 (180 degrees)
 *   - West: 27000 (270 degrees)
 *  
 *  If type is ::SDL_HAPTIC_CARTESIAN, direction is encoded by three positions
 *  (X axis, Y axis and Z axis (with 3 axes)).  ::SDL_HAPTIC_CARTESIAN uses
 *  the first three \c dir parameters.  The cardinal directions would be:
 *   - North:  0,-1, 0
 *   - East:  -1, 0, 0
 *   - South:  0, 1, 0
 *   - West:   1, 0, 0
 *  
 *  The Z axis represents the height of the effect if supported, otherwise
 *  it's unused.  In cartesian encoding (1, 2) would be the same as (2, 4), you
 *  can use any multiple you want, only the direction matters.
 *  
 *  If type is ::SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations.
 *  The first two \c dir parameters are used.  The \c dir parameters are as 
 *  follows (all values are in hundredths of degrees):
 *   - Degrees from (1, 0) rotated towards (0, 1).
 *   - Degrees towards (0, 0, 1) (device needs at least 3 axes).
 *
 *
 *  Example of force coming from the south with all encodings (force coming
 *  from the south means the user will have to pull the stick to counteract):
 *  \code
 *  SDL_HapticDirection direction;
 *  
 *  // Cartesian directions
 *  direction.type = SDL_HAPTIC_CARTESIAN; // Using cartesian direction encoding.
 *  direction.dir[0] = 0; // X position
 *  direction.dir[1] = 1; // Y position
 *  // Assuming the device has 2 axes, we don't need to specify third parameter.
 *  
 *  // Polar directions
 *  direction.type = SDL_HAPTIC_POLAR; // We'll be using polar direction encoding.
 *  direction.dir[0] = 18000; // Polar only uses first parameter
 *  
 *  // Spherical coordinates
 *  direction.type = SDL_HAPTIC_SPHERICAL; // Spherical encoding
 *  direction.dir[0] = 9000; // Since we only have two axes we don't need more parameters.
 *  \endcode
 *
 *  \sa SDL_HAPTIC_POLAR
 *  \sa SDL_HAPTIC_CARTESIAN
 *  \sa SDL_HAPTIC_SPHERICAL
 *  \sa SDL_HapticEffect
 *  \sa SDL_HapticNumAxes
 */

/**< The type of encoding. */

/**< The encoded direction. */

/**
 *  \brief A structure containing a template for a Constant effect.
 *  
 *  The struct is exclusive to the ::SDL_HAPTIC_CONSTANT effect.
 *  
 *  A constant effect applies a constant force in the specified direction
 *  to the joystick.
 *  
 *  \sa SDL_HAPTIC_CONSTANT
 *  \sa SDL_HapticEffect
 */

/* Header */

/**< ::SDL_HAPTIC_CONSTANT */

/**< Direction of the effect. */

/* Replay */

/**< Duration of the effect. */

/**< Delay before starting the effect. */

/* Trigger */

/**< Button that triggers the effect. */

/**< How soon it can be triggered again after button. */

/* Constant */

/**< Strength of the constant effect. */

/* Envelope */

/**< Duration of the attack. */

/**< Level at the start of the attack. */

/**< Duration of the fade. */

/**< Level at the end of the fade. */

/**
 *  \brief A structure containing a template for a Periodic effect.
 *  
 *  The struct handles the following effects:
 *   - ::SDL_HAPTIC_SINE
 *   - ::SDL_HAPTIC_SQUARE
 *   - ::SDL_HAPTIC_TRIANGLE
 *   - ::SDL_HAPTIC_SAWTOOTHUP
 *   - ::SDL_HAPTIC_SAWTOOTHDOWN
 *  
 *  A periodic effect consists in a wave-shaped effect that repeats itself
 *  over time.  The type determines the shape of the wave and the parameters
 *  determine the dimensions of the wave.
 *  
 *  Phase is given by hundredth of a cyle meaning that giving the phase a value
 *  of 9000 will displace it 25% of it's period.  Here are sample values:
 *   -     0: No phase displacement.
 *   -  9000: Displaced 25% of it's period.
 *   - 18000: Displaced 50% of it's period.
 *   - 27000: Displaced 75% of it's period.
 *   - 36000: Displaced 100% of it's period, same as 0, but 0 is preffered.
 *
 *  Examples:
 *  \verbatim
    SDL_HAPTIC_SINE
      __      __      __      __
     /  \    /  \    /  \    /
    /    \__/    \__/    \__/
    
    SDL_HAPTIC_SQUARE
     __    __    __    __    __
    |  |  |  |  |  |  |  |  |  |
    |  |__|  |__|  |__|  |__|  |
    
    SDL_HAPTIC_TRIANGLE
      /\    /\    /\    /\    /\
     /  \  /  \  /  \  /  \  /
    /    \/    \/    \/    \/
    
    SDL_HAPTIC_SAWTOOTHUP
      /|  /|  /|  /|  /|  /|  /|
     / | / | / | / | / | / | / |
    /  |/  |/  |/  |/  |/  |/  |
    
    SDL_HAPTIC_SAWTOOTHDOWN
    \  |\  |\  |\  |\  |\  |\  |
     \ | \ | \ | \ | \ | \ | \ |
      \|  \|  \|  \|  \|  \|  \|
    \endverbatim
 *  
 *  \sa SDL_HAPTIC_SINE
 *  \sa SDL_HAPTIC_SQUARE
 *  \sa SDL_HAPTIC_TRIANGLE
 *  \sa SDL_HAPTIC_SAWTOOTHUP
 *  \sa SDL_HAPTIC_SAWTOOTHDOWN
 *  \sa SDL_HapticEffect
 */

/* Header */

/**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_SQUARE,
                             ::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or
                             ::SDL_HAPTIC_SAWTOOTHDOWN */

/**< Direction of the effect. */

/* Replay */

/**< Duration of the effect. */

/**< Delay before starting the effect. */

/* Trigger */

/**< Button that triggers the effect. */

/**< How soon it can be triggered again after button. */

/* Periodic */

/**< Period of the wave. */

/**< Peak value. */

/**< Mean value of the wave. */

/**< Horizontal shift given by hundredth of a cycle. */

/* Envelope */

/**< Duration of the attack. */

/**< Level at the start of the attack. */

/**< Duration of the fade. */

/**< Level at the end of the fade. */

/**
 *  \brief A structure containing a template for a Condition effect.
 *  
 *  The struct handles the following effects:
 *   - ::SDL_HAPTIC_SPRING: Effect based on axes position.
 *   - ::SDL_HAPTIC_DAMPER: Effect based on axes velocity.
 *   - ::SDL_HAPTIC_INERTIA: Effect based on axes acceleration.
 *   - ::SDL_HAPTIC_FRICTION: Effect based on axes movement.
 *  
 *  Direction is handled by condition internals instead of a direction member.
 *  The condition effect specific members have three parameters.  The first
 *  refers to the X axis, the second refers to the Y axis and the third
 *  refers to the Z axis.  The right terms refer to the positive side of the
 *  axis and the left terms refer to the negative side of the axis.  Please 
 *  refer to the ::SDL_HapticDirection diagram for which side is positive and
 *  which is negative.
 *  
 *  \sa SDL_HapticDirection
 *  \sa SDL_HAPTIC_SPRING
 *  \sa SDL_HAPTIC_DAMPER
 *  \sa SDL_HAPTIC_INERTIA
 *  \sa SDL_HAPTIC_FRICTION
 *  \sa SDL_HapticEffect
 */

/* Header */

/**< ::SDL_HAPTIC_SPRING, ::SDL_HAPTIC_DAMPER,
                                 ::SDL_HAPTIC_INERTIA or ::SDL_HAPTIC_FRICTION */

/**< Direction of the effect - Not used ATM. */

/* Replay */

/**< Duration of the effect. */

/**< Delay before starting the effect. */

/* Trigger */

/**< Button that triggers the effect. */

/**< How soon it can be triggered again after button. */

/* Condition */

/**< Level when joystick is to the positive side. */

/**< Level when joystick is to the negative side. */

/**< How fast to increase the force towards the positive side. */

/**< How fast to increase the force towards the negative side. */

/**< Size of the dead zone. */

/**< Position of the dead zone. */

/**
 *  \brief A structure containing a template for a Ramp effect.
 *  
 *  This struct is exclusively for the ::SDL_HAPTIC_RAMP effect.
 *  
 *  The ramp effect starts at start strength and ends at end strength.
 *  It augments in linear fashion.  If you use attack and fade with a ramp
 *  they effects get added to the ramp effect making the effect become
 *  quadratic instead of linear.
 *  
 *  \sa SDL_HAPTIC_RAMP
 *  \sa SDL_HapticEffect
 */

/* Header */

/**< ::SDL_HAPTIC_RAMP */

/**< Direction of the effect. */

/* Replay */

/**< Duration of the effect. */

/**< Delay before starting the effect. */

/* Trigger */

/**< Button that triggers the effect. */

/**< How soon it can be triggered again after button. */

/* Ramp */

/**< Beginning strength level. */

/**< Ending strength level. */

/* Envelope */

/**< Duration of the attack. */

/**< Level at the start of the attack. */

/**< Duration of the fade. */

/**< Level at the end of the fade. */

/**
 *  \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect.
 *  
 *  A custom force feedback effect is much like a periodic effect, where the
 *  application can define it's exact shape.  You will have to allocate the
 *  data yourself.  Data should consist of channels * samples Uint16 samples.
 *  
 *  If channels is one, the effect is rotated using the defined direction.
 *  Otherwise it uses the samples in data for the different axes.
 *  
 *  \sa SDL_HAPTIC_CUSTOM
 *  \sa SDL_HapticEffect
 */

/* Header */

/**< ::SDL_HAPTIC_CUSTOM */

/**< Direction of the effect. */

/* Replay */

/**< Duration of the effect. */

/**< Delay before starting the effect. */

/* Trigger */

/**< Button that triggers the effect. */

/**< How soon it can be triggered again after button. */

/* Custom */

/**< Axes to use, minimum of one. */

/**< Sample periods. */

/**< Amount of samples. */

/**< Should contain channels*samples items. */

/* Envelope */

/**< Duration of the attack. */

/**< Level at the start of the attack. */

/**< Duration of the fade. */

/**< Level at the end of the fade. */

/**
 *  \brief The generic template for any haptic effect.
 *  
 *  All values max at 32767 (0x7FFF).  Signed values also can be negative.
 *  Time values unless specified otherwise are in milliseconds.
 *  
 *  You can also pass ::SDL_HAPTIC_INFINITY to length instead of a 0-32767 
 *  value.  Neither delay, interval, attack_length nor fade_length support 
 *  ::SDL_HAPTIC_INFINITY.  Fade will also not be used since effect never ends.
 *  
 *  Additionally, the ::SDL_HAPTIC_RAMP effect does not support a duration of
 *  ::SDL_HAPTIC_INFINITY.
 *  
 *  Button triggers may not be supported on all devices, it is advised to not
 *  use them if possible.  Buttons start at index 1 instead of index 0 like
 *  they joystick.
 *  
 *  If both attack_length and fade_level are 0, the envelope is not used,
 *  otherwise both values are used.
 *  
 *  Common parts:
 *  \code
 *  // Replay - All effects have this
 *  Uint32 length;        // Duration of effect (ms).
 *  Uint16 delay;         // Delay before starting effect.
 *  
 *  // Trigger - All effects have this
 *  Uint16 button;        // Button that triggers effect.
 *  Uint16 interval;      // How soon before effect can be triggered again.
 *  
 *  // Envelope - All effects except condition effects have this
 *  Uint16 attack_length; // Duration of the attack (ms).
 *  Uint16 attack_level;  // Level at the start of the attack.
 *  Uint16 fade_length;   // Duration of the fade out (ms).
 *  Uint16 fade_level;    // Level at the end of the fade.
 *  \endcode
 *
 *
 *  Here we have an example of a constant effect evolution in time:
 *  \verbatim
    Strength
    ^
    |
    |    effect level -->  _________________
    |                     /                 \
    |                    /                   \
    |                   /                     \
    |                  /                       \ 
    | attack_level --> |                        \
    |                  |                        |  <---  fade_level
    |
    +--------------------------------------------------> Time
                       [--]                 [---]
                       attack_length        fade_length
    
    [------------------][-----------------------]
    delay               length
    \endverbatim
 *  
 *  Note either the attack_level or the fade_level may be above the actual
 *  effect level.
 *
 *  \sa SDL_HapticConstant
 *  \sa SDL_HapticPeriodic
 *  \sa SDL_HapticCondition
 *  \sa SDL_HapticRamp
 *  \sa SDL_HapticCustom
 */

/* Common for all force feedback effects */

/**< Effect type. */

/**< Constant effect. */

/**< Periodic effect. */

/**< Condition effect. */

/**< Ramp effect. */

/**< Custom effect. */

/* Function prototypes */

/**
 *  \brief Count the number of joysticks attached to the system.
 *  
 *  \return Number of haptic devices detected on the system.
 */

/**
 *  \brief Get the implementation dependent name of a Haptic device.
 *  
 *  This can be called before any joysticks are opened.
 *  If no name can be found, this function returns NULL.
 *  
 *  \param device_index Index of the device to get it's name.
 *  \return Name of the device or NULL on error.
 *
 *  \sa SDL_NumHaptics
 */

/**
 *  \brief Opens a Haptic device for usage.
 *  
 *  The index passed as an argument refers to the N'th Haptic device on this 
 *  system.
 *
 *  When opening a haptic device, it's gain will be set to maximum and
 *  autocenter will be disabled.  To modify these values use
 *  SDL_HapticSetGain() and SDL_HapticSetAutocenter().
 *
 *  \param device_index Index of the device to open.
 *  \return Device identifier or NULL on error.
 *
 *  \sa SDL_HapticIndex
 *  \sa SDL_HapticOpenFromMouse
 *  \sa SDL_HapticOpenFromJoystick
 *  \sa SDL_HapticClose
 *  \sa SDL_HapticSetGain
 *  \sa SDL_HapticSetAutocenter
 *  \sa SDL_HapticPause
 *  \sa SDL_HapticStopAll
 */

/**
 *  \brief Checks if the haptic device at index has been opened.
 *  
 *  \param device_index Index to check to see if it has been opened.
 *  \return 1 if it has been opened or 0 if it hasn't.
 *  
 *  \sa SDL_HapticOpen
 *  \sa SDL_HapticIndex
 */

/**
 *  \brief Gets the index of a haptic device.
 *  
 *  \param haptic Haptic device to get the index of.
 *  \return The index of the haptic device or -1 on error.
 *  
 *  \sa SDL_HapticOpen
 *  \sa SDL_HapticOpened
 */

/**
 *  \brief Gets whether or not the current mouse has haptic capabilities.
 *  
 *  \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't.
 *  
 *  \sa SDL_HapticOpenFromMouse
 */

/**
 *  \brief Tries to open a haptic device from the current mouse.
 *  
 *  \return The haptic device identifier or NULL on error.
 *  
 *  \sa SDL_MouseIsHaptic
 *  \sa SDL_HapticOpen
 */

/**
 *  \brief Checks to see if a joystick has haptic features.
 *  
 *  \param joystick Joystick to test for haptic capabilities.
 *  \return 1 if the joystick is haptic, 0 if it isn't
 *          or -1 if an error ocurred.
 *  
 *  \sa SDL_HapticOpenFromJoystick
 */

/**
 *  \brief Opens a Haptic device for usage from a Joystick device.
 *  
 *  You must still close the haptic device seperately.  It will not be closed 
 *  with the joystick.
 *  
 *  When opening from a joystick you should first close the haptic device before
 *  closing the joystick device.  If not, on some implementations the haptic
 *  device will also get unallocated and you'll be unable to use force feedback
 *  on that device.
 *  
 *  \param joystick Joystick to create a haptic device from.
 *  \return A valid haptic device identifier on success or NULL on error.
 *  
 *  \sa SDL_HapticOpen
 *  \sa SDL_HapticClose
 */

/**
 *  \brief Closes a Haptic device previously opened with SDL_HapticOpen().
 *  
 *  \param haptic Haptic device to close.
 */

/**
 *  \brief Returns the number of effects a haptic device can store.
 *  
 *  On some platforms this isn't fully supported, and therefore is an
 *  aproximation.  Always check to see if your created effect was actually
 *  created and do not rely solely on SDL_HapticNumEffects().
 *  
 *  \param haptic The haptic device to query effect max.
 *  \return The number of effects the haptic device can store or
 *          -1 on error.
 *  
 *  \sa SDL_HapticNumEffectsPlaying
 *  \sa SDL_HapticQuery
 */

/**
 *  \brief Returns the number of effects a haptic device can play at the same 
 *         time.
 *  
 *  This is not supported on all platforms, but will always return a value.  
 *  Added here for the sake of completness.
 *  
 *  \param haptic The haptic device to query maximum playing effects.
 *  \return The number of effects the haptic device can play at the same time
 *          or -1 on error.
 *
 *  \sa SDL_HapticNumEffects
 *  \sa SDL_HapticQuery
 */

/**
 *  \brief Gets the haptic devices supported features in bitwise matter.
 *  
 *  Example: 
 *  \code
 *  if (SDL_HapticQueryEffects(haptic) & SDL_HAPTIC_CONSTANT) {
 *      printf("We have constant haptic effect!");
 *  }
 *  \endcode
 *  
 *  \param haptic The haptic device to query.
 *  \return Haptic features in bitwise manner (OR'd).
 *  
 *  \sa SDL_HapticNumEffects
 *  \sa SDL_HapticEffectSupported
 */

/**
 *  \brief Gets the number of haptic axes the device has.
 *  
 *  \sa SDL_HapticDirection
 */

/**
 *  \brief Checks to see if effect is supported by haptic.
 *  
 *  \param haptic Haptic device to check on.
 *  \param effect Effect to check to see if it is supported.
 *  \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error.
 *  
 *  \sa SDL_HapticQuery
 *  \sa SDL_HapticNewEffect
 */

/**
 *  \brief Creates a new haptic effect on the device.
 *  
 *  \param haptic Haptic device to create the effect on.
 *  \param effect Properties of the effect to create.
 *  \return The id of the effect on success or -1 on error.
 *  
 *  \sa SDL_HapticUpdateEffect
 *  \sa SDL_HapticRunEffect
 *  \sa SDL_HapticDestroyEffect
 */

/**
 *  \brief Updates the properties of an effect.
 *  
 *  Can be used dynamically, although behaviour when dynamically changing
 *  direction may be strange.  Specifically the effect may reupload itself
 *  and start playing from the start.  You cannot change the type either when
 *  running SDL_HapticUpdateEffect().
 *  
 *  \param haptic Haptic device that has the effect.
 *  \param effect Effect to update.
 *  \param data New effect properties to use.
 *  \return The id of the effect on success or -1 on error.
 *  
 *  \sa SDL_HapticNewEffect
 *  \sa SDL_HapticRunEffect
 *  \sa SDL_HapticDestroyEffect
 */

/**
 *  \brief Runs the haptic effect on it's assosciated haptic device.
 *  
 *  If iterations are ::SDL_HAPTIC_INFINITY, it'll run the effect over and over
 *  repeating the envelope (attack and fade) every time.  If you only want the
 *  effect to last forever, set ::SDL_HAPTIC_INFINITY in the effect's length
 *  parameter.
 *  
 *  \param haptic Haptic device to run the effect on.
 *  \param effect Identifier of the haptic effect to run.
 *  \param iterations Number of iterations to run the effect. Use
 *         ::SDL_HAPTIC_INFINITY for infinity.
 *  \return 0 on success or -1 on error.
 *  
 *  \sa SDL_HapticStopEffect
 *  \sa SDL_HapticDestroyEffect
 *  \sa SDL_HapticGetEffectStatus
 */

/**
 *  \brief Stops the haptic effect on it's assosciated haptic device.
 *  
 *  \param haptic Haptic device to stop the effect on.
 *  \param effect Identifier of the effect to stop.
 *  \return 0 on success or -1 on error.
 *  
 *  \sa SDL_HapticRunEffect
 *  \sa SDL_HapticDestroyEffect
 */

/**
 *  \brief Destroys a haptic effect on the device.
 *  
 *  This will stop the effect if it's running.  Effects are automatically 
 *  destroyed when the device is closed.
 *  
 *  \param haptic Device to destroy the effect on.
 *  \param effect Identifier of the effect to destroy.
 *  
 *  \sa SDL_HapticNewEffect
 */

/**
 *  \brief Gets the status of the current effect on the haptic device.
 *  
 *  Device must support the ::SDL_HAPTIC_STATUS feature.
 *  
 *  \param haptic Haptic device to query the effect status on.
 *  \param effect Identifier of the effect to query it's status.
 *  \return 0 if it isn't playing, ::SDL_HAPTIC_PLAYING if it is playing
 *          or -1 on error.
 *  
 *  \sa SDL_HapticRunEffect
 *  \sa SDL_HapticStopEffect
 */

/**
 *  \brief Sets the global gain of the device.
 *  
 *  Device must support the ::SDL_HAPTIC_GAIN feature.
 *  
 *  The user may specify the maxmimum gain by setting the environment variable
 *  ::SDL_HAPTIC_GAIN_MAX which should be between 0 and 100.  All calls to
 *  SDL_HapticSetGain() will scale linearly using ::SDL_HAPTIC_GAIN_MAX as the
 *  maximum.
 *  
 *  \param haptic Haptic device to set the gain on.
 *  \param gain Value to set the gain to, should be between 0 and 100.
 *  \return 0 on success or -1 on error.
 *  
 *  \sa SDL_HapticQuery
 */

/**
 *  \brief Sets the global autocenter of the device.
 *  
 *  Autocenter should be between 0 and 100.  Setting it to 0 will disable 
 *  autocentering.
 *
 *  Device must support the ::SDL_HAPTIC_AUTOCENTER feature.
 *
 *  \param haptic Haptic device to set autocentering on.
 *  \param autocenter Value to set autocenter to, 0 disables autocentering.
 *  \return 0 on success or -1 on error.
 *  
 *  \sa SDL_HapticQuery
 */

/**
 *  \brief Pauses a haptic device.
 *  
 *  Device must support the ::SDL_HAPTIC_PAUSE feature.  Call 
 *  SDL_HapticUnpause() to resume playback.
 *  
 *  Do not modify the effects nor add new ones while the device is paused.
 *  That can cause all sorts of weird errors.
 *  
 *  \param haptic Haptic device to pause.
 *  \return 0 on success or -1 on error.
 *  
 *  \sa SDL_HapticUnpause
 */

/**
 *  \brief Unpauses a haptic device.
 *  
 *  Call to unpause after SDL_HapticPause().
 *  
 *  \param haptic Haptic device to pause.
 *  \return 0 on success or -1 on error.
 *  
 *  \sa SDL_HapticPause
 */

/**
 *  \brief Stops all the currently playing effects on a haptic device.
 *  
 *  \param haptic Haptic device to stop.
 *  \return 0 on success or -1 on error.
 */

/**
 *  \brief Checks to see if rumble is supported on a haptic device..
 *
 *  \param haptic Haptic device to check to see if it supports rumble.
 *  \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error.
 *
 *  \sa SDL_HapticRumbleInit
 *  \sa SDL_HapticRumblePlay
 *  \sa SDL_HapticRumbleStop
 */

/**
 *  \brief Initializes the haptic device for simple rumble playback.
 *
 *  \param haptic Haptic device to initialize for simple rumble playback.
 *  \return 0 on success or -1 on error.
 *
 *  \sa SDL_HapticOpen
 *  \sa SDL_HapticRumbleSupported
 *  \sa SDL_HapticRumblePlay
 *  \sa SDL_HapticRumbleStop
 */

/**
 *  \brief Runs simple rumble on a haptic device
 *
 *  \param haptic Haptic device to play rumble effect on.
 *  \param strength Strength of the rumble to play as a 0-1 float value.
 *  \param length Length of the rumble to play in miliseconds.
 *  \return 0 on success or -1 on error.
 *
 *  \sa SDL_HapticRumbleSupported
 *  \sa SDL_HapticRumbleInit
 *  \sa SDL_HapticRumbleStop
 */

/**
 *  \brief Stops the simple rumble on a haptic device.
 *
 *  \param haptic Haptic to stop the rumble on.
 *  \return 0 on success or -1 on error.
 *
 *  \sa SDL_HapticRumbleSupported
 *  \sa SDL_HapticRumbleInit
 *  \sa SDL_HapticRumblePlay
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_haptic_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_hints.h ===
SHA256: e14e4a039c9075beeb97f2458b45b42970b25fd2d54a2dd85867a01f24b01596
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_hints.h
 *  
 *  Official documentation for SDL configuration variables
 *
 *  This file contains functions to set and get configuration hints,
 *  as well as listing each of them alphabetically.
 *
 *  The convention for naming hints is SDL_HINT_X, where "SDL_X" is
 *  the environment variable that can be used to override the default.
 *
 *  In general these hints are just that - they may or may not be
 *  supported or applicable on any given platform, but they provide
 *  a way for an application or user to give the library a hint as
 *  to how they would like the library to work.
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 *  \brief  A variable controlling how 3D acceleration is used to accelerate the SDL 1.2 screen surface. 
 *
 *  SDL can try to accelerate the SDL 1.2 screen surface by using streaming
 *  textures with a 3D rendering engine.  This variable controls whether and
 *  how this is done.
 *
 *  This variable can be set to the following values:
 *    "0"       - Disable 3D acceleration
 *    "1"       - Enable 3D acceleration, using the default renderer.
 *    "X"       - Enable 3D acceleration, using X where X is one of the valid rendering drivers.  (e.g. "direct3d", "opengl", etc.)
 *
 *  By default SDL tries to make a best guess for each platform whether
 *  to use acceleration or not.
 */

/**
 *  \brief  A variable specifying which render driver to use.
 *
 *  If the application doesn't pick a specific renderer to use, this variable
 *  specifies the name of the preferred renderer.  If the preferred renderer
 *  can't be initialized, the normal default renderer is used.
 *
 *  This variable is case insensitive and can be set to the following values:
 *    "direct3d"
 *    "opengl"
 *    "opengles2"
 *    "opengles"
 *    "software"
 *
 *  The default varies by platform, but it's the first one in the list that
 *  is available on the current platform.
 */

/**
 *  \brief  A variable controlling whether the OpenGL render driver uses shaders if they are available.
 *
 *  This variable can be set to the following values:
 *    "0"       - Disable shaders
 *    "1"       - Enable shaders
 *
 *  By default shaders are used if OpenGL supports them.
 */

/**
 *  \brief  A variable controlling the scaling quality
 *
 *  This variable can be set to the following values:
 *    "0" or "nearest" - Nearest pixel sampling
 *    "1" or "linear"  - Linear filtering (supported by OpenGL and Direct3D)
 *    "2" or "best"    - Anisotropic filtering (supported by Direct3D)
 *
 *  By default nearest pixel sampling is used
 */

/**
 *  \brief  A variable controlling whether updates to the SDL 1.2 screen surface should be synchronized with the vertical refresh, to avoid tearing.
 *
 *  This variable can be set to the following values:
 *    "0"       - Disable vsync
 *    "1"       - Enable vsync
 *
 *  By default SDL does not sync screen surface updates with vertical refresh.
 */

/**
 *  \brief  A variable controlling whether the idle timer is disabled on iOS.
 *
 *  When an iOS app does not receive touches for some time, the screen is
 *  dimmed automatically. For games where the accelerometer is the only input
 *  this is problematic. This functionality can be disabled by setting this
 *  hint.
 *
 *  This variable can be set to the following values:
 *    "0"       - Enable idle timer
 *    "1"       - Disable idle timer
 */

/**
 *  \brief  A variable controlling which orientations are allowed on iOS.
 *
 *  In some circumstances it is necessary to be able to explicitly control
 *  which UI orientations are allowed.
 *
 *  This variable is a space delimited list of the following values:
 *    "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown"
 */

/**
 *  \brief  An enumeration of hint priorities
 */

/**
 *  \brief Set a hint with a specific priority
 *
 *  The priority controls the behavior when setting a hint that already
 *  has a value.  Hints will replace existing hints of their priority and
 *  lower.  Environment variables are considered to have override priority.
 * 
 *  \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
 */

/**
 *  \brief Set a hint with normal priority
 * 
 *  \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
 */

/**
 *  \brief Get a hint
 *  
 *  \return The string value of a hint variable.
 */

/**
 *  \brief  Clear all hints
 *
 *  This function is called during SDL_Quit() to free stored hints.
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_hints_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_image.h ===
SHA256: c8fa78b3a6704034eb84d74c44c136a01595660876b1322fc04630e42c58909f
/*
  SDL_image:  An example image loading library for use with SDL
  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/* A simple library to load images of various formats as SDL surfaces */

/* Set up for C function definitions, even when using C++ */

/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
*/

/* This macro can be used to fill a version structure with the compile-time
 * version of the SDL_image library.
 */

/* This function gets the version of the dynamically linked SDL_image library.
   it should NOT be used to fill a version structure, instead you should
   use the SDL_IMAGE_VERSION() macro.
 */

/* Loads dynamic libraries and prepares them for use.  Flags should be
   one or more flags from IMG_InitFlags OR'd together.
   It returns the flags successfully initialized, or 0 on failure.
 */

/* Unloads libraries loaded with IMG_Init */

/* Load an image from an SDL data source.
   The 'type' may be one of: "BMP", "GIF", "PNG", etc.

   If the image format supports a transparent pixel, SDL will set the
   colorkey for the surface.  You can enable RLE acceleration on the
   surface afterwards by calling:
	SDL_SetColorKey(image, SDL_RLEACCEL, image->format->colorkey);
 */

/* Convenience functions */

/* Invert the alpha of a surface for use with OpenGL
   This function is now a no-op, and only provided for backwards compatibility.
*/

/* Functions to detect a file type, given a seekable source */

/* Individual loading functions */

/* We'll use SDL for reporting errors */

/* Ends C function definitions when using C++ */

/* _SDL_IMAGE_H */


=== system/include/SDL/SDL_input.h ===
SHA256: 16772839a05d85c14c63cc7211d206938fd070a2d3e43f3f01da110450959181
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_input.h
 *  
 *  Include file for lowlevel SDL input device handling.
 *
 *  This talks about individual devices, and not the system cursor. If you
 *  just want to know when the user moves the pointer somewhere in your
 *  window, this is NOT the API you want. This one handles things like
 *  multi-touch, drawing tablets, and multiple, separate mice.
 *
 *  The other API is in SDL_mouse.h
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* Function prototypes */

/* !!! FIXME: real documentation
 * - Redetect devices
 * - This invalidates all existing device information from previous queries!
 * - There is an implicit (re)detect upon SDL_Init().
 */

/**
 *  \brief Get the number of mouse input devices available.
 */

/**
 *  \brief Gets the name of a device with the given index.
 *  
 *  \param index is the index of the device, whose name is to be returned.
 *  
 *  \return the name of the device with the specified index
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_mouse_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_joystick.h ===
SHA256: ebea06aac68a2735b85733477a119e010ac7df34072a493e86b74093ee182230
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_joystick.h
 *  
 *  Include file for SDL joystick event handling
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 *  \file SDL_joystick.h
 *
 *  In order to use these functions, SDL_Init() must have been called
 *  with the ::SDL_INIT_JOYSTICK flag.  This causes SDL to scan the system
 *  for joysticks, and load appropriate drivers.
 */

/* The joystick structure used to identify an SDL joystick */

/* Function prototypes */

/**
 *  Count the number of joysticks attached to the system
 */

/**
 *  Get the implementation dependent name of a joystick.
 *  This can be called before any joysticks are opened.
 *  If no name can be found, this function returns NULL.
 */

/**
 *  Open a joystick for use.  
 *  The index passed as an argument refers tothe N'th joystick on the system.  
 *  This index is the value which will identify this joystick in future joystick
 *  events.
 *  
 *  \return A joystick identifier, or NULL if an error occurred.
 */

/**
 *  Returns 1 if the joystick has been opened, or 0 if it has not.
 */

/**
 *  Get the device index of an opened joystick.
 */

/**
 *  Get the number of general axis controls on a joystick.
 */

/**
 *  Get the number of trackballs on a joystick.
 *  
 *  Joystick trackballs have only relative motion events associated
 *  with them and their state cannot be polled.
 */

/**
 *  Get the number of POV hats on a joystick.
 */

/**
 *  Get the number of buttons on a joystick.
 */

/**
 *  Update the current state of the open joysticks.
 *  
 *  This is called automatically by the event loop if any joystick
 *  events are enabled.
 */

/**
 *  Enable/disable joystick event polling.
 *  
 *  If joystick events are disabled, you must call SDL_JoystickUpdate()
 *  yourself and check the state of the joystick when you want joystick
 *  information.
 *  
 *  The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE.
 */

/**
 *  Get the current state of an axis control on a joystick.
 *  
 *  The state is a value ranging from -32768 to 32767.
 *  
 *  The axis indices start at index 0.
 */

/**
 *  \name Hat positions
 */

/*@{*/

/*@}*/

/**
 *  Get the current state of a POV hat on a joystick.
 *
 *  The hat indices start at index 0.
 *  
 *  \return The return value is one of the following positions:
 *           - ::SDL_HAT_CENTERED
 *           - ::SDL_HAT_UP
 *           - ::SDL_HAT_RIGHT
 *           - ::SDL_HAT_DOWN
 *           - ::SDL_HAT_LEFT
 *           - ::SDL_HAT_RIGHTUP
 *           - ::SDL_HAT_RIGHTDOWN
 *           - ::SDL_HAT_LEFTUP
 *           - ::SDL_HAT_LEFTDOWN
 */

/**
 *  Get the ball axis change since the last poll.
 *  
 *  \return 0, or -1 if you passed it invalid parameters.
 *  
 *  The ball indices start at index 0.
 */

/**
 *  Get the current state of a button on a joystick.
 *  
 *  The button indices start at index 0.
 */

/**
 *  Close a joystick previously opened with SDL_JoystickOpen().
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_joystick_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_keyboard.h ===
SHA256: fa29f64d140362fd637427e429773b2adb41512bbd09cc51a39095d382fefc85
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_keyboard.h
 *  
 *  Include file for SDL keyboard event handling
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 *  \brief The SDL keysym structure, used in key events.
 */

/**< SDL physical key code - see ::SDL_Scancode for details */

/**< SDL virtual key code - see ::SDL_Keycode for details */

/**< current key modifiers */

/**< \deprecated use SDL_TextInputEvent instead */

/* Function prototypes */

/**
 *  \brief Get the window which currently has keyboard focus.
 */

/**
 *  \brief Get a snapshot of the current state of the keyboard.
 *  
 *  \param numkeys if non-NULL, receives the length of the returned array.
 *  
 *  \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values.
 *  
 *  \b Example:
 *  \code
 *  Uint8 *state = SDL_GetKeyboardState(NULL);
 *  if ( state[SDL_SCANCODE_RETURN] )   {
 *      printf("<RETURN> is pressed.\n");
 *  }
 *  \endcode
 */

/**
 *  \brief Get the current key modifier state for the keyboard.
 */

/**
 *  \brief Set the current key modifier state for the keyboard.
 *  
 *  \note This does not change the keyboard state, only the key modifier flags.
 */

/**
 *  \brief Get the key code corresponding to the given scancode according
 *         to the current keyboard layout.
 *  
 *  See ::SDL_Keycode for details.
 *  
 *  \sa SDL_GetKeyName()
 */

/**
 *  \brief Get the scancode corresponding to the given key code according to the
 *         current keyboard layout.
 *  
 *  See ::SDL_Scancode for details.
 *  
 *  \sa SDL_GetScancodeName()
 */

/**
 *  \brief Get a human-readable name for a scancode.
 *  
 *  \return A pointer to a UTF-8 string that stays valid at least until the next
 *          call to this function. If you need it around any longer, you must 
 *          copy it.  If the scancode doesn't have a name, this function returns
 *          an empty string ("").
 *
 *  \sa SDL_Scancode
 */

/**
 *  \brief Get a human-readable name for a key.
 *  
 *  \return A pointer to a UTF-8 string that stays valid at least until the next
 *          call to this function. If you need it around any longer, you must 
 *          copy it.  If the key doesn't have a name, this function returns an 
 *          empty string ("").
 *  
 *  \sa SDL_Key
 */

/**
 *  \brief Start accepting Unicode text input events.
 *  
 *  \sa SDL_StopTextInput()
 *  \sa SDL_SetTextInputRect()
 */

/**
 *  \brief Stop receiving any text input events.
 *  
 *  \sa SDL_StartTextInput()
 */

/**
 *  \brief Set the rectangle used to type Unicode text inputs.
 *  
 *  \sa SDL_StartTextInput()
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_keyboard_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_keycode.h ===
SHA256: 00acec67c0b7df295ea4c2047ecc9bfbe9faa7eac2b5eab8b4887deb045aca10
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_keycode.h
 *  
 *  Defines constants which identify keyboard keys and modifiers.
 */

/**
 *  \brief The SDL virtual key representation.
 *  
 *  Values of this type are used to represent keyboard keys using the current
 *  layout of the keyboard.  These values include Unicode values representing
 *  the unmodified character that would be generated by pressing the key, or
 *  an SDLK_* constant for those keys that do not generate characters.
 */

// XXX Emscripten: We use a mask of 10, which is closer to old SDL, and gives

//     a better chance of SDL 1.X apps working

/* 
       Skip uppercase letters
     */

/**
 * \brief Enumeration of valid key mods (possibly OR'd together).
 */

/* _SDL_keycode_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_loadso.h ===
SHA256: e366140ce62de85f80abb8d797e645cc02668d1f30de50e58e09a794c043530b
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_loadso.h
 *
 *  System dependent library loading routines
 *
 *  Some things to keep in mind:                                        
 *  \li These functions only work on C function names.  Other languages may
 *      have name mangling and intrinsic language support that varies from
 *      compiler to compiler.
 *  \li Make sure you declare your function pointers with the same calling
 *      convention as the actual library function.  Your code will crash
 *      mysteriously if you do not do this.
 *  \li Avoid namespace collisions.  If you load a symbol from the library,
 *      it is not defined whether or not it goes into the global symbol
 *      namespace for the application.  If it does and it conflicts with
 *      symbols in your code or other shared libraries, you will not get
 *      the results you expect. :)
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 *  This function dynamically loads a shared object and returns a pointer
 *  to the object handle (or NULL if there was an error).
 *  The 'sofile' parameter is a system dependent name of the object file.
 */

/**
 *  Given an object handle, this function looks up the address of the
 *  named function in the shared object and returns it.  This address
 *  is no longer valid after calling SDL_UnloadObject().
 */

/**
 *  Unload a shared object from memory.
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_loadso_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_log.h ===
SHA256: 3d1b266ad6d0ef9987066a6dbc0a8dd0991d1fa4eaa2bba6c55c78a951814f1a
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_log.h
 *  
 *  Simple log messages with categories and priorities.
 *
 *  By default logs are quiet, but if you're debugging SDL you might want:
 *
 *      SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
 *
 *  Here's where the messages go on different platforms:
 *      Windows: debug output stream
 *      Android: log output
 *      Others: standard error output (stderr)
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 *  \brief The maximum size of a log message
 *
 *  Messages longer than the maximum size will be truncated
 */

/**
 *  \brief The predefined log categories
 *
 *  By default the application category is enabled at the INFO level,
 *  and all other categories are enabled at the CRITICAL level.
 */

/* Reserved for future SDL library use */

/* Beyond this point is reserved for application use, e.g.
       enum {
           MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM,
           MYAPP_CATEGORY_AWESOME2,
           MYAPP_CATEGORY_AWESOME3,
           ...
       };
     */

/**
 *  \brief The predefined log priorities
 */

/**
 *  \brief Set the priority of all log categories
 */

/**
 *  \brief Set the priority of a particular log category
 */

/**
 *  \brief Set the priority of a particular log category
 */

/**
 *  \brief Reset all priorities to default.
 *
 *  \note This is called in SDL_Quit().
 */

/**
 *  \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO
 */

/**
 *  \brief Log a message with SDL_LOG_PRIORITY_VERBOSE
 */

/**
 *  \brief Log a message with SDL_LOG_PRIORITY_DEBUG
 */

/**
 *  \brief Log a message with SDL_LOG_PRIORITY_INFO
 */

/**
 *  \brief Log a message with SDL_LOG_PRIORITY_WARN
 */

/**
 *  \brief Log a message with SDL_LOG_PRIORITY_ERROR
 */

/**
 *  \brief Log a message with SDL_LOG_PRIORITY_CRITICAL
 */

/**
 *  \brief Log a message with the specified category and priority.
 */

/**
 *  \brief Log a message with the specified category and priority.
 */

/**
 *  \brief The prototype for the log output function
 */

/**
 *  \brief Get the current log output function.
 */

/**
 *  \brief This function allows you to replace the default log output
 *         function with one of your own.
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_log_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_main.h ===
SHA256: 4e44c0a94a0f43d8f68d93388d9784044b7f2754c19065b9f968aea9b04a5c0b
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_main.h
 *  
 *  Redefine main() on some platforms so that it is called by SDL.
 */

/* __cplusplus */

/**
 *  \file SDL_main.h
 *
 *  The application's main() function must be called with C linkage,
 *  and should be declared like this:
 *  \code
 *  #ifdef __cplusplus
 *  extern "C"
 *  #endif
 *  int main(int argc, char *argv[])
 *  {
 *  }
 *  \endcode
 */

/**
 *  The prototype for the application's main() function
 */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 *  This can be called to set the application class at startup
 */

/* __WIN32__ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_main_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_mixer.h ===
SHA256: 48eb65def52e22ceda78f0204d88db94760d5ba217ba84a171dafd6e96d2628f
/*
  SDL_mixer:  An audio mixer library based on the SDL library
  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/* $Id$ */

/* Set up for C function definitions, even when using C++ */

/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
*/

/* This macro can be used to fill a version structure with the compile-time
 * version of the SDL_mixer library.
 */

/* Backwards compatibility */

/* This function gets the version of the dynamically linked SDL_mixer library.
   it should NOT be used to fill a version structure, instead you should
   use the SDL_MIXER_VERSION() macro.
 */

/* Loads dynamic libraries and prepares them for use.  Flags should be
   one or more flags from MIX_InitFlags OR'd together.
   It returns the flags successfully initialized, or 0 on failure.
 */

/* Unloads libraries loaded with Mix_Init */

/* The default mixer has 8 simultaneous mixing channels */

/* Good default values for a PC soundcard */

/* Volume of a chunk */

/* The internal format for an audio chunk */

/* Per-sample volume, 0-128 */

/* The different fading types supported */

/* The internal format for a music chunk interpreted via mikmod */

/* Open the mixer with a certain audio format */

/* Dynamically change the number of channels managed by the mixer.
   If decreasing the number of channels, the upper channels are
   stopped.
   This function returns the new number of allocated channels.
 */

/* Find out what the actual audio device parameters are.
   This function returns 1 if the audio has been opened, 0 otherwise.
 */

/* Load a wave file or a music (.mod .s3m .it .xm) file */

/* Load a music file from an SDL_RWop object (Ogg and MikMod specific currently)
   Matt Campbell (matt@campbellhome.dhs.org) April 2000 */

/* Load a music file from an SDL_RWop object assuming a specific format */

/* Load a wave file of the mixer format from a memory buffer */

/* Load raw audio data of the mixer format from a memory buffer */

/* Free an audio chunk previously loaded */

/* Get a list of chunk/music decoders that this build of SDL_mixer provides.
   This list can change between builds AND runs of the program, if external
   libraries that add functionality become available.
   You must successfully call Mix_OpenAudio() before calling these functions.
   This API is only available in SDL_mixer 1.2.9 and later.

   // usage...
   int i;
   const int total = Mix_GetNumChunkDecoders();
   for (i = 0; i < total; i++)
       printf("Supported chunk decoder: [%s]\n", Mix_GetChunkDecoder(i));

   Appearing in this list doesn't promise your specific audio file will
   decode...but it's handy to know if you have, say, a functioning Timidity
   install.

   These return values are static, read-only data; do not modify or free it.
   The pointers remain valid until you call Mix_CloseAudio().
*/

/* Find out the music format of a mixer music, or the currently playing
   music, if 'music' is NULL.
*/

/* Set a function that is called after all mixing is performed.
   This can be used to provide real-time visual display of the audio stream
   or add a custom mixer filter for the stream data.
*/

/* Add your own music player or additional mixer function.
   If 'mix_func' is NULL, the default music player is re-enabled.
 */

/* Add your own callback when the music has finished playing.
   This callback is only called if the music finishes naturally.
 */

/* Get a pointer to the user data for the current music hook */

/*
 * Add your own callback when a channel has finished playing. NULL
 *  to disable callback. The callback may be called from the mixer's audio 
 *  callback or it could be called as a result of Mix_HaltChannel(), etc.
 *  do not call SDL_LockAudio() from this callback; you will either be 
 *  inside the audio callback, or SDL_mixer will explicitly lock the audio
 *  before calling your callback.
 */

/* Special Effects API by ryan c. gordon. (icculus@icculus.org) */

/* This is the format of a special effect callback:
 *
 *   myeffect(int chan, void *stream, int len, void *udata);
 *
 * (chan) is the channel number that your effect is affecting. (stream) is
 *  the buffer of data to work upon. (len) is the size of (stream), and
 *  (udata) is a user-defined bit of data, which you pass as the last arg of
 *  Mix_RegisterEffect(), and is passed back unmolested to your callback.
 *  Your effect changes the contents of (stream) based on whatever parameters
 *  are significant, or just leaves it be, if you prefer. You can do whatever
 *  you like to the buffer, though, and it will continue in its changed state
 *  down the mixing pipeline, through any other effect functions, then finally
 *  to be mixed with the rest of the channels and music for the final output
 *  stream.
 *
 * DO NOT EVER call SDL_LockAudio() from your callback function!
 */

/*
 * This is a callback that signifies that a channel has finished all its
 *  loops and has completed playback. This gets called if the buffer
 *  plays out normally, or if you call Mix_HaltChannel(), implicitly stop
 *  a channel via Mix_AllocateChannels(), or unregister a callback while
 *  it's still playing.
 *
 * DO NOT EVER call SDL_LockAudio() from your callback function!
 */

/* Register a special effect function. At mixing time, the channel data is
 *  copied into a buffer and passed through each registered effect function.
 *  After it passes through all the functions, it is mixed into the final
 *  output stream. The copy to buffer is performed once, then each effect
 *  function performs on the output of the previous effect. Understand that
 *  this extra copy to a buffer is not performed if there are no effects
 *  registered for a given chunk, which saves CPU cycles, and any given
 *  effect will be extra cycles, too, so it is crucial that your code run
 *  fast. Also note that the data that your function is given is in the
 *  format of the sound device, and not the format you gave to Mix_OpenAudio(),
 *  although they may in reality be the same. This is an unfortunate but
 *  necessary speed concern. Use Mix_QuerySpec() to determine if you can
 *  handle the data before you register your effect, and take appropriate
 *  actions.
 * You may also specify a callback (Mix_EffectDone_t) that is called when
 *  the channel finishes playing. This gives you a more fine-grained control
 *  than Mix_ChannelFinished(), in case you need to free effect-specific
 *  resources, etc. If you don't need this, you can specify NULL.
 * You may set the callbacks before or after calling Mix_PlayChannel().
 * Things like Mix_SetPanning() are just internal special effect functions,
 *  so if you are using that, you've already incurred the overhead of a copy
 *  to a separate buffer, and that these effects will be in the queue with
 *  any functions you've registered. The list of registered effects for a
 *  channel is reset when a chunk finishes playing, so you need to explicitly
 *  set them with each call to Mix_PlayChannel*().
 * You may also register a special effect function that is to be run after
 *  final mixing occurs. The rules for these callbacks are identical to those
 *  in Mix_RegisterEffect, but they are run after all the channels and the
 *  music have been mixed into a single stream, whereas channel-specific
 *  effects run on a given channel before any other mixing occurs. These
 *  global effect callbacks are call "posteffects". Posteffects only have
 *  their Mix_EffectDone_t function called when they are unregistered (since
 *  the main output stream is never "done" in the same sense as a channel).
 *  You must unregister them manually when you've had enough. Your callback
 *  will be told that the channel being mixed is (MIX_CHANNEL_POST) if the
 *  processing is considered a posteffect.
 *
 * After all these effects have finished processing, the callback registered
 *  through Mix_SetPostMix() runs, and then the stream goes to the audio
 *  device. 
 *
 * DO NOT EVER call SDL_LockAudio() from your callback function!
 *
 * returns zero if error (no such channel), nonzero if added.
 *  Error messages can be retrieved from Mix_GetError().
 */

/* You may not need to call this explicitly, unless you need to stop an
 *  effect from processing in the middle of a chunk's playback.
 * Posteffects are never implicitly unregistered as they are for channels,
 *  but they may be explicitly unregistered through this function by
 *  specifying MIX_CHANNEL_POST for a channel.
 * returns zero if error (no such channel or effect), nonzero if removed.
 *  Error messages can be retrieved from Mix_GetError().
 */

/* You may not need to call this explicitly, unless you need to stop all
 *  effects from processing in the middle of a chunk's playback. Note that
 *  this will also shut off some internal effect processing, since
 *  Mix_SetPanning() and others may use this API under the hood. This is
 *  called internally when a channel completes playback.
 * Posteffects are never implicitly unregistered as they are for channels,
 *  but they may be explicitly unregistered through this function by
 *  specifying MIX_CHANNEL_POST for a channel.
 * returns zero if error (no such channel), nonzero if all effects removed.
 *  Error messages can be retrieved from Mix_GetError().
 */

/*
 * These are the internally-defined mixing effects. They use the same API that
 *  effects defined in the application use, but are provided here as a
 *  convenience. Some effects can reduce their quality or use more memory in
 *  the name of speed; to enable this, make sure the environment variable
 *  MIX_EFFECTSMAXSPEED (see above) is defined before you call
 *  Mix_OpenAudio().
 */

/* Set the panning of a channel. The left and right channels are specified
 *  as integers between 0 and 255, quietest to loudest, respectively.
 *
 * Technically, this is just individual volume control for a sample with
 *  two (stereo) channels, so it can be used for more than just panning.
 *  If you want real panning, call it like this:
 *
 *   Mix_SetPanning(channel, left, 255 - left);
 *
 * ...which isn't so hard.
 *
 * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
 *  the panning will be done to the final mixed stream before passing it on
 *  to the audio device.
 *
 * This uses the Mix_RegisterEffect() API internally, and returns without
 *  registering the effect function if the audio device is not configured
 *  for stereo output. Setting both (left) and (right) to 255 causes this
 *  effect to be unregistered, since that is the data's normal state.
 *
 * returns zero if error (no such channel or Mix_RegisterEffect() fails),
 *  nonzero if panning effect enabled. Note that an audio device in mono
 *  mode is a no-op, but this call will return successful in that case.
 *  Error messages can be retrieved from Mix_GetError().
 */

/* Set the position of a channel. (angle) is an integer from 0 to 360, that
 *  specifies the location of the sound in relation to the listener. (angle)
 *  will be reduced as neccesary (540 becomes 180 degrees, -100 becomes 260).
 *  Angle 0 is due north, and rotates clockwise as the value increases.
 *  For efficiency, the precision of this effect may be limited (angles 1
 *  through 7 might all produce the same effect, 8 through 15 are equal, etc).
 *  (distance) is an integer between 0 and 255 that specifies the space
 *  between the sound and the listener. The larger the number, the further
 *  away the sound is. Using 255 does not guarantee that the channel will be
 *  culled from the mixing process or be completely silent. For efficiency,
 *  the precision of this effect may be limited (distance 0 through 5 might
 *  all produce the same effect, 6 through 10 are equal, etc). Setting (angle)
 *  and (distance) to 0 unregisters this effect, since the data would be
 *  unchanged.
 *
 * If you need more precise positional audio, consider using OpenAL for
 *  spatialized effects instead of SDL_mixer. This is only meant to be a
 *  basic effect for simple "3D" games.
 *
 * If the audio device is configured for mono output, then you won't get
 *  any effectiveness from the angle; however, distance attenuation on the
 *  channel will still occur. While this effect will function with stereo
 *  voices, it makes more sense to use voices with only one channel of sound,
 *  so when they are mixed through this effect, the positioning will sound
 *  correct. You can convert them to mono through SDL before giving them to
 *  the mixer in the first place if you like.
 *
 * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
 *  the positioning will be done to the final mixed stream before passing it
 *  on to the audio device.
 *
 * This is a convenience wrapper over Mix_SetDistance() and Mix_SetPanning().
 *
 * returns zero if error (no such channel or Mix_RegisterEffect() fails),
 *  nonzero if position effect is enabled.
 *  Error messages can be retrieved from Mix_GetError().
 */

/* Set the "distance" of a channel. (distance) is an integer from 0 to 255
 *  that specifies the location of the sound in relation to the listener.
 *  Distance 0 is overlapping the listener, and 255 is as far away as possible
 *  A distance of 255 does not guarantee silence; in such a case, you might
 *  want to try changing the chunk's volume, or just cull the sample from the
 *  mixing process with Mix_HaltChannel().
 * For efficiency, the precision of this effect may be limited (distances 1
 *  through 7 might all produce the same effect, 8 through 15 are equal, etc).
 *  (distance) is an integer between 0 and 255 that specifies the space
 *  between the sound and the listener. The larger the number, the further
 *  away the sound is.
 * Setting (distance) to 0 unregisters this effect, since the data would be
 *  unchanged.
 * If you need more precise positional audio, consider using OpenAL for
 *  spatialized effects instead of SDL_mixer. This is only meant to be a
 *  basic effect for simple "3D" games.
 *
 * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
 *  the distance attenuation will be done to the final mixed stream before
 *  passing it on to the audio device.
 *
 * This uses the Mix_RegisterEffect() API internally.
 *
 * returns zero if error (no such channel or Mix_RegisterEffect() fails),
 *  nonzero if position effect is enabled.
 *  Error messages can be retrieved from Mix_GetError().
 */

/*
 * !!! FIXME : Haven't implemented, since the effect goes past the
 *              end of the sound buffer. Will have to think about this.
 *               --ryan.
 */

/* Causes an echo effect to be mixed into a sound. (echo) is the amount
 *  of echo to mix. 0 is no echo, 255 is infinite (and probably not
 *  what you want).
 *
 * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
 *  the reverbing will be done to the final mixed stream before passing it on
 *  to the audio device.
 *
 * This uses the Mix_RegisterEffect() API internally. If you specify an echo
 *  of zero, the effect is unregistered, as the data is already in that state.
 *
 * returns zero if error (no such channel or Mix_RegisterEffect() fails),
 *  nonzero if reversing effect is enabled.
 *  Error messages can be retrieved from Mix_GetError().
 */

/* Causes a channel to reverse its stereo. This is handy if the user has his
 *  speakers hooked up backwards, or you would like to have a minor bit of
 *  psychedelia in your sound code.  :)  Calling this function with (flip)
 *  set to non-zero reverses the chunks's usual channels. If (flip) is zero,
 *  the effect is unregistered.
 *
 * This uses the Mix_RegisterEffect() API internally, and thus is probably
 *  more CPU intensive than having the user just plug in his speakers
 *  correctly. Mix_SetReverseStereo() returns without registering the effect
 *  function if the audio device is not configured for stereo output.
 *
 * If you specify MIX_CHANNEL_POST for (channel), then this the effect is used
 *  on the final mixed stream before sending it on to the audio device (a
 *  posteffect).
 *
 * returns zero if error (no such channel or Mix_RegisterEffect() fails),
 *  nonzero if reversing effect is enabled. Note that an audio device in mono
 *  mode is a no-op, but this call will return successful in that case.
 *  Error messages can be retrieved from Mix_GetError().
 */

/* end of effects API. --ryan. */

/* Reserve the first channels (0 -> n-1) for the application, i.e. don't allocate
   them dynamically to the next sample if requested with a -1 value below.
   Returns the number of reserved channels.
 */

/* Channel grouping functions */

/* Attach a tag to a channel. A tag can be assigned to several mixer
   channels, to form groups of channels.
   If 'tag' is -1, the tag is removed (actually -1 is the tag used to
   represent the group of all the channels).
   Returns true if everything was OK.
 */

/* Assign several consecutive channels to a group */

/* Finds the first available channel in a group of channels,
   returning -1 if none are available.
 */

/* Returns the number of channels in a group. This is also a subtle
   way to get the total number of channels when 'tag' is -1
 */

/* Finds the "oldest" sample playing in a group of channels */

/* Finds the "most recent" (i.e. last) sample playing in a group of channels */

/* Play an audio chunk on a specific channel.
   If the specified channel is -1, play on the first free channel.
   If 'loops' is greater than zero, loop the sound that many times.
   If 'loops' is -1, loop inifinitely (~65000 times).
   Returns which channel was used to play the sound.
*/

/* The same as above, but the sound is played at most 'ticks' milliseconds */

/* Fade in music or a channel over "ms" milliseconds, same semantics as the "Play" functions */

/* Set the volume in the range of 0-128 of a specific channel or chunk.
   If the specified channel is -1, set volume for all channels.
   Returns the original volume.
   If the specified volume is -1, just return the current volume.
*/

/* Halt playing of a particular channel */

/* Change the expiration delay for a particular channel.
   The sample will stop playing after the 'ticks' milliseconds have elapsed,
   or remove the expiration if 'ticks' is -1
*/

/* Halt a channel, fading it out progressively till it's silent
   The ms parameter indicates the number of milliseconds the fading
   will take.
 */

/* Query the fading status of a channel */

/* Pause/Resume a particular channel */

/* Pause/Resume the music stream */

/* Set the current position in the music stream.
   This returns 0 if successful, or -1 if it failed or isn't implemented.
   This function is only implemented for MOD music formats (set pattern
   order number) and for OGG, FLAC, MP3_MAD, and MODPLUG music (set 
   position in seconds), at the moment.
*/

/* Check the status of a specific channel.
   If the specified channel is -1, check all channels.
*/

/* Stop music and set external music playback command */

/* Synchro value is set by MikMod from modules while playing */

/* Set/Get/Iterate SoundFonts paths to use by supported MIDI backends */

/* Get the Mix_Chunk currently associated with a mixer channel
    Returns NULL if it's an invalid channel, or there's no chunk associated.
*/

/* Close the mixer, halting all playing audio */

/* We'll use SDL for reporting errors */

/* Ends C function definitions when using C++ */

/* _SDL_MIXER_H */


=== system/include/SDL/SDL_mouse.h ===
SHA256: 032ca03787e93e5767cf3261025c7d22230d970307b683b93aae20afd517e686
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_mouse.h
 *  
 *  Include file for SDL mouse event handling.
 *
 *  Please note that this ONLY discusses "mice" with the notion of the
 *  desktop GUI. You (usually) have one system cursor, and the OS hides
 *  the hardware details from you. If you plug in 10 mice, all ten move that
 *  one cursor. For many applications and games, this is perfect, and this
 *  API has served hundreds of SDL programs well since its birth.
 *
 *  It's not the whole picture, though. If you want more lowlevel control,
 *  SDL offers a different API, that gives you visibility into each input
 *  device, multi-touch interfaces, etc.
 *
 *  Those two APIs are incompatible, and you usually should not use both
 *  at the same time. But for legacy purposes, this API refers to a "mouse"
 *  when it actually means the system pointer and not a physical mouse.
 *
 *  The other API is in SDL_input.h
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* Implementation dependent */

/* Function prototypes */

/**
 *  \brief Get the window which currently has mouse focus.
 */

/**
 *  \brief Retrieve the current state of the mouse.
 *  
 *  The current button state is returned as a button bitmask, which can
 *  be tested using the SDL_BUTTON(X) macros, and x and y are set to the
 *  mouse cursor position relative to the focus window for the currently
 *  selected mouse.  You can pass NULL for either x or y.
 */

/**
 *  \brief Retrieve the relative state of the mouse.
 *
 *  The current button state is returned as a button bitmask, which can
 *  be tested using the SDL_BUTTON(X) macros, and x and y are set to the
 *  mouse deltas since the last call to SDL_GetRelativeMouseState().
 */

/**
 *  \brief Moves the mouse to the given position within the window.
 *  
 *  \param window The window to move the mouse into, or NULL for the current mouse focus
 *  \param x The x coordinate within the window
 *  \param y The y coordinate within the window
 *  
 *  \note This function generates a mouse motion event
 */

/**
 *  \brief Set relative mouse mode.
 *  
 *  \param enabled Whether or not to enable relative mode
 *
 *  \return 0 on success, or -1 if relative mode is not supported.
 *  
 *  While the mouse is in relative mode, the cursor is hidden, and the
 *  driver will try to report continuous motion in the current window.
 *  Only relative motion events will be delivered, the mouse position
 *  will not change.
 *  
 *  \note This function will flush any pending mouse motion.
 *  
 *  \sa SDL_GetRelativeMouseMode()
 */

/**
 *  \brief Query whether relative mouse mode is enabled.
 *  
 *  \sa SDL_SetRelativeMouseMode()
 */

/**
 *  \brief Create a cursor, using the specified bitmap data and
 *         mask (in MSB format).
 *  
 *  The cursor width must be a multiple of 8 bits.
 *  
 *  The cursor is created in black and white according to the following:
 *  <table>
 *  <tr><td> data </td><td> mask </td><td> resulting pixel on screen </td></tr>
 *  <tr><td>  0   </td><td>  1   </td><td> White </td></tr>
 *  <tr><td>  1   </td><td>  1   </td><td> Black </td></tr>
 *  <tr><td>  0   </td><td>  0   </td><td> Transparent </td></tr>
 *  <tr><td>  1   </td><td>  0   </td><td> Inverted color if possible, black 
 *                                         if not. </td></tr>
 *  </table>
 *  
 *  \sa SDL_FreeCursor()
 */

/**
 *  \brief Create a color cursor.
 *  
 *  \sa SDL_FreeCursor()
 */

/**
 *  \brief Set the active cursor.
 */

/**
 *  \brief Return the active cursor.
 */

/**
 *  \brief Frees a cursor created with SDL_CreateCursor().
 *  
 *  \sa SDL_CreateCursor()
 */

/**
 *  \brief Toggle whether or not the cursor is shown.
 *  
 *  \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current 
 *                state.
 *  
 *  \return 1 if the cursor is shown, or 0 if the cursor is hidden.
 */

/**
 *  Used as a mask when testing buttons in buttonstate.
 *   - Button 1:  Left mouse button
 *   - Button 2:  Middle mouse button
 *   - Button 3:  Right mouse button
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_mouse_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_mutex.h ===
SHA256: 48d280bb62aca090ce90dc5060e626a2f21dea5d8fca47b7e7e0a96c8b3dbe0a
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_mutex.h
 *  
 *  Functions to provide thread synchronization primitives.
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 *  Synchronization functions which can time out return this value
 *  if they time out.
 */

/**
 *  This is the timeout value which corresponds to never time out.
 */

/**
 *  \name Mutex functions
 */

/*@{*/

/* The SDL mutex structure, defined in SDL_mutex.c */

/**
 *  Create a mutex, initialized unlocked.
 */

/**
 *  Lock the mutex.
 *  
 *  \return 0, or -1 on error.
 */

/**
 *  Unlock the mutex.
 *  
 *  \return 0, or -1 on error.
 *  
 *  \warning It is an error to unlock a mutex that has not been locked by
 *           the current thread, and doing so results in undefined behavior.
 */

/** 
 *  Destroy a mutex.
 */

/*@}*/

/*Mutex functions*/

/**
 *  \name Semaphore functions
 */

/*@{*/

/* The SDL semaphore structure, defined in SDL_sem.c */

/**
 *  Create a semaphore, initialized with value, returns NULL on failure.
 */

/**
 *  Destroy a semaphore.
 */

/**
 *  This function suspends the calling thread until the semaphore pointed 
 *  to by \c sem has a positive count. It then atomically decreases the 
 *  semaphore count.
 */

/**
 *  Non-blocking variant of SDL_SemWait().
 *  
 *  \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait would 
 *          block, and -1 on error.
 */

/**
 *  Variant of SDL_SemWait() with a timeout in milliseconds.
 *  
 *  \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait does not 
 *          succeed in the allotted time, and -1 on error.
 *  
 *  \warning On some platforms this function is implemented by looping with a 
 *           delay of 1 ms, and so should be avoided if possible.
 */

/**
 *  Atomically increases the semaphore's count (not blocking).
 *  
 *  \return 0, or -1 on error.
 */

/**
 *  Returns the current count of the semaphore.
 */

/*@}*/

/*Semaphore functions*/

/**
 *  \name Condition variable functions
 */

/*@{*/

/* The SDL condition variable structure, defined in SDL_cond.c */

/**
 *  Create a condition variable.
 *
 *  Typical use of condition variables:
 *
 *  Thread A:
 *    SDL_LockMutex(lock);
 *    while ( ! condition ) {
 *        SDL_CondWait(cond, lock);
 *    }
 *    SDL_UnlockMutex(lock);
 *
 *  Thread B:
 *    SDL_LockMutex(lock);
 *    ...
 *    condition = true;
 *    ...
 *    SDL_CondSignal(cond);
 *    SDL_UnlockMutex(lock);
 *
 *  There is some discussion whether to signal the condition variable
 *  with the mutex locked or not.  There is some potential performance
 *  benefit to unlocking first on some platforms, but there are some
 *  potential race conditions depending on how your code is structured.
 *
 *  In general it's safer to signal the condition variable while the
 *  mutex is locked.
 */

/**
 *  Destroy a condition variable.
 */

/**
 *  Restart one of the threads that are waiting on the condition variable.
 *  
 *  \return 0 or -1 on error.
 */

/**
 *  Restart all threads that are waiting on the condition variable.
 *
 *  \return 0 or -1 on error.
 */

/**
 *  Wait on the condition variable, unlocking the provided mutex.
 *  
 *  \warning The mutex must be locked before entering this function!
 *  
 *  The mutex is re-locked once the condition variable is signaled.
 *  
 *  \return 0 when it is signaled, or -1 on error.
 */

/**
 *  Waits for at most \c ms milliseconds, and returns 0 if the condition
 *  variable is signaled, ::SDL_MUTEX_TIMEDOUT if the condition is not
 *  signaled in the allotted time, and -1 on error.
 *
 *  \warning On some platforms this function is implemented by looping with a 
 *           delay of 1 ms, and so should be avoided if possible.
 */

/*@}*/

/*Condition variable functions*/

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_mutex_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_name.h ===
SHA256: cf8a449f9611e4ec472aeb41ada4b1ffcdb79935a341f9a27bf35db16f7a3167
/* _SDLname_h_ */


=== system/include/SDL/SDL_opengl.h ===
SHA256: b6cdc9c700423762dba235f9771b6c3a712c016d83bf3475bc6d12437b9bf121
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_opengl.h
 *  
 *  This is a simple file to encapsulate the OpenGL API headers.
 */

/* XXX Emscripten */

/* Don't defined min() and max() */

/* Someone has already included glext.h */

/* Don't let gl.h include glext.h */

/* Header File For The OpenGL Library */

/* Header File For The OpenGL Library */

/**
 *  \file SDL_opengl.h
 *  
 *  This file is included because glext.h is not available on some systems.
 *  If you don't want this version included, simply define ::NO_SDL_GLEXT.
 *  
 *  The latest version is available from:
 *  	http://www.opengl.org/registry/
 */

/**
 *  \def NO_SDL_GLEXT
 *  
 *  Define this if you have your own version of glext.h and want to disable the 
 *  version included in SDL_opengl.h.
 */

/* *INDENT-OFF* */

/*
** Copyright (c) 2007-2010 The Khronos Group Inc.
** 
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are 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 Materials.
** 
** THE MATERIALS ARE 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
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/

/* Header file version number, required by OpenGL ABI for Linux */

/* glext.h last updated $Date: 2010-08-03 01:30:25 -0700 (Tue, 03 Aug 2010) $ */

/* Current version at http://www.opengl.org/registry/ */

/* Function declaration macros - to move into glplatform.h */

/*************************************************************/

/* Reuse tokens from ARB_depth_buffer_float */

/* reuse GL_DEPTH_COMPONENT32F */

/* reuse GL_DEPTH32F_STENCIL8 */

/* reuse GL_FLOAT_32_UNSIGNED_INT_24_8_REV */

/* Reuse tokens from ARB_framebuffer_object */

/* reuse GL_INVALID_FRAMEBUFFER_OPERATION */

/* reuse GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */

/* reuse GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */

/* reuse GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */

/* reuse GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */

/* reuse GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */

/* reuse GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */

/* reuse GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */

/* reuse GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */

/* reuse GL_FRAMEBUFFER_DEFAULT */

/* reuse GL_FRAMEBUFFER_UNDEFINED */

/* reuse GL_DEPTH_STENCIL_ATTACHMENT */

/* reuse GL_INDEX */

/* reuse GL_MAX_RENDERBUFFER_SIZE */

/* reuse GL_DEPTH_STENCIL */

/* reuse GL_UNSIGNED_INT_24_8 */

/* reuse GL_DEPTH24_STENCIL8 */

/* reuse GL_TEXTURE_STENCIL_SIZE */

/* reuse GL_TEXTURE_RED_TYPE */

/* reuse GL_TEXTURE_GREEN_TYPE */

/* reuse GL_TEXTURE_BLUE_TYPE */

/* reuse GL_TEXTURE_ALPHA_TYPE */

/* reuse GL_TEXTURE_DEPTH_TYPE */

/* reuse GL_UNSIGNED_NORMALIZED */

/* reuse GL_FRAMEBUFFER_BINDING */

/* reuse GL_DRAW_FRAMEBUFFER_BINDING */

/* reuse GL_RENDERBUFFER_BINDING */

/* reuse GL_READ_FRAMEBUFFER */

/* reuse GL_DRAW_FRAMEBUFFER */

/* reuse GL_READ_FRAMEBUFFER_BINDING */

/* reuse GL_RENDERBUFFER_SAMPLES */

/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */

/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */

/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */

/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */

/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */

/* reuse GL_FRAMEBUFFER_COMPLETE */

/* reuse GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */

/* reuse GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */

/* reuse GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */

/* reuse GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */

/* reuse GL_FRAMEBUFFER_UNSUPPORTED */

/* reuse GL_MAX_COLOR_ATTACHMENTS */

/* reuse GL_COLOR_ATTACHMENT0 */

/* reuse GL_COLOR_ATTACHMENT1 */

/* reuse GL_COLOR_ATTACHMENT2 */

/* reuse GL_COLOR_ATTACHMENT3 */

/* reuse GL_COLOR_ATTACHMENT4 */

/* reuse GL_COLOR_ATTACHMENT5 */

/* reuse GL_COLOR_ATTACHMENT6 */

/* reuse GL_COLOR_ATTACHMENT7 */

/* reuse GL_COLOR_ATTACHMENT8 */

/* reuse GL_COLOR_ATTACHMENT9 */

/* reuse GL_COLOR_ATTACHMENT10 */

/* reuse GL_COLOR_ATTACHMENT11 */

/* reuse GL_COLOR_ATTACHMENT12 */

/* reuse GL_COLOR_ATTACHMENT13 */

/* reuse GL_COLOR_ATTACHMENT14 */

/* reuse GL_COLOR_ATTACHMENT15 */

/* reuse GL_DEPTH_ATTACHMENT */

/* reuse GL_STENCIL_ATTACHMENT */

/* reuse GL_FRAMEBUFFER */

/* reuse GL_RENDERBUFFER */

/* reuse GL_RENDERBUFFER_WIDTH */

/* reuse GL_RENDERBUFFER_HEIGHT */

/* reuse GL_RENDERBUFFER_INTERNAL_FORMAT */

/* reuse GL_STENCIL_INDEX1 */

/* reuse GL_STENCIL_INDEX4 */

/* reuse GL_STENCIL_INDEX8 */

/* reuse GL_STENCIL_INDEX16 */

/* reuse GL_RENDERBUFFER_RED_SIZE */

/* reuse GL_RENDERBUFFER_GREEN_SIZE */

/* reuse GL_RENDERBUFFER_BLUE_SIZE */

/* reuse GL_RENDERBUFFER_ALPHA_SIZE */

/* reuse GL_RENDERBUFFER_DEPTH_SIZE */

/* reuse GL_RENDERBUFFER_STENCIL_SIZE */

/* reuse GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */

/* reuse GL_MAX_SAMPLES */

/* Reuse tokens from ARB_framebuffer_sRGB */

/* reuse GL_FRAMEBUFFER_SRGB */

/* Reuse tokens from ARB_half_float_vertex */

/* reuse GL_HALF_FLOAT */

/* Reuse tokens from ARB_map_buffer_range */

/* reuse GL_MAP_READ_BIT */

/* reuse GL_MAP_WRITE_BIT */

/* reuse GL_MAP_INVALIDATE_RANGE_BIT */

/* reuse GL_MAP_INVALIDATE_BUFFER_BIT */

/* reuse GL_MAP_FLUSH_EXPLICIT_BIT */

/* reuse GL_MAP_UNSYNCHRONIZED_BIT */

/* Reuse tokens from ARB_texture_compression_rgtc */

/* reuse GL_COMPRESSED_RED_RGTC1 */

/* reuse GL_COMPRESSED_SIGNED_RED_RGTC1 */

/* reuse GL_COMPRESSED_RG_RGTC2 */

/* reuse GL_COMPRESSED_SIGNED_RG_RGTC2 */

/* Reuse tokens from ARB_texture_rg */

/* reuse GL_RG */

/* reuse GL_RG_INTEGER */

/* reuse GL_R8 */

/* reuse GL_R16 */

/* reuse GL_RG8 */

/* reuse GL_RG16 */

/* reuse GL_R16F */

/* reuse GL_R32F */

/* reuse GL_RG16F */

/* reuse GL_RG32F */

/* reuse GL_R8I */

/* reuse GL_R8UI */

/* reuse GL_R16I */

/* reuse GL_R16UI */

/* reuse GL_R32I */

/* reuse GL_R32UI */

/* reuse GL_RG8I */

/* reuse GL_RG8UI */

/* reuse GL_RG16I */

/* reuse GL_RG16UI */

/* reuse GL_RG32I */

/* reuse GL_RG32UI */

/* Reuse tokens from ARB_vertex_array_object */

/* reuse GL_VERTEX_ARRAY_BINDING */

/* Reuse tokens from ARB_framebuffer_object */

/* reuse GL_TEXTURE_LUMINANCE_TYPE */

/* reuse GL_TEXTURE_INTENSITY_TYPE */

/* Reuse tokens from ARB_copy_buffer */

/* reuse GL_COPY_READ_BUFFER */

/* reuse GL_COPY_WRITE_BUFFER */

/* Reuse tokens from ARB_draw_instanced (none) */

/* Reuse tokens from ARB_uniform_buffer_object */

/* reuse GL_UNIFORM_BUFFER */

/* reuse GL_UNIFORM_BUFFER_BINDING */

/* reuse GL_UNIFORM_BUFFER_START */

/* reuse GL_UNIFORM_BUFFER_SIZE */

/* reuse GL_MAX_VERTEX_UNIFORM_BLOCKS */

/* reuse GL_MAX_FRAGMENT_UNIFORM_BLOCKS */

/* reuse GL_MAX_COMBINED_UNIFORM_BLOCKS */

/* reuse GL_MAX_UNIFORM_BUFFER_BINDINGS */

/* reuse GL_MAX_UNIFORM_BLOCK_SIZE */

/* reuse GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS */

/* reuse GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS */

/* reuse GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT */

/* reuse GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */

/* reuse GL_ACTIVE_UNIFORM_BLOCKS */

/* reuse GL_UNIFORM_TYPE */

/* reuse GL_UNIFORM_SIZE */

/* reuse GL_UNIFORM_NAME_LENGTH */

/* reuse GL_UNIFORM_BLOCK_INDEX */

/* reuse GL_UNIFORM_OFFSET */

/* reuse GL_UNIFORM_ARRAY_STRIDE */

/* reuse GL_UNIFORM_MATRIX_STRIDE */

/* reuse GL_UNIFORM_IS_ROW_MAJOR */

/* reuse GL_UNIFORM_BLOCK_BINDING */

/* reuse GL_UNIFORM_BLOCK_DATA_SIZE */

/* reuse GL_UNIFORM_BLOCK_NAME_LENGTH */

/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS */

/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES */

/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER */

/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER */

/* reuse GL_INVALID_INDEX */

/* reuse GL_MAX_VARYING_COMPONENTS */

/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */

/* Reuse tokens from ARB_depth_clamp */

/* reuse GL_DEPTH_CLAMP */

/* Reuse tokens from ARB_draw_elements_base_vertex (none) */

/* Reuse tokens from ARB_fragment_coord_conventions (none) */

/* Reuse tokens from ARB_provoking_vertex */

/* reuse GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */

/* reuse GL_FIRST_VERTEX_CONVENTION */

/* reuse GL_LAST_VERTEX_CONVENTION */

/* reuse GL_PROVOKING_VERTEX */

/* Reuse tokens from ARB_seamless_cube_map */

/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS */

/* Reuse tokens from ARB_sync */

/* reuse GL_MAX_SERVER_WAIT_TIMEOUT */

/* reuse GL_OBJECT_TYPE */

/* reuse GL_SYNC_CONDITION */

/* reuse GL_SYNC_STATUS */

/* reuse GL_SYNC_FLAGS */

/* reuse GL_SYNC_FENCE */

/* reuse GL_SYNC_GPU_COMMANDS_COMPLETE */

/* reuse GL_UNSIGNALED */

/* reuse GL_SIGNALED */

/* reuse GL_ALREADY_SIGNALED */

/* reuse GL_TIMEOUT_EXPIRED */

/* reuse GL_CONDITION_SATISFIED */

/* reuse GL_WAIT_FAILED */

/* reuse GL_TIMEOUT_IGNORED */

/* reuse GL_SYNC_FLUSH_COMMANDS_BIT */

/* reuse GL_TIMEOUT_IGNORED */

/* Reuse tokens from ARB_texture_multisample */

/* reuse GL_SAMPLE_POSITION */

/* reuse GL_SAMPLE_MASK */

/* reuse GL_SAMPLE_MASK_VALUE */

/* reuse GL_MAX_SAMPLE_MASK_WORDS */

/* reuse GL_TEXTURE_2D_MULTISAMPLE */

/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE */

/* reuse GL_TEXTURE_2D_MULTISAMPLE_ARRAY */

/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY */

/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE */

/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY */

/* reuse GL_TEXTURE_SAMPLES */

/* reuse GL_TEXTURE_FIXED_SAMPLE_LOCATIONS */

/* reuse GL_SAMPLER_2D_MULTISAMPLE */

/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE */

/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE */

/* reuse GL_SAMPLER_2D_MULTISAMPLE_ARRAY */

/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */

/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */

/* reuse GL_MAX_COLOR_TEXTURE_SAMPLES */

/* reuse GL_MAX_DEPTH_TEXTURE_SAMPLES */

/* reuse GL_MAX_INTEGER_SAMPLES */

/* Don't need to reuse tokens from ARB_vertex_array_bgra since they're already in 1.2 core */

/* Reuse tokens from ARB_blend_func_extended */

/* reuse GL_SRC1_COLOR */

/* reuse GL_ONE_MINUS_SRC1_COLOR */

/* reuse GL_ONE_MINUS_SRC1_ALPHA */

/* reuse GL_MAX_DUAL_SOURCE_DRAW_BUFFERS */

/* Reuse tokens from ARB_explicit_attrib_location (none) */

/* Reuse tokens from ARB_occlusion_query2 */

/* reuse GL_ANY_SAMPLES_PASSED */

/* Reuse tokens from ARB_sampler_objects */

/* reuse GL_SAMPLER_BINDING */

/* Reuse tokens from ARB_shader_bit_encoding (none) */

/* Reuse tokens from ARB_texture_rgb10_a2ui */

/* reuse GL_RGB10_A2UI */

/* Reuse tokens from ARB_texture_swizzle */

/* reuse GL_TEXTURE_SWIZZLE_R */

/* reuse GL_TEXTURE_SWIZZLE_G */

/* reuse GL_TEXTURE_SWIZZLE_B */

/* reuse GL_TEXTURE_SWIZZLE_A */

/* reuse GL_TEXTURE_SWIZZLE_RGBA */

/* Reuse tokens from ARB_timer_query */

/* reuse GL_TIME_ELAPSED */

/* reuse GL_TIMESTAMP */

/* Reuse tokens from ARB_vertex_type_2_10_10_10_rev */

/* reuse GL_INT_2_10_10_10_REV */

/* Reuse tokens from ARB_texture_query_lod (none) */

/* Reuse tokens from ARB_draw_buffers_blend (none) */

/* Reuse tokens from ARB_draw_indirect */

/* reuse GL_DRAW_INDIRECT_BUFFER */

/* reuse GL_DRAW_INDIRECT_BUFFER_BINDING */

/* Reuse tokens from ARB_gpu_shader5 */

/* reuse GL_GEOMETRY_SHADER_INVOCATIONS */

/* reuse GL_MAX_GEOMETRY_SHADER_INVOCATIONS */

/* reuse GL_MIN_FRAGMENT_INTERPOLATION_OFFSET */

/* reuse GL_MAX_FRAGMENT_INTERPOLATION_OFFSET */

/* reuse GL_FRAGMENT_INTERPOLATION_OFFSET_BITS */

/* reuse GL_MAX_VERTEX_STREAMS */

/* Reuse tokens from ARB_gpu_shader_fp64 */

/* reuse GL_DOUBLE_VEC2 */

/* reuse GL_DOUBLE_VEC3 */

/* reuse GL_DOUBLE_VEC4 */

/* reuse GL_DOUBLE_MAT2 */

/* reuse GL_DOUBLE_MAT3 */

/* reuse GL_DOUBLE_MAT4 */

/* reuse GL_DOUBLE_MAT2x3 */

/* reuse GL_DOUBLE_MAT2x4 */

/* reuse GL_DOUBLE_MAT3x2 */

/* reuse GL_DOUBLE_MAT3x4 */

/* reuse GL_DOUBLE_MAT4x2 */

/* reuse GL_DOUBLE_MAT4x3 */

/* Reuse tokens from ARB_shader_subroutine */

/* reuse GL_ACTIVE_SUBROUTINES */

/* reuse GL_ACTIVE_SUBROUTINE_UNIFORMS */

/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS */

/* reuse GL_ACTIVE_SUBROUTINE_MAX_LENGTH */

/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH */

/* reuse GL_MAX_SUBROUTINES */

/* reuse GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS */

/* reuse GL_NUM_COMPATIBLE_SUBROUTINES */

/* reuse GL_COMPATIBLE_SUBROUTINES */

/* Reuse tokens from ARB_tessellation_shader */

/* reuse GL_PATCHES */

/* reuse GL_PATCH_VERTICES */

/* reuse GL_PATCH_DEFAULT_INNER_LEVEL */

/* reuse GL_PATCH_DEFAULT_OUTER_LEVEL */

/* reuse GL_TESS_CONTROL_OUTPUT_VERTICES */

/* reuse GL_TESS_GEN_MODE */

/* reuse GL_TESS_GEN_SPACING */

/* reuse GL_TESS_GEN_VERTEX_ORDER */

/* reuse GL_TESS_GEN_POINT_MODE */

/* reuse GL_ISOLINES */

/* reuse GL_FRACTIONAL_ODD */

/* reuse GL_FRACTIONAL_EVEN */

/* reuse GL_MAX_PATCH_VERTICES */

/* reuse GL_MAX_TESS_GEN_LEVEL */

/* reuse GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS */

/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS */

/* reuse GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS */

/* reuse GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS */

/* reuse GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS */

/* reuse GL_MAX_TESS_PATCH_COMPONENTS */

/* reuse GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS */

/* reuse GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS */

/* reuse GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS */

/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS */

/* reuse GL_MAX_TESS_CONTROL_INPUT_COMPONENTS */

/* reuse GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS */

/* reuse GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS */

/* reuse GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS */

/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER */

/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER */

/* reuse GL_TESS_EVALUATION_SHADER */

/* reuse GL_TESS_CONTROL_SHADER */

/* Reuse tokens from ARB_texture_buffer_object_rgb32 (none) */

/* Reuse tokens from ARB_transform_feedback2 */

/* reuse GL_TRANSFORM_FEEDBACK */

/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */

/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */

/* reuse GL_TRANSFORM_FEEDBACK_BINDING */

/* Reuse tokens from ARB_transform_feedback3 */

/* reuse GL_MAX_TRANSFORM_FEEDBACK_BUFFERS */

/* reuse GL_MAX_VERTEX_STREAMS */

/* Reuse tokens from ARB_ES2_compatibility */

/* reuse GL_FIXED */

/* reuse GL_IMPLEMENTATION_COLOR_READ_TYPE */

/* reuse GL_IMPLEMENTATION_COLOR_READ_FORMAT */

/* reuse GL_LOW_FLOAT */

/* reuse GL_MEDIUM_FLOAT */

/* reuse GL_HIGH_FLOAT */

/* reuse GL_LOW_INT */

/* reuse GL_MEDIUM_INT */

/* reuse GL_HIGH_INT */

/* reuse GL_SHADER_COMPILER */

/* reuse GL_NUM_SHADER_BINARY_FORMATS */

/* reuse GL_MAX_VERTEX_UNIFORM_VECTORS */

/* reuse GL_MAX_VARYING_VECTORS */

/* reuse GL_MAX_FRAGMENT_UNIFORM_VECTORS */

/* Reuse tokens from ARB_get_program_binary */

/* reuse GL_PROGRAM_BINARY_RETRIEVABLE_HINT */

/* reuse GL_PROGRAM_BINARY_LENGTH */

/* reuse GL_NUM_PROGRAM_BINARY_FORMATS */

/* reuse GL_PROGRAM_BINARY_FORMATS */

/* Reuse tokens from ARB_separate_shader_objects */

/* reuse GL_VERTEX_SHADER_BIT */

/* reuse GL_FRAGMENT_SHADER_BIT */

/* reuse GL_GEOMETRY_SHADER_BIT */

/* reuse GL_TESS_CONTROL_SHADER_BIT */

/* reuse GL_TESS_EVALUATION_SHADER_BIT */

/* reuse GL_ALL_SHADER_BITS */

/* reuse GL_PROGRAM_SEPARABLE */

/* reuse GL_ACTIVE_PROGRAM */

/* reuse GL_PROGRAM_PIPELINE_BINDING */

/* Reuse tokens from ARB_shader_precision (none) */

/* Reuse tokens from ARB_vertex_attrib_64bit - all are in GL 3.0 and 4.0 already */

/* Reuse tokens from ARB_viewport_array - some are in GL 1.1 and ARB_provoking_vertex already */

/* reuse GL_MAX_VIEWPORTS */

/* reuse GL_VIEWPORT_SUBPIXEL_BITS */

/* reuse GL_VIEWPORT_BOUNDS_RANGE */

/* reuse GL_LAYER_PROVOKING_VERTEX */

/* reuse GL_VIEWPORT_INDEX_PROVOKING_VERTEX */

/* reuse GL_UNDEFINED_VERTEX */

/* reuse GL_MAX_VARYING_COMPONENTS */

/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */

/* ARB_compatibility just defines tokens from core 3.0 */

/* reuse GL_BGRA */

/* reuse GL_SRC1_ALPHA */

/* reuse GL_UNSIGNED_INT_2_10_10_10_REV */

/* reuse GL_MAX_VERTEX_STREAMS */

/* reuse GL_DOUBLE */

/* reuse GL_UNIFORM_SIZE */

/* reuse GL_UNIFORM_NAME_LENGTH */

/* reuse GL_TRIANGLES */

/* reuse GL_QUADS */

/* reuse GL_EQUAL */

/* reuse GL_CCW */

/* reuse GL_CW */

/* reuse GL_RGB32F */

/* reuse GL_RGB32UI */

/* reuse GL_RGB32I */

/* reuse GL_RGB32I */

/* reuse GL_DOUBLE_VEC2 */

/* reuse GL_DOUBLE_VEC3 */

/* reuse GL_DOUBLE_VEC4 */

/* reuse GL_DOUBLE_MAT2 */

/* reuse GL_DOUBLE_MAT3 */

/* reuse GL_DOUBLE_MAT4 */

/* reuse GL_DOUBLE_MAT2x3 */

/* reuse GL_DOUBLE_MAT2x4 */

/* reuse GL_DOUBLE_MAT3x2 */

/* reuse GL_DOUBLE_MAT3x4 */

/* reuse GL_DOUBLE_MAT4x2 */

/* reuse GL_DOUBLE_MAT4x3 */

/* reuse GL_SCISSOR_BOX */

/* reuse GL_VIEWPORT */

/* reuse GL_DEPTH_RANGE */

/* reuse GL_SCISSOR_TEST */

/* reuse GL_FIRST_VERTEX_CONVENTION */

/* reuse GL_LAST_VERTEX_CONVENTION */

/* reuse GL_PROVOKING_VERTEX */

/* reuse GL_NO_ERROR */

/* reuse GL_FRAGMENT_DEPTH_EXT */

/* reuse GL_TEXTURE0_ARB */

/* reuse GL_TEXTURE1_ARB */

/* reuse GL_ZERO */

/* reuse GL_NONE */

/* reuse GL_FOG */

/* reuse GL_EYE_PLANE */

/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */

/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */

/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */

/* reuse GL_GEOMETRY_VERTICES_OUT_EXT */

/* reuse GL_GEOMETRY_INPUT_TYPE_EXT */

/* reuse GL_GEOMETRY_OUTPUT_TYPE_EXT */

/* reuse GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT */

/* reuse GL_LINES_ADJACENCY_EXT */

/* reuse GL_LINE_STRIP_ADJACENCY_EXT */

/* reuse GL_TRIANGLES_ADJACENCY_EXT */

/* reuse GL_TRIANGLE_STRIP_ADJACENCY_EXT */

/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT */

/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT */

/* reuse GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT */

/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */

/* reuse GL_PROGRAM_POINT_SIZE_EXT */

/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */

/* reuse GL_BGRA */

/* reuse GL_RED_SNORM */

/* reuse GL_RG_SNORM */

/* reuse GL_RGB_SNORM */

/* reuse GL_RGBA_SNORM */

/* reuse GL_R8_SNORM */

/* reuse GL_RG8_SNORM */

/* reuse GL_RGB8_SNORM */

/* reuse GL_RGBA8_SNORM */

/* reuse GL_R16_SNORM */

/* reuse GL_RG16_SNORM */

/* reuse GL_RGB16_SNORM */

/* reuse GL_RGBA16_SNORM */

/* reuse GL_SIGNED_NORMALIZED */

/* reuse GL_STORAGE_CACHED_APPLE */

/* reuse GL_STORAGE_SHARED_APPLE */

/* reuse GL_UNSIGNED_SHORT_8_8_APPLE */

/* reuse GL_UNSIGNED_SHORT_8_8_REV_APPLE */

/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB */

/* reuse GL_DOUBLE */

/* reuse GL_PATCHES */

/* reuse GL_READ_WRITE */

/* reuse GL_WRITE_ONLY */

/* reuse GL_INT64_NV */

/* reuse GL_UNSIGNED_INT64_NV */

/*************************************************************/

/* GL type for program/shader text */

/* GL types for handling large vertex buffer objects */

/* GL types for handling large vertex buffer objects */

/* GL types for program/shader text and shader object handles */

/* GL type for "half" precision (s10e5) float data in host memory */

/* This code block is duplicated in glxext.h, so must be protected */

/* Define int32_t, int64_t, and uint64_t types for UST/MSC */

/* (as used in the GL_EXT_timer_query extension). */

/* __arch64__ */

/* __STDC__ */

/* Fallback if nothing above works */

/* These incomplete types let us declare types compatible with OpenCL's cl_context and cl_event */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* OpenGL 3.0 also reuses entry points from these extensions: */

/* ARB_framebuffer_object */

/* ARB_map_buffer_range */

/* ARB_vertex_array_object */

/* GL_GLEXT_PROTOTYPES */

/* OpenGL 3.1 also reuses entry points from these extensions: */

/* ARB_copy_buffer */

/* ARB_uniform_buffer_object */

/* GL_GLEXT_PROTOTYPES */

/* OpenGL 3.2 also reuses entry points from these extensions: */

/* ARB_draw_elements_base_vertex */

/* ARB_provoking_vertex */

/* ARB_sync */

/* ARB_texture_multisample */

/* GL_GLEXT_PROTOTYPES */

/* OpenGL 3.3 also reuses entry points from these extensions: */

/* ARB_blend_func_extended */

/* ARB_sampler_objects */

/* ARB_explicit_attrib_location, but it has none */

/* ARB_occlusion_query2 (no entry points) */

/* ARB_shader_bit_encoding (no entry points) */

/* ARB_texture_rgb10_a2ui (no entry points) */

/* ARB_texture_swizzle (no entry points) */

/* ARB_timer_query */

/* ARB_vertex_type_2_10_10_10_rev */

/* GL_GLEXT_PROTOTYPES */

/* OpenGL 4.0 also reuses entry points from these extensions: */

/* ARB_texture_query_lod (no entry points) */

/* ARB_draw_indirect */

/* ARB_gpu_shader5 (no entry points) */

/* ARB_gpu_shader_fp64 */

/* ARB_shader_subroutine */

/* ARB_tessellation_shader */

/* ARB_texture_buffer_object_rgb32 (no entry points) */

/* ARB_texture_cube_map_array (no entry points) */

/* ARB_texture_gather (no entry points) */

/* ARB_transform_feedback2 */

/* ARB_transform_feedback3 */

/* GL_GLEXT_PROTOTYPES */

/* OpenGL 4.1 also reuses entry points from these extensions: */

/* ARB_ES2_compatibility */

/* ARB_get_program_binary */

/* ARB_separate_shader_objects */

/* ARB_shader_precision (no entry points) */

/* ARB_vertex_attrib_64bit */

/* ARB_viewport_array */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* This is really a WGL extension, but defines some associated GL enums.
 * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string.
 */

/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* GL_GLEXT_PROTOTYPES */

/* *INDENT-ON* */

/* NO_SDL_GLEXT */

/* _SDL_opengl_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_opengles.h ===
SHA256: cdfc48a0f8913e6480af94a08a32f479d93163975211271b14d25befe8492369
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_opengles.h
 *  
 *  This is a simple file to encapsulate the OpenGL ES 1.X API headers.
 */


=== system/include/SDL/SDL_opengles2.h ===
SHA256: 7c67e135bc67311b97caa0816a295fa93954f49975fb0b9b13edc4d82609d1a4
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_opengles.h
 *  
 *  This is a simple file to encapsulate the OpenGL ES 2.0 API headers.
 */


=== system/include/SDL/SDL_pixels.h ===
SHA256: 092bf8d44e317881756d027804320df4e899121e3a4396c21f9cd9997069750a
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_pixels.h
 *  
 *  Header for the enumerated pixel format definitions.
 */

/* XXX Emscripten: add missing header */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 *  \name Transparency definitions
 *  
 *  These define alpha as the opacity of a surface.
 */

/*@{*/

/*@}*/

/** Pixel type. */

/** Bitmap pixel order, high bit -> low bit. */

/** Packed component order, high bit -> low bit. */

/** Array component order, low byte -> high byte. */

/** Packed component layout. */

/* Note: If you modify this list, update SDL_GetPixelFormatName() */

/**< Planar mode: Y + V + U  (3 planes) */

/**< Planar mode: Y + U + V  (3 planes) */

/**< Packed mode: Y0+U0+Y1+V0 (1 plane) */

/**< Packed mode: U0+Y0+V0+Y1 (1 plane) */

/**< Packed mode: Y0+V0+Y1+U0 (1 plane) */

/**
 *  \note Everything in the pixel format structure is read-only.
 */

/**
 * \brief Get the human readable name of a pixel format
 */

/**
 *  \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks.
 *  
 *  \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible.
 *  
 *  \sa SDL_MasksToPixelFormatEnum()
 */

/**
 *  \brief Convert a bpp and RGBA masks to an enumerated pixel format.
 *  
 *  \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion 
 *          wasn't possible.
 *  
 *  \sa SDL_PixelFormatEnumToMasks()
 */

/**
 *  \brief Create an SDL_PixelFormat structure from a pixel format enum.
 */

/**
 *  \brief Free an SDL_PixelFormat structure.
 */

/**
 *  \brief Create a palette structure with the specified number of color 
 *         entries.
 *  
 *  \return A new palette, or NULL if there wasn't enough memory.
 *  
 *  \note The palette entries are initialized to white.
 *  
 *  \sa SDL_FreePalette()
 */

/**
 *  \brief Set the palette for a pixel format structure.
 */

/**
 *  \brief Set a range of colors in a palette.
 *  
 *  \param palette    The palette to modify.
 *  \param colors     An array of colors to copy into the palette.
 *  \param firstcolor The index of the first palette entry to modify.
 *  \param ncolors    The number of entries to modify.
 *  
 *  \return 0 on success, or -1 if not all of the colors could be set.
 */

/**
 *  \brief Free a palette created with SDL_AllocPalette().
 *  
 *  \sa SDL_AllocPalette()
 */

/**
 *  \brief Maps an RGB triple to an opaque pixel value for a given pixel format.
 *  
 *  \sa SDL_MapRGBA
 */

/**
 *  \brief Maps an RGBA quadruple to a pixel value for a given pixel format.
 *  
 *  \sa SDL_MapRGB
 */

/**
 *  \brief Get the RGB components from a pixel of the specified format.
 *  
 *  \sa SDL_GetRGBA
 */

/**
 *  \brief Get the RGBA components from a pixel of the specified format.
 *  
 *  \sa SDL_GetRGB
 */

/**
 *  \brief Calculate a 256 entry gamma ramp for a gamma value.
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_pixels_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_platform.h ===
SHA256: 650e313c5450faf6c4e87c74662eb5e46f104d6956c0b36d6fdb998b8eb3f2e3
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_platform.h
 *  
 *  Try to get a standard set of platform defines.
 */

/*do we need to do this?*/

/* lets us know what version of Mac OS X we're compiling on */

/* if compiling for iPhone */

/* if not compiling for iPhone */

/* TARGET_OS_IPHONE */

/* defined(__APPLE__) */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 *  \brief Gets the name of the platform.
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_platform_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_power.h ===
SHA256: 63c48086274d4b820ff279b7089abc361de3afdf47add2a12d05bc4921f088ef
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_power.h
 *  
 *  Header for the SDL power management routines.
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 *  \brief The basic state for the system's power supply.
 */

/**< cannot determine power status */

/**< Not plugged in, running on the battery */

/**< Plugged in, no battery available */

/**< Plugged in, charging battery */

/**< Plugged in, battery charged */

/**
 *  \brief Get the current power supply details.
 *  
 *  \param secs Seconds of battery life left. You can pass a NULL here if
 *              you don't care. Will return -1 if we can't determine a
 *              value, or we're not running on a battery.
 *  
 *  \param pct Percentage of battery life left, between 0 and 100. You can
 *             pass a NULL here if you don't care. Will return -1 if we
 *             can't determine a value, or we're not running on a battery.
 *  
 *  \return The state of the battery (if any).
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_power_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_quit.h ===
SHA256: 0b30bb6fbb8f0a97c41dfd920404d9c9edacaadfb44ed9c0d1bc2a837cdd9718
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_quit.h
 *  
 *  Include file for SDL quit event handling.
 */

/**
 *  \file SDL_quit.h
 *  
 *  An ::SDL_QUIT event is generated when the user tries to close the application
 *  window.  If it is ignored or filtered out, the window will remain open.
 *  If it is not ignored or filtered, it is queued normally and the window
 *  is allowed to close.  When the window is closed, screen updates will 
 *  complete, but have no effect.
 *
 *  SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
 *  and SIGTERM (system termination request), if handlers do not already
 *  exist, that generate ::SDL_QUIT events as well.  There is no way
 *  to determine the cause of an ::SDL_QUIT event, but setting a signal
 *  handler in your application will override the default generation of
 *  quit events for that signal.
 *  
 *  \sa SDL_Quit()
 */

/* There are no functions directly affecting the quit event */

/* _SDL_quit_h */


=== system/include/SDL/SDL_rect.h ===
SHA256: a9a128abef3f6789256c3fcdd0f0a85d34efd0f3b44c8214c6cbf17e36330d57
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_rect.h
 *  
 *  Header file for SDL_rect definition and management functions.
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 *  \brief  The structure that defines a point
 *
 *  \sa SDL_EnclosePoints
 */

/**
 *  \brief A rectangle, with the origin at the upper left.
 *  
 *  \sa SDL_RectEmpty
 *  \sa SDL_RectEquals
 *  \sa SDL_HasIntersection
 *  \sa SDL_IntersectRect
 *  \sa SDL_UnionRect
 *  \sa SDL_EnclosePoints
 */

/**
 *  \brief Returns true if the rectangle has no area.
 */

/**
 *  \brief Returns true if the two rectangles are equal.
 */

/**
 *  \brief Determine whether two rectangles intersect.
 *  
 *  \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
 */

/**
 *  \brief Calculate the intersection of two rectangles.
 *  
 *  \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
 */

/**
 *  \brief Calculate the union of two rectangles.
 */

/**
 *  \brief Calculate a minimal rectangle enclosing a set of points
 *
 *  \return SDL_TRUE if any points were within the clipping rect
 */

/**
 *  \brief Calculate the intersection of a rectangle and line segment.
 *  
 *  \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_rect_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_render.h ===
SHA256: 5f6b61271e588da728ac597cf7e4de8a04022d99d16238deb017a66356d59fef
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_render.h
 *  
 *  Header file for SDL 2D rendering functions.
 *
 *  This API supports the following features:
 *      * single pixel points
 *      * single pixel lines
 *      * filled rectangles
 *      * texture images
 *
 *  The primitives may be drawn in opaque, blended, or additive modes.
 *
 *  The texture images may be drawn in opaque, blended, or additive modes.
 *  They can have an additional color tint or alpha modulation applied to
 *  them, and may also be stretched with linear interpolation.
 *
 *  This API is designed to accelerate simple 2D operations. You may
 *  want more functionality such as rotation and particle effects and
 *  in that case you should use SDL's OpenGL/Direct3D support or one
 *  of the many good 3D engines.
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 *  \brief Flags used when creating a rendering context
 */

/**< The renderer is a software fallback */

/**< The renderer uses hardware 
                                                     acceleration */

/**< Present is synchronized 
                                                     with the refresh rate */

/**
 *  \brief Information on the capabilities of a render driver or context.
 */

/**< The name of the renderer */

/**< Supported ::SDL_RendererFlags */

/**< The number of available texture formats */

/**< The available texture formats */

/**< The maximimum texture width */

/**< The maximimum texture height */

/**
 *  \brief The access pattern allowed for a texture.
 */

/**< Changes rarely, not lockable */

/**< Changes frequently, lockable */

/**
 *  \brief The texture channel modulation used in SDL_RenderCopy().
 */

/**< No modulation */

/**< srcC = srcC * color */

/**< srcA = srcA * alpha */

/**
 *  \brief A structure representing rendering state
 */

/**
 *  \brief An efficient driver-specific representation of pixel data
 */

/* Function prototypes */

/**
 *  \brief Get the number of 2D rendering drivers available for the current 
 *         display.
 *  
 *  A render driver is a set of code that handles rendering and texture
 *  management on a particular display.  Normally there is only one, but
 *  some drivers may have several available with different capabilities.
 *  
 *  \sa SDL_GetRenderDriverInfo()
 *  \sa SDL_CreateRenderer()
 */

/**
 *  \brief Get information about a specific 2D rendering driver for the current 
 *         display.
 *  
 *  \param index The index of the driver to query information about.
 *  \param info  A pointer to an SDL_RendererInfo struct to be filled with 
 *               information on the rendering driver.
 *  
 *  \return 0 on success, -1 if the index was out of range.
 *  
 *  \sa SDL_CreateRenderer()
 */

/**
 *  \brief Create a 2D rendering context for a window.
 *  
 *  \param window The window where rendering is displayed.
 *  \param index    The index of the rendering driver to initialize, or -1 to 
 *                  initialize the first one supporting the requested flags.
 *  \param flags    ::SDL_RendererFlags.
 *  
 *  \return A valid rendering context or NULL if there was an error.
 *  
 *  \sa SDL_CreateSoftwareRenderer()
 *  \sa SDL_GetRendererInfo()
 *  \sa SDL_DestroyRenderer()
 */

/**
 *  \brief Create a 2D software rendering context for a surface.
 *  
 *  \param surface The surface where rendering is done.
 *  
 *  \return A valid rendering context or NULL if there was an error.
 *  
 *  \sa SDL_CreateRenderer()
 *  \sa SDL_DestroyRenderer()
 */

/**
 *  \brief Get the renderer associated with a window.
 */

/**
 *  \brief Get information about a rendering context.
 */

/**
 *  \brief Create a texture for a rendering context.
 *  
 *  \param format The format of the texture.
 *  \param access One of the enumerated values in ::SDL_TextureAccess.
 *  \param w      The width of the texture in pixels.
 *  \param h      The height of the texture in pixels.
 *  
 *  \return The created texture is returned, or 0 if no rendering context was 
 *          active,  the format was unsupported, or the width or height were out
 *          of range.
 *  
 *  \sa SDL_QueryTexture()
 *  \sa SDL_UpdateTexture()
 *  \sa SDL_DestroyTexture()
 */

/**
 *  \brief Create a texture from an existing surface.
 *  
 *  \param surface The surface containing pixel data used to fill the texture.
 *  
 *  \return The created texture is returned, or 0 on error.
 *  
 *  \note The surface is not modified or freed by this function.
 *  
 *  \sa SDL_QueryTexture()
 *  \sa SDL_DestroyTexture()
 */

/**
 *  \brief Query the attributes of a texture
 *  
 *  \param texture A texture to be queried.
 *  \param format  A pointer filled in with the raw format of the texture.  The 
 *                 actual format may differ, but pixel transfers will use this 
 *                 format.
 *  \param access  A pointer filled in with the actual access to the texture.
 *  \param w       A pointer filled in with the width of the texture in pixels.
 *  \param h       A pointer filled in with the height of the texture in pixels.
 *  
 *  \return 0 on success, or -1 if the texture is not valid.
 */

/**
 *  \brief Set an additional color value used in render copy operations.
 *  
 *  \param texture The texture to update.
 *  \param r       The red color value multiplied into copy operations.
 *  \param g       The green color value multiplied into copy operations.
 *  \param b       The blue color value multiplied into copy operations.
 *  
 *  \return 0 on success, or -1 if the texture is not valid or color modulation 
 *          is not supported.
 *  
 *  \sa SDL_GetTextureColorMod()
 */

/**
 *  \brief Get the additional color value used in render copy operations.
 *  
 *  \param texture The texture to query.
 *  \param r         A pointer filled in with the current red color value.
 *  \param g         A pointer filled in with the current green color value.
 *  \param b         A pointer filled in with the current blue color value.
 *  
 *  \return 0 on success, or -1 if the texture is not valid.
 *  
 *  \sa SDL_SetTextureColorMod()
 */

/**
 *  \brief Set an additional alpha value used in render copy operations.
 *  
 *  \param texture The texture to update.
 *  \param alpha     The alpha value multiplied into copy operations.
 *  
 *  \return 0 on success, or -1 if the texture is not valid or alpha modulation 
 *          is not supported.
 *  
 *  \sa SDL_GetTextureAlphaMod()
 */

/**
 *  \brief Get the additional alpha value used in render copy operations.
 *  
 *  \param texture The texture to query.
 *  \param alpha     A pointer filled in with the current alpha value.
 *  
 *  \return 0 on success, or -1 if the texture is not valid.
 *  
 *  \sa SDL_SetTextureAlphaMod()
 */

/**
 *  \brief Set the blend mode used for texture copy operations.
 *  
 *  \param texture The texture to update.
 *  \param blendMode ::SDL_BlendMode to use for texture blending.
 *  
 *  \return 0 on success, or -1 if the texture is not valid or the blend mode is
 *          not supported.
 *  
 *  \note If the blend mode is not supported, the closest supported mode is
 *        chosen.
 *  
 *  \sa SDL_GetTextureBlendMode()
 */

/**
 *  \brief Get the blend mode used for texture copy operations.
 *  
 *  \param texture   The texture to query.
 *  \param blendMode A pointer filled in with the current blend mode.
 *  
 *  \return 0 on success, or -1 if the texture is not valid.
 *  
 *  \sa SDL_SetTextureBlendMode()
 */

/**
 *  \brief Update the given texture rectangle with new pixel data.
 *  
 *  \param texture   The texture to update
 *  \param rect      A pointer to the rectangle of pixels to update, or NULL to 
 *                   update the entire texture.
 *  \param pixels    The raw pixel data.
 *  \param pitch     The number of bytes between rows of pixel data.
 *  
 *  \return 0 on success, or -1 if the texture is not valid.
 *  
 *  \note This is a fairly slow function.
 */

/**
 *  \brief Lock a portion of the texture for pixel access.
 *  
 *  \param texture   The texture to lock for access, which was created with 
 *                   ::SDL_TEXTUREACCESS_STREAMING.
 *  \param rect      A pointer to the rectangle to lock for access. If the rect 
 *                   is NULL, the entire texture will be locked.
 *  \param pixels    This is filled in with a pointer to the locked pixels, 
 *                   appropriately offset by the locked area.
 *  \param pitch     This is filled in with the pitch of the locked pixels.
 *  
 *  \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING.
 *  
 *  \sa SDL_UnlockTexture()
 */

/**
 *  \brief Unlock a texture, uploading the changes to video memory, if needed.
 *  
 *  \sa SDL_LockTexture()
 */

/**
 *  \brief Set the drawing area for rendering on the current target.
 *
 *  \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target.
 *
 *  The x,y of the viewport rect represents the origin for rendering.
 *
 *  \note When the window is resized, the current viewport is automatically
 *        centered within the new window size.
 */

/**
 *  \brief Get the drawing area for the current target.
 */

/**
 *  \brief Set the color used for drawing operations (Fill and Line).
 *  
 *  \param r The red value used to draw on the rendering target.
 *  \param g The green value used to draw on the rendering target.
 *  \param b The blue value used to draw on the rendering target.
 *  \param a The alpha value used to draw on the rendering target, usually 
 *           ::SDL_ALPHA_OPAQUE (255).
 *  
 *  \return 0 on success, or -1 on error
 */

/**
 *  \brief Get the color used for drawing operations (Fill and Line).
 *  
 *  \param r A pointer to the red value used to draw on the rendering target.
 *  \param g A pointer to the green value used to draw on the rendering target.
 *  \param b A pointer to the blue value used to draw on the rendering target.
 *  \param a A pointer to the alpha value used to draw on the rendering target, 
 *           usually ::SDL_ALPHA_OPAQUE (255).
 *  
 *  \return 0 on success, or -1 on error
 */

/**
 *  \brief Set the blend mode used for drawing operations (Fill and Line).
 *  
 *  \param blendMode ::SDL_BlendMode to use for blending.
 *  
 *  \return 0 on success, or -1 on error
 *  
 *  \note If the blend mode is not supported, the closest supported mode is 
 *        chosen.
 *  
 *  \sa SDL_GetRenderDrawBlendMode()
 */

/**
 *  \brief Get the blend mode used for drawing operations.
 *  
 *  \param blendMode A pointer filled in with the current blend mode.
 *  
 *  \return 0 on success, or -1 on error
 *  
 *  \sa SDL_SetRenderDrawBlendMode()
 */

/**
 *  \brief Clear the current rendering target with the drawing color
 *
 *  This function clears the entire rendering target, ignoring the viewport.
 */

/**
 *  \brief Draw a point on the current rendering target.
 *  
 *  \param x The x coordinate of the point.
 *  \param y The y coordinate of the point.
 *  
 *  \return 0 on success, or -1 on error
 */

/**
 *  \brief Draw multiple points on the current rendering target.
 *  
 *  \param points The points to draw
 *  \param count The number of points to draw
 *  
 *  \return 0 on success, or -1 on error
 */

/**
 *  \brief Draw a line on the current rendering target.
 *  
 *  \param x1 The x coordinate of the start point.
 *  \param y1 The y coordinate of the start point.
 *  \param x2 The x coordinate of the end point.
 *  \param y2 The y coordinate of the end point.
 *  
 *  \return 0 on success, or -1 on error
 */

/**
 *  \brief Draw a series of connected lines on the current rendering target.
 *  
 *  \param points The points along the lines
 *  \param count The number of points, drawing count-1 lines
 *  
 *  \return 0 on success, or -1 on error
 */

/**
 *  \brief Draw a rectangle on the current rendering target.
 *  
 *  \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
 *  
 *  \return 0 on success, or -1 on error
 */

/**
 *  \brief Draw some number of rectangles on the current rendering target.
 *  
 *  \param rects A pointer to an array of destination rectangles.
 *  \param count The number of rectangles.
 *  
 *  \return 0 on success, or -1 on error
 */

/**
 *  \brief Fill a rectangle on the current rendering target with the drawing color.
 *  
 *  \param rect A pointer to the destination rectangle, or NULL for the entire 
 *              rendering target.
 *  
 *  \return 0 on success, or -1 on error
 */

/**
 *  \brief Fill some number of rectangles on the current rendering target with the drawing color.
 *  
 *  \param rects A pointer to an array of destination rectangles.
 *  \param count The number of rectangles.
 *  
 *  \return 0 on success, or -1 on error
 */

/**
 *  \brief Copy a portion of the texture to the current rendering target.
 *  
 *  \param texture The source texture.
 *  \param srcrect   A pointer to the source rectangle, or NULL for the entire 
 *                   texture.
 *  \param dstrect   A pointer to the destination rectangle, or NULL for the 
 *                   entire rendering target.
 *  
 *  \return 0 on success, or -1 on error
 */

/**
 *  \brief Read pixels from the current rendering target.
 *  
 *  \param rect   A pointer to the rectangle to read, or NULL for the entire 
 *                render target.
 *  \param format The desired format of the pixel data, or 0 to use the format
 *                of the rendering target
 *  \param pixels A pointer to be filled in with the pixel data
 *  \param pitch  The pitch of the pixels parameter.
 *  
 *  \return 0 on success, or -1 if pixel reading is not supported.
 *  
 *  \warning This is a very slow operation, and should not be used frequently.
 */

/**
 *  \brief Update the screen with rendering performed.
 */

/**
 *  \brief Destroy the specified texture.
 *  
 *  \sa SDL_CreateTexture()
 *  \sa SDL_CreateTextureFromSurface()
 */

/**
 *  \brief Destroy the rendering context for a window and free associated
 *         textures.
 *  
 *  \sa SDL_CreateRenderer()
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_render_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_rotozoom.h ===
SHA256: 0c2c34feecaec5cafaab2adfe08a8b165ba32ad7641b00f131deb7343b112e52
/*  

SDL_rotozoom.c: rotozoomer, zoomer and shrinker for 32bit or 8bit surfaces

Copyright (C) 2001-2011  Andreas Schiffler

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

   1. The origin of this software must not be misrepresented; you must not
   claim that you wrote the original software. If you use this software
   in a product, an acknowledgment in the product documentation would be
   appreciated but is not required.

   2. Altered source versions must be plainly marked as such, and must not be
   misrepresented as being the original software.

   3. This notice may not be removed or altered from any source
   distribution.

Andreas Schiffler -- aschiffler at ferzkopp dot net

*/

/* Set up for C function definitions, even when using C++ */

/* ---- Defines */

/*!
	\brief Disable anti-aliasing (no smoothing).
	*/

/*!
	\brief Enable anti-aliasing (smoothing).
	*/

/* ---- Function Prototypes */

/* 

	Rotozoom functions

	*/

/* 

	Zooming functions

	*/

/* 

	Shrinking functions

	*/

/* 

	Specialized rotation functions

	*/

/* Ends C function definitions when using C++ */

/* _SDL_rotozoom_h */


=== system/include/SDL/SDL_rwops.h ===
SHA256: 4471b650d7d14d59ba3c112667328e4d31b0816a1d4f690544862298f5735ea3
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_rwops.h
 *  
 *  This file provides a general interface for SDL to read and write
 *  data streams.  It can easily be extended to files, memory, etc.
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 * This is the read/write operation structure -- very basic.
 */

/**
     *  Seek to \c offset relative to \c whence, one of stdio's whence values:
     *  RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
     *  
     *  \return the final offset in the data stream.
     */

/**
     *  Read up to \c maxnum objects each of size \c size from the data
     *  stream to the area pointed at by \c ptr.
     *  
     *  \return the number of objects read, or 0 at error or end of file.
     */

/**
     *  Write exactly \c num objects each of size \c size from the area
     *  pointed at by \c ptr to data stream.
     *  
     *  \return the number of objects written, or 0 at error or end of file.
     */

/**
     *  Close and free an allocated SDL_RWops structure.
     *  
     *  \return 0 if successful or -1 on write error when flushing data.
     */

/**
 *  \name RWFrom functions
 *  
 *  Functions to create SDL_RWops structures from various data streams.
 */

/*@{*/

/*@}*/

/*RWFrom functions*/

/**< Seek from the beginning of data */

/**< Seek relative to current read point */

/**< Seek relative to the end of data */

/**
 *  \name Read/write macros
 *  
 *  Macros to easily read and write from an SDL_RWops structure.
 */

/*@{*/

/*@}*/

/*Read/write macros*/

/** 
 *  \name Read endian functions
 *  
 *  Read an item of the specified endianness and return in native format.
 */

/*@{*/

/*@}*/

/*Read endian functions*/

/** 
 *  \name Write endian functions
 *  
 *  Write an item of native format to the specified endianness.
 */

/*@{*/

/*@}*/

/*Write endian functions*/

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_rwops_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_scancode.h ===
SHA256: e823e53a6cdd96f8e74b3fa3a357e2299c2a6fd90994535a457b8f6fb28f00ca
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_scancode.h
 *  
 *  Defines keyboard scancodes.
 */

/**
 *  \brief The SDL keyboard scancode representation.
 *  
 *  Values of this type are used to represent keyboard keys, among other places
 *  in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the
 *  SDL_Event structure.
 *  
 *  The values in this enumeration are based on the USB usage page standard:
 *  http://www.usb.org/developers/devclass_docs/Hut1_12.pdf
 */

/** 
     *  \name Usage page 0x07
     *  
     *  These values are from usage page 0x07 (USB keyboard page).
     */

/*@{*/

/**< Located at the lower left of the return 
                                  *   key on ISO keyboards and at the right end 
                                  *   of the QWERTY row on ANSI keyboards. 
                                  *   Produces REVERSE SOLIDUS (backslash) and 
                                  *   VERTICAL LINE in a US layout, REVERSE 
                                  *   SOLIDUS and VERTICAL LINE in a UK Mac 
                                  *   layout, NUMBER SIGN and TILDE in a UK 
                                  *   Windows layout, DOLLAR SIGN and POUND SIGN
                                  *   in a Swiss German layout, NUMBER SIGN and 
                                  *   APOSTROPHE in a German layout, GRAVE 
                                  *   ACCENT and POUND SIGN in a French Mac 
                                  *   layout, and ASTERISK and MICRO SIGN in a 
                                  *   French Windows layout.
                                  */

/**< ISO USB keyboards actually use this code 
                                  *   instead of 49 for the same key, but all 
                                  *   OSes I've seen treat the two codes 
                                  *   identically. So, as an implementor, unless
                                  *   your keyboard generates both of those 
                                  *   codes and your OS treats them differently,
                                  *   you should generate SDL_SCANCODE_BACKSLASH
                                  *   instead of this code. As a user, you 
                                  *   should not rely on this code because SDL 
                                  *   will never generate it with most (all?) 
                                  *   keyboards. 
                                  */

/**< Located in the top left corner (on both ANSI 
                              *   and ISO keyboards). Produces GRAVE ACCENT and 
                              *   TILDE in a US Windows layout and in US and UK 
                              *   Mac layouts on ANSI keyboards, GRAVE ACCENT 
                              *   and NOT SIGN in a UK Windows layout, SECTION 
                              *   SIGN and PLUS-MINUS SIGN in US and UK Mac 
                              *   layouts on ISO keyboards, SECTION SIGN and 
                              *   DEGREE SIGN in a Swiss German layout (Mac: 
                              *   only on ISO keyboards), CIRCUMFLEX ACCENT and 
                              *   DEGREE SIGN in a German layout (Mac: only on 
                              *   ISO keyboards), SUPERSCRIPT TWO and TILDE in a
                              *   French Windows layout, COMMERCIAL AT and 
                              *   NUMBER SIGN in a French Mac layout on ISO 
                              *   keyboards, and LESS-THAN SIGN and GREATER-THAN
                              *   SIGN in a Swiss German, German, or French Mac 
                              *   layout on ANSI keyboards.
                              */

/**< insert on PC, help on some Mac keyboards (but
                                   does send code 73, not 117) */

/**< num lock on PC, clear on Mac keyboards 
                                     */

/**< This is the additional key that ISO 
                                        *   keyboards have over ANSI ones, 
                                        *   located between left shift and Y. 
                                        *   Produces GRAVE ACCENT and TILDE in a
                                        *   US or UK Mac layout, REVERSE SOLIDUS
                                        *   (backslash) and VERTICAL LINE in a 
                                        *   US or UK Windows layout, and 
                                        *   LESS-THAN SIGN and GREATER-THAN SIGN
                                        *   in a Swiss German, German, or French
                                        *   layout. */

/**< windows contextual menu, compose */

/**< The USB document says this is a status flag, 
                               *   not a physical key - but some Mac keyboards 
                               *   do have a power key. */

/**< redo */

/* not sure whether there's a reason to enable these */

/*     SDL_SCANCODE_LOCKINGCAPSLOCK = 130,  */

/*     SDL_SCANCODE_LOCKINGNUMLOCK = 131, */

/*     SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */

/**< used on Asian keyboards, see 
                                            footnotes in USB doc */

/**< Yen */

/**< Hangul/English toggle */

/**< Hanja conversion */

/**< Katakana */

/**< Hiragana */

/**< Zenkaku/Hankaku */

/**< reserved */

/**< reserved */

/**< reserved */

/**< reserved */

/**< Erase-Eaze */

/**< alt, option */

/**< windows, command (apple), meta */

/**< alt gr, option */

/**< windows, command (apple), meta */

/**< I'm not sure if this is really not covered 
                                 *   by any of the above, but since there's a 
                                 *   special KMOD_MODE for it I'm adding it here
                                 */

/*@}*/

/*Usage page 0x07*/

/**
     *  \name Usage page 0x0C
     *  
     *  These values are mapped from usage page 0x0C (USB consumer page).
     */

/*@{*/

/*@}*/

/*Usage page 0x0C*/

/**
     *  \name Walther keys
     *  
     *  These are values that Christian Walther added (for mac keyboard?).
     */

/*@{*/

/**< display mirroring/dual display 
                                           switch, video mode switch */

/*@}*/

/*Walther keys*/

/* Add any other keys here. */

/**< not a key, just marks the number of scancodes 
                                 for array bounds */

/* _SDL_scancode_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_shape.h ===
SHA256: 68bbc1195da09d75ba77eddcd9be7cc5611f31638071ac55b5d6154b38a93092
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/** \file SDL_shape.h
 *
 * Header file for the shaped window API.
 */

/**
 *  \brief Create a window that can be shaped with the specified position, dimensions, and flags.
 *  
 *  \param title The title of the window, in UTF-8 encoding.
 *  \param x     The x position of the window, ::SDL_WINDOWPOS_CENTERED, or 
 *               ::SDL_WINDOWPOS_UNDEFINED.
 *  \param y     The y position of the window, ::SDL_WINDOWPOS_CENTERED, or 
 *               ::SDL_WINDOWPOS_UNDEFINED.
 *  \param w     The width of the window.
 *  \param h     The height of the window.
 *  \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following: 
 *               ::SDL_WINDOW_OPENGL,     ::SDL_WINDOW_INPUT_GRABBED,
 *               ::SDL_WINDOW_SHOWN,      ::SDL_WINDOW_RESIZABLE,
 *               ::SDL_WINDOW_MAXIMIZED,  ::SDL_WINDOW_MINIMIZED,
 *		 ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset.
 *  
 *  \return The window created, or NULL if window creation failed.
 *  
 *  \sa SDL_DestroyWindow()
 */

/**
 * \brief Return whether the given window is a shaped window. 
 *
 * \param window The window to query for being shaped.
 *
 * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL.
 * \sa SDL_CreateShapedWindow
 */

/** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */

/** \brief The default mode, a binarized alpha cutoff of 1. */

/** \brief A binarized alpha cutoff with a given integer value. */

/** \brief A binarized alpha cutoff with a given integer value, but with the opposite comparison. */

/** \brief A color key is applied. */

/** \brief A union containing parameters for shaped windows. */

/** \brief a cutoff alpha value for binarization of the window shape's alpha channel. */

/** \brief A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents. */

/** \brief The mode of these window-shape parameters. */

/** \brief Window-shape parameters. */

/**
 * \brief Set the shape and parameters of a shaped window.
 *
 * \param window The shaped window whose parameters should be set.
 * \param shape A surface encoding the desired shape for the window.
 * \param shape_mode The parameters to set for the shaped window.
 *
 * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on invalid an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW
 *           if the SDL_Window* given does not reference a valid shaped window.
 *
 * \sa SDL_WindowShapeMode
 * \sa SDL_GetShapedWindowMode.
 */

/**
 * \brief Get the shape parameters of a shaped window.
 *
 * \param window The shaped window whose parameters should be retrieved.
 * \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape.
 *
 * \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode
 *           data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if
 *           the SDL_Window* given is a shapeable window currently lacking a shape.
 *
 * \sa SDL_WindowShapeMode
 * \sa SDL_SetWindowShape
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_shape_h */


=== system/include/SDL/SDL_stdinc.h ===
SHA256: 328265d31c92611338adbd0e5053e3fc90178c79f61037c8bbb0560027c143af
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_stdinc.h
 *  
 *  This is a general header that includes C language support.
 */

/**
 *  The number of elements in an array.
 */

/**
 *  \name Cast operators
 *  
 *  Use proper C++ casts when compiled as C++ to be compatible with the option
 *  -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above).
 */

/*@{*/

/*@}*/

/*Cast operators*/

/* Define a four character code as a Uint32 */

/**
 *  \name Basic data types
 */

/*@{*/

/**
 * \brief A signed 8-bit integer type.
 */

/**
 * \brief An unsigned 8-bit integer type.
 */

/**
 * \brief A signed 16-bit integer type.
 */

/**
 * \brief An unsigned 16-bit integer type.
 */

/**
 * \brief A signed 32-bit integer type.
 */

/**
 * \brief An unsigned 32-bit integer type.
 */

/**
 * \brief A signed 64-bit integer type.
 */

/**
 * \brief An unsigned 64-bit integer type.
 */

/*@}*/

/*Basic data types*/

/** \cond */

/* DOXYGEN_SHOULD_IGNORE_THIS */

/** \endcond */

/* Check to make sure enums are the size of ints, for structure packing.
   For both Watcom C/C++ and Borland C/C++ the compiler option that makes
   enums having the size of an int must be enabled.
   This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11).
*/

/* Enable enums always int in CodeWarrior (for MPW use "-enum int") */

/** \cond */

/* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */

/* DOXYGEN_SHOULD_IGNORE_THIS */

/** \endcond */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* SDL_putenv() has moved to SDL_compat. */

/* We can count on memcpy existing on Mac OS X and being well-tuned. */

/* We can count on memcpy existing on Mac OS X and being well-tuned. */

/* TODO: figure out why libnds doesn't have this */

/* pi */

/* The SDL implementation of iconv() returns these error codes */

/**
 *  This function converts a string between encodings in one pass, returning a
 *  string that must be freed with SDL_free() or NULL on error.
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_stdinc_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_surface.h ===
SHA256: 0d85a5be65bbc3852c33aa73ea33b017a6d54cc0ba53f7fd3fc0aca7efeb24ad
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_surface.h
 *  
 *  Header file for ::SDL_surface definition and management functions.
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 *  \name Surface flags
 *  
 *  These are the currently supported flags for the ::SDL_surface.
 *  
 *  \internal
 *  Used internally (read-only).
 */

/*@{*/

/**< Surface uses preallocated memory */

/**< Surface is RLE encoded */

/**< Surface is referenced internally */

/*@}*/

/*Surface flags*/

/**
 *  Evaluates to true if the surface needs to be locked before access.
 */

/* XXX Emscripten: we always need to lock.
                               (((S)->flags & SDL_RLEACCEL) != 0) */

/**
 * \brief A collection of pixels used in software blitting.
 *
 * \note  This structure should be treated as read-only, except for \c pixels,
 *        which, if not NULL, contains the raw pixel data for the surface.
 */

/**< Read-only */

/**< Read-only */

/**< Read-only */

/**< Read-only */

/**< Read-write */

/** Application data associated with the surface */

/**< Read-write */

/** information needed for surfaces requiring locks */

/**< Read-only */

/**< Read-only */

/** clipping information */

/**< Read-only */

/** info for fast blit mapping to other surfaces */

/**< Private */

/** Reference count -- used when freeing surface */

/**< Read-mostly */

/**
 * \brief The type of function used for surface blitting functions.
 */

/**
 *  Allocate and free an RGB surface.
 *  
 *  If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
 *  If the depth is greater than 8 bits, the pixel format is set using the
 *  flags '[RGB]mask'.
 *  
 *  If the function runs out of memory, it will return NULL.
 *  
 *  \param flags The \c flags are obsolete and should be set to 0.
 */

/**
 *  \brief Set the palette used by a surface.
 *  
 *  \return 0, or -1 if the surface format doesn't use a palette.
 *  
 *  \note A single palette can be shared with many surfaces.
 */

/**
 *  \brief Sets up a surface for directly accessing the pixels.
 *  
 *  Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write
 *  to and read from \c surface->pixels, using the pixel format stored in 
 *  \c surface->format.  Once you are done accessing the surface, you should 
 *  use SDL_UnlockSurface() to release it.
 *  
 *  Not all surfaces require locking.  If SDL_MUSTLOCK(surface) evaluates
 *  to 0, then you can read and write to the surface at any time, and the
 *  pixel format of the surface will not change.
 *  
 *  No operating system or library calls should be made between lock/unlock
 *  pairs, as critical system locks may be held during this time.
 *  
 *  SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
 *  
 *  \sa SDL_UnlockSurface()
 */

/** \sa SDL_LockSurface() */

/**
 *  Load a surface from a seekable SDL data stream (memory or file).
 *  
 *  If \c freesrc is non-zero, the stream will be closed after being read.
 *  
 *  The new surface should be freed with SDL_FreeSurface().
 *  
 *  \return the new surface, or NULL if there was an error.
 */

/**
 *  Load a surface from a file.
 *  
 *  Convenience macro.
 */

/**
 *  Save a surface to a seekable SDL data stream (memory or file).
 *  
 *  If \c freedst is non-zero, the stream will be closed after being written.
 *  
 *  \return 0 if successful or -1 if there was an error.
 */

/** 
 *  Save a surface to a file.
 *  
 *  Convenience macro.
 */

/**
 *  \brief Sets the RLE acceleration hint for a surface.
 *  
 *  \return 0 on success, or -1 if the surface is not valid
 *  
 *  \note If RLE is enabled, colorkey and alpha blending blits are much faster,
 *        but the surface must be locked before directly accessing the pixels.
 */

/**
 *  \brief Sets the color key (transparent pixel) in a blittable surface.
 *  
 *  \param surface The surface to update
 *  \param flag Non-zero to enable colorkey and 0 to disable colorkey 
 *  \param key The transparent pixel in the native surface format
 *  
 *  \return 0 on success, or -1 if the surface is not valid
 */

/**
 *  \brief Gets the color key (transparent pixel) in a blittable surface.
 *  
 *  \param surface The surface to update
 *  \param key A pointer filled in with the transparent pixel in the native 
 *             surface format
 *  
 *  \return 0 on success, or -1 if the surface is not valid or colorkey is not 
 *          enabled.
 */

/**
 *  \brief Set an additional color value used in blit operations.
 *  
 *  \param surface The surface to update.
 *  \param r The red color value multiplied into blit operations.
 *  \param g The green color value multiplied into blit operations.
 *  \param b The blue color value multiplied into blit operations.
 *  
 *  \return 0 on success, or -1 if the surface is not valid.
 *  
 *  \sa SDL_GetSurfaceColorMod()
 */

/**
 *  \brief Get the additional color value used in blit operations.
 *  
 *  \param surface The surface to query.
 *  \param r A pointer filled in with the current red color value.
 *  \param g A pointer filled in with the current green color value.
 *  \param b A pointer filled in with the current blue color value.
 *  
 *  \return 0 on success, or -1 if the surface is not valid.
 *  
 *  \sa SDL_SetSurfaceColorMod()
 */

/**
 *  \brief Set an additional alpha value used in blit operations.
 *  
 *  \param surface The surface to update.
 *  \param alpha The alpha value multiplied into blit operations.
 *  
 *  \return 0 on success, or -1 if the surface is not valid.
 *  
 *  \sa SDL_GetSurfaceAlphaMod()
 */

/**
 *  \brief Get the additional alpha value used in blit operations.
 *  
 *  \param surface The surface to query.
 *  \param alpha A pointer filled in with the current alpha value.
 *  
 *  \return 0 on success, or -1 if the surface is not valid.
 *  
 *  \sa SDL_SetSurfaceAlphaMod()
 */

/**
 *  \brief Set the blend mode used for blit operations.
 *  
 *  \param surface The surface to update.
 *  \param blendMode ::SDL_BlendMode to use for blit blending.
 *  
 *  \return 0 on success, or -1 if the parameters are not valid.
 *  
 *  \sa SDL_GetSurfaceBlendMode()
 */

/**
 *  \brief Get the blend mode used for blit operations.
 *  
 *  \param surface   The surface to query.
 *  \param blendMode A pointer filled in with the current blend mode.
 *  
 *  \return 0 on success, or -1 if the surface is not valid.
 *  
 *  \sa SDL_SetSurfaceBlendMode()
 */

/**
 *  Sets the clipping rectangle for the destination surface in a blit.
 *  
 *  If the clip rectangle is NULL, clipping will be disabled.
 *  
 *  If the clip rectangle doesn't intersect the surface, the function will
 *  return SDL_FALSE and blits will be completely clipped.  Otherwise the
 *  function returns SDL_TRUE and blits to the surface will be clipped to
 *  the intersection of the surface area and the clipping rectangle.
 *  
 *  Note that blits are automatically clipped to the edges of the source
 *  and destination surfaces.
 */

/**
 *  Gets the clipping rectangle for the destination surface in a blit.
 *  
 *  \c rect must be a pointer to a valid rectangle which will be filled
 *  with the correct values.
 */

/**
 *  Creates a new surface of the specified format, and then copies and maps 
 *  the given surface to it so the blit of the converted surface will be as 
 *  fast as possible.  If this function fails, it returns NULL.
 *  
 *  The \c flags parameter is passed to SDL_CreateRGBSurface() and has those 
 *  semantics.  You can also pass ::SDL_RLEACCEL in the flags parameter and
 *  SDL will try to RLE accelerate colorkey and alpha blits in the resulting
 *  surface.
 */

/**
 * \brief Copy a block of pixels of one format to another format
 */

/**
 *  Performs a fast fill of the given rectangle with \c color.
 *  
 *  If \c rect is NULL, the whole surface will be filled with \c color.
 *  
 *  The color should be a pixel of the format used by the surface, and 
 *  can be generated by the SDL_MapRGB() function.
 *  
 *  \return 0 on success, or -1 on error.
 */

/**
 *  Performs a fast blit from the source surface to the destination surface.
 *  
 *  This assumes that the source and destination rectangles are
 *  the same size.  If either \c srcrect or \c dstrect are NULL, the entire
 *  surface (\c src or \c dst) is copied.  The final blit rectangles are saved
 *  in \c srcrect and \c dstrect after all clipping is performed.
 *  
 *  \return If the blit is successful, it returns 0, otherwise it returns -1.
 *
 *  The blit function should not be called on a locked surface.
 *
 *  The blit semantics for surfaces with and without alpha and colorkey
 *  are defined as follows:
 *  \verbatim
    RGBA->RGB:
      SDL_SRCALPHA set:
        alpha-blend (using alpha-channel).
        SDL_SRCCOLORKEY ignored.
      SDL_SRCALPHA not set:
        copy RGB.
        if SDL_SRCCOLORKEY set, only copy the pixels matching the
        RGB values of the source colour key, ignoring alpha in the
        comparison.
   
    RGB->RGBA:
      SDL_SRCALPHA set:
        alpha-blend (using the source per-surface alpha value);
        set destination alpha to opaque.
      SDL_SRCALPHA not set:
        copy RGB, set destination alpha to source per-surface alpha value.
      both:
        if SDL_SRCCOLORKEY set, only copy the pixels matching the
        source colour key.
   
    RGBA->RGBA:
      SDL_SRCALPHA set:
        alpha-blend (using the source alpha channel) the RGB values;
        leave destination alpha untouched. [Note: is this correct?]
        SDL_SRCCOLORKEY ignored.
      SDL_SRCALPHA not set:
        copy all of RGBA to the destination.
        if SDL_SRCCOLORKEY set, only copy the pixels matching the
        RGB values of the source colour key, ignoring alpha in the
       comparison.
   
    RGB->RGB: 
      SDL_SRCALPHA set:
        alpha-blend (using the source per-surface alpha value).
      SDL_SRCALPHA not set:
        copy RGB.
      both:
        if SDL_SRCCOLORKEY set, only copy the pixels matching the
        source colour key.
    \endverbatim
 *  
 *  You should call SDL_BlitSurface() unless you know exactly how SDL
 *  blitting works internally and how to use the other blit functions.
 */

/**
 *  This is the public blit function, SDL_BlitSurface(), and it performs
 *  rectangle validation and clipping before passing it to SDL_LowerBlit()
 */

/**
 *  This is a semi-private blit function and it performs low-level surface
 *  blitting only.
 */

/**
 *  \brief Perform a fast, low quality, stretch blit between two surfaces of the
 *         same pixel format.
 *  
 *  \note This function uses a static buffer, and is not thread-safe.
 */

/**
 *  This is the public scaled blit function, SDL_BlitScaled(), and it performs
 *  rectangle validation and clipping before passing it to SDL_LowerBlitScaled()
 */

/**
 *  This is a semi-private blit function and it performs low-level surface
 *  scaled blitting only.
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_surface_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_syswm.h ===
SHA256: 68303e2f94cdbae66e473506918a8f0d5aa3bddee73d233277f5b9dfe39c5d47
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_syswm.h
 *  
 *  Include file for SDL custom system window manager hooks.
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 *  \file SDL_syswm.h
 *  
 *  Your application has access to a special type of event ::SDL_SYSWMEVENT,
 *  which contains window-manager specific information and arrives whenever
 *  an unhandled window event occurs.  This event is ignored by default, but
 *  you can enable it with SDL_EventState().
 */

/* This is the structure for custom window manager events */

/* conflicts with Quickdraw.h */

/* matches the re-define above */

/* defined(SDL_VIDEO_DRIVER_X11) */

/** 
 *  These are the various supported windowing subsystems
 */

/**
 *  The custom event structure.
 */

/**< The window for the message */

/**< The type of message */

/**< WORD message parameter */

/**< LONG message parameter */

/* No Cocoa window events yet */

/* No UIKit window events yet */

/* Can't have an empty union */

/**
 *  The custom window manager information structure.
 *
 *  When this structure is returned, it holds information about which
 *  low level system it is using, and will be one of SDL_SYSWM_TYPE.
 */

/**< The window handle */

/**< The X11 display */

/**< The X11 window */

/**< The directfb main interface */

/**< The directfb window handle */

/**< The directfb client surface */

/* The Cocoa window */

/* The UIKit window */

/* Can't have an empty union */

/* SDL_PROTOTYPES_ONLY */

/* Function prototypes */

/**
 *  \brief This function allows access to driver-dependent window information.
 *  
 *  \param window The window about which information is being requested
 *  \param info This structure must be initialized with the SDL version, and is 
 *              then filled in with information about the given window.
 *  
 *  \return SDL_TRUE if the function is implemented and the version member of 
 *          the \c info struct is valid, SDL_FALSE otherwise.
 *  
 *  You typically use this function like this:
 *  \code
 *  SDL_SysWMinfo info;
 *  SDL_VERSION(&info.version);
 *  if ( SDL_GetWindowWMInfo(&info) ) { ... }
 *  \endcode
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_syswm_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_thread.h ===
SHA256: 7fedd11289a017fa4c236942ef80cedfeb2a10ef1b175744650427a5e3f7b9f4
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_thread.h
 *  
 *  Header for the SDL thread management routines.
 */

/* Thread synchronization primitives */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* The SDL thread structure, defined in SDL_thread.c */

/* The SDL thread ID */

/* The SDL thread priority
 *
 * Note: On many systems you require special privileges to set high priority.
 */

/* The function passed to SDL_CreateThread()
   It is passed a void* user context parameter and returns an int.
 */

/**
 *  \file SDL_thread.h
 *  
 *  We compile SDL into a DLL. This means, that it's the DLL which
 *  creates a new thread for the calling process with the SDL_CreateThread()
 *  API. There is a problem with this, that only the RTL of the SDL.DLL will
 *  be initialized for those threads, and not the RTL of the calling 
 *  application!
 *  
 *  To solve this, we make a little hack here.
 *  
 *  We'll always use the caller's _beginthread() and _endthread() APIs to
 *  start a new thread. This way, if it's the SDL.DLL which uses this API,
 *  then the RTL of SDL.DLL will be used to create the new thread, and if it's
 *  the application, then the RTL of the application will be used.
 *  
 *  So, in short:
 *  Always use the _beginthread() and _endthread() of the calling runtime 
 *  library!
 */

/* This has _beginthread() and _endthread() defined! */

/**
 *  Create a thread.
 */

/**
 *  Create a thread.
 */

/**
 *  Create a thread.
 */

/**
 *  Create a thread.
 */

/**
 *  Get the thread identifier for the current thread.
 */

/**
 *  Get the thread identifier for the specified thread.
 *  
 *  Equivalent to SDL_ThreadID() if the specified thread is NULL.
 */

/**
 *  Set the priority for the current thread
 */

/**
 *  Wait for a thread to finish.
 *  
 *  The return code for the thread function is placed in the area
 *  pointed to by \c status, if \c status is not NULL.
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_thread_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_timer.h ===
SHA256: 25bab1486f7730abf01dd72b87cb510ca1fed6fd826cf9e34c33fdba162646e0
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_timer.h
 *  
 *  Header for the SDL time management routines.
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 * \brief Get the number of milliseconds since the SDL library initialization.
 *  
 * \note This value wraps if the program runs for more than ~49 days.
 */

/**
 * \brief Get the current value of the high resolution counter
 */

/**
 * \brief Get the count per second of the high resolution counter
 */

/**
 * \brief Wait a specified number of milliseconds before returning.
 */

/**
 *  Function prototype for the timer callback function.
 *  
 *  The callback function is passed the current timer interval and returns
 *  the next timer interval.  If the returned value is the same as the one
 *  passed in, the periodic alarm continues, otherwise a new alarm is
 *  scheduled.  If the callback returns 0, the periodic alarm is cancelled.
 */

/**
 * Definition of the timer ID type.
 */

/**
 * \brief Add a new timer to the pool of timers already running.
 *
 * \return A timer ID, or NULL when an error occurs.
 */

/**
 * \brief Remove a timer knowing its ID.
 *
 * \return A boolean value indicating success or failure.
 *
 * \warning It is not safe to remove a timer multiple times.
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_timer_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_touch.h ===
SHA256: 1192deeef74eb4db906709c7b75114c55f8be6fa69fee7f6520695f8154d33b8
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/*
  ================================= IMPORTANT ================================
  This header taken from SDL2
  ============================================================================
*/

/**
 *  \file SDL_touch.h
 *
 *  Include file for SDL touch event handling.
 */

/* Set up for C function definitions, even when using C++ */

/* Used as the device ID for mouse events simulated with touch input */

/* Function prototypes */

/**
 *  \brief Get the number of registered touch devices.
 */

/**
 *  \brief Get the touch ID with the given index, or 0 if the index is invalid.
 */

/**
 *  \brief Get the number of active fingers for a given touch device.
 */

/**
 *  \brief Get the finger object of the given touch, with the given index.
 */

/* Ends C function definitions when using C++ */

/* _SDL_touch_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_ttf.h ===
SHA256: 3c52109d6ec58ac677e2a93d2a74e258a552dfa6439532607b6ff8360586a2f5
/*
  SDL_ttf:  A companion library to SDL for working with TrueType (tm) fonts
  Copyright (C) 2001-2012 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/* This library is a wrapper around the excellent FreeType 2.0 library,
   available at:
	http://www.freetype.org/
*/

/* Set up for C function definitions, even when using C++ */

/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
*/

/* This macro can be used to fill a version structure with the compile-time
 * version of the SDL_ttf library.
 */

/* Backwards compatibility */

/* This function gets the version of the dynamically linked SDL_ttf library.
   it should NOT be used to fill a version structure, instead you should
   use the SDL_TTF_VERSION() macro.
 */

/* ZERO WIDTH NO-BREAKSPACE (Unicode byte order mark) */

/* This function tells the library whether UNICODE text is generally
   byteswapped.  A UNICODE BOM character in a string will override
   this setting for the remainder of that string.
*/

/* The internal structure containing font information */

/* Initialize the TTF engine - returns 0 if successful, -1 on error */

/* Open a font file and create a font of the specified point size.
 * Some .fon fonts will have several sizes embedded in the file, so the
 * point size becomes the index of choosing which size.  If the value
 * is too high, the last indexed size will be the default. */

/* Set and retrieve the font style */

/* Set and retrieve FreeType hinter settings */

/* Get the total height of the font - usually equal to point size */

/* Get the offset from the baseline to the top of the font
   This is a positive value, relative to the baseline.
 */

/* Get the offset from the baseline to the bottom of the font
   This is a negative value, relative to the baseline.
 */

/* Get the recommended spacing between lines of text for this font */

/* Get/Set whether or not kerning is allowed for this font */

/* Get the number of faces of the font */

/* Get the font face attributes, if any */

/* Check wether a glyph is provided by the font or not */

/* Get the metrics (dimensions) of a glyph
   To understand what these metrics mean, here is a useful link:
    http://freetype.sourceforge.net/freetype2/docs/tutorial/step2.html
 */

/* Get the dimensions of a rendered string of text */

/* Create an 8-bit palettized surface and render the given text at
   fast quality with the given font and color.  The 0 pixel is the
   colorkey, giving a transparent background, and the 1 pixel is set
   to the text color.
   This function returns the new surface, or NULL if there was an error.
*/

/* Create an 8-bit palettized surface and render the given glyph at
   fast quality with the given font and color.  The 0 pixel is the
   colorkey, giving a transparent background, and the 1 pixel is set
   to the text color.  The glyph is rendered without any padding or
   centering in the X direction, and aligned normally in the Y direction.
   This function returns the new surface, or NULL if there was an error.
*/

/* Create an 8-bit palettized surface and render the given text at
   high quality with the given font and colors.  The 0 pixel is background,
   while other pixels have varying degrees of the foreground color.
   This function returns the new surface, or NULL if there was an error.
*/

/* Create an 8-bit palettized surface and render the given glyph at
   high quality with the given font and colors.  The 0 pixel is background,
   while other pixels have varying degrees of the foreground color.
   The glyph is rendered without any padding or centering in the X
   direction, and aligned normally in the Y direction.
   This function returns the new surface, or NULL if there was an error.
*/

/* Create a 32-bit ARGB surface and render the given text at high quality,
   using alpha blending to dither the font with the given color.
   This function returns the new surface, or NULL if there was an error.
*/

/* Create a 32-bit ARGB surface and render the given glyph at high quality,
   using alpha blending to dither the font with the given color.
   The glyph is rendered without any padding or centering in the X
   direction, and aligned normally in the Y direction.
   This function returns the new surface, or NULL if there was an error.
*/

/* For compatibility with previous versions, here are the old functions */

/* Close an opened font file */

/* De-initialize the TTF engine */

/* Check if the TTF engine is initialized */

/* Get the kerning size of two glyphs */

/* We'll use SDL for reporting errors */

/* Ends C function definitions when using C++ */

/* _SDL_TTF_H */


=== system/include/SDL/SDL_types.h ===
SHA256: 34504fb7121f28c25eea3d372d64279a79a0bef0336dc2b9ec6b1eb8a938cf09
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_types.h
 *  
 *  \deprecated
 */

/* DEPRECATED */


=== system/include/SDL/SDL_version.h ===
SHA256: 9c6ecd240fe51214fdede86209e0907d8b863c57de61f6141bdc75aba1760690
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_version.h
 *  
 *  This header defines the current SDL version.
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 *  \brief Information the version of SDL in use.
 *  
 *  Represents the library's version as three levels: major revision
 *  (increments with massive changes, additions, and enhancements),
 *  minor revision (increments with backwards-compatible changes to the
 *  major revision), and patchlevel (increments with fixes to the minor
 *  revision).
 *  
 *  \sa SDL_VERSION
 *  \sa SDL_GetVersion
 */

/**< major version */

/**< minor version */

/**< update version */

/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
*/

/**
 *  \brief Macro to determine SDL version program was compiled against.
 *  
 *  This macro fills in a SDL_version structure with the version of the
 *  library you compiled against. This is determined by what header the
 *  compiler uses. Note that if you dynamically linked the library, you might
 *  have a slightly newer or older version at runtime. That version can be
 *  determined with SDL_GetVersion(), which, unlike SDL_VERSION(),
 *  is not a macro.
 *  
 *  \param x A pointer to a SDL_version struct to initialize.
 *  
 *  \sa SDL_version
 *  \sa SDL_GetVersion
 */

/**
 *  This macro turns the version numbers into a numeric value:
 *  \verbatim
    (1,2,3) -> (1203)
    \endverbatim
 *  
 *  This assumes that there will never be more than 100 patchlevels.
 */

/**
 *  This is the version number macro for the current SDL version.
 */

/**
 *  This macro will evaluate to true if compiled with SDL at least X.Y.Z.
 */

/**
 *  \brief Get the version of SDL that is linked against your program.
 *
 *  If you are linking to SDL dynamically, then it is possible that the
 *  current version will be different than the version you compiled against.
 *  This function returns the current version, while SDL_VERSION() is a
 *  macro that tells you what version you compiled with.
 *  
 *  \code
 *  SDL_version compiled;
 *  SDL_version linked;
 *  
 *  SDL_VERSION(&compiled);
 *  SDL_GetVersion(&linked);
 *  printf("We compiled against SDL version %d.%d.%d ...\n",
 *         compiled.major, compiled.minor, compiled.patch);
 *  printf("But we linked against SDL version %d.%d.%d.\n",
 *         linked.major, linked.minor, linked.patch);
 *  \endcode
 *  
 *  This function may be called safely at any time, even before SDL_Init().
 *  
 *  \sa SDL_VERSION
 */

/**
 *  \brief Get the code revision of SDL that is linked against your program.
 *
 *  Returns an arbitrary string (a hash value) uniquely identifying the
 *  exact revision of the SDL library in use, and is only useful in comparing
 *  against other revisions. It is NOT an incrementing number.
 */

/**
 *  \brief Get the revision number of SDL that is linked against your program.
 *
 *  Returns a number uniquely identifying the exact revision of the SDL
 *  library in use. It is an incrementing number based on commits to
 *  hg.libsdl.org.
 */

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_version_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/SDL_video.h ===
SHA256: e00b737c587e437059976df09c9d59db5c7f92ea95b07f9cb738daa8380e7cd6
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file SDL_video.h
 *  
 *  Header file for SDL video functions.
 */

/* Set up for C function definitions, even when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/**
 *  \brief  The structure that defines a display mode
 *  
 *  \sa SDL_GetNumDisplayModes()
 *  \sa SDL_GetDisplayMode()
 *  \sa SDL_GetDesktopDisplayMode()
 *  \sa SDL_GetCurrentDisplayMode()
 *  \sa SDL_GetClosestDisplayMode()
 *  \sa SDL_SetWindowDisplayMode()
 *  \sa SDL_GetWindowDisplayMode()
 */

/**< pixel format */

/**< width */

/**< height */

/**< refresh rate (or zero for unspecified) */

/**< driver-specific data, initialize to 0 */

/**
 *  \brief The type used to identify a window
 *  
 *  \sa SDL_CreateWindow()
 *  \sa SDL_CreateWindowFrom()
 *  \sa SDL_DestroyWindow()
 *  \sa SDL_GetWindowData()
 *  \sa SDL_GetWindowFlags()
 *  \sa SDL_GetWindowGrab()
 *  \sa SDL_GetWindowPosition()
 *  \sa SDL_GetWindowSize()
 *  \sa SDL_GetWindowTitle()
 *  \sa SDL_HideWindow()
 *  \sa SDL_MaximizeWindow()
 *  \sa SDL_MinimizeWindow()
 *  \sa SDL_RaiseWindow()
 *  \sa SDL_RestoreWindow()
 *  \sa SDL_SetWindowData()
 *  \sa SDL_SetWindowFullscreen()
 *  \sa SDL_SetWindowGrab()
 *  \sa SDL_SetWindowIcon()
 *  \sa SDL_SetWindowPosition()
 *  \sa SDL_SetWindowSize()
 *  \sa SDL_SetWindowTitle()
 *  \sa SDL_ShowWindow()
 */

/**
 *  \brief The flags on a window
 *  
 *  \sa SDL_GetWindowFlags()
 */

/**< fullscreen window */

/**< window usable with OpenGL context */

/**< window is visible */

/**< window is not visible */

/**< no window decoration */

/**< window can be resized */

/**< window is minimized */

/**< window is maximized */

/**< window has grabbed input focus */

/**< window has input focus */

/**< window has mouse focus */

/**< window not created by SDL */

/**
 *  \brief Used to indicate that you don't care what the window position is.
 */

/**
 *  \brief Used to indicate that the window position should be centered.
 */

/**
 *  \brief Event subtype for window events
 */

/**< Never used */

/**< Window has been shown */

/**< Window has been hidden */

/**< Window has been exposed and should be 
                                         redrawn */

/**< Window has been moved to data1, data2 
                                     */

/**< Window has been resized to data1xdata2 */

/**< The window size has changed, either as a result of an API call or through the system or user changing the window size. */

/**< Window has been minimized */

/**< Window has been maximized */

/**< Window has been restored to normal size
                                         and position */

/**< Window has gained mouse focus */

/**< Window has lost mouse focus */

/**< Window has gained keyboard focus */

/**< Window has lost keyboard focus */

/**< The window manager requests that the 
                                         window be closed */

/**
 *  \brief An opaque handle to an OpenGL context.
 */

/**
 *  \brief OpenGL configuration attributes
 */

/* Function prototypes */

/**
 *  \brief Get the number of video drivers compiled into SDL
 *  
 *  \sa SDL_GetVideoDriver()
 */

/**
 *  \brief Get the name of a built in video driver.
 *  
 *  \note The video drivers are presented in the order in which they are
 *        normally checked during initialization.
 *  
 *  \sa SDL_GetNumVideoDrivers()
 */

/**
 *  \brief Initialize the video subsystem, optionally specifying a video driver.
 *  
 *  \param driver_name Initialize a specific driver by name, or NULL for the 
 *                     default video driver.
 *  
 *  \return 0 on success, -1 on error
 *  
 *  This function initializes the video subsystem; setting up a connection
 *  to the window manager, etc, and determines the available display modes
 *  and pixel formats, but does not initialize a window or graphics mode.
 *  
 *  \sa SDL_VideoQuit()
 */

/**
 *  \brief Shuts down the video subsystem.
 *  
 *  This function closes all windows, and restores the original video mode.
 *  
 *  \sa SDL_VideoInit()
 */

/**
 *  \brief Returns the name of the currently initialized video driver.
 *  
 *  \return The name of the current video driver or NULL if no driver
 *          has been initialized
 *  
 *  \sa SDL_GetNumVideoDrivers()
 *  \sa SDL_GetVideoDriver()
 */

/**
 *  \brief Returns the number of available video displays.
 *  
 *  \sa SDL_GetDisplayBounds()
 */

/**
 *  \brief Get the desktop area represented by a display, with the primary
 *         display located at 0,0
 *  
 *  \return 0 on success, or -1 if the index is out of range.
 *  
 *  \sa SDL_GetNumVideoDisplays()
 */

/**
 *  \brief Returns the number of available display modes.
 *  
 *  \sa SDL_GetDisplayMode()
 */

/**
 *  \brief Fill in information about a specific display mode.
 *  
 *  \note The display modes are sorted in this priority:
 *        \li bits per pixel -> more colors to fewer colors
 *        \li width -> largest to smallest
 *        \li height -> largest to smallest
 *        \li refresh rate -> highest to lowest
 *  
 *  \sa SDL_GetNumDisplayModes()
 */

/**
 *  \brief Fill in information about the desktop display mode.
 */

/**
 *  \brief Fill in information about the current display mode.
 */

/**
 *  \brief Get the closest match to the requested display mode.
 *  
 *  \param mode The desired display mode
 *  \param closest A pointer to a display mode to be filled in with the closest 
 *                 match of the available display modes.
 *  
 *  \return The passed in value \c closest, or NULL if no matching video mode 
 *          was available.
 *  
 *  The available display modes are scanned, and \c closest is filled in with the
 *  closest mode matching the requested mode and returned.  The mode format and 
 *  refresh_rate default to the desktop mode if they are 0.  The modes are 
 *  scanned with size being first priority, format being second priority, and 
 *  finally checking the refresh_rate.  If all the available modes are too 
 *  small, then NULL is returned.
 *  
 *  \sa SDL_GetNumDisplayModes()
 *  \sa SDL_GetDisplayMode()
 */

/**
 *  \brief Get the display index associated with a window.
 *  
 *  \return the display index of the display containing the center of the
 *          window, or -1 on error.
 */

/**
 *  \brief Set the display mode used when a fullscreen window is visible.
 *
 *  By default the window's dimensions and the desktop format and refresh rate
 *  are used.
 *  
 *  \param mode The mode to use, or NULL for the default mode.
 *  
 *  \return 0 on success, or -1 if setting the display mode failed.
 *  
 *  \sa SDL_GetWindowDisplayMode()
 *  \sa SDL_SetWindowFullscreen()
 */

/**
 *  \brief Fill in information about the display mode used when a fullscreen
 *         window is visible.
 *
 *  \sa SDL_SetWindowDisplayMode()
 *  \sa SDL_SetWindowFullscreen()
 */

/**
 *  \brief Get the pixel format associated with the window.
 */

/**
 *  \brief Create a window with the specified position, dimensions, and flags.
 *  
 *  \param title The title of the window, in UTF-8 encoding.
 *  \param x     The x position of the window, ::SDL_WINDOWPOS_CENTERED, or 
 *               ::SDL_WINDOWPOS_UNDEFINED.
 *  \param y     The y position of the window, ::SDL_WINDOWPOS_CENTERED, or 
 *               ::SDL_WINDOWPOS_UNDEFINED.
 *  \param w     The width of the window.
 *  \param h     The height of the window.
 *  \param flags The flags for the window, a mask of any of the following: 
 *               ::SDL_WINDOW_FULLSCREEN, ::SDL_WINDOW_OPENGL, 
 *               ::SDL_WINDOW_SHOWN,      ::SDL_WINDOW_BORDERLESS, 
 *               ::SDL_WINDOW_RESIZABLE,  ::SDL_WINDOW_MAXIMIZED, 
 *               ::SDL_WINDOW_MINIMIZED,  ::SDL_WINDOW_INPUT_GRABBED.
 *  
 *  \return The id of the window created, or zero if window creation failed.
 *  
 *  \sa SDL_DestroyWindow()
 */

/**
 *  \brief Create an SDL window from an existing native window.
 *  
 *  \param data A pointer to driver-dependent window creation data
 *  
 *  \return The id of the window created, or zero if window creation failed.
 *  
 *  \sa SDL_DestroyWindow()
 */

/**
 *  \brief Get the numeric ID of a window, for logging purposes.
 */

/**
 *  \brief Get a window from a stored ID, or NULL if it doesn't exist.
 */

/**
 *  \brief Get the window flags.
 */

/**
 *  \brief Set the title of a window, in UTF-8 format.
 *  
 *  \sa SDL_GetWindowTitle()
 */

/**
 *  \brief Get the title of a window, in UTF-8 format.
 *  
 *  \sa SDL_SetWindowTitle()
 */

/**
 *  \brief Set the icon for a window.
 *  
 *  \param icon The icon for the window.
 */

/**
 *  \brief Associate an arbitrary named pointer with a window.
 *  
 *  \param window   The window to associate with the pointer.
 *  \param name     The name of the pointer.
 *  \param userdata The associated pointer.
 *
 *  \return The previous value associated with 'name'
 *
 *  \note The name is case-sensitive.
 *
 *  \sa SDL_GetWindowData()
 */

/**
 *  \brief Retrieve the data pointer associated with a window.
 *  
 *  \param window   The window to query.
 *  \param name     The name of the pointer.
 *
 *  \return The value associated with 'name'
 *  
 *  \sa SDL_SetWindowData()
 */

/**
 *  \brief Set the position of a window.
 *  
 *  \param window   The window to reposition.
 *  \param x        The x coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or
                    ::SDL_WINDOWPOS_UNDEFINED.
 *  \param y        The y coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or
                    ::SDL_WINDOWPOS_UNDEFINED.
 *  
 *  \note The window coordinate origin is the upper left of the display.
 *  
 *  \sa SDL_GetWindowPosition()
 */

/**
 *  \brief Get the position of a window.
 *  
 *  \sa SDL_SetWindowPosition()
 */

/**
 *  \brief Set the size of a window's client area.
 *  
 *  \note You can't change the size of a fullscreen window, it automatically
 *        matches the size of the display mode.
 *  
 *  \sa SDL_GetWindowSize()
 */

/**
 *  \brief Get the size of a window's client area.
 *  
 *  \sa SDL_SetWindowSize()
 */

/**
 *  \brief Show a window.
 *  
 *  \sa SDL_HideWindow()
 */

/**
 *  \brief Hide a window.
 *  
 *  \sa SDL_ShowWindow()
 */

/**
 *  \brief Raise a window above other windows and set the input focus.
 */

/**
 *  \brief Make a window as large as possible.
 *  
 *  \sa SDL_RestoreWindow()
 */

/**
 *  \brief Minimize a window to an iconic representation.
 *  
 *  \sa SDL_RestoreWindow()
 */

/**
 *  \brief Restore the size and position of a minimized or maximized window.
 *  
 *  \sa SDL_MaximizeWindow()
 *  \sa SDL_MinimizeWindow()
 */

/**
 *  \brief Set a window's fullscreen state.
 *  
 *  \return 0 on success, or -1 if setting the display mode failed.
 *  
 *  \sa SDL_SetWindowDisplayMode()
 *  \sa SDL_GetWindowDisplayMode()
 */

/**
 *  \brief Get the SDL surface associated with the window.
 *
 *  \return The window's framebuffer surface, or NULL on error. 
 *
 *  A new surface will be created with the optimal format for the window,
 *  if necessary. This surface will be freed when the window is destroyed.
 *
 *  \note You may not combine this with 3D or the rendering API on this window.
 *
 *  \sa SDL_UpdateWindowSurface()
 *  \sa SDL_UpdateWindowSurfaceRects()
 */

/**
 *  \brief Copy the window surface to the screen.
 *
 *  \return 0 on success, or -1 on error.
 *
 *  \sa SDL_GetWindowSurface()
 *  \sa SDL_UpdateWindowSurfaceRects()
 */

/**
 *  \brief Copy a number of rectangles on the window surface to the screen.
 *
 *  \return 0 on success, or -1 on error.
 *
 *  \sa SDL_GetWindowSurface()
 *  \sa SDL_UpdateWindowSurfaceRect()
 */

/**
 *  \brief Set a window's input grab mode.
 *  
 *  \param grabbed This is SDL_TRUE to grab input, and SDL_FALSE to release input.
 *  
 *  \sa SDL_GetWindowGrab()
 */

/**
 *  \brief Get a window's input grab mode.
 *  
 *  \return This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise.
 *  
 *  \sa SDL_SetWindowGrab()
 */

/**
 *  \brief Set the brightness (gamma correction) for a window.
 *  
 *  \return 0 on success, or -1 if setting the brightness isn't supported.
 *  
 *  \sa SDL_GetWindowBrightness()
 *  \sa SDL_SetWindowGammaRamp()
 */

/**
 *  \brief Get the brightness (gamma correction) for a window.
 *  
 *  \return The last brightness value passed to SDL_SetWindowBrightness()
 *  
 *  \sa SDL_SetWindowBrightness()
 */

/**
 *  \brief Set the gamma ramp for a window.
 *  
 *  \param red The translation table for the red channel, or NULL.
 *  \param green The translation table for the green channel, or NULL.
 *  \param blue The translation table for the blue channel, or NULL.
 *  
 *  \return 0 on success, or -1 if gamma ramps are unsupported.
 *  
 *  Set the gamma translation table for the red, green, and blue channels
 *  of the video hardware.  Each table is an array of 256 16-bit quantities,
 *  representing a mapping between the input and output for that channel.
 *  The input is the index into the array, and the output is the 16-bit
 *  gamma value at that index, scaled to the output color precision.
 *
 *  \sa SDL_GetWindowGammaRamp()
 */

/**
 *  \brief Get the gamma ramp for a window.
 *  
 *  \param red   A pointer to a 256 element array of 16-bit quantities to hold 
 *               the translation table for the red channel, or NULL.
 *  \param green A pointer to a 256 element array of 16-bit quantities to hold 
 *               the translation table for the green channel, or NULL.
 *  \param blue  A pointer to a 256 element array of 16-bit quantities to hold 
 *               the translation table for the blue channel, or NULL.
 *   
 *  \return 0 on success, or -1 if gamma ramps are unsupported.
 *  
 *  \sa SDL_SetWindowGammaRamp()
 */

/**
 *  \brief Destroy a window.
 */

/**
 *  \brief Returns whether the screensaver is currently enabled (default on).
 *  
 *  \sa SDL_EnableScreenSaver()
 *  \sa SDL_DisableScreenSaver()
 */

/**
 *  \brief Allow the screen to be blanked by a screensaver
 *  
 *  \sa SDL_IsScreenSaverEnabled()
 *  \sa SDL_DisableScreenSaver()
 */

/**
 *  \brief Prevent the screen from being blanked by a screensaver
 *  
 *  \sa SDL_IsScreenSaverEnabled()
 *  \sa SDL_EnableScreenSaver()
 */

/**
 *  \name OpenGL support functions
 */

/*@{*/

/**
 *  \brief Dynamically load an OpenGL library.
 *  
 *  \param path The platform dependent OpenGL library name, or NULL to open the 
 *              default OpenGL library.
 *  
 *  \return 0 on success, or -1 if the library couldn't be loaded.
 *  
 *  This should be done after initializing the video driver, but before
 *  creating any OpenGL windows.  If no OpenGL library is loaded, the default
 *  library will be loaded upon creation of the first OpenGL window.
 *  
 *  \note If you do this, you need to retrieve all of the GL functions used in
 *        your program from the dynamic library using SDL_GL_GetProcAddress().
 *  
 *  \sa SDL_GL_GetProcAddress()
 *  \sa SDL_GL_UnloadLibrary()
 */

/**
 *  \brief Get the address of an OpenGL function.
 */

/**
 *  \brief Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary().
 *  
 *  \sa SDL_GL_LoadLibrary()
 */

/**
 *  \brief Return true if an OpenGL extension is supported for the current 
 *         context.
 */

/**
 *  \brief Set an OpenGL window attribute before window creation.
 */

/**
 *  \brief Get the actual value for an attribute from the current context.
 */

/**
 *  \brief Create an OpenGL context for use with an OpenGL window, and make it 
 *         current.
 *  
 *  \sa SDL_GL_DeleteContext()
 */

/**
 *  \brief Set up an OpenGL context for rendering into an OpenGL window.
 *  
 *  \note The context must have been created with a compatible window.
 */

/**
 *  \brief Set the swap interval for the current OpenGL context.
 *  
 *  \param interval 0 for immediate updates, 1 for updates synchronized with the
 *                  vertical retrace.
 *  
 *  \return 0 on success, or -1 if setting the swap interval is not supported.
 *  
 *  \sa SDL_GL_GetSwapInterval()
 */

/**
 *  \brief Get the swap interval for the current OpenGL context.
 *  
 *  \return 0 if there is no vertical retrace synchronization, 1 if the buffer 
 *          swap is synchronized with the vertical retrace, and -1 if getting 
 *          the swap interval is not supported.
 *  
 *  \sa SDL_GL_SetSwapInterval()
 */

/**
 * \brief Swap the OpenGL buffers for a window, if double-buffering is 
 *        supported.
 */

/**
 *  \brief Delete an OpenGL context.
 *  
 *  \sa SDL_GL_CreateContext()
 */

/*@}*/

/*OpenGL support functions*/

/* Ends C function definitions when using C++ */

/* *INDENT-OFF* */

/* *INDENT-ON* */

/* _SDL_video_h */

/* vi: set ts=4 sw=4 expandtab: */


=== system/include/SDL/begin_code.h ===
SHA256: 384f11791e66b98555c3b32e90a76bb9f9f22677c0f5043f9b9971adb1c388ba
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file begin_code.h
 *
 *  This file sets things up for C dynamic library function definitions,
 *  static inlined functions, and structures aligned at 4-byte alignment.
 *  If you don't like ugly C preprocessor code, don't look at this file. :)
 */

/* This shouldn't be nested -- included it around code only. */

/* Some compilers use a special export keyword */

/* By default SDL uses the C calling convention */

/* SDLCALL */

/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */

/* __SYMBIAN32__ */

/* Force structure packing at 4 byte alignment.
   This is necessary if the header is included in code which has structure
   packing set to an alternate value, say for loading structures from disk.
   The packing is reset to the previous value in close_code.h
 */

/* Compiler needs structure packing set */

/* Set up compiler-specific options for inlining functions */

/* Add any special compiler-specific cases here */

/* Not a funky compiler */

/* Visual C++ */

/* GNU C */

/* SDL_INLINE_OKAY */

/* If inlining isn't supported, remove "__inline__", turning static
   inlined functions into static functions (resulting in code bloat
   in all files which include the offending header files)
*/

/* Apparently this is needed by several Windows compilers */

/* NULL */

/* ! Mac OS X - breaks precompiled headers */


=== system/include/SDL/close_code.h ===
SHA256: e299f0e8515a7cdb90aaca8c8876f4caea40f196a21be954b2d4e94a4ad67842
/*
  Simple DirectMedia Layer
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.
*/

/**
 *  \file close_code.h
 *  
 *  This file reverses the effects of begin_code.h and should be included
 *  after you finish any function and structure declarations in your headers
 */

/* Reset structure packing at previous byte alignment */

/* Compiler needs structure packing set */


=== system/include/X11/X.h ===
SHA256: 26a7649965968fbea32d2b04c6e2daa8ab9dd86cbd3abcdf24f0a806b008834d
/* Definitions for the X window system likely to be used by applications */

/***********************************************************

Copyright 1987, 1998  The Open Group

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.

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
OPEN GROUP 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.

Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.


Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.

                        All Rights Reserved

Permission to use, copy, modify, and distribute this software and its 
documentation for any purpose and without fee is hereby granted, 
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in 
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.  

DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.

******************************************************************/

/* current protocol version */

/* current minor version */

/* Resources */

/*
 * _XSERVER64 must ONLY be defined when compiling X server sources on
 * systems where unsigned long is not 32 bits, must NOT be used in
 * client or library code.
 */

/* Also in Xdefs.h */

/*****************************************************************
 * RESERVED RESOURCE AND CONSTANT DEFINITIONS
 *****************************************************************/

/* universal null resource or null atom */

/* background pixmap in CreateWindow
				    and ChangeWindowAttributes */

/* border pixmap in CreateWindow
				       and ChangeWindowAttributes
				   special VisualID and special window
				       class passed to CreateWindow */

/* destination window in SendEvent */

/* destination window in SendEvent */

/* focus window in SetInputFocus */

/* special Atom, passed to GetProperty */

/* special Key Code, passed to GrabKey */

/* special Button Code, passed to GrabButton */

/* special Resource ID passed to KillClient */

/* special Time */

/* special KeySym */

/***************************************************************** 
 * EVENT DEFINITIONS 
 *****************************************************************/

/* Input Event Masks. Used as event-mask window attribute and as arguments
   to Grab requests.  Not to be confused with event names.  */

/* Event names.  Used in "type" field in XEvent structures.  Not to be
confused with event masks above.  They start from 2 because 0 and 1
are reserved in the protocol for errors and replies. */

/* must be bigger than any event # */

/* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
   state in various key-, mouse-, and button-related events. */

/* modifier names.  Used to build a SetModifierMapping request or
   to read a GetModifierMapping request.  These correspond to the
   masks defined above. */

/* button masks.  Used in same manner as Key masks above. Not to be confused
   with button names below. */

/* used in GrabButton, GrabKey */

/* button names. Used as arguments to GrabButton and as detail in ButtonPress
   and ButtonRelease events.  Not to be confused with button masks above.
   Note that 0 is already defined above as "AnyButton".  */

/* Notify modes */

/* for MotionNotify events */

/* Notify detail */

/* Visibility notify */

/* Circulation request */

/* protocol families */

/* IPv4 */

/* IPv6 */

/* authentication families not tied to a specific protocol */

/* Property notification */

/* Color Map notification */

/* GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes */

/* GrabPointer, GrabKeyboard reply status */

/* AllowEvents modes */

/* Used in SetInputFocus, GetInputFocus */

/*****************************************************************
 * ERROR CODES 
 *****************************************************************/

/* everything's okay */

/* bad request code */

/* int parameter out of range */

/* parameter not a Window */

/* parameter not a Pixmap */

/* parameter not an Atom */

/* parameter not a Cursor */

/* parameter not a Font */

/* parameter mismatch */

/* parameter not a Pixmap or Window */

/* depending on context:
				 - key/button already grabbed
				 - attempt to free an illegal 
				   cmap entry 
				- attempt to store into a read-only 
				   color map entry.
 				- attempt to modify the access control
				   list from other than the local host.
				*/

/* insufficient resources */

/* no such colormap */

/* parameter not a GC */

/* choice not in range or already used */

/* font or color name doesn't exist */

/* Request length incorrect */

/* server is defective */

/*****************************************************************
 * WINDOW DEFINITIONS 
 *****************************************************************/

/* Window classes used by CreateWindow */

/* Note that CopyFromParent is already defined as 0 above */

/* Window attributes for CreateWindow and ChangeWindowAttributes */

/* ConfigureWindow structure */

/* Bit Gravity */

/* Window gravity + bit gravity above */

/* Used in CreateWindow for backing-store hint */

/* Used in GetWindowAttributes reply */

/* Used in ChangeSaveSet */

/* Used in ChangeCloseDownMode */

/* Window stacking method (in configureWindow) */

/* Circulation direction */

/* Property modes */

/*****************************************************************
 * GRAPHICS DEFINITIONS
 *****************************************************************/

/* graphics functions, as in GC.alu */

/* 0 */

/* src AND dst */

/* src AND NOT dst */

/* src */

/* NOT src AND dst */

/* dst */

/* src XOR dst */

/* src OR dst */

/* NOT src AND NOT dst */

/* NOT src XOR dst */

/* NOT dst */

/* src OR NOT dst */

/* NOT src */

/* NOT src OR dst */

/* NOT src OR NOT dst */

/* 1 */

/* LineStyle */

/* capStyle */

/* joinStyle */

/* fillStyle */

/* fillRule */

/* subwindow mode */

/* SetClipRectangles ordering */

/* CoordinateMode for drawing routines */

/* relative to the origin */

/* relative to previous point */

/* Polygon shapes */

/* paths may intersect */

/* no paths intersect, but not convex */

/* wholly convex */

/* Arc modes for PolyFillArc */

/* join endpoints of arc */

/* join endpoints to center of arc */

/* GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into
   GC.stateChanges */

/*****************************************************************
 * FONTS 
 *****************************************************************/

/* used in QueryFont -- draw direction */

/*****************************************************************
 *  IMAGING 
 *****************************************************************/

/* ImageFormat -- PutImage, GetImage */

/* depth 1, XYFormat */

/* depth == drawable depth */

/* depth == drawable depth */

/*****************************************************************
 *  COLOR MAP STUFF 
 *****************************************************************/

/* For CreateColormap */

/* create map with no entries */

/* allocate entire map writeable */

/* Flags used in StoreNamedColor, StoreColors */

/*****************************************************************
 * CURSOR STUFF
 *****************************************************************/

/* QueryBestSize Class */

/* largest size that can be displayed */

/* size tiled fastest */

/* size stippled fastest */

/***************************************************************** 
 * KEYBOARD/POINTER STUFF
 *****************************************************************/

/* masks for ChangeKeyboardControl */

/*****************************************************************
 * SCREEN SAVER STUFF 
 *****************************************************************/

/* for ForceScreenSaver */

/*****************************************************************
 * HOSTS AND CONNECTIONS
 *****************************************************************/

/* for ChangeHosts */

/* for ChangeAccessControl */

/* Display classes  used in opening the connection 
 * Note that the statically allocated ones are even numbered and the
 * dynamically changeable ones are odd numbered */

/* Byte order  used in imageByteOrder and bitmapBitOrder */

/* X_H */


=== system/include/X11/XKBlib.h ===
SHA256: a6979a801ea5dd3f66c30bfbc7c01759119074bae1dfcdae195fde13a9065c3b
/************************************************************
Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.

Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation, and that the name of Silicon Graphics not be
used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.

SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.

********************************************************/

/* XkbAnyEvent */

/* # of last req processed by server */

/* is this from a SendEvent request? */

/* Display the event was read from */

/* milliseconds */

/* XKB event minor code */

/* device ID */

/* XkbAnyEvent */

/* of last req processed by server */

/* is this from a SendEvent request? */

/* Display the event was read from */

/* milliseconds */

/* XkbNewKeyboardNotify */

/* device ID */

/* device ID of previous keyboard */

/* minimum key code */

/* maximum key code */

/* min key code of previous kbd */

/* max key code of previous kbd */

/* changed aspects of the keyboard */

/* major and minor opcode of req */

/* that caused change, if applicable */

/* XkbAnyEvent */

/* of last req processed by server */

/* is this from a SendEvent request */

/* Display the event was read from */

/* milliseconds */

/* XkbMapNotify */

/* device ID */

/* fields which have been changed */

/* reserved */

/* first changed key type */

/* number of changed key types */

/* mask of changed virtual mods */

/* XkbAnyEvent */

/* # of last req processed by server */

/* is this from a SendEvent request? */

/* Display the event was read from */

/* milliseconds */

/* XkbStateNotify */

/* device ID */

/* mask of changed state components */

/* keyboard group */

/* base keyboard group */

/* latched keyboard group */

/* locked keyboard group */

/* modifier state */

/* base modifier state */

/* latched modifiers */

/* locked modifiers */

/* compatibility state */

/* mods used for grabs */

/* grab mods for non-XKB clients */

/* mods sent to clients */

/* mods sent to non-XKB clients */

/* pointer button state */

/* keycode that caused the change */

/* KeyPress or KeyRelease */

/* Major opcode of request */

/* Minor opcode of request */

/* XkbAnyEvent */

/* of last req processed by server */

/* is this from a SendEvent request? */

/* Display the event was read from */

/* milliseconds */

/* XkbControlsNotify */

/* device ID */

/* controls with changed sub-values */

/* controls currently enabled */

/* controls just {en,dis}abled */

/* total groups on keyboard */

/* key that caused change or 0 */

/* type of event that caused change */

/* if keycode==0, major and minor */

/* opcode of req that caused change */

/* XkbAnyEvent */

/* of last req processed by server */

/* is this from a SendEvent request? */

/* Display the event was read from */

/* milliseconds */

/* XkbIndicatorNotify */

/* device ID */

/* indicators with new state or map */

/* current state of all indicators */

/* XkbAnyEvent */

/* of last req processed by server */

/* is this from a SendEvent request? */

/* Display the event was read from */

/* milliseconds */

/* XkbNamesNotify */

/* device ID */

/* names that have changed */

/* first key type with new name */

/* number of key types with new names */

/* first key type new new level names */

/* # of key types w/new level names */

/* total number of key aliases*/

/* total number of radio groups */

/* virtual modifiers with new names */

/* groups with new names */

/* indicators with new names */

/* first key with new name */

/* number of keys with new names */

/* XkbAnyEvent */

/* of last req processed by server */

/* is this from a SendEvent request? */

/* Display the event was read from */

/* milliseconds */

/* XkbCompatMapNotify */

/* device ID */

/* groups with new compat maps */

/* first new symbol interp */

/* number of new symbol interps */

/* total # of symbol interps */

/* XkbAnyEvent */

/* of last req processed by server */

/* is this from a SendEvent request? */

/* Display the event was read from */

/* milliseconds */

/* XkbBellNotify */

/* device ID */

/* requested volume as a % of maximum */

/* requested pitch in Hz */

/* requested duration in useconds */

/* (input extension) feedback class */

/* (input extension) ID of feedback */

/* "name" of requested bell */

/* window associated with event */

/* "event only" requested */

/* XkbAnyEvent */

/* of last req processed by server */

/* is this from a SendEvent request? */

/* Display the event was read from */

/* milliseconds */

/* XkbActionMessage */

/* device ID */

/* key that generated the event */

/* true if act caused by key press */

/* true if key event also generated */

/* effective group */

/* effective mods */

/* message -- leave space for NUL */

/* XkbAnyEvent */

/* of last req processed by server */

/* is this from a SendEvent request? */

/* Display the event was read from */

/* milliseconds */

/* XkbAccessXNotify */

/* device ID */

/* XkbAXN_* */

/* key of event */

/* current slow keys delay */

/* current debounce delay */

/* XkbAnyEvent */

/* of last req processed by server */

/* is this from a SendEvent request? */

/* Display the event was read from */

/* milliseconds */

/* XkbExtensionDeviceNotify */

/* device ID */

/* reason for the event */

/* mask of supported features */

/* mask of unsupported features */

/* that some app tried to use */

/* first button that changed */

/* range of buttons changed */

/* indicators with names or maps */

/* current state of the indicators */

/* feedback class for led changes */

/* feedback id for led changes */

/* XkbOpenDisplay error codes */

/* Values for XlibFlags */

/* ignore */

/* name */

/* ev_rtrn */

/* err_rtrn */

/* major_rtrn */

/* minor_rtrn */

/* reason */

/* dpy */

/* opcodeReturn */

/* eventBaseReturn */

/* errorBaseReturn */

/* majorRtrn */

/* minorRtrn */

/* dpy */

/* major_rtrn */

/* minor_rtrn */

/* libMajorRtrn */

/* libMinorRtrn */

/* dpy */

/* affect */

/* values */

/* dpy */

/* dpy */

/* name */

/* only_if_exists */

/* dpy */

/* atom */

/* getAtom */

/* getName */

/* dpy */

/* kc */

/* kc */

/* group */

/* level */

/* dpy */

/* ks */

/* dpy */

/* keycode */

/* modifiers */

/* modifiers_return */

/* keysym_return */

/* dpy */

/* sym_rtrn */

/* mods */

/* buffer */

/* nbytes */

/* extra_rtrn */

/* xkb */

/* keycode */

/* modifiers */

/* modifiers_return */

/* keysym_return */

/* dpy */

/* sym_return */

/* modifiers */

/* buffer */

/* nbytes */

/* extra_rtrn */

/* dpy */

/* deviceSpec */

/* delay */

/* interval */

/* dpy */

/* deviceSpec */

/* delayRtrn */

/* intervalRtrn */

/* dpy */

/* deviceSpec */

/* affect */

/* values */

/* dpy */

/* win */

/* deviceSpec */

/* bellClass */

/* bellID */

/* percent */

/* name */

/* dpy */

/* deviceSpec */

/* bellClass */

/* bellID */

/* percent */

/* dpy */

/* win */

/* deviceSpec */

/* bellClass */

/* bellID */

/* percent */

/* name */

/* dpy */

/* win */

/* percent */

/* name */

/* dpy */

/* percent */

/* dpy */

/* win */

/* percent */

/* name */

/* dpy */

/* deviceID */

/* affect */

/* values */

/* dpy */

/* deviceID */

/* eventType */

/* affect */

/* details */

/* old */

/* new */

/* wanted */

/* old */

/* new */

/* wanted */

/* dpy */

/* deviceSpec */

/* pStateRtrn */

/* dpy */

/* deviceSpec */

/* ledClass */

/* ledID */

/* pStateRtrn */

/* dpy */

/* which */

/* desc */

/* dpy */

/* which */

/* desc */

/* dpy */

/* name */

/* pNdxRtrn */

/* pStateRtrn */

/* pMapRtrn */

/* pRealRtrn */

/* dpy */

/* deviceSpec */

/* ledClass */

/* ledID */

/* name */

/* pNdxRtrn */

/* pStateRtrn */

/* pMapRtrn */

/* pRealRtrn */

/* dpy */

/* name */

/* changeState */

/* state */

/* createNewMap */

/* pMap */

/* dpy */

/* deviceSpec */

/* ledClass */

/* ledID */

/* name */

/* changeState */

/* state */

/* createNewMap */

/* pMap */

/* dpy */

/* deviceSpec */

/* affect */

/* values */

/* dpy */

/* deviceSpec */

/* affect */

/* values */

/* dpy */

/* deviceSpec */

/* group */

/* dpy */

/* deviceSpec */

/* group */

/* dpy */

/* deviceSpec */

/* affectReal */

/* realValues */

/* affectVirtual */

/* virtualValues */

/* dpy */

/* deviceSpec */

/* affectReal */

/* realValues */

/* affectVirtual */

/* virtualValues */

/* xkb */

/* virtual_mask */

/* mask_rtrn */

/* xkb */

/* type */

/* map_rtrn */

/* xkb */

/* which */

/* keypadVMod */

/* xkb */

/* which */

/* freeDesc */

/* xkb */

/* which */

/* nTypes */

/* xkb */

/* which */

/* nActions */

/* xkb */

/* what */

/* freeMap */

/* xkb */

/* what */

/* freeMap */

/* xkb */

/* name */

/* map_count */

/* want_preserve */

/* num_lvls */

/* xkb */

/* xkb */

/* dpy */

/* which */

/* deviceSpec */

/* dpy */

/* which */

/* desc */

/* dpy */

/* xkb */

/* changes */

/* event */

/* dpy */

/* first */

/* num */

/* xkb */

/* dpy */

/* first */

/* num */

/* xkb */

/* dpy */

/* first */

/* num */

/* xkb */

/* dpy */

/* firstKey */

/* nKeys */

/* desc */

/* dpy */

/* which */

/* desc */

/* dpy */

/* firstKey */

/* nKeys */

/* desc */

/* dpy */

/* firstKey */

/* nKeys */

/* desc */

/* dpy */

/* first */

/* num */

/* xkb */

/* xkb */

/* which*/

/* xkb */

/* which */

/* freeMap */

/* dpy */

/* which */

/* desc */

/* dpy */

/* which */

/* desc */

/* old */

/* new */

/* wanted */

/* xkb */

/* which */

/* nInterpret */

/* xkb */

/* which */

/* freeMap */

/* dpy */

/* which */

/* xkb */

/* dpy */

/* which */

/* xkb */

/* updateActions */

/* xkb */

/* si */

/* updateMap */

/* changes */

/* xkb */

/* which */

/* nTotalRG */

/* nTotalAliases */

/* dpy */

/* which */

/* desc */

/* dpy */

/* which */

/* firstType */

/* nTypes */

/* desc */

/* dpy */

/* xkb */

/* changes */

/* xkb */

/* which */

/* freeMap */

/* dpy */

/* deviceSpec */

/* rtrnState */

/* dpy */

/* which */

/* desc */

/* dpy */

/* desc */

/* changes */

/* dpy */

/* detectable */

/* supported */

/* dpy */

/* supported */

/* dpy */

/* changes */

/* auto_ctrls */

/* auto_values */

/* dpy */

/* auto_ctrls */

/* auto_ctrl_values */

/* dpy */

/* change */

/* values */

/* dpy */

/* ctrls */

/* from */

/* into */

/* from */

/* into */

/* num_types */

/* xkb */

/* type_ndx */

/* map_count */

/* want_preserve */

/* new_num_lvls */

/* desc */

/* forKey */

/* symsNeeded */

/* desc */

/* forKey */

/* actsNeeded */

/* xkb */

/* key */

/* num_groups */

/* groups */

/* newTypes */

/* pChanges */

/* xkb */

/* minKC */

/* maxKC */

/* changes */

/***====================================================================***/

/* dpy */

/* deviceSpec */

/* ptrns */

/* max_inout */

/* list */

/* dpy */

/* which */

/* deviceSpec */

/* dpy */

/* deviceSpec */

/* names */

/* want */

/* need */

/* load */

/***====================================================================***/

/* returns # of groups */

/* xkb */

/* keyboard device */

/* map_width */

/* width of core KeySym array */

/* core_syms */

/* always mapWidth symbols */

/* protected */

/* explicit key types */

/* types_inout */

/* always four type indices */

/* xkb_syms_rtrn */

/* must have enough space */

/* False only on error */

/* xkb */

/* keymap to be edited */

/* key */

/* key to be updated */

/* changes */

/* resulting changes to map */

/* False only on error */

/* xkb */

/* XKB keyboard to be edited */

/* first_key */

/* first changed key */

/* num_keys */

/* number of changed keys */

/* map_width */

/* width of core keymap */

/* core_keysyms */

/* symbols from core keymap */

/* changes */

/* resulting changes */

/***====================================================================***/

/* devi */

/* ledClass */

/* ledId */

/* devi */

/* newTotal */

/* deviceSpec */

/* nButtons */

/* szLeds */

/* devi */

/* which */

/* freeDevI */

/* old */

/* new */

/* wanted */

/* dpy */

/* which */

/* deviceSpec */

/* ledClass */

/* ledID */

/* dpy */

/* devi */

/* changes */

/* dpy */

/* devi */

/* all */

/* first */

/* nBtns */

/* dpy */

/* devi */

/* ledClass (class, XIDflt, XIAll) */

/* ledId (id, XIDflt, XIAll) */

/* which (XkbXI_Indicator{Names,Map}Mask */

/* dpy */

/* which */

/* devi */

/* dpy */

/* desc */

/* changes */

/* dpy */

/* devi */

/* ledClass */

/* ledID */

/* which */

/* dpy */

/* devi */

/* first */

/* nBtns */

/***====================================================================***/

/* c */

/***====================================================================***/

/* dpy */

/* mask */

/* flags */

/* msg */

/* ctrls_mask */

/* ctrls */

/* rtrn_flags */

/* rtrn_ctrls */

/* xkb */

/* changed */

/* changes */

/* xkb */

/* act */

/* changed */

/* xkb */

/* type */

/* changed */

/* changes */

/* _X11_XKBLIB_H_ */


=== system/include/X11/Xatom.h ===
SHA256: 4da0ace354f86d5ad38fd24b4bcdb2e28e17432e0637c3eb25ecddb444f89486
/* THIS IS A GENERATED FILE
 *
 * Do not change!  Changing this file implies a protocol change!
 */

/* XATOM_H */


=== system/include/X11/Xfuncproto.h ===
SHA256: 4e27999cabe63504199d561a8ed1b5ea4d846df6f857da3613a0a331ad0f8d90
/* Xfuncproto.h.  Generated from Xfuncproto.h.in by configure.  */

/*
 *
Copyright 1989, 1991, 1998  The Open Group

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.

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
OPEN GROUP 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.

Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
 *
 */

/* Definitions to make function prototypes manageable */

/* NeedFunctionPrototypes */

/* NeedVarargsPrototypes */

/* NeedNestedPrototypes */

/* _Xconst */

/* Function prototype configuration (see configure for more info) */

/**/

/* default to make interropt. easier */

/* NeedWidePrototypes */

/* NeedFunctionPrototypes */

/* for C++ V2.0 */

/* do not leave open across includes */

/* _XFUNCPROTOBEGIN */

/* GNUC >= 4 */

/* not gcc >= 4 and not Sun Studio >= 8 */

/* GNUC >= 4 */

/* not gcc >= 3.3 and not Sun Studio >= 8 */

/* not gcc >= 3.1 */

/* GNUC  */

/* _XFUNCPROTO_H_ */


=== system/include/X11/Xfuncs.h ===
SHA256: 065a3e3d17db1bc197a6738056c2ecfb8ba2482cba8771b8621245cccb966615
/*
 * 
Copyright 1990, 1998  The Open Group

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.

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
OPEN GROUP 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.

Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
 *
 */

/* the old Xfuncs.h, for pre-R6 */

/* X_USEBFUNCS */

/* the new Xfuncs.h */

/* the ANSI C way */

/* !(defined(XFree86LOADER) && defined(IN_MODULE)) */

/* _XFUNCS_H_ */


=== system/include/X11/Xlib.h ===
SHA256: a2feabf0e857bea0e2ee431529b83aa1ada33c700f39807df2811d41c2dd85a6
/*

Copyright 1985, 1986, 1987, 1991, 1998  The Open Group

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.

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
OPEN GROUP 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.

Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.

*/

/*
 *	Xlib.h - Header definition and support file for the C subroutine
 *	interface library (Xlib) to the X Window System Protocol (V11).
 *	Structures and symbols starting with "_" are private to the library.
 */

/* applications should not depend on these two headers being included! */

/* replace this with #include or typedef appropriate for your system */

/* API mentioning "UTF8" or "utf8" is an XFree86 extension, introduced in
   November 2000. Its presence is indicated through the following macro. */

/* unable to get WORD64 without pulling in other symbols */

/* macros for screen oriented applications (toolkit) */

/*
 * Extensions need a way to hang private data on some structures.
 */

/* number returned by XRegisterExtension */

/* next item on list of data for structure */

/* called to free private storage */

/* data private to this extension. */

/*
 * This file contains structures used by the extension mechanism.
 */

/* public to extension, cannot be changed */

/* extension number */

/* major op-code assigned by server */

/* first event number for the extension */

/* first error number for the extension */

/*
 * Data structure for retrieving info about pixmap formats.
 */

/*
 * Data structure for setting graphics context.
 */

/* logical operation */

/* plane mask */

/* foreground pixel */

/* background pixel */

/* line width */

/* LineSolid, LineOnOffDash, LineDoubleDash */

/* CapNotLast, CapButt,
				   CapRound, CapProjecting */

/* JoinMiter, JoinRound, JoinBevel */

/* FillSolid, FillTiled,
				   FillStippled, FillOpaeueStippled */

/* EvenOddRule, WindingRule */

/* ArcChord, ArcPieSlice */

/* tile pixmap for tiling operations */

/* stipple 1 plane pixmap for stipping */

/* offset for tile or stipple operations */

/* default text font for text operations */

/* ClipByChildren, IncludeInferiors */

/* boolean, should exposures be generated */

/* origin for clipping */

/* bitmap clipping; other calls for rects */

/* patterned/dashed line information */

/*
 * Graphics context.  The contents of this structure are implementation
 * dependent.  A GC should be treated as opaque by application code.
 */

/* hook for extension to hang data */

/* protocol ID for graphics context */

/* there is more to this structure, but it is private to Xlib */

/*
 * Visual structure; contains information about colormapping possible.
 */

/* hook for extension to hang data */

/* visual id of this visual */

/* C++ class of screen (monochrome, etc.) */

/* class of screen (monochrome, etc.) */

/* mask values */

/* log base 2 of distinct color values */

/* color map entries */

/*
 * Depth structure; contains information for each possible depth.
 */

/* this depth (Z) of the depth */

/* number of Visual types at this depth */

/* list of visuals possible at this depth */

/*
 * Information about the screen.  The contents of this structure are
 * implementation dependent.  A Screen should be treated as opaque
 * by application code.
 */

/* Forward declare before use for C++ */

/* hook for extension to hang data */

/* back pointer to display structure */

/* Root window id. */

/* width and height of screen */

/* width and height of  in millimeters */

/* number of depths possible */

/* list of allowable depths on the screen */

/* bits per pixel */

/* root visual */

/* GC for the root root visual */

/* default color map */

/* White and Black pixel values */

/* max and min color maps */

/* Never, WhenMapped, Always */

/* initial root input mask */

/*
 * Format structure; describes ZFormat data the screen will understand.
 */

/* hook for extension to hang data */

/* depth of this image format */

/* bits/pixel at this depth */

/* scanline must padded to this multiple */

/*
 * Data structure for setting window attributes.
 */

/* background or None or ParentRelative */

/* background pixel */

/* border of the window */

/* border pixel value */

/* one of bit gravity values */

/* one of the window gravity values */

/* NotUseful, WhenMapped, Always */

/* planes to be preseved if possible */

/* value to use in restoring planes */

/* should bits under be saved? (popups) */

/* set of events that should be saved */

/* set of events that should not propagate */

/* boolean value for override-redirect */

/* color map to be associated with window */

/* cursor to be displayed (or None) */

/* location of window */

/* width and height of window */

/* border width of window */

/* depth of window */

/* the associated visual structure */

/* root of screen containing window */

/* C++ InputOutput, InputOnly*/

/* InputOutput, InputOnly*/

/* one of bit gravity values */

/* one of the window gravity values */

/* NotUseful, WhenMapped, Always */

/* planes to be preserved if possible */

/* value to be used when restoring planes */

/* boolean, should bits under be saved? */

/* color map to be associated with window */

/* boolean, is color map currently installed*/

/* IsUnmapped, IsUnviewable, IsViewable */

/* set of events all people have interest in*/

/* my event mask */

/* set of events that should not propagate */

/* boolean value for override-redirect */

/* back pointer to correct screen */

/*
 * Data structure for host setting; getting routines.
 *
 */

/* for example FamilyInternet */

/* length of address, in bytes */

/* pointer to where to find the bytes */

/*
 * Data structure for ServerFamilyInterpreted addresses in host routines
 */

/* length of type string, in bytes */

/* length of value string, in bytes */

/* pointer to where to find the type string */

/* pointer to where to find the address */

/*
 * Data structure for "image" data, used by image manipulation routines.
 */

/* size of image */

/* number of pixels offset in X direction */

/* XYBitmap, XYPixmap, ZPixmap */

/* pointer to image data */

/* data byte order, LSBFirst, MSBFirst */

/* quant. of scanline 8, 16, 32 */

/* LSBFirst, MSBFirst */

/* 8, 16, 32 either XY or ZPixmap */

/* depth of image */

/* accelarator to next line */

/* bits per pixel (ZPixmap) */

/* bits in z arrangment */

/* hook for the object routines to hang on */

/* image manipulation routines */

/* display */

/* visual */

/* depth */

/* format */

/* offset */

/* data */

/* width */

/* height */

/* bitmap_pad */

/* bytes_per_line */

/*
 * Data structure for XReconfigureWindow
 */

/*
 * Data structure used by color operations
 */

/* do_red, do_green, do_blue */

/*
 * Data structures for graphics operations.  On most machines, these are
 * congruent with the wire protocol structures, so reformatting the data
 * can be avoided on these architectures.
 */

/* Data structure for XChangeKeyboardControl */

/* On, Off, Default */

/* Data structure for XGetKeyboardControl */

/* Data structure for XGetMotionEvents.  */

/* Data structure for X{Set,Get}ModifierMapping */

/* The server's max # of keys per modifier */

/* An 8 by max_keypermod array of modifiers */

/*
 * Display datatype maintaining display specific data.
 * The contents of this structure are implementation dependent.
 * A Display should be treated as opaque by application code.
 */

/* Forward declare before use for C++ */

/* hook for extension to hang data */

/* Network socket. */

/* major version of server's X protocol */

/* minor version of servers X protocol */

/* vendor of the server hardware */

/* allocator function */

/* screen byte order, LSBFirst, MSBFirst */

/* padding and data requirements */

/* padding requirements on bitmaps */

/* LeastSignificant or MostSignificant */

/* number of pixmap formats in list */

/* pixmap format list */

/* release of the server */

/* Length of input event queue */

/* seq number of last event read */

/* sequence number of last request. */

/* maximum number 32 bit words in request*/

/* "host:display" string used on this connect*/

/* default screen for operations */

/* number of screens on this server*/

/* pointer to list of screens */

/* size of motion buffer */

/* minimum defined keycode */

/* maximum defined keycode */

/* contents of defaults from server */

/* there is more to this structure, but it is private to Xlib */

/*
 * Definitions of specific events.
 */

/* of event */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* "event" window it is reported relative to */

/* root window that the event occurred on */

/* child window */

/* milliseconds */

/* pointer x, y coordinates in event window */

/* coordinates relative to root */

/* key or button mask */

/* detail */

/* same screen flag */

/* of event */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* "event" window it is reported relative to */

/* root window that the event occurred on */

/* child window */

/* milliseconds */

/* pointer x, y coordinates in event window */

/* coordinates relative to root */

/* key or button mask */

/* detail */

/* same screen flag */

/* of event */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* "event" window reported relative to */

/* root window that the event occurred on */

/* child window */

/* milliseconds */

/* pointer x, y coordinates in event window */

/* coordinates relative to root */

/* key or button mask */

/* detail */

/* same screen flag */

/* of event */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* "event" window reported relative to */

/* root window that the event occurred on */

/* child window */

/* milliseconds */

/* pointer x, y coordinates in event window */

/* coordinates relative to root */

/* NotifyNormal, NotifyGrab, NotifyUngrab */

/*
	 * NotifyAncestor, NotifyVirtual, NotifyInferior,
	 * NotifyNonlinear,NotifyNonlinearVirtual
	 */

/* same screen flag */

/* boolean focus */

/* key or button mask */

/* FocusIn or FocusOut */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* window of event */

/* NotifyNormal, NotifyWhileGrabbed,
				   NotifyGrab, NotifyUngrab */

/*
	 * NotifyAncestor, NotifyVirtual, NotifyInferior,
	 * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer,
	 * NotifyPointerRoot, NotifyDetailNone
	 */

/* generated on EnterWindow and FocusIn  when KeyMapState selected */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* if non-zero, at least this many more */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* if non-zero, at least this many more */

/* core is CopyArea or CopyPlane */

/* not defined in the core */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* core is CopyArea or CopyPlane */

/* not defined in the core */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* Visibility state */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* parent of the window */

/* window id of window created */

/* window location */

/* size of window */

/* border width */

/* creation should be overridden */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* boolean, is override set... */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* Above, Below, TopIf, BottomIf, Opposite */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* PlaceOnTop, PlaceOnBottom */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* PlaceOnTop, PlaceOnBottom */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* NewValue, Deleted */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* ATOM or None */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* COLORMAP or None */

/* C++ */

/* ColormapInstalled, ColormapUninstalled */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* unused */

/* one of MappingModifier, MappingKeyboard,
				   MappingPointer */

/* first keycode */

/* defines range of change w. first_keycode*/

/* Display the event was read from */

/* resource id */

/* serial number of failed request */

/* error code of failed request */

/* Major op-code of failed request */

/* Minor op-code of failed request */

/* # of last request processed by server */

/* true if this came from a SendEvent request */

/* Display the event was read from */

/* window on which event was requested in event mask */

/***************************************************************
 *
 * GenericEvent.  This event is the standard event for all newer extensions.
 */

/* of event. Always GenericEvent */

/* # of last request processed */

/* true if from SendEvent request */

/* Display the event was read from */

/* major opcode of extension that caused the event */

/* actual event type. */

/* of event. Always GenericEvent */

/* # of last request processed */

/* true if from SendEvent request */

/* Display the event was read from */

/* major opcode of extension that caused the event */

/* actual event type. */

/*
 * this union is defined so Xlib can always use the same sized
 * event structure internally, to avoid memory fragmentation.
 */

/* must not be changed; first element */

/*
 * per character font metric information.
 */

/* origin to left edge of raster */

/* origin to right edge of raster */

/* advance to next char's origin */

/* baseline to top edge of raster */

/* baseline to bottom edge of raster */

/* per char flags (not predefined) */

/*
 * To allow arbitrary information with fonts, there are additional properties
 * returned.
 */

/* hook for extension to hang data */

/* Font id for this font */

/* hint about direction the font is painted */

/* first character */

/* last character */

/* first row that exists */

/* last row that exists */

/* flag if all characters have non-zero size*/

/* char to print for undefined character */

/* how many properties there are */

/* pointer to array of additional properties*/

/* minimum bounds over all existing char*/

/* maximum bounds over all existing char*/

/* first_char to last_char information */

/* log. extent above baseline for spacing */

/* log. descent below baseline for spacing */

/*
 * PolyText routines take these as arguments.
 */

/* pointer to string */

/* number of characters */

/* delta between strings */

/* font to print it in, None don't change */

/* normal 16 bit characters are two bytes */

/* two byte characters */

/* number of characters */

/* delta between strings */

/* font to print it in, None don't change */

/* unused:
typedef void (*XOMProc)();
 */

/* Input Text description */

/* Cursor offset within pre-edit string */

/* Starting change position */

/* Length of the change in character count */

/* Disable caret feedback */

/* UI defined caret feedback */

/* UI defined caret feedback */

/* Caret offset within pre-edit string */

/* Caret moves direction */

/* Feedback of the caret */

/* display */

/* name */

/* display */

/* font_ID */

/* display */

/* w */

/* start */

/* stop */

/* nevents_return */

/* modmap */

/* keycode_entry */

/* keycode_entry */

/* modifier */

/* display */

/* modmap */

/* keycode_entry */

/* keycode_entry */

/* modifier */

/* max_keys_per_mod */

/* display */

/* visual */

/* depth */

/* format */

/* offset */

/* data */

/* width */

/* height */

/* bitmap_pad */

/* bytes_per_line */

/* image */

/* display */

/* d */

/* x */

/* y */

/* width */

/* height */

/* plane_mask */

/* format */

/* display */

/* d */

/* x */

/* y */

/* width */

/* height */

/* plane_mask */

/* format */

/* dest_image */

/* dest_x */

/* dest_y */

/*
 * X function declarations.
 */

/* display_name */

/* display */

/* nbytes_return */

/* display */

/* nbytes_return */

/* buffer */

/* display */

/* atom */

/* dpy */

/* atoms */

/* count */

/* names_return */

/* display */

/* program */

/* option */

/* string */

/* keysym */

/* display */

/* onoff */

/* display */

/* display */

/* display */

/* procedure */

/* display */

/* display */

/* atom_name */

/* only_if_exists */

/* dpy */

/* names */

/* count */

/* onlyIfExists */

/* atoms_return */

/* display */

/* colormap */

/* display */

/* w */

/* visual */

/* alloc */

/* display */

/* source */

/* mask */

/* foreground_color */

/* background_color */

/* x */

/* y */

/* display */

/* source_font */

/* mask_font */

/* source_char */

/* mask_char */

/* foreground_color */

/* background_color */

/* display */

/* shape */

/* display */

/* name */

/* display */

/* d */

/* valuemask */

/* values */

/* gc */

/* display */

/* gc */

/* display */

/* d */

/* width */

/* height */

/* depth */

/* display */

/* d */

/* data */

/* width */

/* height */

/* display */

/* d */

/* data */

/* width */

/* height */

/* fg */

/* bg */

/* depth */

/* display */

/* parent */

/* x */

/* y */

/* width */

/* height */

/* border_width */

/* border */

/* background */

/* display */

/* selection */

/* display */

/* parent */

/* x */

/* y */

/* width */

/* height */

/* border_width */

/* depth */

/* class */

/* visual */

/* valuemask */

/* attributes */

/* display */

/* w */

/* num_return */

/* display */

/* pattern */

/* maxnames */

/* actual_count_return */

/* display */

/* pattern */

/* maxnames */

/* count_return */

/* info_return */

/* display */

/* npaths_return */

/* display */

/* nextensions_return */

/* display */

/* w */

/* num_prop_return */

/* display */

/* nhosts_return */

/* state_return */

/* display */

/* keycode */

/* keycode */

/* index */

/* key_event */

/* index */

/* display */

/* first_keycode */

/* first_keycode */

/* keycode_count */

/* keysyms_per_keycode_return */

/* string */

/* display */

/* display */

/* display */

/* screen */

/* display */

/* visual */

/* multithread routines */

/* display */

/* display */

/* routines for dealing with extensions */

/* display */

/* name */

/* display */

/* structure */

/* number */

/* object */

/* these are routines for which there are also macros */

/* display */

/* screen_number */

/* display */

/* screen */

/* display */

/* screen_number */

/* screen */

/* display */

/* screen_number */

/* screen */

/* display */

/* screen_number */

/* display */

/* screen_number */

/* screen */

/* screen */

/* display */

/* display */

/* display */

/* display */

/* display */

/* screen_number */

/* screen */

/* screen */

/* display */

/* screen_number */

/* display */

/* screen */

/* screen */

/* WARNING, this type not in Xlib spec */

/* display */

/* error_event */

/* handler */

/* WARNING, this type not in Xlib spec */

/* display */

/* handler */

/* display */

/* count_return */

/* display */

/* screen_number */

/* count_return */

/* ICCCM routines for things that don't require special include files; */

/* other declarations are given in Xutil.h                             */

/* display */

/* w */

/* screen_number */

/* mask */

/* changes */

/* display */

/* w */

/* protocols_return */

/* count_return */

/* display */

/* w */

/* protocols */

/* count */

/* display */

/* w */

/* screen_number */

/* display */

/* w */

/* screen_number */

/* display */

/* w */

/* argv_return */

/* argc_return */

/* display */

/* w */

/* windows_return */

/* count_return */

/* display */

/* w */

/* colormap_windows */

/* count */

/* list */

/* display */

/* w */

/* prop_window */

/* The following are given in alphabetical order */

/* display */

/* display */

/* host */

/* display */

/* hosts */

/* num_hosts */

/* structure */

/* ext_data */

/* display */

/* w */

/* display */

/* colormap */

/* screen_in_out */

/* display */

/* colormap */

/* contig */

/* plane_masks_return */

/* nplanes */

/* pixels_return */

/* npixels */

/* display */

/* colormap */

/* contig */

/* pixels_return */

/* ncolors */

/* nreds */

/* ngreens */

/* nblues */

/* rmask_return */

/* gmask_return */

/* bmask_return */

/* display */

/* colormap */

/* color_name */

/* screen_def_return */

/* exact_def_return */

/* display */

/* event_mode */

/* time */

/* display */

/* display */

/* display */

/* percent */

/* display */

/* display */

/* display */

/* screen */

/* display */

/* event_mask */

/* cursor */

/* time */

/* display */

/* gc */

/* valuemask */

/* values */

/* display */

/* value_mask */

/* values */

/* display */

/* first_keycode */

/* keysyms_per_keycode */

/* keysyms */

/* num_codes */

/* display */

/* do_accel */

/* do_threshold */

/* accel_numerator */

/* accel_denominator */

/* threshold */

/* display */

/* w */

/* property */

/* type */

/* format */

/* mode */

/* data */

/* nelements */

/* display */

/* w */

/* change_mode */

/* display */

/* w */

/* valuemask */

/* attributes */

/* display */

/* event_return */

/* display */

/* event */

/* arg */

/* predicate */

/* arg */

/* display */

/* event_mask */

/* event_return */

/* display */

/* event_type */

/* event_return */

/* display */

/* w */

/* event_type */

/* event_return */

/* display */

/* w */

/* event_mask */

/* event_return */

/* display */

/* w */

/* direction */

/* display */

/* w */

/* display */

/* w */

/* display */

/* w */

/* x */

/* y */

/* width */

/* height */

/* exposures */

/* display */

/* w */

/* display */

/* display */

/* w */

/* value_mask */

/* values */

/* display */

/* display */

/* selection */

/* target */

/* property */

/* requestor */

/* time */

/* display */

/* src */

/* dest */

/* gc */

/* src_x */

/* src_y */

/* width */

/* height */

/* dest_x */

/* dest_y */

/* display */

/* src */

/* valuemask */

/* dest */

/* display */

/* src */

/* dest */

/* gc */

/* src_x */

/* src_y */

/* width */

/* height */

/* dest_x */

/* dest_y */

/* plane */

/* display */

/* screen_number */

/* screen */

/* display */

/* display */

/* w */

/* cursor */

/* display */

/* w */

/* property */

/* display */

/* w */

/* display */

/* w */

/* screen */

/* screen */

/* display */

/* display */

/* screen_number */

/* display */

/* screen_number */

/* display */

/* screen_number */

/* display */

/* min_keycodes_return */

/* max_keycodes_return */

/* display */

/* screen_number */

/* display */

/* screen_number */

/* display */

/* screen_number */

/* display */

/* d */

/* gc */

/* x */

/* y */

/* width */

/* height */

/* angle1 */

/* angle2 */

/* display */

/* d */

/* gc */

/* arcs */

/* narcs */

/* display */

/* d */

/* gc */

/* x */

/* y */

/* string */

/* length */

/* display */

/* d */

/* gc */

/* x */

/* y */

/* string */

/* length */

/* display */

/* d */

/* gc */

/* x1 */

/* y1 */

/* x2 */

/* y2 */

/* display */

/* d */

/* gc */

/* points */

/* npoints */

/* mode */

/* display */

/* d */

/* gc */

/* x */

/* y */

/* display */

/* d */

/* gc */

/* points */

/* npoints */

/* mode */

/* display */

/* d */

/* gc */

/* x */

/* y */

/* width */

/* height */

/* display */

/* d */

/* gc */

/* rectangles */

/* nrectangles */

/* display */

/* d */

/* gc */

/* segments */

/* nsegments */

/* display */

/* d */

/* gc */

/* x */

/* y */

/* string */

/* length */

/* display */

/* d */

/* gc */

/* x */

/* y */

/* string */

/* length */

/* display */

/* d */

/* gc */

/* x */

/* y */

/* items */

/* nitems */

/* display */

/* d */

/* gc */

/* x */

/* y */

/* items */

/* nitems */

/* display */

/* display */

/* mode */

/* display */

/* w */

/* window_name_return */

/* display */

/* d */

/* gc */

/* x */

/* y */

/* width */

/* height */

/* angle1 */

/* angle2 */

/* display */

/* d */

/* gc */

/* arcs */

/* narcs */

/* display */

/* d */

/* gc */

/* points */

/* npoints */

/* shape */

/* mode */

/* display */

/* d */

/* gc */

/* x */

/* y */

/* width */

/* height */

/* display */

/* d */

/* gc */

/* rectangles */

/* nrectangles */

/* display */

/* display */

/* mode */

/* data */

/* display */

/* colormap */

/* display */

/* colormap */

/* pixels */

/* npixels */

/* planes */

/* display */

/* cursor */

/* list */

/* display */

/* font_struct */

/* names */

/* free_info */

/* actual_count */

/* list */

/* list */

/* display */

/* gc */

/* modmap */

/* display */

/* pixmap */

/* display */

/* screen */

/* position */

/* default_position */

/* bwidth */

/* fwidth */

/* fheight */

/* xadder */

/* yadder */

/* x_return */

/* y_return */

/* width_return */

/* height_return */

/* display */

/* name */

/* message */

/* default_string */

/* buffer_return */

/* length */

/* display */

/* code */

/* buffer_return */

/* length */

/* font_struct */

/* atom */

/* value_return */

/* display */

/* gc */

/* valuemask */

/* values_return */

/* display */

/* d */

/* root_return */

/* x_return */

/* y_return */

/* width_return */

/* height_return */

/* border_width_return */

/* depth_return */

/* display */

/* w */

/* icon_name_return */

/* display */

/* focus_return */

/* revert_to_return */

/* display */

/* values_return */

/* display */

/* accel_numerator_return */

/* accel_denominator_return */

/* threshold_return */

/* display */

/* map_return */

/* nmap */

/* display */

/* timeout_return */

/* interval_return */

/* prefer_blanking_return */

/* allow_exposures_return */

/* display */

/* w */

/* prop_window_return */

/* display */

/* w */

/* property */

/* long_offset */

/* long_length */

/* delete */

/* req_type */

/* actual_type_return */

/* actual_format_return */

/* nitems_return */

/* bytes_after_return */

/* prop_return */

/* display */

/* w */

/* window_attributes_return */

/* display */

/* button */

/* modifiers */

/* grab_window */

/* owner_events */

/* event_mask */

/* pointer_mode */

/* keyboard_mode */

/* confine_to */

/* cursor */

/* display */

/* keycode */

/* modifiers */

/* grab_window */

/* owner_events */

/* pointer_mode */

/* keyboard_mode */

/* display */

/* grab_window */

/* owner_events */

/* pointer_mode */

/* keyboard_mode */

/* time */

/* display */

/* grab_window */

/* owner_events */

/* event_mask */

/* pointer_mode */

/* keyboard_mode */

/* confine_to */

/* cursor */

/* time */

/* display */

/* screen */

/* screen */

/* display */

/* event_return */

/* display */

/* event */

/* arg */

/* predicate */

/* arg */

/* display */

/* display */

/* colormap */

/* display */

/* keysym */

/* display */

/* resource */

/* display */

/* colormap */

/* color_name */

/* exact_def_return */

/* screen_def_return */

/* display */

/* w */

/* display */

/* w */

/* display */

/* w */

/* display */

/* w */

/* display */

/* event_mask */

/* event_return */

/* screen */

/* screen */

/* display */

/* w */

/* x */

/* y */

/* width */

/* height */

/* display */

/* w */

/* x */

/* y */

/* display */

/* event_return */

/* display */

/* display */

/* colormap */

/* spec */

/* exact_def_return */

/* parsestring */

/* x_return */

/* y_return */

/* width_return */

/* height_return */

/* display */

/* event_return */

/* display */

/* event_return */

/* display */

/* event */

/* arg */

/* predicate */

/* arg */

/* display */

/* screen */

/* display */

/* display */

/* display */

/* event */

/* display */

/* d */

/* gc */

/* image */

/* src_x */

/* src_y */

/* dest_x */

/* dest_y */

/* width */

/* height */

/* display */

/* display */

/* d */

/* width */

/* height */

/* width_return */

/* height_return */

/* display */

/* class */

/* which_screen */

/* width */

/* height */

/* width_return */

/* height_return */

/* display */

/* which_screen */

/* width */

/* height */

/* width_return */

/* height_return */

/* display */

/* which_screen */

/* width */

/* height */

/* width_return */

/* height_return */

/* display */

/* colormap */

/* def_in_out */

/* display */

/* colormap */

/* defs_in_out */

/* ncolors */

/* display */

/* name */

/* major_opcode_return */

/* first_event_return */

/* first_error_return */

/* display */

/* keys_return */

/* display */

/* w */

/* root_return */

/* child_return */

/* root_x_return */

/* root_y_return */

/* win_x_return */

/* win_y_return */

/* mask_return */

/* display */

/* font_ID */

/* string */

/* nchars */

/* direction_return */

/* font_ascent_return */

/* font_descent_return */

/* overall_return */

/* display */

/* font_ID */

/* string */

/* nchars */

/* direction_return */

/* font_ascent_return */

/* font_descent_return */

/* overall_return */

/* display */

/* w */

/* root_return */

/* parent_return */

/* children_return */

/* nchildren_return */

/* display */

/* w */

/* display */

/* d */

/* filename */

/* width_return */

/* height_return */

/* bitmap_return */

/* x_hot_return */

/* y_hot_return */

/* filename */

/* width_return */

/* height_return */

/* data_return */

/* x_hot_return */

/* y_hot_return */

/* display */

/* keysym */

/* list */

/* mod_count */

/* string */

/* bytes_string */

/* display */

/* cursor */

/* foreground_color */

/* background_color */

/* event_map */

/* display */

/* w */

/* display */

/* host */

/* display */

/* hosts */

/* num_hosts */

/* display */

/* w */

/* parent */

/* x */

/* y */

/* display */

/* display */

/* w */

/* width */

/* height */

/* display */

/* windows */

/* nwindows */

/* display */

/* rotate */

/* display */

/* w */

/* properties */

/* num_prop */

/* npositions */

/* display */

/* display */

/* w */

/* event_mask */

/* display */

/* w */

/* propagate */

/* event_mask */

/* event_send */

/* display */

/* mode */

/* display */

/* gc */

/* arc_mode */

/* display */

/* gc */

/* background */

/* display */

/* gc */

/* pixmap */

/* display */

/* gc */

/* clip_x_origin */

/* clip_y_origin */

/* display */

/* gc */

/* clip_x_origin */

/* clip_y_origin */

/* rectangles */

/* n */

/* ordering */

/* display */

/* close_mode */

/* display */

/* w */

/* argv */

/* argc */

/* display */

/* gc */

/* dash_offset */

/* dash_list */

/* n */

/* display */

/* gc */

/* fill_rule */

/* display */

/* gc */

/* fill_style */

/* display */

/* gc */

/* font */

/* display */

/* directories */

/* ndirs */

/* display */

/* gc */

/* foreground */

/* display */

/* gc */

/* function */

/* display */

/* gc */

/* graphics_exposures */

/* display */

/* w */

/* icon_name */

/* display */

/* focus */

/* revert_to */

/* time */

/* display */

/* gc */

/* line_width */

/* line_style */

/* cap_style */

/* join_style */

/* display */

/* modmap */

/* display */

/* gc */

/* plane_mask */

/* display */

/* map */

/* nmap */

/* display */

/* timeout */

/* interval */

/* prefer_blanking */

/* allow_exposures */

/* display */

/* selection */

/* owner */

/* time */

/* display */

/* gc */

/* foreground */

/* background */

/* function */

/* plane_mask */

/* display */

/* gc */

/* stipple */

/* display */

/* gc */

/* subwindow_mode */

/* display */

/* gc */

/* ts_x_origin */

/* ts_y_origin */

/* display */

/* gc */

/* tile */

/* display */

/* w */

/* background_pixel */

/* display */

/* w */

/* background_pixmap */

/* display */

/* w */

/* border_pixel */

/* display */

/* w */

/* border_pixmap */

/* display */

/* w */

/* width */

/* display */

/* w */

/* colormap */

/* display */

/* bytes */

/* nbytes */

/* buffer */

/* display */

/* bytes */

/* nbytes */

/* display */

/* colormap */

/* color */

/* display */

/* colormap */

/* color */

/* ncolors */

/* display */

/* w */

/* window_name */

/* display */

/* colormap */

/* color */

/* pixel */

/* flags */

/* display */

/* discard */

/* font_struct */

/* string */

/* nchars */

/* direction_return */

/* font_ascent_return */

/* font_descent_return */

/* overall_return */

/* font_struct */

/* string */

/* nchars */

/* direction_return */

/* font_ascent_return */

/* font_descent_return */

/* overall_return */

/* font_struct */

/* string */

/* count */

/* font_struct */

/* string */

/* count */

/* display */

/* src_w */

/* dest_w */

/* src_x */

/* src_y */

/* dest_x_return */

/* dest_y_return */

/* child_return */

/* display */

/* w */

/* display */

/* button */

/* modifiers */

/* grab_window */

/* display */

/* keycode */

/* modifiers */

/* grab_window */

/* display */

/* time */

/* display */

/* time */

/* display */

/* display */

/* colormap */

/* display */

/* font */

/* display */

/* w */

/* display */

/* w */

/* display */

/* display */

/* src_w */

/* dest_w */

/* src_x */

/* src_y */

/* src_width */

/* src_height */

/* dest_x */

/* dest_y */

/* screen */

/* screen */

/* display */

/* w */

/* event_mask */

/* event_return */

/* display */

/* filename */

/* bitmap */

/* width */

/* height */

/* x_hot */

/* y_hot */

/* modifier_list */

/* display */

/* rdb */

/* res_name */

/* res_class */

/* om */

/* om */

/* om */

/* om */

/* om */

/* om */

/* oc */

/* oc */

/* oc */

/* oc */

/* display */

/* base_font_name_list */

/* missing_charset_list */

/* missing_charset_count */

/* def_string */

/* display */

/* font_set */

/* font_set */

/* font_struct_list */

/* font_name_list */

/* font_set */

/* font_set */

/* font_set */

/* font_set */

/* font_set */

/* font_set */

/* font_set */

/* text */

/* bytes_text */

/* font_set */

/* text */

/* num_wchars */

/* font_set */

/* text */

/* bytes_text */

/* font_set */

/* text */

/* bytes_text */

/* overall_ink_return */

/* overall_logical_return */

/* font_set */

/* text */

/* num_wchars */

/* overall_ink_return */

/* overall_logical_return */

/* font_set */

/* text */

/* bytes_text */

/* overall_ink_return */

/* overall_logical_return */

/* font_set */

/* text */

/* bytes_text */

/* ink_extents_buffer */

/* logical_extents_buffer */

/* buffer_size */

/* num_chars */

/* overall_ink_return */

/* overall_logical_return */

/* font_set */

/* text */

/* num_wchars */

/* ink_extents_buffer */

/* logical_extents_buffer */

/* buffer_size */

/* num_chars */

/* overall_ink_return */

/* overall_logical_return */

/* font_set */

/* text */

/* bytes_text */

/* ink_extents_buffer */

/* logical_extents_buffer */

/* buffer_size */

/* num_chars */

/* overall_ink_return */

/* overall_logical_return */

/* display */

/* d */

/* gc */

/* x */

/* y */

/* text_items */

/* nitems */

/* display */

/* d */

/* gc */

/* x */

/* y */

/* text_items */

/* nitems */

/* display */

/* d */

/* gc */

/* x */

/* y */

/* text_items */

/* nitems */

/* display */

/* d */

/* font_set */

/* gc */

/* x */

/* y */

/* text */

/* bytes_text */

/* display */

/* d */

/* font_set */

/* gc */

/* x */

/* y */

/* text */

/* num_wchars */

/* display */

/* d */

/* font_set */

/* gc */

/* x */

/* y */

/* text */

/* bytes_text */

/* display */

/* d */

/* font_set */

/* gc */

/* x */

/* y */

/* text */

/* bytes_text */

/* display */

/* d */

/* font_set */

/* gc */

/* x */

/* y */

/* text */

/* num_wchars */

/* display */

/* d */

/* font_set */

/* gc */

/* x */

/* y */

/* text */

/* bytes_text */

/* dpy */

/* rdb */

/* res_name */

/* res_class */

/* im */

/* im */

/* im */

/* im */

/* im*/

/* im */

/* ic */

/* ic */

/* ic */

/* ic */

/* ic */

/* ic */

/* ic */

/* ic */

/* ic */

/* event */

/* window */

/* ic */

/* event */

/* buffer_return */

/* bytes_buffer */

/* keysym_return */

/* status_return */

/* ic */

/* event */

/* buffer_return */

/* wchars_buffer */

/* keysym_return */

/* status_return */

/* ic */

/* event */

/* buffer_return */

/* bytes_buffer */

/* keysym_return */

/* status_return */

/*unused*/

/* internal connections for IMs */

/* dpy */

/* rdb */

/* res_name */

/* res_class */

/* callback */

/* client_data */

/* dpy */

/* rdb */

/* res_name */

/* res_class */

/* callback */

/* client_data */

/* dpy */

/* client_data */

/* fd */

/* opening */

/* open or close flag */

/* watch_data */

/* open sets, close uses */

/* dpy */

/* fd_return */

/* count_return */

/* dpy */

/* fd */

/* dpy */

/* callback */

/* client_data */

/* dpy */

/* callback */

/* client_data */

/* name */

/* namelen */

/* data */

/* datalen */

/* wstr */

/* str */

/* len */

/* str */

/* len */

/* str */

/* wc */

/* dpy */

/* cookie*/

/* dpy */

/* cookie*/

/* _XLIB_H_ */


=== system/include/X11/XlibConf.h ===
SHA256: 2456e8ad48c1f0efe1e95432fe86f1dabbde89a6b0b1fd1c526ebb44c1a31b81
/* include/X11/XlibConf.h.  Generated from XlibConf.h.in by configure.  */

/*
 * Copyright © 2005 Keith Packard
 *
 * Permission to use, copy, modify, distribute, and sell this software and its
 * documentation for any purpose is hereby granted without fee, provided that
 * the above copyright notice appear in all copies and that both that
 * copyright notice and this permission notice appear in supporting
 * documentation, and that the name of Keith Packard not be used in
 * advertising or publicity pertaining to distribution of the software without
 * specific, written prior permission.  Keith Packard makes no
 * representations about the suitability of this software for any purpose.  It
 * is provided "as is" without express or implied warranty.
 *
 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

/*
 * This header file exports defines necessary to correctly
 * use Xlibint.h both inside Xlib and by external libraries
 * such as extensions.
 */

/* Threading support? */

/* Use multi-threaded libc functions? */

/* _XLIBCONF_H_ */


=== system/include/X11/Xlibint.h ===
SHA256: 53d58c2473acbeec35cbb67c11069519931b33226da6cab2643575f4518a984b
/*

Copyright 1984, 1985, 1987, 1989, 1998  The Open Group

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.

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 OPEN GROUP 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.

Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.

*/

/*
 *	Xlibint.h - Header definition and support file for the internal
 *	support routines used by the C subroutine interface
 *	library (Xlib) to the X Window System.
 *
 *	Warning, there be dragons here....
 */

/* to declare xEvent */

/* for configured options like XTHREADS */

/*
 * If your BytesReadable correctly detects broken connections, then
 * you should NOT define XCONN_CHECK_FREQ.
 */

/* hook for extension to hang data */

/* protocol ID for graphics context */

/* boolean: TRUE if clipmask is list of rectangles */

/* boolean: TRUE if dash-list is really a list */

/* cache dirty bits */

/* shadow structure of values */

/* hook for extension to hang data */

/* internal free functions */

/* Network socket. */

/* ugly thing used by _XEventsQueued */

/* maj. version of server's X protocol */

/* minor version of server's X protocol */

/* vendor of the server hardware */

/* resource ID base */

/* resource ID mask bits */

/* allocator current ID */

/* allocator shift to correct bits */

/* allocator function */

/* screen byte order, LSBFirst, MSBFirst */

/* padding and data requirements */

/* padding requirements on bitmaps */

/* LeastSignificant or MostSignificant */

/* number of pixmap formats in list */

/* pixmap format list */

/* Xlib's X protocol version number. */

/* release of the server */

/* Input event queue. */

/* Length of input event queue */

/* seq number of last event read */

/* sequence number of last request. */

/* beginning of last request, or dummy */

/* Output buffer starting address. */

/* Output buffer index pointer. */

/* Output buffer maximum+1 address. */

/* maximum number 32 bit words in request*/

/* Synchronization handler */

/* "host:display" string used on this connect*/

/* default screen for operations */

/* number of screens on this server*/

/* pointer to list of screens */

/* size of motion buffer */

/* internal connection flags */

/* minimum defined keycode */

/* maximum defined keycode */

/* This server's keysyms */

/* This server's modifier keymap */

/* number of rows */

/* contents of defaults from server */

/* place to hang scratch buffer */

/* length of scratch buffer */

/* extension number on this display */

/* extensions initialized on this display */

/*
	 * the following can be fixed size, as the protocol defines how
	 * much address space is available.
	 * While this could be done using the extension vector, there
	 * may be MANY events processed, so a search through the extension
	 * list to find the right procedure for each event might be
	 * expensive if many extensions are being used.
	 */

/* vector for wire to event */

/* dpy */

/* re */

/* event */

/* vector for event to wire */

/* dpy */

/* re */

/* event */

/* for XLookupString */

/* multi-thread state, display lock */

/* for internal async */

/* max size of big requests */

/* pointers to threads functions */

/* XID list allocator function */

/* dpy */

/* ids */

/* count */

/* things above this line should not move, for binary compatibility */

/* for XLookupString */

/* for XCreateFontCursor */

/* for XInternAtom */

/* keyboard group modifiers */

/* keyboard numlock modifiers */

/* context database */

/* vector for wire to error */

/* display */

/* he */

/* we */

/*
	 * Xcms information
	 */

/* pointer to an array of default XcmsCCC */

/* pointer to linked list of XcmsCmapRec */

/* linked list of XcmsIntensityMap */

/* unallocated event queue elements */

/* inserted into next queue elt */

/* Flush hooks */

/* _XRegisterInternalConnection */

/* number of im_fd_info */

/* XAddConnectionWatch */

/* number of conn_watchers */

/* struct pollfd cache for _XWaitForReadable */

/* user synchandler when Xlib usurps */

/* dpy */

/* allocator max ID */

/* major opcode for XC-MISC */

/* XKB info */

/* transport connection object */

/* XCB glue private data */

/* Generic event cookie handling */

/* next event cookie */

/* vector for wire to generic event, index is (extension - 128) */

/* dpy */

/* Xlib event */

/* wire event */

/* vector for event copy, index is (extension - 128) */

/* dpy */

/* in */

/* out*/

/* cookie events returned but not claimed */

/*
 * define the following if you want the Data macro to be a procedure instead
 */

/* CRAY */

/*
 * _QEvent datatype for use in input queueing.
 */

/* so multi-threaded code can find new ones */

/* turn this on to get MP safe errno */

/* Utek leaves kernel macros around in include files (bleah) */

/*
 * The following definitions can be used for locking requests in multi-threaded
 * address spaces.
 */

/* Author: Stephen Gildea, MIT X Consortium
 *
 * declarations for C Threads locking
 */

/* interfaces for locking.c */

/* used by all, including extensions; do not move */

/* in XlibInt.c */

/* lock */

/* lock */

/* lock */

/* file */

/* line */

/* lock */

/* file */

/* line */

/* used everywhere, so must be fast if not using threads */

/* XTHREADS */

/*
 * Note that some machines do not return a valid pointer for malloc(0), in
 * which case we provide an alternate under the control of the
 * define MALLOC_0_RETURNS_NULL.  This is necessary because some
 * Xlib code expects malloc(0) to return a valid pointer to storage.
 */

/* X output buffer size. */

/* point batching */

/* wide line batching */

/* thin line batching */

/* wide line rectangle batching */

/* thin line rectangle batching */

/* filled rectangle batching */

/* filled arc batching */

/* standard cursor fonts */

/*
 * Display flags
 */

/* in _XProcessInternalConnection */

/* in _XReadEvents */

/* in _XReply */

/* in _XFlushInt, _XSend */

/* mark if RM db from XGetDefault */

/*
 * X Protocol packetizing macros.
 */

/*   Need to start requests on 64 bit word boundaries
 *   on a CRAY computer so add a NoOp (127) if needed.
 *   A character pointer on a CRAY computer will be non-zero
 *   after shifting right 61 bits of it is not pointing to
 *   a word boundary.
 */

/* else does not require alignment on 64-bit boundaries */

/* WORD64 */

/**
 * Return a len-sized request buffer for the request type. This function may
 * flush the output queue.
 *
 * @param dpy The display connection
 * @param type The request type
 * @param len Length of the request in bytes
 *
 * @returns A pointer to the request buffer with a few default values
 * initialized.
 */

/* GetReqSized is the same as GetReq but allows the caller to specify the
 * size in bytes. 'sz' must be a multiple of 4! */

/**/

/**/

/**/

/*
 * GetReq - Get the next available X request packet in the buffer and
 * return it.
 *
 * "name" is the name of the request, e.g. CreatePixmap, OpenFont, etc.
 * "req" is the name of the request pointer.
 *
 */

/* non-ANSI C uses empty comment instead of "##" for token concatenation */

/**/

/**/

/* GetReqExtra is the same as GetReq, but allocates "n" additional
   bytes after the request. "n" must be a multiple of 4!  */

/**/

/**/

/*
 * GetResReq is for those requests that have a resource ID
 * (Window, Pixmap, GContext, etc.) as their single argument.
 * "rid" is the name of the resource.
 */

/**/

/*
 * GetEmptyReq is for those requests that have no arguments
 * at all.
 */

/**/

/*
 * Data - Place data in the buffer and pad the end to provide
 * 32 bit word alignment.  Transmit if the buffer fills.
 *
 * "dpy" is a pointer to a Display.
 * "data" is a pinter to a data buffer.
 * "len" is the length of the data buffer.
 */

/* DataRoutineIsProcedure */

/* Allocate bytes from the buffer.  No padding is done, so if
 * the length is not a multiple of 4, the caller must be
 * careful to leave the buffer aligned after sending the
 * current request.
 *
 * "type" is the type of the pointer being assigned to.
 * "ptr" is the pointer being assigned to.
 * "n" is the number of bytes to allocate.
 *
 * Example:
 *    xTextElt *elt;
 *    BufAlloc (xTextElt *, elt, nbytes)
 */

/* not WORD64 */

/* Xlib manual is bogus */

/*
 * CI_GET_CHAR_INFO_1D - return the charinfo struct for the indicated 8bit
 * character.  If the character is in the column and exists, then return the
 * appropriate metrics (note that fonts with common per-character metrics will
 * return min_bounds).  If none of these hold true, try again with the default
 * char.
 */

/*
 * CI_GET_CHAR_INFO_2D - return the charinfo struct for the indicated row and
 * column.  This is used for fonts that have more than row zero.
 */

/* for when 32-bit alignment is not good enough */

/* srcvar must be a variable for large architecture version */

/* MUSTCOPY */

/*
     * handler arguments:
     * rep is the generic reply that caused this handler
     * to be invoked.  It must also be passed to _XGetAsyncReply.
     * buf and len are opaque values that must be passed to
     * _XGetAsyncReply or _XGetAsyncData.
     * data is the closure stored in this struct.
     * The handler returns True iff it handled this reply.
     */

/* dpy */

/* rep */

/* buf */

/* len */

/* data */

/* display */

/* modmap */

/*
 * This structure is private to the library.
 */

/* _XFreeAtomTable */

/* XFreeModifiermap */

/* _XFreeKeyBindings */

/* _XFreeContextDB */

/* _XcmsFreeDefaultCCCs */

/* _XcmsFreeClientCmaps */

/* _XcmsFreeIntensityMaps */

/* _XFreeIMFilters */

/* _XkbFreeInfo */

/* types for InitExt.c */

/* display */

/* gc */

/* codes */

/* display */

/* gc */

/* codes */

/* display */

/* gc */

/* codes */

/* display */

/* gc */

/* codes */

/* display */

/* fs */

/* codes */

/* display */

/* fs */

/* codes */

/* display */

/* codes */

/* display */

/* err */

/* codes */

/* ret_code */

/* display */

/* code */

/* codes */

/* buffer */

/* nbytes */

/* display */

/* ev */

/* fp */

/* display */

/* codes */

/* data */

/* len */

/*
 * This structure is private to the library.
 */

/* private to extension mechanism */

/* next in list */

/* public information, all extension told */

/* routine to call when GC created */

/* routine to call when GC copied */

/* routine to call when GC flushed */

/* routine to call when GC freed */

/* routine to call when Font created */

/* routine to call when Font freed */

/* routine to call when connection closed */

/* who to call when an error occurs */

/* routine to supply error string */

/* name of this extension */

/* routine to supply error values */

/* routine to call when sending data */

/* next in list of those with flushes */

/* Temporary definition until we can depend on an xproto release with it */

/* 4.3+ */

/* nothing */

/* extension hooks */

/* dpy */

/* rep */

/* dpy */

/* dpy */

/* dpy */

/* error_event */

/* dpy */

/* n */

/* dpy */

/* n */

/* Studio compiler alternative to "cold" attribute */

/* dpy */

/* nbytes */

/* dpy */

/* nbytes */

/* dpy */

/* buf */

/* nbytes */

/* dpy */

/* id */

/* dpy */

/* rep */

/* buf */

/* maxlen */

/* dpy */

/* w */

/* dpy */

/* rep */

/* buf */

/* len */

/* data */

/* dpy */

/* replbuf */

/* rep */

/* buf */

/* len */

/* extra */

/* discard */

/* dpy */

/* data */

/* buf */

/* len */

/* skip */

/* datalen */

/* discardtotal */

/* dpy */

/* dpy */

/* mode */

/* dpy */

/* dpy */

/* data */

/* size */

/* dpy */

/* data */

/* size */

/* dpy */

/* data */

/* size */

/* dpy */

/* rep */

/* extra */

/* discard */

/* dpy */

/* event */

/* dpy */

/* prev */

/* qelt */

/* dpy */

/* re */

/* event */

/* dpy */

/* re */

/* event */

/* dpy */

/* in */

/* out */

/* dpy */

/* re */

/* event */

/* extension */

/* display */

/* extension */

/* display */

/* gc */

/* codes */

/* proc */

/* display */

/* extension */

/* display */

/* gc */

/* codes */

/* proc */

/* display */

/* extension */

/* display */

/* gc */

/* codes */

/* proc */

/* display */

/* extension */

/* display */

/* gc */

/* codes */

/* proc */

/* display */

/* extension */

/* display */

/* fs */

/* codes */

/* proc */

/* display */

/* extension */

/* display */

/* fs */

/* codes */

/* proc */

/* display */

/* extension */

/* display */

/* codes */

/* proc */

/* display */

/* extension */

/* display */

/* err */

/* codes */

/* ret_code */

/* proc */

/* display */

/* extension */

/* display */

/* code */

/* codes */

/* buffer */

/* nbytes */

/* proc */

/* display */

/* extension */

/* display */

/* ev */

/* fp */

/* proc */

/* display */

/* event_number */

/* display */

/* re */

/* event */

/* proc */

/* display */

/* extension */

/* display */

/* re */

/* event */

/* proc */

/* display */

/* extension */

/* display */

/* in */

/* out */

/* proc */

/* display */

/* event_number */

/* display */

/* re */

/* event */

/* proc */

/* display */

/* error_number */

/* display */

/* he */

/* we */

/* proc */

/* display */

/* error_number */

/* display */

/* codes */

/* data */

/* len */

/* proc */

/* internal connections for IMs */

/* dpy */

/* fd */

/* call_data */

/* dpy */

/* fd */

/* callback */

/* call_data */

/* dpy */

/* fd */

/* dpy */

/* conn_info */

/* Display structure has pointers to these */

/* info from _XRegisterInternalConnection */

/* set/used by XConnectionWatchProc */

/* info from XAddConnectionWatch */

/* font_struct */

/* string */

/* count */

/* font_struct */

/* string */

/* count */

/* path */

/* flags */

/* path */

/* flags */

/* mode */

/* path */

/* mode */

/* path */

/* EvToWire.c */

/* dpy */

/* name*/

/* xfp*/

/* fidp */

/* lcFile.c */

/* _X11_XLIBINT_H_ */


=== system/include/X11/Xmd.h ===
SHA256: 5582b463cbebeb001e796f6348e21b487619cf3fa23eae4ef3d8fd92b8b6c5f9
/***********************************************************

Copyright 1987, 1998  The Open Group

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.

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
OPEN GROUP 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.

Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.


Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.

                        All Rights Reserved

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.

DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.

******************************************************************/

/*
 *  Xmd.h: MACHINE DEPENDENT DECLARATIONS.
 */

/*
 * Special per-machine configuration flags.
 */

/* Solaris: defines _LP64 if necessary */

/* 32/64-bit architecture */

/*
 * Stuff to handle large architecture machines; the constants were generated
 * on a 32-bit machine and must correspond to the protocol.
 */

/* WORD64 */

/*
 * Definition of macro used to set constants for size of network structures;
 * machines with preprocessors that can't handle all of the sz_ symbols
 * can define this macro to be sizeof(x) if and only if their compiler doesn't
 * pad out structures (esp. the xTextElt structure which contains only two
 * one-byte fields).  Network structures should always define sz_symbols.
 *
 * The sz_ prefix is used instead of something more descriptive so that the
 * symbols are no more than 32 characters long (which causes problems for some
 * compilers and preprocessors).
 *
 * The extra indirection is to get macro arguments to expand correctly before
 * the concatenation, rather than afterward.
 */

/*
 * Bitfield suffixes for the protocol structure elements, if you
 * need them.  Note that bitfields are not guaranteed to be signed
 * (or even unsigned) according to ANSI C.
 */

/*
 * definitions for sign-extending bitfields on 64-bit architectures
 */

/* WORD64 and UNSIGNEDBITFIELDS */

/*
 * This macro must not cast or else pointers will get aligned and be wrong
 */

/* else not MUSTCOPY, this is used for 32-bit machines */

/*
 * this version should leave result of type (t *), but that should only be
 * used when not in MUSTCOPY
 */

/* MUSTCOPY - used machines whose C structs don't line up with proto */

/* XMD_H */


=== system/include/X11/Xosdefs.h ===
SHA256: cab0a2d64c7d75dcc07718bbd07a6046be254cd9150fb810c1134ab551532b5b
/*
 * O/S-dependent (mis)feature macro definitions
 *
Copyright 1991, 1998  The Open Group

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.

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
OPEN GROUP 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.

Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
 */

/*
 * X_NOT_POSIX means does not have POSIX header files.  Lack of this
 * symbol does NOT mean that the POSIX environment is the default.
 * You may still have to define _POSIX_SOURCE to get it.
 */

/* Imake configs define SVR4 on Solaris, but cc & gcc only define __SVR4
 * This check allows non-Imake configured programs to build correctly.
 */

/* define this to whatever it needs to be */

/* Defining any of these will sanitize the namespace to JUST want is defined by
 * that particular standard.  If that happens, we don't get some expected
 * prototypes, typedefs, etc (like fd_mask).  We can define _DARWIN_C_SOURCE to
 * loosen our belts a tad.
 */

/* _XOSDEFS_H_ */


=== system/include/X11/Xproto.h ===
SHA256: 0ad01bd48c6e5175b5d11d582bece617840334e98bc641a0e8e00e32e51ba9fb
/* Definitions for the X window system used by server and c bindings */

/*
 * This packet-construction scheme makes the following assumptions:
 *
 * 1. The compiler is able
 * to generate code which addresses one- and two-byte quantities.
 * In the worst case, this would be done with bit-fields.  If bit-fields
 * are used it may be necessary to reorder the request fields in this file,
 * depending on the order in which the machine assigns bit fields to
 * machine words.  There may also be a problem with sign extension,
 * as K+R specify that bitfields are always unsigned.
 *
 * 2. 2- and 4-byte fields in packet structures must be ordered by hand
 * such that they are naturally-aligned, so that no compiler will ever
 * insert padding bytes.
 *
 * 3. All packets are hand-padded to a multiple of 4 bytes, for
 * the same reason.
 */

/***********************************************************

Copyright 1987, 1998  The Open Group

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.

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
OPEN GROUP 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.

Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.


Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.

                        All Rights Reserved

Permission to use, copy, modify, and distribute this software and its 
documentation for any purpose and without fee is hereby granted, 
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in 
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.  

DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.

******************************************************************/

/*
 * Define constants for the sizes of the network packets.  The sz_ prefix is
 * used instead of something more descriptive so that the symbols are no more
 * than 32 characters in length (which causes problems for some compilers).
 */

/* For the purpose of the structure definitions in this file,
we must redefine the following types in terms of Xmd.h's types, which may
include bit fields.  All of these are #undef'd at the end of this file,
restoring the definitions in X.h.  */

/* add display number */

/***************** 
   connection setup structure.  This is followed by
   numRoots xWindowRoot structs.
*****************/

/* Authorization protocol */

/* Authorization string */

/*num bytes in string following if failure */

/* 1/4 additional bytes in setup info */

/* number of bytes in vendor string */

/* number of roots structs to follow */

/* number of pixmap formats */

/* LSBFirst, MSBFirst */

/* LeastSignificant, MostSign...*/

/* 8, 16, 32 */

/* 8, 16, 32 */

/* window root */

/* number of xVisualType structures following */

/* number of xDepth structures following */

/*****************************************************************
 * Structure Defns
 *   Structures needed for replies 
 *****************************************************************/

/* Used in GetMotionEvents */

/*
 * non-aligned big-endian font ID follows this struct
 */

/* followed by string */

/* number of *characters* in string, or FontChange (255)
		   for font change, or 0 if just delta given */

/* DoRed, DoGreen, DoBlue booleans */

/*****************
 * XRep:
 *    meant to be 32 byte quantity 
 *****************/

/* GenericReply is the common format of all replies.  The "data" items
   are specific to each individual reply type. */

/* X_Reply */

/* depends on reply type */

/* of last request received by server */

/* 4 byte quantities beyond size of GenericReply */

/* Individual reply formats. */

/* X_Reply */

/* NOT 0; this is an extra-large reply */

/* X_Reply */

/* 0 */

/* X_Reply */

/* X_Reply */

/* 0 */

/* X_Reply */

/* of additional bytes */

/* # of characters in name */

/* X_Reply */

/* of additional bytes */

/* # of 8, 16, or 32-bit entities in reply */

/* X_Reply */

/* X_Reply */

/* 0 */

/* X_Reply */

/* 0 */

/* X_Reply */

/* 0 */

/* X_Reply */

/* X_Reply */

/* 0 */

/* X_Reply */

/* 0 */

/* X_Reply */

/* 2, NOT 0; this is an extra-large reply */

/* Warning: this MUST match (up to component renaming) xListFontsWithInfoReply */

/* X_Reply */

/* definitely > 0, even if "nCharInfos" is 0 */

/* followed by this many xFontProp structures */

/* followed by this many xCharInfo structures */

/* X_Reply */

/* 0 */

/* X_Reply */

/* Warning: this MUST match (up to component renaming) xQueryFontReply */

/* X_Reply */

/* 0 indicates end-of-reply-sequence */

/* definitely > 0, even if "nameLength" is 0 */

/* followed by this many xFontProp structures */

/* hint as to how many more replies might be coming */

/* X_Reply */

/* X_Reply */

/* X_Reply */

/* X_Reply */

/* 0 */

/* X_Reply */

/* 0 */

/* X_Reply */

/* X_Reply */

/* X_Reply */

/* X_Reply */

/* 0 */

/* X_Reply */

/* 0 */

/* X_Reply */

/* 0 */

/* X_Reply */

/* X_Reply */

/* X_Reply */

/* how many elements does the map have */

/* X_Reply */

/* 5 */

/* bit masks start here */

/* X_Reply */

/* 0 */

/* X_Reply */

/* 0 */

/* X_Reply */

/*****************************************************************
 * Xerror
 *    All errors  are 32 bytes 
 *****************************************************************/

/* X_Error */

/* the nth request from this client */

/*****************************************************************
 * xEvent
 *    All events are 32 bytes
 *****************************************************************/

/* really XMode */

/* sameScreen and focus booleans, packed together */

/* really XMode */

/*
 * The event fields in the structures for DestroyNotify, UnmapNotify,
 * MapNotify, ReparentNotify, ConfigureNotify, CirculateNotify, GravityNotify,
 * must be at the same offset because server internal code is depending upon
 * this to patch up the events before they are delivered.
 * Also note that MapRequest, ConfigureRequest and CirculateRequest have
 * the same offset for the event window.
 */

/* The event field in the circulate record is really the parent when this
   is used as a CirculateRequest instead of a CirculateNotify */

/* Top or Bottom */

/* NewValue or Deleted */

/* Installed or UnInstalled */

/*********************************************************
 *
 * Generic event
 * 
 * Those events are not part of the core protocol spec and can be used by
 * various extensions.
 * type is always GenericEvent
 * extension is the minor opcode of the extension the event belongs to.
 * evtype is the actual event type, unique __per extension__. 
 *
 * GenericEvents can be longer than 32 bytes, with the length field
 * specifying the number of 4 byte blocks after the first 32 bytes. 
 *
 *
 */

/* KeymapNotify events are not included in the above union because they
   are different from all other events: they do not have a "detail"
   or "sequenceNumber", so there is room for a 248-bit key mask. */

/* XReply is the union of all the replies above whose "fixed part"
fits in 32 bytes.  It does NOT include GetWindowAttributesReply,
QueryFontReply, QueryKeymapReply, or GetKeyboardControlReply 
ListFontsWithInfoReply */

/*****************************************************************
 * REQUESTS
 *****************************************************************/

/* Request structure */

/* meaning depends on request type */

/* length in 4 bytes quantities 
				  of whole request, including this header */

/*****************************************************************
 *  structures that follow request. 
 *****************************************************************/

/* ResourceReq is used for any request which has a resource ID 
   (or Atom or Time) as its one and only argument.  */

/* a Window, Drawable, Font, GContext, Pixmap, etc. */

/* followed by padded string */

/* number of bytes in string */

/* length of stuff following, depends on format */

/* the structure should have been quad-aligned */

/* WORD64 */

/* string follows on word boundary */

/* followed immediately by string bytes */

/* LISTofSTRING8 follows on word boundary */

/* length LISTofCARD8 of values following */

/* same request structure */

/* The following used for PolySegment, PolyRectangle, PolyArc, PolyFillRectangle, PolyFillArc */

/* the following used by PolyText8 and PolyText16 */

/* items (xTextElt) start after struct */

/* followed by structure */

/* DoRed, DoGreen, DoBlue, as in xColorItem */

/* number of name string bytes following structure */

/* followed  by string of length len */

/* number of string bytes following structure*/

/* number of string bytes following structure */

/* how many elements in the map */

/* -100 to 100 */

/* followed by LIST of ATOM */

/* Reply codes */

/* Normal reply */

/* Error */

/* Request codes */

/* restore these definitions back to the typedefs in X.h */

/* XPROTO_H */


=== system/include/X11/Xprotostr.h ===
SHA256: 2286016b57ad8c45da16eb7ad2072aa85c4b7350569d868001bef28464f36845
/***********************************************************

Copyright 1987, 1998  The Open Group

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.

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
OPEN GROUP 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.

Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.


Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.

                        All Rights Reserved

Permission to use, copy, modify, and distribute this software and its 
documentation for any purpose and without fee is hereby granted, 
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in 
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.  

DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.

******************************************************************/

/* Used by PolySegment */

/* POINT */

/*  ARC  */

/* XPROTOSTRUCTS_H */


=== system/include/X11/Xutil.h ===
SHA256: 1884a52dd5055f25313e8ecae6553606d9b1585aee951389503be2d0d68741af
/***********************************************************

Copyright 1987, 1998  The Open Group

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.

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
OPEN GROUP 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.

Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.


Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.

                        All Rights Reserved

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.

DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.

******************************************************************/

/* You must include <X11/Xlib.h> before including this file */

/*
 * Bitmask returned by XParseGeometry().  Each bit tells if the corresponding
 * value (x, y, width, height) was found in the parsed string.
 */

/*
 * new version containing base_width, base_height, and win_gravity fields;
 * used with WM_NORMAL_HINTS.
 */

/* marks which fields in this structure are defined */

/* obsolete for new window mgrs, but clients */

/* should set so old wm's don't mess up */

/* numerator */

/* denominator */

/* added by ICCCM version 1 */

/* added by ICCCM version 1 */

/*
 * The next block of definitions are for window manager properties that
 * clients and applications use for communication.
 */

/* flags argument in size hints */

/* user specified x, y */

/* user specified width, height */

/* program specified position */

/* program specified size */

/* program specified minimum size */

/* program specified maximum size */

/* program specified resize increments */

/* program specified min and max aspect ratios */

/* program specified base for incrementing */

/* program specified window gravity */

/* obsolete */

/* marks which fields in this structure are defined */

/* does this application rely on the window manager to
			get keyboard input? */

/* see below */

/* pixmap to be used as icon */

/* window to be used as icon */

/* initial position of icon */

/* icon mask bitmap */

/* id of related window group */

/* this structure may be extended in the future */

/* definition for flags of XWMHints */

/* definitions for initial window state */

/* for windows that are not mapped */

/* most applications want to start this way */

/* application wants to start as an icon */

/*
 * Obsolete states no longer defined by ICCCM
 */

/* don't know or care */

/* application wants to start zoomed */

/* application believes it is seldom used; */

/* some wm's may put it on inactive menu */

/*
 * new structure for manipulating TEXT properties; used with WM_NAME,
 * WM_ICON_NAME, WM_CLIENT_MACHINE, and WM_COMMAND.
 */

/* same as Property routines */

/* prop type */

/* prop data format: 8, 16, or 32 */

/* number of data items in value */

/* STRING */

/* COMPOUND_TEXT */

/* text in owner's encoding (current locale)*/

/* STRING, else COMPOUND_TEXT */

/* The following is an XFree86 extension, introduced in November 2000 */

/* UTF8_STRING */

/*
 * These macros are used to give some sugar to the image routines so that
 * naive people are more comfortable with them.
 */

/*
 * Compose sequence status structure, used in calling XLookupString.
 */

/* state table pointer */

/* match state */

/*
 * Keysym macros, used on Keysyms to test for classes of symbols
 */

/*
 * opaque reference to Region data type
 */

/* Return values from XRectInRegion() */

/*
 * Information used by the visual utility routines to find desired visual
 * type from the many visuals a display may support.
 */

/* C++ */

/*
 * This defines a window manager property that clients may use to
 * share standard color maps of type RGB_COLOR_MAP:
 */

/* added by ICCCM version 1 */

/* added by ICCCM version 1 */

/* for killid field above */

/*
 * return codes for XReadBitmapFile and XWriteBitmapFile
 */

/****************************************************************
 *
 * Context Management
 *
 ****************************************************************/

/* Associative lookup table return codes */

/* No error. */

/* Out of memory */

/* No entry in table */

/* The following declarations are alphabetized. */

/* r */

/* rect_return */

/* display */

/* rid */

/* context */

/* r */

/* r */

/* r1 */

/* r2 */

/* display */

/* rid */

/* context */

/* data_return */

/* display */

/* w */

/* class_hints_return */

/* display */

/* w */

/* size_list_return */

/* count_return */

/* display */

/* w */

/* hints_return */

/* display */

/* w */

/* stdcmap_return */

/* count_return */

/* property */

/* display */

/* w */

/* hints_return */

/* property */

/* display */

/* w */

/* colormap_return */

/* property */

/* display */

/* window */

/* text_prop_return */

/* property */

/* display */

/* vinfo_mask */

/* vinfo_template */

/* nitems_return */

/* display */

/* w */

/* text_prop_return */

/* display */

/* w */

/* display */

/* w */

/* text_prop_return */

/* display */

/* w */

/* text_prop_return */

/* display */

/* w */

/* hints_return */

/* supplied_return */

/* display */

/* w */

/* hints_return */

/* supplied_return */

/* property */

/* display */

/* w */

/* zhints_return */

/* sra */

/* srb */

/* dr_return */

/* sym */

/* lower */

/* upper */

/* event_struct */

/* buffer_return */

/* bytes_buffer */

/* keysym_return */

/* status_in_out */

/* display */

/* screen */

/* depth */

/* class */

/* vinfo_return */

/* r */

/* dx */

/* dy */

/* r */

/* x */

/* y */

/* points */

/* n */

/* fill_rule */

/* r */

/* x */

/* y */

/* width */

/* height */

/* display */

/* rid */

/* context */

/* data */

/* display */

/* w */

/* class_hints */

/* display */

/* w */

/* size_list */

/* count */

/* display */

/* w */

/* hints */

/* display */

/* w */

/* stdcmaps */

/* count */

/* property */

/* display */

/* w */

/* hints */

/* property */

/* display */

/* w */

/* window_name */

/* icon_name */

/* icon_pixmap */

/* argv */

/* argc */

/* hints */

/* display */

/* w */

/* text_prop */

/* property */

/* display */

/* w */

/* text_prop */

/* display */

/* w */

/* wm_hints */

/* display */

/* w */

/* text_prop */

/* display */

/* w */

/* text_prop */

/* display */

/* w */

/* hints */

/* display */

/* w */

/* window_name */

/* icon_name */

/* argv */

/* argc */

/* normal_hints */

/* wm_hints */

/* class_hints */

/* display */

/* w */

/* window_name */

/* icon_name */

/* argv */

/* argc */

/* normal_hints */

/* wm_hints */

/* class_hints */

/* display */

/* w */

/* window_name */

/* icon_name */

/* argv */

/* argc */

/* normal_hints */

/* wm_hints */

/* class_hints */

/* display */

/* w */

/* hints */

/* property */

/* display */

/* gc */

/* r */

/* display */

/* w */

/* colormap */

/* property */

/* display */

/* w */

/* zhints */

/* r */

/* dx */

/* dy */

/* list */

/* count */

/* text_prop_return */

/* sra */

/* srb */

/* dr_return */

/* text_prop */

/* list_return */

/* count_return */

/* rectangle */

/* src_region */

/* dest_region_return */

/* sra */

/* srb */

/* dr_return */

/* display */

/* screen_number */

/* user_geometry */

/* default_geometry */

/* border_width */

/* hints */

/* x_return */

/* y_return */

/* width_return */

/* height_return */

/* gravity_return */

/* sra */

/* srb */

/* dr_return */

/* _XUTIL_H_ */


=== system/include/X11/cursorfont.h ===
SHA256: aaf570a10ee79c3ab9df5c5b611d98d1c08dd7c6584e4491b03bc802c05a1a77
/*

Copyright 1987, 1998  The Open Group

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.

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 OPEN GROUP 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.

Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.

*/

/* _X11_CURSORFONT_H_ */


=== system/include/X11/extensions/XKB.h ===
SHA256: 77db1eff73db5e27af9cc7055bf48035465b276331141250aa843644e71233ab
/************************************************************
Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.

Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation, and that the name of Silicon Graphics not be 
used in advertising or publicity pertaining to distribution 
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability 
of this software for any purpose. It is provided "as is"
without any express or implied warranty.

SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.

********************************************************/

/*
     * XKB request codes, used in:
     *  -  xkbReqType field of all requests
     *  -  requestMinor field of some events
     */

/*
     * In the X sense, XKB reports only one event.
     * The type field of all XKB events is XkbEventCode
     */

/*
     * XKB has a minor event code so it can use one X event code for 
     * multiple purposes.  
     *  - reported in the xkbType field of all XKB events.
     *  - XkbSelectEventDetails: Indicates the event for which event details 
     *    are being changed
     */

/*
     * Event Mask:
     *  - XkbSelectEvents:  Specifies event interest.
     */

/*
     * NewKeyboardNotify event details:
     */

/*
     * AccessXNotify event types:
     *  - The 'what' field of AccessXNotify events reports the
     *    reason that the event was generated.
     */

/*
     * AccessXNotify details:
     * - Used as an event detail mask to limit the conditions under which
     *   AccessXNotify events are reported
     */

/*
     * Miscellaneous event details:
     * - event detail masks for assorted events that don't reall
     *   have any details.
     */

/*
     * XKB reports one error:  BadKeyboard
     * A further reason for the error is encoded into to most significant
     * byte of the resourceID for the error:
     *    XkbErr_BadDevice - the device in question was not found
     *    XkbErr_BadClass  - the device was found but it doesn't belong to 
     *                       the appropriate class.
     *    XkbErr_BadId     - the device was found and belongs to the right
     *                       class, but not feedback with a matching id was
     *                       found.
     * The low byte of the resourceID for this error contains the device
     * id, class specifier or feedback id that failed.
     */

/*
     * Keyboard Components Mask:
     * - Specifies the components that follow a GetKeyboardByNameReply
     */

/*
     * State detail mask:
     *  - The 'changed' field of StateNotify events reports which of
     *    the keyboard state components have changed.
     *  - Used as an event detail mask to limit the conditions under
     *    which StateNotify events are reported.
     */

/*
     * Controls detail masks:
     *  The controls specified in XkbAllControlsMask:
     *  - The 'changed' field of ControlsNotify events reports which of 
     *    the keyboard controls have changed.
     *  - The 'changeControls' field of the SetControls request specifies
     *    the controls for which values are to be changed.
     *  - Used as an event detail mask to limit the conditions under 
     *    which ControlsNotify events are reported.
     *
     *  The controls specified in the XkbAllBooleanCtrlsMask:
     *  - The 'enabledControls' field of ControlsNotify events reports the
     *    current status of the boolean controls.
     *  - The 'enabledControlsChanges' field of ControlsNotify events reports
     *    any boolean controls that have been turned on or off.
     *  - The 'affectEnabledControls' and 'enabledControls' fields of the
     *    kbSetControls request change the set of enabled controls.
     *  - The 'accessXTimeoutMask' and 'accessXTimeoutValues' fields of
     *    an XkbControlsRec specify the controls to be changed if the keyboard
     *    times out and the values to which they should be changed.
     *  - The 'autoCtrls' and 'autoCtrlsValues' fields of the PerClientFlags 
     *    request specifies the specify the controls to be reset when the
     *    client exits and the values to which they should be reset.
     *  - The 'ctrls' field of an indicator map specifies the controls
     *    that drive the indicator.
     *  - Specifies the boolean controls affected by the SetControls and
     *    LockControls key actions.
     */

/*
     * AccessX Options Mask
     *  - The 'accessXOptions' field of an XkbControlsRec specifies the
     *    AccessX options that are currently in effect.
     *  - The 'accessXTimeoutOptionsMask' and 'accessXTimeoutOptionsValues'
     *    fields of an XkbControlsRec specify the Access X options to be 
     *    changed if the keyboard times out and the values to which they 
     *    should be changed.
     */

/*
     * XkbUseCoreKbd is used to specify the core keyboard without having
     * 			to look up its X input extension identifier.
     * XkbUseCorePtr is used to specify the core pointer without having
     *			to look up its X input extension identifier.
     * XkbDfltXIClass is used to specify "don't care" any place that the
     *			XKB protocol is looking for an X Input Extension 
     *			device class.
     * XkbDfltXIId is used to specify "don't care" any place that the
     *			XKB protocol is looking for an X Input Extension
     *			feedback identifier.
     * XkbAllXIClasses is used to get information about all device indicators,
     *			whether they're part of the indicator feedback class
     *			or the keyboard feedback class.
     * XkbAllXIIds is used to get information about all device indicator
     *			feedbacks without having to list them.
     * XkbXINone is used to indicate that no class or id has been specified.
     * XkbLegalXILedClass(c)  True if 'c' specifies a legal class with LEDs
     * XkbLegalXIBellClass(c) True if 'c' specifies a legal class with bells
     * XkbExplicitXIDevice(d) True if 'd' explicitly specifies a device
     * XkbExplicitXIClass(c)  True if 'c' explicitly specifies a device class
     * XkbExplicitXIId(c)     True if 'i' explicitly specifies a device id
     * XkbSingleXIClass(c)    True if 'c' specifies exactly one device class, 
     *                        including the default.
     * XkbSingleXIId(i)       True if 'i' specifies exactly one device 
     *	                      identifier, including the default.
     */

/*
     * Group Index and Mask:
     *  - Indices into the kt_index array of a key type.
     *  - Mask specifies types to be changed for XkbChangeTypesOfKey
     */

/*
     * BuildCoreState: Given a keyboard group and a modifier state,
     *                 construct the value to be reported an event.
     * GroupForCoreState:  Given the state reported in an event,
     *                 determine the keyboard group.
     * IsLegalGroup:   Returns TRUE if 'g' is a valid group index.
     */

/*
     * GroupsWrap values:
     *  - The 'groupsWrap' field of an XkbControlsRec specifies the
     *    treatment of out of range groups.
     *  - Bits 6 and 7 of the group info field of a key symbol map
     *    specify the interpretation of out of range groups for the
     *    corresponding key.
     */

/*
     * Action flags:  Reported in the 'flags' field of most key actions.
     * Interpretation depends on the type of the action; not all actions
     * accept all flags.
     *
     * Option			Used for Actions
     * ------			----------------
     * ClearLocks		SetMods, LatchMods, SetGroup, LatchGroup
     * LatchToLock		SetMods, LatchMods, SetGroup, LatchGroup
     * LockNoLock		LockMods, ISOLock, LockPtrBtn, LockDeviceBtn
     * LockNoUnlock		LockMods, ISOLock, LockPtrBtn, LockDeviceBtn
     * UseModMapMods		SetMods, LatchMods, LockMods, ISOLock
     * GroupAbsolute		SetGroup, LatchGroup, LockGroup, ISOLock
     * UseDfltButton		PtrBtn, LockPtrBtn
     * NoAcceleration		MovePtr
     * MoveAbsoluteX		MovePtr
     * MoveAbsoluteY		MovePtr
     * ISODfltIsGroup		ISOLock
     * ISONoAffectMods		ISOLock
     * ISONoAffectGroup		ISOLock
     * ISONoAffectPtr		ISOLock
     * ISONoAffectCtrls		ISOLock
     * MessageOnPress		ActionMessage
     * MessageOnRelease		ActionMessage
     * MessageGenKeyEvent	ActionMessage
     * AffectDfltBtn		SetPtrDflt
     * DfltBtnAbsolute		SetPtrDflt
     * SwitchApplication	SwitchScreen
     * SwitchAbsolute		SwitchScreen
     */

/*
     * The following values apply to the SA_DeviceValuator 
     * action only.  Valuator operations specify the action 
     * to be taken.   Values specified in the action are 
     * multiplied by 2^scale before they are applied.
     */

/*
     * Action types: specifies the type of a key action.  Reported in the
     * type field of all key actions.
     */

/*
     * Specifies the key actions that clear latched groups or modifiers.
     */

/*
     * Macros to classify key actions
     */

/*
     * Key Behavior Qualifier:
     *    KB_Permanent indicates that the behavior describes an unalterable
     *    characteristic of the keyboard, not an XKB software-simulation of
     *    the listed behavior.
     * Key Behavior Types:  
     *    Specifies the behavior of the underlying key.
     */

/*
     * Various macros which describe the range of legal keycodes.
     */

/* Seems kinda silly to check that an unsigned char is <= 255... */

/*
     * Assorted constants and limits.
     */

/*
     * Key Type index and mask for the four standard key types.
     */

/*
     * Extension name and version information
     */

/*
     * Explicit map components:
     *  - Used in the 'explicit' field of an XkbServerMap.  Specifies
     *    the keyboard components that should _not_ be updated automatically
     *    in response to core protocol keyboard mapping requests.
     */

/*
     * Map components masks:
     * Those in AllMapComponentsMask:
     *  - Specifies the individual fields to be loaded or changed for the
     *    GetMap and SetMap requests.
     * Those in ClientInfoMask:
     *  - Specifies the components to be allocated by XkbAllocClientMap.
     * Those in ServerInfoMask:
     *  - Specifies the components to be allocated by XkbAllocServerMap.
     */

/*
     * Symbol interpretations flags:
     *  - Used in the flags field of a symbol interpretation
     */

/*
     * Symbol interpretations match specification:
     *  - Used in the match field of a symbol interpretation to specify 
     *    the conditions under which an interpretation is used.
     */

/*
     * Indicator map flags:
     *  - Used in the flags field of an indicator map to indicate the
     *    conditions under which and indicator can be changed and the
     *    effects of changing the indicator.
     */

/*
     * Indicator map component specifications:
     *  - Used by the 'which_groups' and 'which_mods' fields of an indicator
     *    map to specify which keyboard components should be used to drive
     *    the indicator.
     */

/*
     * Compatibility Map Compontents:
     *  - Specifies the components to be allocated in XkbAllocCompatMap.
     */

/*
     * Names component mask:
     *  - Specifies the names to be loaded or changed for the GetNames and
     *    SetNames requests.
     *  - Specifies the names that have changed in a NamesNotify event.
     *  - Specifies the names components to be allocated by XkbAllocNames.
     */

/*
     * GetByName components:
     *  - Specifies desired or necessary components to GetKbdByName request.
     *  - Reports the components that were found in a GetKbdByNameReply
     */

/*
      * ListComponents flags
      */

/*
     * X Input Extension Interactions
     * - Specifies the possible interactions between XKB and the X input
     *   extension
     * - Used to request (XkbGetDeviceInfo) or change (XKbSetDeviceInfo)
     *   XKB information about an extension device.
     * - Reports the list of supported optional features in the reply to
     *   XkbGetDeviceInfo or in an XkbExtensionDeviceNotify event.
     * XkbXI_UnsupportedFeature is reported in XkbExtensionDeviceNotify
     * events to indicate an attempt to use an unsupported feature.
     */

/*
     * Per-Client Flags:
     *  - Specifies flags to be changed by the PerClientFlags request.
     */

/*
     * Debugging flags and controls
     */

/* _XKB_H_ */


=== system/include/X11/extensions/XKBstr.h ===
SHA256: 63620203dd58840a999e5ce61c75472281a0c9f995fdfbf9920cd3ce324a8770
/************************************************************
Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.

Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation, and that the name of Silicon Graphics not be 
used in advertising or publicity pertaining to distribution 
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability 
of this software for any purpose. It is provided "as is"
without any express or implied warranty.

SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.

********************************************************/

/*
	 * Common data structures and access macros
	 */

/* effective mods */

/*
	 * Structures and access macros used primarily by the server
	 */

/* explicit is a C++ reserved word */

/*
	 * Structures and access macros used primarily by clients
	 */

/*
	 * Compatibility structures and access macros
	 */

/*
	 * Names for everything 
	 */

/*
	 * Tie it all together into one big keyboard description
	 */

/*
	 * The following structures can be used to track changes
	 * to a keyboard device
	 */

/*
	 * These data structures are used to construct a keymap from 
	 * a set of components or to list components in the server
	 * database.
	 */

/*
	 * The following data structures describe and track changes to a 
	 * non-keyboard extension device 
	 */

/* names or maps changed */

/* _XKBSTR_H_ */


=== system/include/X11/extensions/XShm.h ===
SHA256: 67bb1736e6692302ec0162f8c2ccfbdb39da396fa31ae4a01fb6ea63ba95624f
/************************************************************

Copyright 1989, 1998  The Open Group

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.

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
OPEN GROUP 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.

Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.

********************************************************/

/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */

/* of event */

/* # of last request processed by server */

/* true if this came frome a SendEvent request */

/* Display the event was read from */

/* drawable of request */

/* ShmReqCode */

/* X_ShmPutImage */

/* the ShmSeg used in the request */

/* the offset into ShmSeg used in the request */

/* resource id */

/* kernel id */

/* address in client */

/* how the server should attach it */

/* dpy */

/* dpy */

/* dpy */

/* majorVersion */

/* minorVersion */

/* sharedPixmaps */

/* dpy */

/* dpy */

/* shminfo */

/* dpy */

/* shminfo */

/* dpy */

/* d */

/* gc */

/* image */

/* src_x */

/* src_y */

/* dst_x */

/* dst_y */

/* src_width */

/* src_height */

/* send_event */

/* dpy */

/* d */

/* image */

/* x */

/* y */

/* plane_mask */

/* dpy */

/* visual */

/* depth */

/* format */

/* data */

/* shminfo */

/* width */

/* height */

/* dpy */

/* d */

/* data */

/* shminfo */

/* width */

/* height */

/* depth */

/* _XSHM_SERVER_ */


=== system/include/X11/extensions/Xext.h ===
SHA256: ea4aaf64f74d19ac557754b524c0b97c34c96e54216b6f5616928e9327bbf50a
/*
 *
Copyright 1989, 1998  The Open Group

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.

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
OPEN GROUP 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.

Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
 */

/* dpy */

/* ext_name */

/* reason */

/* handler */

/* dpy */

/* ext_name */

/* _XEXT_H_ */


=== system/include/X11/extensions/extutil.h ===
SHA256: 7039b6fbf38e58516ec4ee25a4344d6a838822bad39ae2a1cb19e5f1d9ae4c59
/*
 *
Copyright 1989, 1998  The Open Group

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.

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
OPEN GROUP 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.

Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
 *
 * Author:  Jim Fulton, MIT The Open Group
 *
 *                     Xlib Extension-Writing Utilities
 *
 * This package contains utilities for writing the client API for various
 * protocol extensions.  THESE INTERFACES ARE NOT PART OF THE X STANDARD AND
 * ARE SUBJECT TO CHANGE!
 */

/*
 * We need to keep a list of open displays since the Xlib display list isn't
 * public.  We also have to per-display info in a separate block since it isn't
 * stored directly in the Display structure.
 */

/* keep a linked list */

/* which display this is */

/* the extension protocol codes */

/* extra data for extension to use */

/* start of list */

/* most recently used */

/* number of displays */

/* display */

/* gc */

/* codes */

/* display */

/* gc */

/* codes */

/* display */

/* gc */

/* codes */

/* display */

/* gc */

/* codes */

/* display */

/* fs */

/* codes */

/* display */

/* fs */

/* codes */

/* display */

/* codes */

/* display */

/* re */

/* event */

/* display */

/* re */

/* event */

/* display */

/* err */

/* codes */

/* ret_code */

/* display */

/* code */

/* codes */

/* buffer */

/* nbytes */

/* info */

/* extinfo */

/* dpy */

/* ext_name */

/* hooks */

/* nevents */

/* data */

/* extinfo */

/* dpy */

/* extinfo */

/* dpy */

/*
 * helper macros to generate code that is common to all extensions; caller
 * should prefix it with static if extension source is in one file; this
 * could be a utility function, but have to stack 6 unused arguments for
 * something that is called many, many times would be bad.
 */


=== system/include/X11/extensions/shm.h ===
SHA256: e343fd82d8c672a18461a840356610c9824a02b859876a86e60b39f24e90329a
/************************************************************

Copyright 1989, 1998  The Open Group

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.

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
OPEN GROUP 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.

Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.

********************************************************/

/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */

/* current version numbers */

/* _SHM_H_ */


=== system/include/X11/keysym.h ===
SHA256: 8b20fbcdfa52a6ce5bf8c0c1746e2e47fca02e2534561dde0e085893db2a57ca
/***********************************************************

Copyright 1987, 1998  The Open Group

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.

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
OPEN GROUP 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.

Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.


Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.

                        All Rights Reserved

Permission to use, copy, modify, and distribute this software and its 
documentation for any purpose and without fee is hereby granted, 
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in 
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.  

DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.

******************************************************************/

/* default keysyms */


=== system/include/X11/keysymdef.h ===
SHA256: ff31183de7751c1079b1179fbbcb096f155a3b82c0429dcc8e329be43fb93b72
/***********************************************************
Copyright 1987, 1994, 1998  The Open Group

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.

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 OPEN GROUP 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.

Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.


Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts

                        All Rights Reserved

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.

DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.

******************************************************************/

/*
 * The "X11 Window System Protocol" standard defines in Appendix A the
 * keysym codes. These 29-bit integer values identify characters or
 * functions associated with each key (e.g., via the visible
 * engraving) of a keyboard layout. This file assigns mnemonic macro
 * names for these keysyms.
 *
 * This file is also compiled (by src/util/makekeys.c in libX11) into
 * hash tables that can be accessed with X11 library functions such as
 * XStringToKeysym() and XKeysymToString().
 *
 * Where a keysym corresponds one-to-one to an ISO 10646 / Unicode
 * character, this is noted in a comment that provides both the U+xxxx
 * Unicode position, as well as the official Unicode name of the
 * character.
 *
 * Where the correspondence is either not one-to-one or semantically
 * unclear, the Unicode position and name are enclosed in
 * parentheses. Such legacy keysyms should be considered deprecated
 * and are not recommended for use in future keyboard mappings.
 *
 * For any future extension of the keysyms with characters already
 * found in ISO 10646 / Unicode, the following algorithm shall be
 * used. The new keysym code position will simply be the character's
 * Unicode number plus 0x01000000. The keysym values in the range
 * 0x01000100 to 0x0110ffff are reserved to represent Unicode
 * characters in the range U+0100 to U+10FFFF.
 * 
 * While most newer Unicode-based X11 clients do already accept
 * Unicode-mapped keysyms in the range 0x01000100 to 0x0110ffff, it
 * will remain necessary for clients -- in the interest of
 * compatibility with existing servers -- to also understand the
 * existing legacy keysym values in the range 0x0100 to 0x20ff.
 *
 * Where several mnemonic names are defined for the same keysym in this
 * file, all but the first one listed should be considered deprecated.
 *
 * Mnemonic names for keysyms are defined in this file with lines
 * that match one of these Perl regular expressions:
 *
 *    /^\#define XK_([a-zA-Z_0-9]+)\s+0x([0-9a-f]+)\s*\/\* U+([0-9A-F]{4,6}) (.*) \*\/\s*$/
 *    /^\#define XK_([a-zA-Z_0-9]+)\s+0x([0-9a-f]+)\s*\/\*\(U+([0-9A-F]{4,6}) (.*)\)\*\/\s*$/
 *    /^\#define XK_([a-zA-Z_0-9]+)\s+0x([0-9a-f]+)\s*(\/\*\s*(.*)\s*\*\/)?\s*$/
 *
 * Before adding new keysyms, please do consider the following: In
 * addition to the keysym names defined in this file, the
 * XStringToKeysym() and XKeysymToString() functions will also handle
 * any keysym string of the form "U0020" to "U007E" and "U00A0" to
 * "U10FFFF" for all possible Unicode characters. In other words,
 * every possible Unicode character has already a keysym string
 * defined algorithmically, even if it is not listed here. Therefore,
 * defining an additional keysym macro is only necessary where a
 * non-hexadecimal mnemonic name is needed, or where the new keysym
 * does not represent any existing Unicode character.
 *
 * When adding new keysyms to this file, do not forget to also update the
 * following:
 *
 *   - the mappings in src/KeyBind.c in the repo
 *     git://anongit.freedesktop.org/xorg/lib/libX11
 *
 *   - the protocol specification in specs/XProtocol/X11.keysyms
 *     in the repo git://anongit.freedesktop.org/xorg/doc/xorg-docs
 *
 */

/* Void symbol */

/*
 * TTY function keys, cleverly chosen to map to ASCII, for convenience of
 * programming, but could have been arbitrary (at the cost of lookup
 * tables in client code).
 */

/* Back space, back char */

/* Linefeed, LF */

/* Return, enter */

/* Pause, hold */

/* Delete, rubout */

/* International & multi-key character composition */

/* Multi-key character compose */

/* Japanese keyboard support */

/* Kanji, Kanji convert */

/* Cancel Conversion */

/* Start/Stop Conversion */

/* Alias for Henkan_Mode */

/* to Romaji */

/* to Hiragana */

/* to Katakana */

/* Hiragana/Katakana toggle */

/* to Zenkaku */

/* to Hankaku */

/* Zenkaku/Hankaku toggle */

/* Add to Dictionary */

/* Delete from Dictionary */

/* Kana Lock */

/* Kana Shift */

/* Alphanumeric Shift */

/* Alphanumeric toggle */

/* Codeinput */

/* Multiple/All Candidate(s) */

/* Previous Candidate */

/* 0xff31 thru 0xff3f are under XK_KOREAN */

/* Cursor control & motion */

/* Move left, left arrow */

/* Move up, up arrow */

/* Move right, right arrow */

/* Move down, down arrow */

/* Prior, previous */

/* Next */

/* EOL */

/* BOL */

/* Misc functions */

/* Select, mark */

/* Execute, run, do */

/* Insert, insert here */

/* Redo, again */

/* Find, search */

/* Cancel, stop, abort, exit */

/* Help */

/* Character set switch */

/* Alias for mode_switch */

/* Keypad functions, keypad numbers cleverly chosen to map to ASCII */

/* Space */

/* Enter */

/* PF1, KP_A, ... */

/* Equals */

/* Separator, often comma */

/*
 * Auxiliary functions; note the duplicate definitions for left and right
 * function keys;  Sun keyboards and a few other manufacturers have such
 * function key groups on the left and/or right sides of the keyboard.
 * We've not found a keyboard with more than 35 function keys total.
 */

/* Modifiers */

/* Left shift */

/* Right shift */

/* Left control */

/* Right control */

/* Caps lock */

/* Shift lock */

/* Left meta */

/* Right meta */

/* Left alt */

/* Right alt */

/* Left super */

/* Right super */

/* Left hyper */

/* Right hyper */

/* XK_MISCELLANY */

/*
 * Keyboard (XKB) Extension function and modifier keys
 * (from Appendix C of "The X Keyboard Extension: Protocol Specification")
 * Byte 3 = 0xfe
 */

/* Alias for mode_switch */

/* alias for dead_tilde */

/* alias for dead_abovecomma */

/* alias for dead_abovereversedcomma */

/* dead vowels for universal syllable entry */

/* XK_XKB_KEYS */

/*
 * 3270 Terminal Keys
 * Byte 3 = 0xfd
 */

/* XK_3270 */

/*
 * Latin 1
 * (ISO/IEC 8859-1 = Unicode U+0020..U+00FF)
 * Byte 3 = 0
 */

/* U+0020 SPACE */

/* U+0021 EXCLAMATION MARK */

/* U+0022 QUOTATION MARK */

/* U+0023 NUMBER SIGN */

/* U+0024 DOLLAR SIGN */

/* U+0025 PERCENT SIGN */

/* U+0026 AMPERSAND */

/* U+0027 APOSTROPHE */

/* deprecated */

/* U+0028 LEFT PARENTHESIS */

/* U+0029 RIGHT PARENTHESIS */

/* U+002A ASTERISK */

/* U+002B PLUS SIGN */

/* U+002C COMMA */

/* U+002D HYPHEN-MINUS */

/* U+002E FULL STOP */

/* U+002F SOLIDUS */

/* U+0030 DIGIT ZERO */

/* U+0031 DIGIT ONE */

/* U+0032 DIGIT TWO */

/* U+0033 DIGIT THREE */

/* U+0034 DIGIT FOUR */

/* U+0035 DIGIT FIVE */

/* U+0036 DIGIT SIX */

/* U+0037 DIGIT SEVEN */

/* U+0038 DIGIT EIGHT */

/* U+0039 DIGIT NINE */

/* U+003A COLON */

/* U+003B SEMICOLON */

/* U+003C LESS-THAN SIGN */

/* U+003D EQUALS SIGN */

/* U+003E GREATER-THAN SIGN */

/* U+003F QUESTION MARK */

/* U+0040 COMMERCIAL AT */

/* U+0041 LATIN CAPITAL LETTER A */

/* U+0042 LATIN CAPITAL LETTER B */

/* U+0043 LATIN CAPITAL LETTER C */

/* U+0044 LATIN CAPITAL LETTER D */

/* U+0045 LATIN CAPITAL LETTER E */

/* U+0046 LATIN CAPITAL LETTER F */

/* U+0047 LATIN CAPITAL LETTER G */

/* U+0048 LATIN CAPITAL LETTER H */

/* U+0049 LATIN CAPITAL LETTER I */

/* U+004A LATIN CAPITAL LETTER J */

/* U+004B LATIN CAPITAL LETTER K */

/* U+004C LATIN CAPITAL LETTER L */

/* U+004D LATIN CAPITAL LETTER M */

/* U+004E LATIN CAPITAL LETTER N */

/* U+004F LATIN CAPITAL LETTER O */

/* U+0050 LATIN CAPITAL LETTER P */

/* U+0051 LATIN CAPITAL LETTER Q */

/* U+0052 LATIN CAPITAL LETTER R */

/* U+0053 LATIN CAPITAL LETTER S */

/* U+0054 LATIN CAPITAL LETTER T */

/* U+0055 LATIN CAPITAL LETTER U */

/* U+0056 LATIN CAPITAL LETTER V */

/* U+0057 LATIN CAPITAL LETTER W */

/* U+0058 LATIN CAPITAL LETTER X */

/* U+0059 LATIN CAPITAL LETTER Y */

/* U+005A LATIN CAPITAL LETTER Z */

/* U+005B LEFT SQUARE BRACKET */

/* U+005C REVERSE SOLIDUS */

/* U+005D RIGHT SQUARE BRACKET */

/* U+005E CIRCUMFLEX ACCENT */

/* U+005F LOW LINE */

/* U+0060 GRAVE ACCENT */

/* deprecated */

/* U+0061 LATIN SMALL LETTER A */

/* U+0062 LATIN SMALL LETTER B */

/* U+0063 LATIN SMALL LETTER C */

/* U+0064 LATIN SMALL LETTER D */

/* U+0065 LATIN SMALL LETTER E */

/* U+0066 LATIN SMALL LETTER F */

/* U+0067 LATIN SMALL LETTER G */

/* U+0068 LATIN SMALL LETTER H */

/* U+0069 LATIN SMALL LETTER I */

/* U+006A LATIN SMALL LETTER J */

/* U+006B LATIN SMALL LETTER K */

/* U+006C LATIN SMALL LETTER L */

/* U+006D LATIN SMALL LETTER M */

/* U+006E LATIN SMALL LETTER N */

/* U+006F LATIN SMALL LETTER O */

/* U+0070 LATIN SMALL LETTER P */

/* U+0071 LATIN SMALL LETTER Q */

/* U+0072 LATIN SMALL LETTER R */

/* U+0073 LATIN SMALL LETTER S */

/* U+0074 LATIN SMALL LETTER T */

/* U+0075 LATIN SMALL LETTER U */

/* U+0076 LATIN SMALL LETTER V */

/* U+0077 LATIN SMALL LETTER W */

/* U+0078 LATIN SMALL LETTER X */

/* U+0079 LATIN SMALL LETTER Y */

/* U+007A LATIN SMALL LETTER Z */

/* U+007B LEFT CURLY BRACKET */

/* U+007C VERTICAL LINE */

/* U+007D RIGHT CURLY BRACKET */

/* U+007E TILDE */

/* U+00A0 NO-BREAK SPACE */

/* U+00A1 INVERTED EXCLAMATION MARK */

/* U+00A2 CENT SIGN */

/* U+00A3 POUND SIGN */

/* U+00A4 CURRENCY SIGN */

/* U+00A5 YEN SIGN */

/* U+00A6 BROKEN BAR */

/* U+00A7 SECTION SIGN */

/* U+00A8 DIAERESIS */

/* U+00A9 COPYRIGHT SIGN */

/* U+00AA FEMININE ORDINAL INDICATOR */

/* U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */

/* U+00AC NOT SIGN */

/* U+00AD SOFT HYPHEN */

/* U+00AE REGISTERED SIGN */

/* U+00AF MACRON */

/* U+00B0 DEGREE SIGN */

/* U+00B1 PLUS-MINUS SIGN */

/* U+00B2 SUPERSCRIPT TWO */

/* U+00B3 SUPERSCRIPT THREE */

/* U+00B4 ACUTE ACCENT */

/* U+00B5 MICRO SIGN */

/* U+00B6 PILCROW SIGN */

/* U+00B7 MIDDLE DOT */

/* U+00B8 CEDILLA */

/* U+00B9 SUPERSCRIPT ONE */

/* U+00BA MASCULINE ORDINAL INDICATOR */

/* U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */

/* U+00BC VULGAR FRACTION ONE QUARTER */

/* U+00BD VULGAR FRACTION ONE HALF */

/* U+00BE VULGAR FRACTION THREE QUARTERS */

/* U+00BF INVERTED QUESTION MARK */

/* U+00C0 LATIN CAPITAL LETTER A WITH GRAVE */

/* U+00C1 LATIN CAPITAL LETTER A WITH ACUTE */

/* U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX */

/* U+00C3 LATIN CAPITAL LETTER A WITH TILDE */

/* U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS */

/* U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE */

/* U+00C6 LATIN CAPITAL LETTER AE */

/* U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA */

/* U+00C8 LATIN CAPITAL LETTER E WITH GRAVE */

/* U+00C9 LATIN CAPITAL LETTER E WITH ACUTE */

/* U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX */

/* U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS */

/* U+00CC LATIN CAPITAL LETTER I WITH GRAVE */

/* U+00CD LATIN CAPITAL LETTER I WITH ACUTE */

/* U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX */

/* U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS */

/* U+00D0 LATIN CAPITAL LETTER ETH */

/* deprecated */

/* U+00D1 LATIN CAPITAL LETTER N WITH TILDE */

/* U+00D2 LATIN CAPITAL LETTER O WITH GRAVE */

/* U+00D3 LATIN CAPITAL LETTER O WITH ACUTE */

/* U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX */

/* U+00D5 LATIN CAPITAL LETTER O WITH TILDE */

/* U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS */

/* U+00D7 MULTIPLICATION SIGN */

/* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */

/* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */

/* U+00D9 LATIN CAPITAL LETTER U WITH GRAVE */

/* U+00DA LATIN CAPITAL LETTER U WITH ACUTE */

/* U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX */

/* U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS */

/* U+00DD LATIN CAPITAL LETTER Y WITH ACUTE */

/* U+00DE LATIN CAPITAL LETTER THORN */

/* deprecated */

/* U+00DF LATIN SMALL LETTER SHARP S */

/* U+00E0 LATIN SMALL LETTER A WITH GRAVE */

/* U+00E1 LATIN SMALL LETTER A WITH ACUTE */

/* U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX */

/* U+00E3 LATIN SMALL LETTER A WITH TILDE */

/* U+00E4 LATIN SMALL LETTER A WITH DIAERESIS */

/* U+00E5 LATIN SMALL LETTER A WITH RING ABOVE */

/* U+00E6 LATIN SMALL LETTER AE */

/* U+00E7 LATIN SMALL LETTER C WITH CEDILLA */

/* U+00E8 LATIN SMALL LETTER E WITH GRAVE */

/* U+00E9 LATIN SMALL LETTER E WITH ACUTE */

/* U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX */

/* U+00EB LATIN SMALL LETTER E WITH DIAERESIS */

/* U+00EC LATIN SMALL LETTER I WITH GRAVE */

/* U+00ED LATIN SMALL LETTER I WITH ACUTE */

/* U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX */

/* U+00EF LATIN SMALL LETTER I WITH DIAERESIS */

/* U+00F0 LATIN SMALL LETTER ETH */

/* U+00F1 LATIN SMALL LETTER N WITH TILDE */

/* U+00F2 LATIN SMALL LETTER O WITH GRAVE */

/* U+00F3 LATIN SMALL LETTER O WITH ACUTE */

/* U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX */

/* U+00F5 LATIN SMALL LETTER O WITH TILDE */

/* U+00F6 LATIN SMALL LETTER O WITH DIAERESIS */

/* U+00F7 DIVISION SIGN */

/* U+00F8 LATIN SMALL LETTER O WITH STROKE */

/* U+00F8 LATIN SMALL LETTER O WITH STROKE */

/* U+00F9 LATIN SMALL LETTER U WITH GRAVE */

/* U+00FA LATIN SMALL LETTER U WITH ACUTE */

/* U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX */

/* U+00FC LATIN SMALL LETTER U WITH DIAERESIS */

/* U+00FD LATIN SMALL LETTER Y WITH ACUTE */

/* U+00FE LATIN SMALL LETTER THORN */

/* U+00FF LATIN SMALL LETTER Y WITH DIAERESIS */

/* XK_LATIN1 */

/*
 * Latin 2
 * Byte 3 = 1
 */

/* U+0104 LATIN CAPITAL LETTER A WITH OGONEK */

/* U+02D8 BREVE */

/* U+0141 LATIN CAPITAL LETTER L WITH STROKE */

/* U+013D LATIN CAPITAL LETTER L WITH CARON */

/* U+015A LATIN CAPITAL LETTER S WITH ACUTE */

/* U+0160 LATIN CAPITAL LETTER S WITH CARON */

/* U+015E LATIN CAPITAL LETTER S WITH CEDILLA */

/* U+0164 LATIN CAPITAL LETTER T WITH CARON */

/* U+0179 LATIN CAPITAL LETTER Z WITH ACUTE */

/* U+017D LATIN CAPITAL LETTER Z WITH CARON */

/* U+017B LATIN CAPITAL LETTER Z WITH DOT ABOVE */

/* U+0105 LATIN SMALL LETTER A WITH OGONEK */

/* U+02DB OGONEK */

/* U+0142 LATIN SMALL LETTER L WITH STROKE */

/* U+013E LATIN SMALL LETTER L WITH CARON */

/* U+015B LATIN SMALL LETTER S WITH ACUTE */

/* U+02C7 CARON */

/* U+0161 LATIN SMALL LETTER S WITH CARON */

/* U+015F LATIN SMALL LETTER S WITH CEDILLA */

/* U+0165 LATIN SMALL LETTER T WITH CARON */

/* U+017A LATIN SMALL LETTER Z WITH ACUTE */

/* U+02DD DOUBLE ACUTE ACCENT */

/* U+017E LATIN SMALL LETTER Z WITH CARON */

/* U+017C LATIN SMALL LETTER Z WITH DOT ABOVE */

/* U+0154 LATIN CAPITAL LETTER R WITH ACUTE */

/* U+0102 LATIN CAPITAL LETTER A WITH BREVE */

/* U+0139 LATIN CAPITAL LETTER L WITH ACUTE */

/* U+0106 LATIN CAPITAL LETTER C WITH ACUTE */

/* U+010C LATIN CAPITAL LETTER C WITH CARON */

/* U+0118 LATIN CAPITAL LETTER E WITH OGONEK */

/* U+011A LATIN CAPITAL LETTER E WITH CARON */

/* U+010E LATIN CAPITAL LETTER D WITH CARON */

/* U+0110 LATIN CAPITAL LETTER D WITH STROKE */

/* U+0143 LATIN CAPITAL LETTER N WITH ACUTE */

/* U+0147 LATIN CAPITAL LETTER N WITH CARON */

/* U+0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */

/* U+0158 LATIN CAPITAL LETTER R WITH CARON */

/* U+016E LATIN CAPITAL LETTER U WITH RING ABOVE */

/* U+0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */

/* U+0162 LATIN CAPITAL LETTER T WITH CEDILLA */

/* U+0155 LATIN SMALL LETTER R WITH ACUTE */

/* U+0103 LATIN SMALL LETTER A WITH BREVE */

/* U+013A LATIN SMALL LETTER L WITH ACUTE */

/* U+0107 LATIN SMALL LETTER C WITH ACUTE */

/* U+010D LATIN SMALL LETTER C WITH CARON */

/* U+0119 LATIN SMALL LETTER E WITH OGONEK */

/* U+011B LATIN SMALL LETTER E WITH CARON */

/* U+010F LATIN SMALL LETTER D WITH CARON */

/* U+0111 LATIN SMALL LETTER D WITH STROKE */

/* U+0144 LATIN SMALL LETTER N WITH ACUTE */

/* U+0148 LATIN SMALL LETTER N WITH CARON */

/* U+0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE */

/* U+0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE */

/* U+0159 LATIN SMALL LETTER R WITH CARON */

/* U+016F LATIN SMALL LETTER U WITH RING ABOVE */

/* U+0163 LATIN SMALL LETTER T WITH CEDILLA */

/* U+02D9 DOT ABOVE */

/* XK_LATIN2 */

/*
 * Latin 3
 * Byte 3 = 2
 */

/* U+0126 LATIN CAPITAL LETTER H WITH STROKE */

/* U+0124 LATIN CAPITAL LETTER H WITH CIRCUMFLEX */

/* U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE */

/* U+011E LATIN CAPITAL LETTER G WITH BREVE */

/* U+0134 LATIN CAPITAL LETTER J WITH CIRCUMFLEX */

/* U+0127 LATIN SMALL LETTER H WITH STROKE */

/* U+0125 LATIN SMALL LETTER H WITH CIRCUMFLEX */

/* U+0131 LATIN SMALL LETTER DOTLESS I */

/* U+011F LATIN SMALL LETTER G WITH BREVE */

/* U+0135 LATIN SMALL LETTER J WITH CIRCUMFLEX */

/* U+010A LATIN CAPITAL LETTER C WITH DOT ABOVE */

/* U+0108 LATIN CAPITAL LETTER C WITH CIRCUMFLEX */

/* U+0120 LATIN CAPITAL LETTER G WITH DOT ABOVE */

/* U+011C LATIN CAPITAL LETTER G WITH CIRCUMFLEX */

/* U+016C LATIN CAPITAL LETTER U WITH BREVE */

/* U+015C LATIN CAPITAL LETTER S WITH CIRCUMFLEX */

/* U+010B LATIN SMALL LETTER C WITH DOT ABOVE */

/* U+0109 LATIN SMALL LETTER C WITH CIRCUMFLEX */

/* U+0121 LATIN SMALL LETTER G WITH DOT ABOVE */

/* U+011D LATIN SMALL LETTER G WITH CIRCUMFLEX */

/* U+016D LATIN SMALL LETTER U WITH BREVE */

/* U+015D LATIN SMALL LETTER S WITH CIRCUMFLEX */

/* XK_LATIN3 */

/*
 * Latin 4
 * Byte 3 = 3
 */

/* U+0138 LATIN SMALL LETTER KRA */

/* deprecated */

/* U+0156 LATIN CAPITAL LETTER R WITH CEDILLA */

/* U+0128 LATIN CAPITAL LETTER I WITH TILDE */

/* U+013B LATIN CAPITAL LETTER L WITH CEDILLA */

/* U+0112 LATIN CAPITAL LETTER E WITH MACRON */

/* U+0122 LATIN CAPITAL LETTER G WITH CEDILLA */

/* U+0166 LATIN CAPITAL LETTER T WITH STROKE */

/* U+0157 LATIN SMALL LETTER R WITH CEDILLA */

/* U+0129 LATIN SMALL LETTER I WITH TILDE */

/* U+013C LATIN SMALL LETTER L WITH CEDILLA */

/* U+0113 LATIN SMALL LETTER E WITH MACRON */

/* U+0123 LATIN SMALL LETTER G WITH CEDILLA */

/* U+0167 LATIN SMALL LETTER T WITH STROKE */

/* U+014A LATIN CAPITAL LETTER ENG */

/* U+014B LATIN SMALL LETTER ENG */

/* U+0100 LATIN CAPITAL LETTER A WITH MACRON */

/* U+012E LATIN CAPITAL LETTER I WITH OGONEK */

/* U+0116 LATIN CAPITAL LETTER E WITH DOT ABOVE */

/* U+012A LATIN CAPITAL LETTER I WITH MACRON */

/* U+0145 LATIN CAPITAL LETTER N WITH CEDILLA */

/* U+014C LATIN CAPITAL LETTER O WITH MACRON */

/* U+0136 LATIN CAPITAL LETTER K WITH CEDILLA */

/* U+0172 LATIN CAPITAL LETTER U WITH OGONEK */

/* U+0168 LATIN CAPITAL LETTER U WITH TILDE */

/* U+016A LATIN CAPITAL LETTER U WITH MACRON */

/* U+0101 LATIN SMALL LETTER A WITH MACRON */

/* U+012F LATIN SMALL LETTER I WITH OGONEK */

/* U+0117 LATIN SMALL LETTER E WITH DOT ABOVE */

/* U+012B LATIN SMALL LETTER I WITH MACRON */

/* U+0146 LATIN SMALL LETTER N WITH CEDILLA */

/* U+014D LATIN SMALL LETTER O WITH MACRON */

/* U+0137 LATIN SMALL LETTER K WITH CEDILLA */

/* U+0173 LATIN SMALL LETTER U WITH OGONEK */

/* U+0169 LATIN SMALL LETTER U WITH TILDE */

/* U+016B LATIN SMALL LETTER U WITH MACRON */

/* XK_LATIN4 */

/*
 * Latin 8
 */

/* U+1E02 LATIN CAPITAL LETTER B WITH DOT ABOVE */

/* U+1E03 LATIN SMALL LETTER B WITH DOT ABOVE */

/* U+1E0A LATIN CAPITAL LETTER D WITH DOT ABOVE */

/* U+1E80 LATIN CAPITAL LETTER W WITH GRAVE */

/* U+1E82 LATIN CAPITAL LETTER W WITH ACUTE */

/* U+1E0B LATIN SMALL LETTER D WITH DOT ABOVE */

/* U+1EF2 LATIN CAPITAL LETTER Y WITH GRAVE */

/* U+1E1E LATIN CAPITAL LETTER F WITH DOT ABOVE */

/* U+1E1F LATIN SMALL LETTER F WITH DOT ABOVE */

/* U+1E40 LATIN CAPITAL LETTER M WITH DOT ABOVE */

/* U+1E41 LATIN SMALL LETTER M WITH DOT ABOVE */

/* U+1E56 LATIN CAPITAL LETTER P WITH DOT ABOVE */

/* U+1E81 LATIN SMALL LETTER W WITH GRAVE */

/* U+1E57 LATIN SMALL LETTER P WITH DOT ABOVE */

/* U+1E83 LATIN SMALL LETTER W WITH ACUTE */

/* U+1E60 LATIN CAPITAL LETTER S WITH DOT ABOVE */

/* U+1EF3 LATIN SMALL LETTER Y WITH GRAVE */

/* U+1E84 LATIN CAPITAL LETTER W WITH DIAERESIS */

/* U+1E85 LATIN SMALL LETTER W WITH DIAERESIS */

/* U+1E61 LATIN SMALL LETTER S WITH DOT ABOVE */

/* U+0174 LATIN CAPITAL LETTER W WITH CIRCUMFLEX */

/* U+1E6A LATIN CAPITAL LETTER T WITH DOT ABOVE */

/* U+0176 LATIN CAPITAL LETTER Y WITH CIRCUMFLEX */

/* U+0175 LATIN SMALL LETTER W WITH CIRCUMFLEX */

/* U+1E6B LATIN SMALL LETTER T WITH DOT ABOVE */

/* U+0177 LATIN SMALL LETTER Y WITH CIRCUMFLEX */

/* XK_LATIN8 */

/*
 * Latin 9
 * Byte 3 = 0x13
 */

/* U+0152 LATIN CAPITAL LIGATURE OE */

/* U+0153 LATIN SMALL LIGATURE OE */

/* U+0178 LATIN CAPITAL LETTER Y WITH DIAERESIS */

/* XK_LATIN9 */

/*
 * Katakana
 * Byte 3 = 4
 */

/* U+203E OVERLINE */

/* U+3002 IDEOGRAPHIC FULL STOP */

/* U+300C LEFT CORNER BRACKET */

/* U+300D RIGHT CORNER BRACKET */

/* U+3001 IDEOGRAPHIC COMMA */

/* U+30FB KATAKANA MIDDLE DOT */

/* deprecated */

/* U+30F2 KATAKANA LETTER WO */

/* U+30A1 KATAKANA LETTER SMALL A */

/* U+30A3 KATAKANA LETTER SMALL I */

/* U+30A5 KATAKANA LETTER SMALL U */

/* U+30A7 KATAKANA LETTER SMALL E */

/* U+30A9 KATAKANA LETTER SMALL O */

/* U+30E3 KATAKANA LETTER SMALL YA */

/* U+30E5 KATAKANA LETTER SMALL YU */

/* U+30E7 KATAKANA LETTER SMALL YO */

/* U+30C3 KATAKANA LETTER SMALL TU */

/* deprecated */

/* U+30FC KATAKANA-HIRAGANA PROLONGED SOUND MARK */

/* U+30A2 KATAKANA LETTER A */

/* U+30A4 KATAKANA LETTER I */

/* U+30A6 KATAKANA LETTER U */

/* U+30A8 KATAKANA LETTER E */

/* U+30AA KATAKANA LETTER O */

/* U+30AB KATAKANA LETTER KA */

/* U+30AD KATAKANA LETTER KI */

/* U+30AF KATAKANA LETTER KU */

/* U+30B1 KATAKANA LETTER KE */

/* U+30B3 KATAKANA LETTER KO */

/* U+30B5 KATAKANA LETTER SA */

/* U+30B7 KATAKANA LETTER SI */

/* U+30B9 KATAKANA LETTER SU */

/* U+30BB KATAKANA LETTER SE */

/* U+30BD KATAKANA LETTER SO */

/* U+30BF KATAKANA LETTER TA */

/* U+30C1 KATAKANA LETTER TI */

/* deprecated */

/* U+30C4 KATAKANA LETTER TU */

/* deprecated */

/* U+30C6 KATAKANA LETTER TE */

/* U+30C8 KATAKANA LETTER TO */

/* U+30CA KATAKANA LETTER NA */

/* U+30CB KATAKANA LETTER NI */

/* U+30CC KATAKANA LETTER NU */

/* U+30CD KATAKANA LETTER NE */

/* U+30CE KATAKANA LETTER NO */

/* U+30CF KATAKANA LETTER HA */

/* U+30D2 KATAKANA LETTER HI */

/* U+30D5 KATAKANA LETTER HU */

/* deprecated */

/* U+30D8 KATAKANA LETTER HE */

/* U+30DB KATAKANA LETTER HO */

/* U+30DE KATAKANA LETTER MA */

/* U+30DF KATAKANA LETTER MI */

/* U+30E0 KATAKANA LETTER MU */

/* U+30E1 KATAKANA LETTER ME */

/* U+30E2 KATAKANA LETTER MO */

/* U+30E4 KATAKANA LETTER YA */

/* U+30E6 KATAKANA LETTER YU */

/* U+30E8 KATAKANA LETTER YO */

/* U+30E9 KATAKANA LETTER RA */

/* U+30EA KATAKANA LETTER RI */

/* U+30EB KATAKANA LETTER RU */

/* U+30EC KATAKANA LETTER RE */

/* U+30ED KATAKANA LETTER RO */

/* U+30EF KATAKANA LETTER WA */

/* U+30F3 KATAKANA LETTER N */

/* U+309B KATAKANA-HIRAGANA VOICED SOUND MARK */

/* U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK */

/* Alias for mode_switch */

/* XK_KATAKANA */

/*
 * Arabic
 * Byte 3 = 5
 */

/* U+06F0 EXTENDED ARABIC-INDIC DIGIT ZERO */

/* U+06F1 EXTENDED ARABIC-INDIC DIGIT ONE */

/* U+06F2 EXTENDED ARABIC-INDIC DIGIT TWO */

/* U+06F3 EXTENDED ARABIC-INDIC DIGIT THREE */

/* U+06F4 EXTENDED ARABIC-INDIC DIGIT FOUR */

/* U+06F5 EXTENDED ARABIC-INDIC DIGIT FIVE */

/* U+06F6 EXTENDED ARABIC-INDIC DIGIT SIX */

/* U+06F7 EXTENDED ARABIC-INDIC DIGIT SEVEN */

/* U+06F8 EXTENDED ARABIC-INDIC DIGIT EIGHT */

/* U+06F9 EXTENDED ARABIC-INDIC DIGIT NINE */

/* U+066A ARABIC PERCENT SIGN */

/* U+0670 ARABIC LETTER SUPERSCRIPT ALEF */

/* U+0679 ARABIC LETTER TTEH */

/* U+067E ARABIC LETTER PEH */

/* U+0686 ARABIC LETTER TCHEH */

/* U+0688 ARABIC LETTER DDAL */

/* U+0691 ARABIC LETTER RREH */

/* U+060C ARABIC COMMA */

/* U+06D4 ARABIC FULL STOP */

/* U+0660 ARABIC-INDIC DIGIT ZERO */

/* U+0661 ARABIC-INDIC DIGIT ONE */

/* U+0662 ARABIC-INDIC DIGIT TWO */

/* U+0663 ARABIC-INDIC DIGIT THREE */

/* U+0664 ARABIC-INDIC DIGIT FOUR */

/* U+0665 ARABIC-INDIC DIGIT FIVE */

/* U+0666 ARABIC-INDIC DIGIT SIX */

/* U+0667 ARABIC-INDIC DIGIT SEVEN */

/* U+0668 ARABIC-INDIC DIGIT EIGHT */

/* U+0669 ARABIC-INDIC DIGIT NINE */

/* U+061B ARABIC SEMICOLON */

/* U+061F ARABIC QUESTION MARK */

/* U+0621 ARABIC LETTER HAMZA */

/* U+0622 ARABIC LETTER ALEF WITH MADDA ABOVE */

/* U+0623 ARABIC LETTER ALEF WITH HAMZA ABOVE */

/* U+0624 ARABIC LETTER WAW WITH HAMZA ABOVE */

/* U+0625 ARABIC LETTER ALEF WITH HAMZA BELOW */

/* U+0626 ARABIC LETTER YEH WITH HAMZA ABOVE */

/* U+0627 ARABIC LETTER ALEF */

/* U+0628 ARABIC LETTER BEH */

/* U+0629 ARABIC LETTER TEH MARBUTA */

/* U+062A ARABIC LETTER TEH */

/* U+062B ARABIC LETTER THEH */

/* U+062C ARABIC LETTER JEEM */

/* U+062D ARABIC LETTER HAH */

/* U+062E ARABIC LETTER KHAH */

/* U+062F ARABIC LETTER DAL */

/* U+0630 ARABIC LETTER THAL */

/* U+0631 ARABIC LETTER REH */

/* U+0632 ARABIC LETTER ZAIN */

/* U+0633 ARABIC LETTER SEEN */

/* U+0634 ARABIC LETTER SHEEN */

/* U+0635 ARABIC LETTER SAD */

/* U+0636 ARABIC LETTER DAD */

/* U+0637 ARABIC LETTER TAH */

/* U+0638 ARABIC LETTER ZAH */

/* U+0639 ARABIC LETTER AIN */

/* U+063A ARABIC LETTER GHAIN */

/* U+0640 ARABIC TATWEEL */

/* U+0641 ARABIC LETTER FEH */

/* U+0642 ARABIC LETTER QAF */

/* U+0643 ARABIC LETTER KAF */

/* U+0644 ARABIC LETTER LAM */

/* U+0645 ARABIC LETTER MEEM */

/* U+0646 ARABIC LETTER NOON */

/* U+0647 ARABIC LETTER HEH */

/* deprecated */

/* U+0648 ARABIC LETTER WAW */

/* U+0649 ARABIC LETTER ALEF MAKSURA */

/* U+064A ARABIC LETTER YEH */

/* U+064B ARABIC FATHATAN */

/* U+064C ARABIC DAMMATAN */

/* U+064D ARABIC KASRATAN */

/* U+064E ARABIC FATHA */

/* U+064F ARABIC DAMMA */

/* U+0650 ARABIC KASRA */

/* U+0651 ARABIC SHADDA */

/* U+0652 ARABIC SUKUN */

/* U+0653 ARABIC MADDAH ABOVE */

/* U+0654 ARABIC HAMZA ABOVE */

/* U+0655 ARABIC HAMZA BELOW */

/* U+0698 ARABIC LETTER JEH */

/* U+06A4 ARABIC LETTER VEH */

/* U+06A9 ARABIC LETTER KEHEH */

/* U+06AF ARABIC LETTER GAF */

/* U+06BA ARABIC LETTER NOON GHUNNA */

/* U+06BE ARABIC LETTER HEH DOACHASHMEE */

/* U+06CC ARABIC LETTER FARSI YEH */

/* U+06CC ARABIC LETTER FARSI YEH */

/* U+06D2 ARABIC LETTER YEH BARREE */

/* U+06C1 ARABIC LETTER HEH GOAL */

/* Alias for mode_switch */

/* XK_ARABIC */

/*
 * Cyrillic
 * Byte 3 = 6
 */

/* U+0492 CYRILLIC CAPITAL LETTER GHE WITH STROKE */

/* U+0493 CYRILLIC SMALL LETTER GHE WITH STROKE */

/* U+0496 CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER */

/* U+0497 CYRILLIC SMALL LETTER ZHE WITH DESCENDER */

/* U+049A CYRILLIC CAPITAL LETTER KA WITH DESCENDER */

/* U+049B CYRILLIC SMALL LETTER KA WITH DESCENDER */

/* U+049C CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE */

/* U+049D CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE */

/* U+04A2 CYRILLIC CAPITAL LETTER EN WITH DESCENDER */

/* U+04A3 CYRILLIC SMALL LETTER EN WITH DESCENDER */

/* U+04AE CYRILLIC CAPITAL LETTER STRAIGHT U */

/* U+04AF CYRILLIC SMALL LETTER STRAIGHT U */

/* U+04B0 CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE */

/* U+04B1 CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE */

/* U+04B2 CYRILLIC CAPITAL LETTER HA WITH DESCENDER */

/* U+04B3 CYRILLIC SMALL LETTER HA WITH DESCENDER */

/* U+04B6 CYRILLIC CAPITAL LETTER CHE WITH DESCENDER */

/* U+04B7 CYRILLIC SMALL LETTER CHE WITH DESCENDER */

/* U+04B8 CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE */

/* U+04B9 CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE */

/* U+04BA CYRILLIC CAPITAL LETTER SHHA */

/* U+04BB CYRILLIC SMALL LETTER SHHA */

/* U+04D8 CYRILLIC CAPITAL LETTER SCHWA */

/* U+04D9 CYRILLIC SMALL LETTER SCHWA */

/* U+04E2 CYRILLIC CAPITAL LETTER I WITH MACRON */

/* U+04E3 CYRILLIC SMALL LETTER I WITH MACRON */

/* U+04E8 CYRILLIC CAPITAL LETTER BARRED O */

/* U+04E9 CYRILLIC SMALL LETTER BARRED O */

/* U+04EE CYRILLIC CAPITAL LETTER U WITH MACRON */

/* U+04EF CYRILLIC SMALL LETTER U WITH MACRON */

/* U+0452 CYRILLIC SMALL LETTER DJE */

/* U+0453 CYRILLIC SMALL LETTER GJE */

/* U+0451 CYRILLIC SMALL LETTER IO */

/* U+0454 CYRILLIC SMALL LETTER UKRAINIAN IE */

/* deprecated */

/* U+0455 CYRILLIC SMALL LETTER DZE */

/* U+0456 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I */

/* deprecated */

/* U+0457 CYRILLIC SMALL LETTER YI */

/* deprecated */

/* U+0458 CYRILLIC SMALL LETTER JE */

/* deprecated */

/* U+0459 CYRILLIC SMALL LETTER LJE */

/* deprecated */

/* U+045A CYRILLIC SMALL LETTER NJE */

/* deprecated */

/* U+045B CYRILLIC SMALL LETTER TSHE */

/* U+045C CYRILLIC SMALL LETTER KJE */

/* U+0491 CYRILLIC SMALL LETTER GHE WITH UPTURN */

/* U+045E CYRILLIC SMALL LETTER SHORT U */

/* U+045F CYRILLIC SMALL LETTER DZHE */

/* deprecated */

/* U+2116 NUMERO SIGN */

/* U+0402 CYRILLIC CAPITAL LETTER DJE */

/* U+0403 CYRILLIC CAPITAL LETTER GJE */

/* U+0401 CYRILLIC CAPITAL LETTER IO */

/* U+0404 CYRILLIC CAPITAL LETTER UKRAINIAN IE */

/* deprecated */

/* U+0405 CYRILLIC CAPITAL LETTER DZE */

/* U+0406 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I */

/* deprecated */

/* U+0407 CYRILLIC CAPITAL LETTER YI */

/* deprecated */

/* U+0408 CYRILLIC CAPITAL LETTER JE */

/* deprecated */

/* U+0409 CYRILLIC CAPITAL LETTER LJE */

/* deprecated */

/* U+040A CYRILLIC CAPITAL LETTER NJE */

/* deprecated */

/* U+040B CYRILLIC CAPITAL LETTER TSHE */

/* U+040C CYRILLIC CAPITAL LETTER KJE */

/* U+0490 CYRILLIC CAPITAL LETTER GHE WITH UPTURN */

/* U+040E CYRILLIC CAPITAL LETTER SHORT U */

/* U+040F CYRILLIC CAPITAL LETTER DZHE */

/* deprecated */

/* U+044E CYRILLIC SMALL LETTER YU */

/* U+0430 CYRILLIC SMALL LETTER A */

/* U+0431 CYRILLIC SMALL LETTER BE */

/* U+0446 CYRILLIC SMALL LETTER TSE */

/* U+0434 CYRILLIC SMALL LETTER DE */

/* U+0435 CYRILLIC SMALL LETTER IE */

/* U+0444 CYRILLIC SMALL LETTER EF */

/* U+0433 CYRILLIC SMALL LETTER GHE */

/* U+0445 CYRILLIC SMALL LETTER HA */

/* U+0438 CYRILLIC SMALL LETTER I */

/* U+0439 CYRILLIC SMALL LETTER SHORT I */

/* U+043A CYRILLIC SMALL LETTER KA */

/* U+043B CYRILLIC SMALL LETTER EL */

/* U+043C CYRILLIC SMALL LETTER EM */

/* U+043D CYRILLIC SMALL LETTER EN */

/* U+043E CYRILLIC SMALL LETTER O */

/* U+043F CYRILLIC SMALL LETTER PE */

/* U+044F CYRILLIC SMALL LETTER YA */

/* U+0440 CYRILLIC SMALL LETTER ER */

/* U+0441 CYRILLIC SMALL LETTER ES */

/* U+0442 CYRILLIC SMALL LETTER TE */

/* U+0443 CYRILLIC SMALL LETTER U */

/* U+0436 CYRILLIC SMALL LETTER ZHE */

/* U+0432 CYRILLIC SMALL LETTER VE */

/* U+044C CYRILLIC SMALL LETTER SOFT SIGN */

/* U+044B CYRILLIC SMALL LETTER YERU */

/* U+0437 CYRILLIC SMALL LETTER ZE */

/* U+0448 CYRILLIC SMALL LETTER SHA */

/* U+044D CYRILLIC SMALL LETTER E */

/* U+0449 CYRILLIC SMALL LETTER SHCHA */

/* U+0447 CYRILLIC SMALL LETTER CHE */

/* U+044A CYRILLIC SMALL LETTER HARD SIGN */

/* U+042E CYRILLIC CAPITAL LETTER YU */

/* U+0410 CYRILLIC CAPITAL LETTER A */

/* U+0411 CYRILLIC CAPITAL LETTER BE */

/* U+0426 CYRILLIC CAPITAL LETTER TSE */

/* U+0414 CYRILLIC CAPITAL LETTER DE */

/* U+0415 CYRILLIC CAPITAL LETTER IE */

/* U+0424 CYRILLIC CAPITAL LETTER EF */

/* U+0413 CYRILLIC CAPITAL LETTER GHE */

/* U+0425 CYRILLIC CAPITAL LETTER HA */

/* U+0418 CYRILLIC CAPITAL LETTER I */

/* U+0419 CYRILLIC CAPITAL LETTER SHORT I */

/* U+041A CYRILLIC CAPITAL LETTER KA */

/* U+041B CYRILLIC CAPITAL LETTER EL */

/* U+041C CYRILLIC CAPITAL LETTER EM */

/* U+041D CYRILLIC CAPITAL LETTER EN */

/* U+041E CYRILLIC CAPITAL LETTER O */

/* U+041F CYRILLIC CAPITAL LETTER PE */

/* U+042F CYRILLIC CAPITAL LETTER YA */

/* U+0420 CYRILLIC CAPITAL LETTER ER */

/* U+0421 CYRILLIC CAPITAL LETTER ES */

/* U+0422 CYRILLIC CAPITAL LETTER TE */

/* U+0423 CYRILLIC CAPITAL LETTER U */

/* U+0416 CYRILLIC CAPITAL LETTER ZHE */

/* U+0412 CYRILLIC CAPITAL LETTER VE */

/* U+042C CYRILLIC CAPITAL LETTER SOFT SIGN */

/* U+042B CYRILLIC CAPITAL LETTER YERU */

/* U+0417 CYRILLIC CAPITAL LETTER ZE */

/* U+0428 CYRILLIC CAPITAL LETTER SHA */

/* U+042D CYRILLIC CAPITAL LETTER E */

/* U+0429 CYRILLIC CAPITAL LETTER SHCHA */

/* U+0427 CYRILLIC CAPITAL LETTER CHE */

/* U+042A CYRILLIC CAPITAL LETTER HARD SIGN */

/* XK_CYRILLIC */

/*
 * Greek
 * (based on an early draft of, and not quite identical to, ISO/IEC 8859-7)
 * Byte 3 = 7
 */

/* U+0386 GREEK CAPITAL LETTER ALPHA WITH TONOS */

/* U+0388 GREEK CAPITAL LETTER EPSILON WITH TONOS */

/* U+0389 GREEK CAPITAL LETTER ETA WITH TONOS */

/* U+038A GREEK CAPITAL LETTER IOTA WITH TONOS */

/* U+03AA GREEK CAPITAL LETTER IOTA WITH DIALYTIKA */

/* old typo */

/* U+038C GREEK CAPITAL LETTER OMICRON WITH TONOS */

/* U+038E GREEK CAPITAL LETTER UPSILON WITH TONOS */

/* U+03AB GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA */

/* U+038F GREEK CAPITAL LETTER OMEGA WITH TONOS */

/* U+0385 GREEK DIALYTIKA TONOS */

/* U+2015 HORIZONTAL BAR */

/* U+03AC GREEK SMALL LETTER ALPHA WITH TONOS */

/* U+03AD GREEK SMALL LETTER EPSILON WITH TONOS */

/* U+03AE GREEK SMALL LETTER ETA WITH TONOS */

/* U+03AF GREEK SMALL LETTER IOTA WITH TONOS */

/* U+03CA GREEK SMALL LETTER IOTA WITH DIALYTIKA */

/* U+0390 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS */

/* U+03CC GREEK SMALL LETTER OMICRON WITH TONOS */

/* U+03CD GREEK SMALL LETTER UPSILON WITH TONOS */

/* U+03CB GREEK SMALL LETTER UPSILON WITH DIALYTIKA */

/* U+03B0 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS */

/* U+03CE GREEK SMALL LETTER OMEGA WITH TONOS */

/* U+0391 GREEK CAPITAL LETTER ALPHA */

/* U+0392 GREEK CAPITAL LETTER BETA */

/* U+0393 GREEK CAPITAL LETTER GAMMA */

/* U+0394 GREEK CAPITAL LETTER DELTA */

/* U+0395 GREEK CAPITAL LETTER EPSILON */

/* U+0396 GREEK CAPITAL LETTER ZETA */

/* U+0397 GREEK CAPITAL LETTER ETA */

/* U+0398 GREEK CAPITAL LETTER THETA */

/* U+0399 GREEK CAPITAL LETTER IOTA */

/* U+039A GREEK CAPITAL LETTER KAPPA */

/* U+039B GREEK CAPITAL LETTER LAMDA */

/* U+039B GREEK CAPITAL LETTER LAMDA */

/* U+039C GREEK CAPITAL LETTER MU */

/* U+039D GREEK CAPITAL LETTER NU */

/* U+039E GREEK CAPITAL LETTER XI */

/* U+039F GREEK CAPITAL LETTER OMICRON */

/* U+03A0 GREEK CAPITAL LETTER PI */

/* U+03A1 GREEK CAPITAL LETTER RHO */

/* U+03A3 GREEK CAPITAL LETTER SIGMA */

/* U+03A4 GREEK CAPITAL LETTER TAU */

/* U+03A5 GREEK CAPITAL LETTER UPSILON */

/* U+03A6 GREEK CAPITAL LETTER PHI */

/* U+03A7 GREEK CAPITAL LETTER CHI */

/* U+03A8 GREEK CAPITAL LETTER PSI */

/* U+03A9 GREEK CAPITAL LETTER OMEGA */

/* U+03B1 GREEK SMALL LETTER ALPHA */

/* U+03B2 GREEK SMALL LETTER BETA */

/* U+03B3 GREEK SMALL LETTER GAMMA */

/* U+03B4 GREEK SMALL LETTER DELTA */

/* U+03B5 GREEK SMALL LETTER EPSILON */

/* U+03B6 GREEK SMALL LETTER ZETA */

/* U+03B7 GREEK SMALL LETTER ETA */

/* U+03B8 GREEK SMALL LETTER THETA */

/* U+03B9 GREEK SMALL LETTER IOTA */

/* U+03BA GREEK SMALL LETTER KAPPA */

/* U+03BB GREEK SMALL LETTER LAMDA */

/* U+03BB GREEK SMALL LETTER LAMDA */

/* U+03BC GREEK SMALL LETTER MU */

/* U+03BD GREEK SMALL LETTER NU */

/* U+03BE GREEK SMALL LETTER XI */

/* U+03BF GREEK SMALL LETTER OMICRON */

/* U+03C0 GREEK SMALL LETTER PI */

/* U+03C1 GREEK SMALL LETTER RHO */

/* U+03C3 GREEK SMALL LETTER SIGMA */

/* U+03C2 GREEK SMALL LETTER FINAL SIGMA */

/* U+03C4 GREEK SMALL LETTER TAU */

/* U+03C5 GREEK SMALL LETTER UPSILON */

/* U+03C6 GREEK SMALL LETTER PHI */

/* U+03C7 GREEK SMALL LETTER CHI */

/* U+03C8 GREEK SMALL LETTER PSI */

/* U+03C9 GREEK SMALL LETTER OMEGA */

/* Alias for mode_switch */

/* XK_GREEK */

/*
 * Technical
 * (from the DEC VT330/VT420 Technical Character Set, http://vt100.net/charsets/technical.html)
 * Byte 3 = 8
 */

/* U+23B7 RADICAL SYMBOL BOTTOM */

/*(U+250C BOX DRAWINGS LIGHT DOWN AND RIGHT)*/

/*(U+2500 BOX DRAWINGS LIGHT HORIZONTAL)*/

/* U+2320 TOP HALF INTEGRAL */

/* U+2321 BOTTOM HALF INTEGRAL */

/*(U+2502 BOX DRAWINGS LIGHT VERTICAL)*/

/* U+23A1 LEFT SQUARE BRACKET UPPER CORNER */

/* U+23A3 LEFT SQUARE BRACKET LOWER CORNER */

/* U+23A4 RIGHT SQUARE BRACKET UPPER CORNER */

/* U+23A6 RIGHT SQUARE BRACKET LOWER CORNER */

/* U+239B LEFT PARENTHESIS UPPER HOOK */

/* U+239D LEFT PARENTHESIS LOWER HOOK */

/* U+239E RIGHT PARENTHESIS UPPER HOOK */

/* U+23A0 RIGHT PARENTHESIS LOWER HOOK */

/* U+23A8 LEFT CURLY BRACKET MIDDLE PIECE */

/* U+23AC RIGHT CURLY BRACKET MIDDLE PIECE */

/* U+2264 LESS-THAN OR EQUAL TO */

/* U+2260 NOT EQUAL TO */

/* U+2265 GREATER-THAN OR EQUAL TO */

/* U+222B INTEGRAL */

/* U+2234 THEREFORE */

/* U+221D PROPORTIONAL TO */

/* U+221E INFINITY */

/* U+2207 NABLA */

/* U+223C TILDE OPERATOR */

/* U+2243 ASYMPTOTICALLY EQUAL TO */

/* U+21D4 LEFT RIGHT DOUBLE ARROW */

/* U+21D2 RIGHTWARDS DOUBLE ARROW */

/* U+2261 IDENTICAL TO */

/* U+221A SQUARE ROOT */

/* U+2282 SUBSET OF */

/* U+2283 SUPERSET OF */

/* U+2229 INTERSECTION */

/* U+222A UNION */

/* U+2227 LOGICAL AND */

/* U+2228 LOGICAL OR */

/* U+2202 PARTIAL DIFFERENTIAL */

/* U+0192 LATIN SMALL LETTER F WITH HOOK */

/* U+2190 LEFTWARDS ARROW */

/* U+2191 UPWARDS ARROW */

/* U+2192 RIGHTWARDS ARROW */

/* U+2193 DOWNWARDS ARROW */

/* XK_TECHNICAL */

/*
 * Special
 * (from the DEC VT100 Special Graphics Character Set)
 * Byte 3 = 9
 */

/* U+25C6 BLACK DIAMOND */

/* U+2592 MEDIUM SHADE */

/* U+2409 SYMBOL FOR HORIZONTAL TABULATION */

/* U+240C SYMBOL FOR FORM FEED */

/* U+240D SYMBOL FOR CARRIAGE RETURN */

/* U+240A SYMBOL FOR LINE FEED */

/* U+2424 SYMBOL FOR NEWLINE */

/* U+240B SYMBOL FOR VERTICAL TABULATION */

/* U+2518 BOX DRAWINGS LIGHT UP AND LEFT */

/* U+2510 BOX DRAWINGS LIGHT DOWN AND LEFT */

/* U+250C BOX DRAWINGS LIGHT DOWN AND RIGHT */

/* U+2514 BOX DRAWINGS LIGHT UP AND RIGHT */

/* U+253C BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL */

/* U+23BA HORIZONTAL SCAN LINE-1 */

/* U+23BB HORIZONTAL SCAN LINE-3 */

/* U+2500 BOX DRAWINGS LIGHT HORIZONTAL */

/* U+23BC HORIZONTAL SCAN LINE-7 */

/* U+23BD HORIZONTAL SCAN LINE-9 */

/* U+251C BOX DRAWINGS LIGHT VERTICAL AND RIGHT */

/* U+2524 BOX DRAWINGS LIGHT VERTICAL AND LEFT */

/* U+2534 BOX DRAWINGS LIGHT UP AND HORIZONTAL */

/* U+252C BOX DRAWINGS LIGHT DOWN AND HORIZONTAL */

/* U+2502 BOX DRAWINGS LIGHT VERTICAL */

/* XK_SPECIAL */

/*
 * Publishing
 * (these are probably from a long forgotten DEC Publishing
 * font that once shipped with DECwrite)
 * Byte 3 = 0x0a
 */

/* U+2003 EM SPACE */

/* U+2002 EN SPACE */

/* U+2004 THREE-PER-EM SPACE */

/* U+2005 FOUR-PER-EM SPACE */

/* U+2007 FIGURE SPACE */

/* U+2008 PUNCTUATION SPACE */

/* U+2009 THIN SPACE */

/* U+200A HAIR SPACE */

/* U+2014 EM DASH */

/* U+2013 EN DASH */

/*(U+2423 OPEN BOX)*/

/* U+2026 HORIZONTAL ELLIPSIS */

/* U+2025 TWO DOT LEADER */

/* U+2153 VULGAR FRACTION ONE THIRD */

/* U+2154 VULGAR FRACTION TWO THIRDS */

/* U+2155 VULGAR FRACTION ONE FIFTH */

/* U+2156 VULGAR FRACTION TWO FIFTHS */

/* U+2157 VULGAR FRACTION THREE FIFTHS */

/* U+2158 VULGAR FRACTION FOUR FIFTHS */

/* U+2159 VULGAR FRACTION ONE SIXTH */

/* U+215A VULGAR FRACTION FIVE SIXTHS */

/* U+2105 CARE OF */

/* U+2012 FIGURE DASH */

/*(U+27E8 MATHEMATICAL LEFT ANGLE BRACKET)*/

/*(U+002E FULL STOP)*/

/*(U+27E9 MATHEMATICAL RIGHT ANGLE BRACKET)*/

/* U+215B VULGAR FRACTION ONE EIGHTH */

/* U+215C VULGAR FRACTION THREE EIGHTHS */

/* U+215D VULGAR FRACTION FIVE EIGHTHS */

/* U+215E VULGAR FRACTION SEVEN EIGHTHS */

/* U+2122 TRADE MARK SIGN */

/*(U+2613 SALTIRE)*/

/*(U+25C1 WHITE LEFT-POINTING TRIANGLE)*/

/*(U+25B7 WHITE RIGHT-POINTING TRIANGLE)*/

/*(U+25CB WHITE CIRCLE)*/

/*(U+25AF WHITE VERTICAL RECTANGLE)*/

/* U+2018 LEFT SINGLE QUOTATION MARK */

/* U+2019 RIGHT SINGLE QUOTATION MARK */

/* U+201C LEFT DOUBLE QUOTATION MARK */

/* U+201D RIGHT DOUBLE QUOTATION MARK */

/* U+211E PRESCRIPTION TAKE */

/* U+2032 PRIME */

/* U+2033 DOUBLE PRIME */

/* U+271D LATIN CROSS */

/*(U+25AC BLACK RECTANGLE)*/

/*(U+25C0 BLACK LEFT-POINTING TRIANGLE)*/

/*(U+25B6 BLACK RIGHT-POINTING TRIANGLE)*/

/*(U+25CF BLACK CIRCLE)*/

/*(U+25AE BLACK VERTICAL RECTANGLE)*/

/*(U+25E6 WHITE BULLET)*/

/*(U+25AB WHITE SMALL SQUARE)*/

/*(U+25AD WHITE RECTANGLE)*/

/*(U+25B3 WHITE UP-POINTING TRIANGLE)*/

/*(U+25BD WHITE DOWN-POINTING TRIANGLE)*/

/*(U+2606 WHITE STAR)*/

/*(U+2022 BULLET)*/

/*(U+25AA BLACK SMALL SQUARE)*/

/*(U+25B2 BLACK UP-POINTING TRIANGLE)*/

/*(U+25BC BLACK DOWN-POINTING TRIANGLE)*/

/*(U+261C WHITE LEFT POINTING INDEX)*/

/*(U+261E WHITE RIGHT POINTING INDEX)*/

/* U+2663 BLACK CLUB SUIT */

/* U+2666 BLACK DIAMOND SUIT */

/* U+2665 BLACK HEART SUIT */

/* U+2720 MALTESE CROSS */

/* U+2020 DAGGER */

/* U+2021 DOUBLE DAGGER */

/* U+2713 CHECK MARK */

/* U+2717 BALLOT X */

/* U+266F MUSIC SHARP SIGN */

/* U+266D MUSIC FLAT SIGN */

/* U+2642 MALE SIGN */

/* U+2640 FEMALE SIGN */

/* U+260E BLACK TELEPHONE */

/* U+2315 TELEPHONE RECORDER */

/* U+2117 SOUND RECORDING COPYRIGHT */

/* U+2038 CARET */

/* U+201A SINGLE LOW-9 QUOTATION MARK */

/* U+201E DOUBLE LOW-9 QUOTATION MARK */

/* XK_PUBLISHING */

/*
 * APL
 * Byte 3 = 0x0b
 */

/*(U+003C LESS-THAN SIGN)*/

/*(U+003E GREATER-THAN SIGN)*/

/*(U+2228 LOGICAL OR)*/

/*(U+2227 LOGICAL AND)*/

/*(U+00AF MACRON)*/

/* U+22A4 DOWN TACK */

/*(U+2229 INTERSECTION)*/

/* U+230A LEFT FLOOR */

/*(U+005F LOW LINE)*/

/* U+2218 RING OPERATOR */

/* U+2395 APL FUNCTIONAL SYMBOL QUAD */

/* U+22A5 UP TACK */

/* U+25CB WHITE CIRCLE */

/* U+2308 LEFT CEILING */

/*(U+222A UNION)*/

/*(U+2283 SUPERSET OF)*/

/*(U+2282 SUBSET OF)*/

/* U+22A3 LEFT TACK */

/* U+22A2 RIGHT TACK */

/* XK_APL */

/*
 * Hebrew
 * Byte 3 = 0x0c
 */

/* U+2017 DOUBLE LOW LINE */

/* U+05D0 HEBREW LETTER ALEF */

/* U+05D1 HEBREW LETTER BET */

/* deprecated */

/* U+05D2 HEBREW LETTER GIMEL */

/* deprecated */

/* U+05D3 HEBREW LETTER DALET */

/* deprecated */

/* U+05D4 HEBREW LETTER HE */

/* U+05D5 HEBREW LETTER VAV */

/* U+05D6 HEBREW LETTER ZAYIN */

/* deprecated */

/* U+05D7 HEBREW LETTER HET */

/* deprecated */

/* U+05D8 HEBREW LETTER TET */

/* deprecated */

/* U+05D9 HEBREW LETTER YOD */

/* U+05DA HEBREW LETTER FINAL KAF */

/* U+05DB HEBREW LETTER KAF */

/* U+05DC HEBREW LETTER LAMED */

/* U+05DD HEBREW LETTER FINAL MEM */

/* U+05DE HEBREW LETTER MEM */

/* U+05DF HEBREW LETTER FINAL NUN */

/* U+05E0 HEBREW LETTER NUN */

/* U+05E1 HEBREW LETTER SAMEKH */

/* deprecated */

/* U+05E2 HEBREW LETTER AYIN */

/* U+05E3 HEBREW LETTER FINAL PE */

/* U+05E4 HEBREW LETTER PE */

/* U+05E5 HEBREW LETTER FINAL TSADI */

/* deprecated */

/* U+05E6 HEBREW LETTER TSADI */

/* deprecated */

/* U+05E7 HEBREW LETTER QOF */

/* deprecated */

/* U+05E8 HEBREW LETTER RESH */

/* U+05E9 HEBREW LETTER SHIN */

/* U+05EA HEBREW LETTER TAV */

/* deprecated */

/* Alias for mode_switch */

/* XK_HEBREW */

/*
 * Thai
 * Byte 3 = 0x0d
 */

/* U+0E01 THAI CHARACTER KO KAI */

/* U+0E02 THAI CHARACTER KHO KHAI */

/* U+0E03 THAI CHARACTER KHO KHUAT */

/* U+0E04 THAI CHARACTER KHO KHWAI */

/* U+0E05 THAI CHARACTER KHO KHON */

/* U+0E06 THAI CHARACTER KHO RAKHANG */

/* U+0E07 THAI CHARACTER NGO NGU */

/* U+0E08 THAI CHARACTER CHO CHAN */

/* U+0E09 THAI CHARACTER CHO CHING */

/* U+0E0A THAI CHARACTER CHO CHANG */

/* U+0E0B THAI CHARACTER SO SO */

/* U+0E0C THAI CHARACTER CHO CHOE */

/* U+0E0D THAI CHARACTER YO YING */

/* U+0E0E THAI CHARACTER DO CHADA */

/* U+0E0F THAI CHARACTER TO PATAK */

/* U+0E10 THAI CHARACTER THO THAN */

/* U+0E11 THAI CHARACTER THO NANGMONTHO */

/* U+0E12 THAI CHARACTER THO PHUTHAO */

/* U+0E13 THAI CHARACTER NO NEN */

/* U+0E14 THAI CHARACTER DO DEK */

/* U+0E15 THAI CHARACTER TO TAO */

/* U+0E16 THAI CHARACTER THO THUNG */

/* U+0E17 THAI CHARACTER THO THAHAN */

/* U+0E18 THAI CHARACTER THO THONG */

/* U+0E19 THAI CHARACTER NO NU */

/* U+0E1A THAI CHARACTER BO BAIMAI */

/* U+0E1B THAI CHARACTER PO PLA */

/* U+0E1C THAI CHARACTER PHO PHUNG */

/* U+0E1D THAI CHARACTER FO FA */

/* U+0E1E THAI CHARACTER PHO PHAN */

/* U+0E1F THAI CHARACTER FO FAN */

/* U+0E20 THAI CHARACTER PHO SAMPHAO */

/* U+0E21 THAI CHARACTER MO MA */

/* U+0E22 THAI CHARACTER YO YAK */

/* U+0E23 THAI CHARACTER RO RUA */

/* U+0E24 THAI CHARACTER RU */

/* U+0E25 THAI CHARACTER LO LING */

/* U+0E26 THAI CHARACTER LU */

/* U+0E27 THAI CHARACTER WO WAEN */

/* U+0E28 THAI CHARACTER SO SALA */

/* U+0E29 THAI CHARACTER SO RUSI */

/* U+0E2A THAI CHARACTER SO SUA */

/* U+0E2B THAI CHARACTER HO HIP */

/* U+0E2C THAI CHARACTER LO CHULA */

/* U+0E2D THAI CHARACTER O ANG */

/* U+0E2E THAI CHARACTER HO NOKHUK */

/* U+0E2F THAI CHARACTER PAIYANNOI */

/* U+0E30 THAI CHARACTER SARA A */

/* U+0E31 THAI CHARACTER MAI HAN-AKAT */

/* U+0E32 THAI CHARACTER SARA AA */

/* U+0E33 THAI CHARACTER SARA AM */

/* U+0E34 THAI CHARACTER SARA I */

/* U+0E35 THAI CHARACTER SARA II */

/* U+0E36 THAI CHARACTER SARA UE */

/* U+0E37 THAI CHARACTER SARA UEE */

/* U+0E38 THAI CHARACTER SARA U */

/* U+0E39 THAI CHARACTER SARA UU */

/* U+0E3A THAI CHARACTER PHINTHU */

/* U+0E3F THAI CURRENCY SYMBOL BAHT */

/* U+0E40 THAI CHARACTER SARA E */

/* U+0E41 THAI CHARACTER SARA AE */

/* U+0E42 THAI CHARACTER SARA O */

/* U+0E43 THAI CHARACTER SARA AI MAIMUAN */

/* U+0E44 THAI CHARACTER SARA AI MAIMALAI */

/* U+0E45 THAI CHARACTER LAKKHANGYAO */

/* U+0E46 THAI CHARACTER MAIYAMOK */

/* U+0E47 THAI CHARACTER MAITAIKHU */

/* U+0E48 THAI CHARACTER MAI EK */

/* U+0E49 THAI CHARACTER MAI THO */

/* U+0E4A THAI CHARACTER MAI TRI */

/* U+0E4B THAI CHARACTER MAI CHATTAWA */

/* U+0E4C THAI CHARACTER THANTHAKHAT */

/* U+0E4D THAI CHARACTER NIKHAHIT */

/* U+0E50 THAI DIGIT ZERO */

/* U+0E51 THAI DIGIT ONE */

/* U+0E52 THAI DIGIT TWO */

/* U+0E53 THAI DIGIT THREE */

/* U+0E54 THAI DIGIT FOUR */

/* U+0E55 THAI DIGIT FIVE */

/* U+0E56 THAI DIGIT SIX */

/* U+0E57 THAI DIGIT SEVEN */

/* U+0E58 THAI DIGIT EIGHT */

/* U+0E59 THAI DIGIT NINE */

/* XK_THAI */

/*
 * Korean
 * Byte 3 = 0x0e
 */

/* Hangul start/stop(toggle) */

/* Hangul start */

/* Hangul end, English start */

/* Start Hangul->Hanja Conversion */

/* Hangul Jamo mode */

/* Hangul Romaja mode */

/* Hangul code input mode */

/* Jeonja mode */

/* Banja mode */

/* Pre Hanja conversion */

/* Post Hanja conversion */

/* Single candidate */

/* Multiple candidate */

/* Previous candidate */

/* Special symbols */

/* Alias for mode_switch */

/* Hangul Consonant Characters */

/* Hangul Vowel Characters */

/* Hangul syllable-final (JongSeong) Characters */

/* Ancient Hangul Consonant Characters */

/* Ancient Hangul Vowel Characters */

/* Ancient Hangul syllable-final (JongSeong) Characters */

/* Korean currency symbol */

/*(U+20A9 WON SIGN)*/

/* XK_KOREAN */

/*
 * Armenian
 */

/* U+0587 ARMENIAN SMALL LIGATURE ECH YIWN */

/* U+0589 ARMENIAN FULL STOP */

/* U+0589 ARMENIAN FULL STOP */

/* U+055D ARMENIAN COMMA */

/* U+055D ARMENIAN COMMA */

/* U+058A ARMENIAN HYPHEN */

/* U+058A ARMENIAN HYPHEN */

/* U+055C ARMENIAN EXCLAMATION MARK */

/* U+055C ARMENIAN EXCLAMATION MARK */

/* U+055B ARMENIAN EMPHASIS MARK */

/* U+055B ARMENIAN EMPHASIS MARK */

/* U+055E ARMENIAN QUESTION MARK */

/* U+055E ARMENIAN QUESTION MARK */

/* U+0531 ARMENIAN CAPITAL LETTER AYB */

/* U+0561 ARMENIAN SMALL LETTER AYB */

/* U+0532 ARMENIAN CAPITAL LETTER BEN */

/* U+0562 ARMENIAN SMALL LETTER BEN */

/* U+0533 ARMENIAN CAPITAL LETTER GIM */

/* U+0563 ARMENIAN SMALL LETTER GIM */

/* U+0534 ARMENIAN CAPITAL LETTER DA */

/* U+0564 ARMENIAN SMALL LETTER DA */

/* U+0535 ARMENIAN CAPITAL LETTER ECH */

/* U+0565 ARMENIAN SMALL LETTER ECH */

/* U+0536 ARMENIAN CAPITAL LETTER ZA */

/* U+0566 ARMENIAN SMALL LETTER ZA */

/* U+0537 ARMENIAN CAPITAL LETTER EH */

/* U+0567 ARMENIAN SMALL LETTER EH */

/* U+0538 ARMENIAN CAPITAL LETTER ET */

/* U+0568 ARMENIAN SMALL LETTER ET */

/* U+0539 ARMENIAN CAPITAL LETTER TO */

/* U+0569 ARMENIAN SMALL LETTER TO */

/* U+053A ARMENIAN CAPITAL LETTER ZHE */

/* U+056A ARMENIAN SMALL LETTER ZHE */

/* U+053B ARMENIAN CAPITAL LETTER INI */

/* U+056B ARMENIAN SMALL LETTER INI */

/* U+053C ARMENIAN CAPITAL LETTER LIWN */

/* U+056C ARMENIAN SMALL LETTER LIWN */

/* U+053D ARMENIAN CAPITAL LETTER XEH */

/* U+056D ARMENIAN SMALL LETTER XEH */

/* U+053E ARMENIAN CAPITAL LETTER CA */

/* U+056E ARMENIAN SMALL LETTER CA */

/* U+053F ARMENIAN CAPITAL LETTER KEN */

/* U+056F ARMENIAN SMALL LETTER KEN */

/* U+0540 ARMENIAN CAPITAL LETTER HO */

/* U+0570 ARMENIAN SMALL LETTER HO */

/* U+0541 ARMENIAN CAPITAL LETTER JA */

/* U+0571 ARMENIAN SMALL LETTER JA */

/* U+0542 ARMENIAN CAPITAL LETTER GHAD */

/* U+0572 ARMENIAN SMALL LETTER GHAD */

/* U+0543 ARMENIAN CAPITAL LETTER CHEH */

/* U+0573 ARMENIAN SMALL LETTER CHEH */

/* U+0544 ARMENIAN CAPITAL LETTER MEN */

/* U+0574 ARMENIAN SMALL LETTER MEN */

/* U+0545 ARMENIAN CAPITAL LETTER YI */

/* U+0575 ARMENIAN SMALL LETTER YI */

/* U+0546 ARMENIAN CAPITAL LETTER NOW */

/* U+0576 ARMENIAN SMALL LETTER NOW */

/* U+0547 ARMENIAN CAPITAL LETTER SHA */

/* U+0577 ARMENIAN SMALL LETTER SHA */

/* U+0548 ARMENIAN CAPITAL LETTER VO */

/* U+0578 ARMENIAN SMALL LETTER VO */

/* U+0549 ARMENIAN CAPITAL LETTER CHA */

/* U+0579 ARMENIAN SMALL LETTER CHA */

/* U+054A ARMENIAN CAPITAL LETTER PEH */

/* U+057A ARMENIAN SMALL LETTER PEH */

/* U+054B ARMENIAN CAPITAL LETTER JHEH */

/* U+057B ARMENIAN SMALL LETTER JHEH */

/* U+054C ARMENIAN CAPITAL LETTER RA */

/* U+057C ARMENIAN SMALL LETTER RA */

/* U+054D ARMENIAN CAPITAL LETTER SEH */

/* U+057D ARMENIAN SMALL LETTER SEH */

/* U+054E ARMENIAN CAPITAL LETTER VEW */

/* U+057E ARMENIAN SMALL LETTER VEW */

/* U+054F ARMENIAN CAPITAL LETTER TIWN */

/* U+057F ARMENIAN SMALL LETTER TIWN */

/* U+0550 ARMENIAN CAPITAL LETTER REH */

/* U+0580 ARMENIAN SMALL LETTER REH */

/* U+0551 ARMENIAN CAPITAL LETTER CO */

/* U+0581 ARMENIAN SMALL LETTER CO */

/* U+0552 ARMENIAN CAPITAL LETTER YIWN */

/* U+0582 ARMENIAN SMALL LETTER YIWN */

/* U+0553 ARMENIAN CAPITAL LETTER PIWR */

/* U+0583 ARMENIAN SMALL LETTER PIWR */

/* U+0554 ARMENIAN CAPITAL LETTER KEH */

/* U+0584 ARMENIAN SMALL LETTER KEH */

/* U+0555 ARMENIAN CAPITAL LETTER OH */

/* U+0585 ARMENIAN SMALL LETTER OH */

/* U+0556 ARMENIAN CAPITAL LETTER FEH */

/* U+0586 ARMENIAN SMALL LETTER FEH */

/* U+055A ARMENIAN APOSTROPHE */

/* XK_ARMENIAN */

/*
 * Georgian
 */

/* U+10D0 GEORGIAN LETTER AN */

/* U+10D1 GEORGIAN LETTER BAN */

/* U+10D2 GEORGIAN LETTER GAN */

/* U+10D3 GEORGIAN LETTER DON */

/* U+10D4 GEORGIAN LETTER EN */

/* U+10D5 GEORGIAN LETTER VIN */

/* U+10D6 GEORGIAN LETTER ZEN */

/* U+10D7 GEORGIAN LETTER TAN */

/* U+10D8 GEORGIAN LETTER IN */

/* U+10D9 GEORGIAN LETTER KAN */

/* U+10DA GEORGIAN LETTER LAS */

/* U+10DB GEORGIAN LETTER MAN */

/* U+10DC GEORGIAN LETTER NAR */

/* U+10DD GEORGIAN LETTER ON */

/* U+10DE GEORGIAN LETTER PAR */

/* U+10DF GEORGIAN LETTER ZHAR */

/* U+10E0 GEORGIAN LETTER RAE */

/* U+10E1 GEORGIAN LETTER SAN */

/* U+10E2 GEORGIAN LETTER TAR */

/* U+10E3 GEORGIAN LETTER UN */

/* U+10E4 GEORGIAN LETTER PHAR */

/* U+10E5 GEORGIAN LETTER KHAR */

/* U+10E6 GEORGIAN LETTER GHAN */

/* U+10E7 GEORGIAN LETTER QAR */

/* U+10E8 GEORGIAN LETTER SHIN */

/* U+10E9 GEORGIAN LETTER CHIN */

/* U+10EA GEORGIAN LETTER CAN */

/* U+10EB GEORGIAN LETTER JIL */

/* U+10EC GEORGIAN LETTER CIL */

/* U+10ED GEORGIAN LETTER CHAR */

/* U+10EE GEORGIAN LETTER XAN */

/* U+10EF GEORGIAN LETTER JHAN */

/* U+10F0 GEORGIAN LETTER HAE */

/* U+10F1 GEORGIAN LETTER HE */

/* U+10F2 GEORGIAN LETTER HIE */

/* U+10F3 GEORGIAN LETTER WE */

/* U+10F4 GEORGIAN LETTER HAR */

/* U+10F5 GEORGIAN LETTER HOE */

/* U+10F6 GEORGIAN LETTER FI */

/* XK_GEORGIAN */

/*
 * Azeri (and other Turkic or Caucasian languages)
 */

/* latin */

/* U+1E8A LATIN CAPITAL LETTER X WITH DOT ABOVE */

/* U+012C LATIN CAPITAL LETTER I WITH BREVE */

/* U+01B5 LATIN CAPITAL LETTER Z WITH STROKE */

/* U+01E6 LATIN CAPITAL LETTER G WITH CARON */

/* U+01D2 LATIN CAPITAL LETTER O WITH CARON */

/* U+019F LATIN CAPITAL LETTER O WITH MIDDLE TILDE */

/* U+1E8B LATIN SMALL LETTER X WITH DOT ABOVE */

/* U+012D LATIN SMALL LETTER I WITH BREVE */

/* U+01B6 LATIN SMALL LETTER Z WITH STROKE */

/* U+01E7 LATIN SMALL LETTER G WITH CARON */

/* U+01D2 LATIN SMALL LETTER O WITH CARON */

/* U+0275 LATIN SMALL LETTER BARRED O */

/* U+018F LATIN CAPITAL LETTER SCHWA */

/* U+0259 LATIN SMALL LETTER SCHWA */

/* those are not really Caucasus */

/* For Inupiak */

/* U+1E36 LATIN CAPITAL LETTER L WITH DOT BELOW */

/* U+1E37 LATIN SMALL LETTER L WITH DOT BELOW */

/* XK_CAUCASUS */

/*
 * Vietnamese
 */

/* U+1EA0 LATIN CAPITAL LETTER A WITH DOT BELOW */

/* U+1EA1 LATIN SMALL LETTER A WITH DOT BELOW */

/* U+1EA2 LATIN CAPITAL LETTER A WITH HOOK ABOVE */

/* U+1EA3 LATIN SMALL LETTER A WITH HOOK ABOVE */

/* U+1EA4 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE */

/* U+1EA5 LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE */

/* U+1EA6 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE */

/* U+1EA7 LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE */

/* U+1EA8 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE */

/* U+1EA9 LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE */

/* U+1EAA LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE */

/* U+1EAB LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE */

/* U+1EAC LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW */

/* U+1EAD LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW */

/* U+1EAE LATIN CAPITAL LETTER A WITH BREVE AND ACUTE */

/* U+1EAF LATIN SMALL LETTER A WITH BREVE AND ACUTE */

/* U+1EB0 LATIN CAPITAL LETTER A WITH BREVE AND GRAVE */

/* U+1EB1 LATIN SMALL LETTER A WITH BREVE AND GRAVE */

/* U+1EB2 LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE */

/* U+1EB3 LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE */

/* U+1EB4 LATIN CAPITAL LETTER A WITH BREVE AND TILDE */

/* U+1EB5 LATIN SMALL LETTER A WITH BREVE AND TILDE */

/* U+1EB6 LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW */

/* U+1EB7 LATIN SMALL LETTER A WITH BREVE AND DOT BELOW */

/* U+1EB8 LATIN CAPITAL LETTER E WITH DOT BELOW */

/* U+1EB9 LATIN SMALL LETTER E WITH DOT BELOW */

/* U+1EBA LATIN CAPITAL LETTER E WITH HOOK ABOVE */

/* U+1EBB LATIN SMALL LETTER E WITH HOOK ABOVE */

/* U+1EBC LATIN CAPITAL LETTER E WITH TILDE */

/* U+1EBD LATIN SMALL LETTER E WITH TILDE */

/* U+1EBE LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE */

/* U+1EBF LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE */

/* U+1EC0 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE */

/* U+1EC1 LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE */

/* U+1EC2 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE */

/* U+1EC3 LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE */

/* U+1EC4 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE */

/* U+1EC5 LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE */

/* U+1EC6 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW */

/* U+1EC7 LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW */

/* U+1EC8 LATIN CAPITAL LETTER I WITH HOOK ABOVE */

/* U+1EC9 LATIN SMALL LETTER I WITH HOOK ABOVE */

/* U+1ECA LATIN CAPITAL LETTER I WITH DOT BELOW */

/* U+1ECB LATIN SMALL LETTER I WITH DOT BELOW */

/* U+1ECC LATIN CAPITAL LETTER O WITH DOT BELOW */

/* U+1ECD LATIN SMALL LETTER O WITH DOT BELOW */

/* U+1ECE LATIN CAPITAL LETTER O WITH HOOK ABOVE */

/* U+1ECF LATIN SMALL LETTER O WITH HOOK ABOVE */

/* U+1ED0 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE */

/* U+1ED1 LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE */

/* U+1ED2 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE */

/* U+1ED3 LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE */

/* U+1ED4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE */

/* U+1ED5 LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE */

/* U+1ED6 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE */

/* U+1ED7 LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE */

/* U+1ED8 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW */

/* U+1ED9 LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW */

/* U+1EDA LATIN CAPITAL LETTER O WITH HORN AND ACUTE */

/* U+1EDB LATIN SMALL LETTER O WITH HORN AND ACUTE */

/* U+1EDC LATIN CAPITAL LETTER O WITH HORN AND GRAVE */

/* U+1EDD LATIN SMALL LETTER O WITH HORN AND GRAVE */

/* U+1EDE LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE */

/* U+1EDF LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE */

/* U+1EE0 LATIN CAPITAL LETTER O WITH HORN AND TILDE */

/* U+1EE1 LATIN SMALL LETTER O WITH HORN AND TILDE */

/* U+1EE2 LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW */

/* U+1EE3 LATIN SMALL LETTER O WITH HORN AND DOT BELOW */

/* U+1EE4 LATIN CAPITAL LETTER U WITH DOT BELOW */

/* U+1EE5 LATIN SMALL LETTER U WITH DOT BELOW */

/* U+1EE6 LATIN CAPITAL LETTER U WITH HOOK ABOVE */

/* U+1EE7 LATIN SMALL LETTER U WITH HOOK ABOVE */

/* U+1EE8 LATIN CAPITAL LETTER U WITH HORN AND ACUTE */

/* U+1EE9 LATIN SMALL LETTER U WITH HORN AND ACUTE */

/* U+1EEA LATIN CAPITAL LETTER U WITH HORN AND GRAVE */

/* U+1EEB LATIN SMALL LETTER U WITH HORN AND GRAVE */

/* U+1EEC LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE */

/* U+1EED LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE */

/* U+1EEE LATIN CAPITAL LETTER U WITH HORN AND TILDE */

/* U+1EEF LATIN SMALL LETTER U WITH HORN AND TILDE */

/* U+1EF0 LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW */

/* U+1EF1 LATIN SMALL LETTER U WITH HORN AND DOT BELOW */

/* U+1EF4 LATIN CAPITAL LETTER Y WITH DOT BELOW */

/* U+1EF5 LATIN SMALL LETTER Y WITH DOT BELOW */

/* U+1EF6 LATIN CAPITAL LETTER Y WITH HOOK ABOVE */

/* U+1EF7 LATIN SMALL LETTER Y WITH HOOK ABOVE */

/* U+1EF8 LATIN CAPITAL LETTER Y WITH TILDE */

/* U+1EF9 LATIN SMALL LETTER Y WITH TILDE */

/* U+01A0 LATIN CAPITAL LETTER O WITH HORN */

/* U+01A1 LATIN SMALL LETTER O WITH HORN */

/* U+01AF LATIN CAPITAL LETTER U WITH HORN */

/* U+01B0 LATIN SMALL LETTER U WITH HORN */

/* XK_VIETNAMESE */

/* U+20A0 EURO-CURRENCY SIGN */

/* U+20A1 COLON SIGN */

/* U+20A2 CRUZEIRO SIGN */

/* U+20A3 FRENCH FRANC SIGN */

/* U+20A4 LIRA SIGN */

/* U+20A5 MILL SIGN */

/* U+20A6 NAIRA SIGN */

/* U+20A7 PESETA SIGN */

/* U+20A8 RUPEE SIGN */

/* U+20A9 WON SIGN */

/* U+20AA NEW SHEQEL SIGN */

/* U+20AB DONG SIGN */

/* U+20AC EURO SIGN */

/* XK_CURRENCY */

/* one, two and three are defined above. */

/* U+2070 SUPERSCRIPT ZERO */

/* U+2074 SUPERSCRIPT FOUR */

/* U+2075 SUPERSCRIPT FIVE */

/* U+2076 SUPERSCRIPT SIX */

/* U+2077 SUPERSCRIPT SEVEN */

/* U+2078 SUPERSCRIPT EIGHT */

/* U+2079 SUPERSCRIPT NINE */

/* U+2080 SUBSCRIPT ZERO */

/* U+2081 SUBSCRIPT ONE */

/* U+2082 SUBSCRIPT TWO */

/* U+2083 SUBSCRIPT THREE */

/* U+2084 SUBSCRIPT FOUR */

/* U+2085 SUBSCRIPT FIVE */

/* U+2086 SUBSCRIPT SIX */

/* U+2087 SUBSCRIPT SEVEN */

/* U+2088 SUBSCRIPT EIGHT */

/* U+2089 SUBSCRIPT NINE */

/* U+2202 PARTIAL DIFFERENTIAL */

/* U+2205 NULL SET */

/* U+2208 ELEMENT OF */

/* U+2209 NOT AN ELEMENT OF */

/* U+220B CONTAINS AS MEMBER */

/* U+221A SQUARE ROOT */

/* U+221B CUBE ROOT */

/* U+221C FOURTH ROOT */

/* U+222C DOUBLE INTEGRAL */

/* U+222D TRIPLE INTEGRAL */

/* U+2235 BECAUSE */

/* U+2245 ALMOST EQUAL TO */

/* U+2247 NOT ALMOST EQUAL TO */

/* U+2262 NOT IDENTICAL TO */

/* U+2263 STRICTLY EQUIVALENT TO */

/* XK_MATHEMATICAL */

/* U+2800 BRAILLE PATTERN BLANK */

/* U+2801 BRAILLE PATTERN DOTS-1 */

/* U+2802 BRAILLE PATTERN DOTS-2 */

/* U+2803 BRAILLE PATTERN DOTS-12 */

/* U+2804 BRAILLE PATTERN DOTS-3 */

/* U+2805 BRAILLE PATTERN DOTS-13 */

/* U+2806 BRAILLE PATTERN DOTS-23 */

/* U+2807 BRAILLE PATTERN DOTS-123 */

/* U+2808 BRAILLE PATTERN DOTS-4 */

/* U+2809 BRAILLE PATTERN DOTS-14 */

/* U+280a BRAILLE PATTERN DOTS-24 */

/* U+280b BRAILLE PATTERN DOTS-124 */

/* U+280c BRAILLE PATTERN DOTS-34 */

/* U+280d BRAILLE PATTERN DOTS-134 */

/* U+280e BRAILLE PATTERN DOTS-234 */

/* U+280f BRAILLE PATTERN DOTS-1234 */

/* U+2810 BRAILLE PATTERN DOTS-5 */

/* U+2811 BRAILLE PATTERN DOTS-15 */

/* U+2812 BRAILLE PATTERN DOTS-25 */

/* U+2813 BRAILLE PATTERN DOTS-125 */

/* U+2814 BRAILLE PATTERN DOTS-35 */

/* U+2815 BRAILLE PATTERN DOTS-135 */

/* U+2816 BRAILLE PATTERN DOTS-235 */

/* U+2817 BRAILLE PATTERN DOTS-1235 */

/* U+2818 BRAILLE PATTERN DOTS-45 */

/* U+2819 BRAILLE PATTERN DOTS-145 */

/* U+281a BRAILLE PATTERN DOTS-245 */

/* U+281b BRAILLE PATTERN DOTS-1245 */

/* U+281c BRAILLE PATTERN DOTS-345 */

/* U+281d BRAILLE PATTERN DOTS-1345 */

/* U+281e BRAILLE PATTERN DOTS-2345 */

/* U+281f BRAILLE PATTERN DOTS-12345 */

/* U+2820 BRAILLE PATTERN DOTS-6 */

/* U+2821 BRAILLE PATTERN DOTS-16 */

/* U+2822 BRAILLE PATTERN DOTS-26 */

/* U+2823 BRAILLE PATTERN DOTS-126 */

/* U+2824 BRAILLE PATTERN DOTS-36 */

/* U+2825 BRAILLE PATTERN DOTS-136 */

/* U+2826 BRAILLE PATTERN DOTS-236 */

/* U+2827 BRAILLE PATTERN DOTS-1236 */

/* U+2828 BRAILLE PATTERN DOTS-46 */

/* U+2829 BRAILLE PATTERN DOTS-146 */

/* U+282a BRAILLE PATTERN DOTS-246 */

/* U+282b BRAILLE PATTERN DOTS-1246 */

/* U+282c BRAILLE PATTERN DOTS-346 */

/* U+282d BRAILLE PATTERN DOTS-1346 */

/* U+282e BRAILLE PATTERN DOTS-2346 */

/* U+282f BRAILLE PATTERN DOTS-12346 */

/* U+2830 BRAILLE PATTERN DOTS-56 */

/* U+2831 BRAILLE PATTERN DOTS-156 */

/* U+2832 BRAILLE PATTERN DOTS-256 */

/* U+2833 BRAILLE PATTERN DOTS-1256 */

/* U+2834 BRAILLE PATTERN DOTS-356 */

/* U+2835 BRAILLE PATTERN DOTS-1356 */

/* U+2836 BRAILLE PATTERN DOTS-2356 */

/* U+2837 BRAILLE PATTERN DOTS-12356 */

/* U+2838 BRAILLE PATTERN DOTS-456 */

/* U+2839 BRAILLE PATTERN DOTS-1456 */

/* U+283a BRAILLE PATTERN DOTS-2456 */

/* U+283b BRAILLE PATTERN DOTS-12456 */

/* U+283c BRAILLE PATTERN DOTS-3456 */

/* U+283d BRAILLE PATTERN DOTS-13456 */

/* U+283e BRAILLE PATTERN DOTS-23456 */

/* U+283f BRAILLE PATTERN DOTS-123456 */

/* U+2840 BRAILLE PATTERN DOTS-7 */

/* U+2841 BRAILLE PATTERN DOTS-17 */

/* U+2842 BRAILLE PATTERN DOTS-27 */

/* U+2843 BRAILLE PATTERN DOTS-127 */

/* U+2844 BRAILLE PATTERN DOTS-37 */

/* U+2845 BRAILLE PATTERN DOTS-137 */

/* U+2846 BRAILLE PATTERN DOTS-237 */

/* U+2847 BRAILLE PATTERN DOTS-1237 */

/* U+2848 BRAILLE PATTERN DOTS-47 */

/* U+2849 BRAILLE PATTERN DOTS-147 */

/* U+284a BRAILLE PATTERN DOTS-247 */

/* U+284b BRAILLE PATTERN DOTS-1247 */

/* U+284c BRAILLE PATTERN DOTS-347 */

/* U+284d BRAILLE PATTERN DOTS-1347 */

/* U+284e BRAILLE PATTERN DOTS-2347 */

/* U+284f BRAILLE PATTERN DOTS-12347 */

/* U+2850 BRAILLE PATTERN DOTS-57 */

/* U+2851 BRAILLE PATTERN DOTS-157 */

/* U+2852 BRAILLE PATTERN DOTS-257 */

/* U+2853 BRAILLE PATTERN DOTS-1257 */

/* U+2854 BRAILLE PATTERN DOTS-357 */

/* U+2855 BRAILLE PATTERN DOTS-1357 */

/* U+2856 BRAILLE PATTERN DOTS-2357 */

/* U+2857 BRAILLE PATTERN DOTS-12357 */

/* U+2858 BRAILLE PATTERN DOTS-457 */

/* U+2859 BRAILLE PATTERN DOTS-1457 */

/* U+285a BRAILLE PATTERN DOTS-2457 */

/* U+285b BRAILLE PATTERN DOTS-12457 */

/* U+285c BRAILLE PATTERN DOTS-3457 */

/* U+285d BRAILLE PATTERN DOTS-13457 */

/* U+285e BRAILLE PATTERN DOTS-23457 */

/* U+285f BRAILLE PATTERN DOTS-123457 */

/* U+2860 BRAILLE PATTERN DOTS-67 */

/* U+2861 BRAILLE PATTERN DOTS-167 */

/* U+2862 BRAILLE PATTERN DOTS-267 */

/* U+2863 BRAILLE PATTERN DOTS-1267 */

/* U+2864 BRAILLE PATTERN DOTS-367 */

/* U+2865 BRAILLE PATTERN DOTS-1367 */

/* U+2866 BRAILLE PATTERN DOTS-2367 */

/* U+2867 BRAILLE PATTERN DOTS-12367 */

/* U+2868 BRAILLE PATTERN DOTS-467 */

/* U+2869 BRAILLE PATTERN DOTS-1467 */

/* U+286a BRAILLE PATTERN DOTS-2467 */

/* U+286b BRAILLE PATTERN DOTS-12467 */

/* U+286c BRAILLE PATTERN DOTS-3467 */

/* U+286d BRAILLE PATTERN DOTS-13467 */

/* U+286e BRAILLE PATTERN DOTS-23467 */

/* U+286f BRAILLE PATTERN DOTS-123467 */

/* U+2870 BRAILLE PATTERN DOTS-567 */

/* U+2871 BRAILLE PATTERN DOTS-1567 */

/* U+2872 BRAILLE PATTERN DOTS-2567 */

/* U+2873 BRAILLE PATTERN DOTS-12567 */

/* U+2874 BRAILLE PATTERN DOTS-3567 */

/* U+2875 BRAILLE PATTERN DOTS-13567 */

/* U+2876 BRAILLE PATTERN DOTS-23567 */

/* U+2877 BRAILLE PATTERN DOTS-123567 */

/* U+2878 BRAILLE PATTERN DOTS-4567 */

/* U+2879 BRAILLE PATTERN DOTS-14567 */

/* U+287a BRAILLE PATTERN DOTS-24567 */

/* U+287b BRAILLE PATTERN DOTS-124567 */

/* U+287c BRAILLE PATTERN DOTS-34567 */

/* U+287d BRAILLE PATTERN DOTS-134567 */

/* U+287e BRAILLE PATTERN DOTS-234567 */

/* U+287f BRAILLE PATTERN DOTS-1234567 */

/* U+2880 BRAILLE PATTERN DOTS-8 */

/* U+2881 BRAILLE PATTERN DOTS-18 */

/* U+2882 BRAILLE PATTERN DOTS-28 */

/* U+2883 BRAILLE PATTERN DOTS-128 */

/* U+2884 BRAILLE PATTERN DOTS-38 */

/* U+2885 BRAILLE PATTERN DOTS-138 */

/* U+2886 BRAILLE PATTERN DOTS-238 */

/* U+2887 BRAILLE PATTERN DOTS-1238 */

/* U+2888 BRAILLE PATTERN DOTS-48 */

/* U+2889 BRAILLE PATTERN DOTS-148 */

/* U+288a BRAILLE PATTERN DOTS-248 */

/* U+288b BRAILLE PATTERN DOTS-1248 */

/* U+288c BRAILLE PATTERN DOTS-348 */

/* U+288d BRAILLE PATTERN DOTS-1348 */

/* U+288e BRAILLE PATTERN DOTS-2348 */

/* U+288f BRAILLE PATTERN DOTS-12348 */

/* U+2890 BRAILLE PATTERN DOTS-58 */

/* U+2891 BRAILLE PATTERN DOTS-158 */

/* U+2892 BRAILLE PATTERN DOTS-258 */

/* U+2893 BRAILLE PATTERN DOTS-1258 */

/* U+2894 BRAILLE PATTERN DOTS-358 */

/* U+2895 BRAILLE PATTERN DOTS-1358 */

/* U+2896 BRAILLE PATTERN DOTS-2358 */

/* U+2897 BRAILLE PATTERN DOTS-12358 */

/* U+2898 BRAILLE PATTERN DOTS-458 */

/* U+2899 BRAILLE PATTERN DOTS-1458 */

/* U+289a BRAILLE PATTERN DOTS-2458 */

/* U+289b BRAILLE PATTERN DOTS-12458 */

/* U+289c BRAILLE PATTERN DOTS-3458 */

/* U+289d BRAILLE PATTERN DOTS-13458 */

/* U+289e BRAILLE PATTERN DOTS-23458 */

/* U+289f BRAILLE PATTERN DOTS-123458 */

/* U+28a0 BRAILLE PATTERN DOTS-68 */

/* U+28a1 BRAILLE PATTERN DOTS-168 */

/* U+28a2 BRAILLE PATTERN DOTS-268 */

/* U+28a3 BRAILLE PATTERN DOTS-1268 */

/* U+28a4 BRAILLE PATTERN DOTS-368 */

/* U+28a5 BRAILLE PATTERN DOTS-1368 */

/* U+28a6 BRAILLE PATTERN DOTS-2368 */

/* U+28a7 BRAILLE PATTERN DOTS-12368 */

/* U+28a8 BRAILLE PATTERN DOTS-468 */

/* U+28a9 BRAILLE PATTERN DOTS-1468 */

/* U+28aa BRAILLE PATTERN DOTS-2468 */

/* U+28ab BRAILLE PATTERN DOTS-12468 */

/* U+28ac BRAILLE PATTERN DOTS-3468 */

/* U+28ad BRAILLE PATTERN DOTS-13468 */

/* U+28ae BRAILLE PATTERN DOTS-23468 */

/* U+28af BRAILLE PATTERN DOTS-123468 */

/* U+28b0 BRAILLE PATTERN DOTS-568 */

/* U+28b1 BRAILLE PATTERN DOTS-1568 */

/* U+28b2 BRAILLE PATTERN DOTS-2568 */

/* U+28b3 BRAILLE PATTERN DOTS-12568 */

/* U+28b4 BRAILLE PATTERN DOTS-3568 */

/* U+28b5 BRAILLE PATTERN DOTS-13568 */

/* U+28b6 BRAILLE PATTERN DOTS-23568 */

/* U+28b7 BRAILLE PATTERN DOTS-123568 */

/* U+28b8 BRAILLE PATTERN DOTS-4568 */

/* U+28b9 BRAILLE PATTERN DOTS-14568 */

/* U+28ba BRAILLE PATTERN DOTS-24568 */

/* U+28bb BRAILLE PATTERN DOTS-124568 */

/* U+28bc BRAILLE PATTERN DOTS-34568 */

/* U+28bd BRAILLE PATTERN DOTS-134568 */

/* U+28be BRAILLE PATTERN DOTS-234568 */

/* U+28bf BRAILLE PATTERN DOTS-1234568 */

/* U+28c0 BRAILLE PATTERN DOTS-78 */

/* U+28c1 BRAILLE PATTERN DOTS-178 */

/* U+28c2 BRAILLE PATTERN DOTS-278 */

/* U+28c3 BRAILLE PATTERN DOTS-1278 */

/* U+28c4 BRAILLE PATTERN DOTS-378 */

/* U+28c5 BRAILLE PATTERN DOTS-1378 */

/* U+28c6 BRAILLE PATTERN DOTS-2378 */

/* U+28c7 BRAILLE PATTERN DOTS-12378 */

/* U+28c8 BRAILLE PATTERN DOTS-478 */

/* U+28c9 BRAILLE PATTERN DOTS-1478 */

/* U+28ca BRAILLE PATTERN DOTS-2478 */

/* U+28cb BRAILLE PATTERN DOTS-12478 */

/* U+28cc BRAILLE PATTERN DOTS-3478 */

/* U+28cd BRAILLE PATTERN DOTS-13478 */

/* U+28ce BRAILLE PATTERN DOTS-23478 */

/* U+28cf BRAILLE PATTERN DOTS-123478 */

/* U+28d0 BRAILLE PATTERN DOTS-578 */

/* U+28d1 BRAILLE PATTERN DOTS-1578 */

/* U+28d2 BRAILLE PATTERN DOTS-2578 */

/* U+28d3 BRAILLE PATTERN DOTS-12578 */

/* U+28d4 BRAILLE PATTERN DOTS-3578 */

/* U+28d5 BRAILLE PATTERN DOTS-13578 */

/* U+28d6 BRAILLE PATTERN DOTS-23578 */

/* U+28d7 BRAILLE PATTERN DOTS-123578 */

/* U+28d8 BRAILLE PATTERN DOTS-4578 */

/* U+28d9 BRAILLE PATTERN DOTS-14578 */

/* U+28da BRAILLE PATTERN DOTS-24578 */

/* U+28db BRAILLE PATTERN DOTS-124578 */

/* U+28dc BRAILLE PATTERN DOTS-34578 */

/* U+28dd BRAILLE PATTERN DOTS-134578 */

/* U+28de BRAILLE PATTERN DOTS-234578 */

/* U+28df BRAILLE PATTERN DOTS-1234578 */

/* U+28e0 BRAILLE PATTERN DOTS-678 */

/* U+28e1 BRAILLE PATTERN DOTS-1678 */

/* U+28e2 BRAILLE PATTERN DOTS-2678 */

/* U+28e3 BRAILLE PATTERN DOTS-12678 */

/* U+28e4 BRAILLE PATTERN DOTS-3678 */

/* U+28e5 BRAILLE PATTERN DOTS-13678 */

/* U+28e6 BRAILLE PATTERN DOTS-23678 */

/* U+28e7 BRAILLE PATTERN DOTS-123678 */

/* U+28e8 BRAILLE PATTERN DOTS-4678 */

/* U+28e9 BRAILLE PATTERN DOTS-14678 */

/* U+28ea BRAILLE PATTERN DOTS-24678 */

/* U+28eb BRAILLE PATTERN DOTS-124678 */

/* U+28ec BRAILLE PATTERN DOTS-34678 */

/* U+28ed BRAILLE PATTERN DOTS-134678 */

/* U+28ee BRAILLE PATTERN DOTS-234678 */

/* U+28ef BRAILLE PATTERN DOTS-1234678 */

/* U+28f0 BRAILLE PATTERN DOTS-5678 */

/* U+28f1 BRAILLE PATTERN DOTS-15678 */

/* U+28f2 BRAILLE PATTERN DOTS-25678 */

/* U+28f3 BRAILLE PATTERN DOTS-125678 */

/* U+28f4 BRAILLE PATTERN DOTS-35678 */

/* U+28f5 BRAILLE PATTERN DOTS-135678 */

/* U+28f6 BRAILLE PATTERN DOTS-235678 */

/* U+28f7 BRAILLE PATTERN DOTS-1235678 */

/* U+28f8 BRAILLE PATTERN DOTS-45678 */

/* U+28f9 BRAILLE PATTERN DOTS-145678 */

/* U+28fa BRAILLE PATTERN DOTS-245678 */

/* U+28fb BRAILLE PATTERN DOTS-1245678 */

/* U+28fc BRAILLE PATTERN DOTS-345678 */

/* U+28fd BRAILLE PATTERN DOTS-1345678 */

/* U+28fe BRAILLE PATTERN DOTS-2345678 */

/* U+28ff BRAILLE PATTERN DOTS-12345678 */

/* XK_BRAILLE */


=== system/include/compat/arm_neon.h ===
SHA256: e3fed1bcc9aa3298a144c274acdb20cba7c38d5a1e7892bf1b84c25f3789df35
/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/types.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Ju-Hung Li <jhlee@pllab.cs.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/simde-common.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2017-2020 Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Ju-Hung Li <jhlee@pllab.cs.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/hedley.h :: */

/* Hedley - https://nemequ.github.io/hedley
 * Created by Evan Nemerson <evan@nemerson.com>
 *
 * To the extent possible under law, the author(s) have dedicated all
 * copyright and related and neighboring rights to this software to
 * the public domain worldwide. This software is distributed without
 * any warranty.
 *
 * For details, see <http://creativecommons.org/publicdomain/zero/1.0/>.
 * SPDX-License-Identifier: CC0-1.0
 */

/* HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ is for
   HEDLEY INTERNAL USE ONLY.  API subject to change without notice. */

/* SAL */

/* SAL */

/* SAL */

/* HEDLEY_IS_CONSTEXPR_ is for
   HEDLEY INTERNAL USE ONLY.  API subject to change without notice. */

/* Remaining macros are deprecated. */

/* !defined(HEDLEY_VERSION) || (HEDLEY_VERSION < X) */

/* :: End simde/simde/hedley.h :: */

// Also update meson.build in the root directory of the repository

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/simde-detect-clang.h :: */

/* Detect Clang Version
 * Created by Evan Nemerson <evan@nemerson.com>
 *
 * To the extent possible under law, the author(s) have dedicated all
 * copyright and related and neighboring rights to this software to
 * the public domain worldwide. This software is distributed without
 * any warranty.
 *
 * For details, see <http://creativecommons.org/publicdomain/zero/1.0/>.
 * SPDX-License-Identifier: CC0-1.0
 */

/* This file was originally part of SIMDe
 * (<https://github.com/simd-everywhere/simde>).  You're free to do with it as
 * you please, but I do have a few small requests:
 *
 *  * If you make improvements, please submit them back to SIMDe
 *    (at <https://github.com/simd-everywhere/simde/issues>) so others can
 *    benefit from them.
 *  * Please keep a link to SIMDe intact so people know where to submit
 *    improvements.
 *  * If you expose it publicly, please change the SIMDE_ prefix to
 *    something specific to your project.
 *
 * The version numbers clang exposes (in the ___clang_major__,
 * __clang_minor__, and __clang_patchlevel__ macros) are unreliable.
 * Vendors such as Apple will define these values to their version
 * numbers; for example, "Apple Clang 4.0" is really clang 3.1, but
 * __clang_major__ and __clang_minor__ are defined to 4 and 0
 * respectively, instead of 3 and 1.
 *
 * The solution is *usually* to use clang's feature detection macros
 * (<https://clang.llvm.org/docs/LanguageExtensions.html#feature-checking-macros>)
 * to determine if the feature you're interested in is available.  This
 * generally works well, and it should probably be the first thing you
 * try.  Unfortunately, it's not possible to check for everything.  In
 * particular, compiler bugs.
 *
 * This file just uses the feature checking macros to detect features
 * added in specific versions of clang to identify which version of
 * clang the compiler is based on.
 *
 * Right now it only goes back to 3.6, but I'm happy to accept patches
 * to go back further.  And, of course, newer versions are welcome if
 * they're not already present, and if you find a way to detect a point
 * release that would be great, too!
 */

/* Attempt to detect the upstream clang version number.  I usually only
 * worry about major version numbers (at least for 4.0+), but if you
 * need more resolution I'm happy to accept patches that are able to
 * detect minor versions as well.  That said, you'll probably have a
 * hard time with detection since AFAIK most minor releases don't add
 * anything we can detect. Updated based on
 * https://github.com/google/highway/blob/438c705a295176b96a50336527bb3e7ea365ffac/hwy/detect_compiler_arch.h#L73
 * - would welcome patches/updates there as well.
 */

// no new warnings in 17.0

// no new warnings in 16.0

// For reasons unknown, Xcode 10.3 (Apple LLVM version 10.0.1) is apparently

// based on Clang 7, but does not support the warning we test.

// See https://en.wikipedia.org/wiki/Xcode#Toolchain_versions and

// https://trac.macports.org/wiki/XcodeVersionInfo.

/* defined(__clang__) && !defined(SIMDE_DETECT_CLANG_VERSION) */

/* The SIMDE_DETECT_CLANG_VERSION_CHECK macro is pretty
 * straightforward; it returns true if the compiler is a derivative
 * of clang >= the specified version.
 *
 * Since this file is often (primarily?) useful for working around bugs
 * it is also helpful to have a macro which returns true if only if the
 * compiler is a version of clang *older* than the specified version to
 * make it a bit easier to ifdef regions to add code for older versions,
 * such as pragmas to disable a specific warning. */

/* !defined(SIMDE_DETECT_CLANG_H) */

/* :: End simde/simde/simde-detect-clang.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/simde-arch.h :: */

/* Architecture detection
 * Created by Evan Nemerson <evan@nemerson.com>
 *
 *   To the extent possible under law, the authors have waived all
 *   copyright and related or neighboring rights to this code.  For
 *   details, see the Creative Commons Zero 1.0 Universal license at
 *   <https://creativecommons.org/publicdomain/zero/1.0/>
 *
 * SPDX-License-Identifier: CC0-1.0
 *
 * Different compilers define different preprocessor macros for the
 * same architecture.  This is an attempt to provide a single
 * interface which is usable on any compiler.
 *
 * In general, a macro named SIMDE_ARCH_* is defined for each
 * architecture the CPU supports.  When there are multiple possible
 * versions, we try to define the macro to the target version.  For
 * example, if you want to check for i586+, you could do something
 * like:
 *
 *   #if defined(SIMDE_ARCH_X86) && (SIMDE_ARCH_X86 >= 5)
 *   ...
 *   #endif
 *
 * You could also just check that SIMDE_ARCH_X86 >= 5 without checking
 * if it's defined first, but some compilers may emit a warning about
 * an undefined macro being used (e.g., GCC with -Wundef).
 *
 * This was originally created for SIMDe
 * <https://github.com/simd-everywhere/simde> (hence the prefix), but this
 * header has no dependencies and may be used anywhere.  It is
 * originally based on information from
 * <https://sourceforge.net/p/predef/wiki/Architectures/>, though it
 * has been enhanced with additional information.
 *
 * If you improve this file, or find a bug, please file the issue at
 * <https://github.com/simd-everywhere/simde/issues>.  If you copy this into
 * your project, even if you change the prefix, please keep the links
 * to SIMDe intact so others know where to report issues, submit
 * enhancements, and find the latest version. */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* Alpha
   <https://en.wikipedia.org/wiki/DEC_Alpha> */

/* Atmel AVR
   <https://en.wikipedia.org/wiki/Atmel_AVR> */

/* AMD64 / x86_64
   <https://en.wikipedia.org/wiki/X86-64> */

/* ARM
   <https://en.wikipedia.org/wiki/ARM_architecture> */

/* AArch64
   <https://en.wikipedia.org/wiki/ARM_architecture> */

/* ARM SIMD ISA extensions */

/* Blackfin
   <https://en.wikipedia.org/wiki/Blackfin> */

/* CRIS
   <https://en.wikipedia.org/wiki/ETRAX_CRIS> */

/* Convex
   <https://en.wikipedia.org/wiki/Convex_Computer> */

/* Adapteva Epiphany
   <https://en.wikipedia.org/wiki/Adapteva_Epiphany> */

/* Fujitsu FR-V
   <https://en.wikipedia.org/wiki/FR-V_(microprocessor)> */

/* H8/300
   <https://en.wikipedia.org/wiki/H8_Family> */

/* Elbrus (8S, 8SV and successors)
   <https://en.wikipedia.org/wiki/Elbrus-8S> */

/* HP/PA / PA-RISC
   <https://en.wikipedia.org/wiki/PA-RISC> */

/* x86
   <https://en.wikipedia.org/wiki/X86> */

/* SIMD ISA extensions for x86/x86_64 and Elbrus */

/* Itanium
   <https://en.wikipedia.org/wiki/Itanium> */

/* Renesas M32R
   <https://en.wikipedia.org/wiki/M32R> */

/* Motorola 68000
   <https://en.wikipedia.org/wiki/Motorola_68000> */

/* Xilinx MicroBlaze
   <https://en.wikipedia.org/wiki/MicroBlaze> */

/* MIPS
   <https://en.wikipedia.org/wiki/MIPS_architecture> */

/* Matsushita MN10300
   <https://en.wikipedia.org/wiki/MN103> */

/* POWER
   <https://en.wikipedia.org/wiki/IBM_POWER_Instruction_Set_Architecture> */

/* RISC-V
   <https://en.wikipedia.org/wiki/RISC-V> */

/* RISC-V SIMD ISA extensions */

/* SPARC
   <https://en.wikipedia.org/wiki/SPARC> */

/* SuperH
   <https://en.wikipedia.org/wiki/SuperH> */

/* IBM System z
   <https://en.wikipedia.org/wiki/IBM_System_z> */

/* TMS320 DSP
   <https://en.wikipedia.org/wiki/Texas_Instruments_TMS320> */

/* WebAssembly */

/* Xtensa
   <https://en.wikipedia.org/wiki/> */

/* Availability of 16-bit floating-point arithmetic intrinsics */

/* Availability of 16-bit brain floating-point arithmetic intrinsics */

/* LoongArch
   <https://en.wikipedia.org/wiki/Loongson#LoongArch> */

/* LSX: LoongArch 128-bits SIMD extension */

/* LASX: LoongArch 256-bits SIMD extension */

/* !defined(SIMDE_ARCH_H) */

/* :: End simde/simde/simde-arch.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/simde-features.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Ju-Hung Li <jhlee@pllab.cs.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* simde-arch.h is used to determine which features are available according
   to the compiler.  However, we want to make it possible to forcibly enable
   or disable APIs */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/simde-diagnostic.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2017-2020 Evan Nemerson <evan@nemerson.com>
 */

/* SIMDe targets a very wide range of standards and compilers, and our
 * goal is to compile cleanly even with extremely aggressive warnings
 * (i.e., -Weverything in clang, -Wextra in GCC, /W4 for MSVC, etc.)
 * treated as errors.
 *
 * While our preference is to resolve the underlying issue a given
 * diagnostic is warning us about, sometimes that's not possible.
 * Fixing a warning in one compiler may cause problems in another.
 * Sometimes a warning doesn't really apply to us (false positives),
 * and sometimes adhering to a warning would mean dropping a feature
 * we *know* the compiler supports since we have tested specifically
 * for the compiler or feature.
 *
 * When practical, warnings are only disabled for specific code.  For
 * a list of warnings which are enabled by default in all SIMDe code,
 * see SIMDE_DISABLE_UNWANTED_DIAGNOSTICS.  Note that we restore the
 * warning stack when SIMDe is done parsing, so code which includes
 * SIMDe is not deprived of these warnings.
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* This is only to help us implement functions like _mm_undefined_ps. */

/* GCC emits a lot of "notes" about the ABI being different for things
 * in newer versions of GCC.  We don't really care because all our
 * functions are inlined and don't generate ABI. */

/* Since MMX uses x87 FP registers, you're supposed to call _mm_empty()
 * after each MMX function before any floating point instructions.
 * Some compilers warn about functions which use MMX functions but
 * don't call _mm_empty().  However, since SIMDe is implementyng the
 * MMX API we shouldn't be calling _mm_empty(); we leave it to the
 * caller to invoke simde_mm_empty(). */

/* Intel is pushing people to use OpenMP SIMD instead of Cilk+, so they
 * emit a diagnostic if you use #pragma simd instead of
 * #pragma omp simd.  SIMDe supports OpenMP SIMD, you just need to
 * compile with -qopenmp or -qopenmp-simd and define
 * SIMDE_ENABLE_OPENMP.  Cilk+ is just a fallback. */

/* MSVC emits a diagnostic when we call a function (like
 * simde_mm_set_epi32) while initializing a struct.  We currently do
 * this a *lot* in the tests. */

/* This warning needs a lot of work.  It is triggered if all you do is
 * pass the value to memcpy/__builtin_memcpy, or if you initialize a
 * member of the union, even if that member takes up the entire union.
 * Last tested with clang-10, hopefully things will improve in the
 * future; if clang fixes this I'd love to enable it. */

/* This warning is meant to catch things like `0.3 + 0.4 == 0.7`, which
 * will is false.  However, SIMDe uses these operations exclusively
 * for things like _mm_cmpeq_ps, for which we really do want to check
 * for equality (or inequality).
 *
 * If someone wants to put together a SIMDE_FLOAT_EQUAL(a, op, b) macro
 * which just wraps a check in some code do disable this diagnostic I'd
 * be happy to accept it. */

/* This is because we use HEDLEY_STATIC_ASSERT for static assertions.
 * If Hedley can't find an implementation it will preprocess to
 * nothing, which means there will be a trailing semi-colon. */

/* We do use a few variadic macros, which technically aren't available
 * until C99 and C++11, but every compiler I'm aware of has supported
 * them for much longer.  That said, usage is isolated to the test
 * suite and compilers known to support them. */

/* emscripten requires us to use a __wasm_unimplemented_simd128__ macro
 * before we can access certain SIMD intrinsics, but this diagnostic
 * warns about it being a reserved name.  It is a reserved name, but
 * it's reserved for the compiler and we are using it to convey
 * information to the compiler.
 *
 * This is also used when enabling native aliases since we don't get to
 * choose the macro names. */

/* Similar to above; types like simde__m128i are reserved due to the
 * double underscore, but we didn't choose them, Intel did. */

/* clang 3.8 warns about the packed attribute being unnecessary when
 * used in the _mm_loadu_* functions.  That *may* be true for version
 * 3.8, but for later versions it is crucial in order to make unaligned
 * access safe. */

/* Triggered when assigning a float to a double implicitly.  We use
 * explicit casts in SIMDe, this is only used in the test suite. */

/* Several compilers treat conformant array parameters as VLAs.  We
 * test to make sure we're in C mode (C++ doesn't support CAPs), and
 * that the version of the standard supports CAPs.  We also reject
 * some buggy compilers like MSVC (the logic is in Hedley if you want
 * to take a look), but with certain warnings enabled some compilers
 * still like to emit a diagnostic. */

/* If you add an unused attribute to a function and don't use it, clang
 * may emit this. */

/* Likely goes back further */

/* clang will emit this warning when we use C99 extensions when not in
 * C99 mode, even though it does support this.  In such cases we check
 * the compiler and version first, so we know it's not a problem. */

/* Similar problm as above; we rely on some basic C99 support, but clang
 * has started warning obut this even in C17 mode with -Weverything. */

/* https://github.com/simd-everywhere/simde/issues/277 */

/* This is the warning that you normally define _CRT_SECURE_NO_WARNINGS
 * to silence, but you have to do that before including anything and
 * that would require reordering includes. */

/* Some compilers, such as clang, may use `long long` for 64-bit
 * integers, but `long long` triggers a diagnostic with
 * -Wc++98-compat-pedantic which says 'long long' is incompatible with
 * C++98. */

/* Some problem as above */

/* emscripten emits this whenever stdin/stdout/stderr is used in a
 * macro. */

/* Clang uses C11 generic selections to implement some AltiVec
 * functions, which triggers this diagnostic when not compiling
 * in C11 mode */

/* Clang sometimes triggers this warning in macros in the AltiVec and
 * NEON headers, or due to missing functions. */

/* For NEON, the situation with -Wvector-conversion in clang < 10 is
   * bad enough that we just disable the warning altogether.  On x86,
   * clang has similar issues on several sse4.2+ intrinsics before 3.8. */

/* Prior to 5.0, clang didn't support disabling diagnostics in
 * statement exprs.  As a result, some macros we use don't
 * properly silence warnings. */

/* SLEEF triggers this a *lot* in their headers */

/* GCC emits this under some circumstances when using __int128 */

/* MSVC doesn't like (__assume(0), code) and will warn about code being
 * unreachable, but we want it there because not all compilers
 * understand the unreachable macro and will complain if it is missing.
 * I'm planning on adding a new macro to Hedley to handle this a bit
 * more elegantly, but until then... */

/* This is a false positive from GCC in a few places. */

/* Some native functions on E2K with instruction set < v6 are declared
 * as deprecated due to inefficiency. Still they are more efficient
 * than SIMDe implementation. So we're using them, and switching off
 * these deprecation warnings. */

/* !defined(SIMDE_DIAGNOSTIC_H) */

/* :: End simde/simde/simde-diagnostic.h :: */

/* AltiVec conflicts with lots of stuff.  The bool keyword conflicts
   * with the bool keyword in C++ and the bool macro in C99+ (defined
   * in stdbool.h).  The vector keyword conflicts with std::vector in
   * C++ if you are `using std;`.
   *
   * Luckily AltiVec allows you to use `__vector`/`__bool`/`__pixel`
   * instead, but altivec.h will unconditionally define
   * `vector`/`bool`/`pixel` so we need to work around that.
   *
   * Unfortunately this means that if your code uses AltiVec directly
   * it may break.  If this is the case you'll want to define
   * `SIMDE_POWER_ALTIVEC_NO_UNDEF` before including SIMDe.  Or, even
   * better, port your code to use the double-underscore versions. */

/* !defined(SIMDE_POWER_ALTIVEC_NO_UNDEF) */

/* Use these intsead of vector/pixel/bool in SIMDe. */

/* Re-define bool if we're using stdbool.h */

/* This is used to determine whether or not to fall back on a vector
 * function in an earlier ISA extensions, as well as whether
 * we expected any attempts at vectorization to be fruitful or if we
 * expect to always be running serial code.
 *
 * Note that, for some architectures (okay, *one* architecture) there
 * can be a split where some types are supported for one vector length
 * but others only for a shorter length.  Therefore, it is possible to
 * provide separate values for float/int/double types. */

//FIXME : SIMDE_NATURAL_VECTOR_SIZE == __riscv_v_fixed_vlen

/* Native aliases */

/* Are floating point values stored using IEEE 754?  Knowing
 * this at during preprocessing is a bit tricky, mostly because what
 * we're curious about is how values are stored and not whether the
 * implementation is fully conformant in terms of rounding, NaN
 * handling, etc.
 *
 * For example, if you use -ffast-math or -Ofast on
 * GCC or clang IEEE 754 isn't strictly followed, therefore IEE 754
 * support is not advertised (by defining __STDC_IEC_559__).
 *
 * However, what we care about is whether it is safe to assume that
 * floating point values are stored in IEEE 754 format, in which case
 * we can provide faster implementations of some functions.
 *
 * Luckily every vaugely modern architecture I'm aware of uses IEEE 754-
 * so we just assume IEEE 754 for now.  There is a test which verifies
 * this, if that test fails sowewhere please let us know and we'll add
 * an exception for that platform.  Meanwhile, you can define
 * SIMDE_NO_IEEE754_STORAGE. */

/* !defined(SIMDE_FEATURES_H) */

/* :: End simde/simde/simde-features.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/simde-math.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2017-2020 Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* Attempt to find math functions.  Functions may be in <cmath>,
 * <math.h>, compiler built-ins/intrinsics, or platform/architecture
 * specific headers.  In some cases, especially those not built in to
 * libm, we may need to define our own implementations. */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* SLEEF support
 * https://sleef.org/
 *
 * If you include <sleef.h> prior to including SIMDe, SIMDe will use
 * SLEEF.  You can also define SIMDE_MATH_SLEEF_ENABLE prior to
 * including SIMDe to force the issue.
 *
 * Note that SLEEF does requires linking to libsleef.
 *
 * By default, SIMDe will use the 1 ULP functions, but if you use
 * SIMDE_ACCURACY_PREFERENCE of 0 we will use up to 4 ULP.  This is
 * only the case for the simde_math_* functions; for code in other
 * SIMDe headers which calls SLEEF directly we may use functions with
 * greater error if the API we're implementing is less precise (for
 * example, SVML guarantees 4 ULP, so we will generally use the 3.5
 * ULP functions from SLEEF). */

/* Looks like <math.h> or <cmath> has already been included. */

/* The math.h from libc++ (yes, the C header from the C++ standard
   * library) will define an isnan function, but not an isnan macro
   * like the C standard requires.  So we detect the header guards
   * macro libc++ uses. */

/* VS 14 emits this diagnostic about noexcept being used on a
       * <cmath> function, which we can't do anything about. */

/*** Classification macros from C99 ***/

/* XL C/C++ has __builtin_isnan but not __builtin_isnanf */

// [30:23]

// [22:0]

// [62:52]

// [51:0]

/*** Manipulation functions ***/

/*** Functions from C99 ***/

/*** Comparison macros (which don't raise invalid errors) ***/

/*** Additional functions not in libm ***/

/* https://www.johndcook.com/blog/cpp_phi/
    * Public Domain */

/* A&S formula 7.1.26 */

/* https://www.johndcook.com/blog/cpp_phi/
    * Public Domain */

/* A&S formula 7.1.26 */

/*https://web.archive.org/web/20150910081113/http://home.online.no/~pjacklam/notes/invnorm/impl/sprouse/ltqnorm.c*/

/* https://stackoverflow.com/questions/27229371/inverse-error-function-in-c
     *
     * The original answer on SO uses a constant of 0.147, but in my
     * testing 0.14829094707965850830078125 gives a lower average absolute error
     * (0.0001410958211636170744895935 vs. 0.0001465479290345683693885803).
     * That said, if your goal is to minimize the *maximum* absolute
     * error, 0.15449436008930206298828125 provides significantly better
     * results; 0.0009250640869140625000000000 vs ~ 0.005. */

/***  Saturated arithmetic ***/

/* !defined(SIMDE_MATH_H) */

/* :: End simde/simde/simde-math.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/simde-constify.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* Constify macros.  For internal use only.
 *
 * These are used to make it possible to call a function which takes
 * an Integer Constant Expression (ICE) using a compile time constant.
 * Technically it would also be possible to use a value not trivially
 * known by the compiler, but there would be a siginficant performance
 * hit (a switch switch is used).
 *
 * The basic idea is pretty simple; we just emit a do while loop which
 * contains a switch with a case for every possible value of the
 * constant.
 *
 * As long as the value you pass to the function in constant, pretty
 * much any copmiler shouldn't have a problem generating exactly the
 * same code as if you had used an ICE.
 *
 * This is intended to be used in the SIMDe implementations of
 * functions the compilers require to be an ICE, but the other benefit
 * is that if we also disable the warnings from
 * SIMDE_REQUIRE_CONSTANT_RANGE we can actually just allow the tests
 * to use non-ICE parameters
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: End simde/simde/simde-constify.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/simde-align.h :: */

/* Alignment
 * Created by Evan Nemerson <evan@nemerson.com>
 *
 *   To the extent possible under law, the authors have waived all
 *   copyright and related or neighboring rights to this code.  For
 *   details, see the Creative Commons Zero 1.0 Universal license at
 *   <https://creativecommons.org/publicdomain/zero/1.0/>
 *
 * SPDX-License-Identifier: CC0-1.0
 *
 **********************************************************************
 *
 * This is portability layer which should help iron out some
 * differences across various compilers, as well as various versions of
 * C and C++.
 *
 * It was originally developed for SIMD Everywhere
 * (<https://github.com/simd-everywhere/simde>), but since its only
 * dependency is Hedley (<https://nemequ.github.io/hedley>, also CC0)
 * it can easily be used in other projects, so please feel free to do
 * so.
 *
 * If you do use this in your project, please keep a link to SIMDe in
 * your code to remind you where to report any bugs and/or check for
 * updated versions.
 *
 * # API Overview
 *
 * The API has several parts, and most macros have a few variations.
 * There are APIs for declaring aligned fields/variables, optimization
 * hints, and run-time alignment checks.
 *
 * Briefly, macros ending with "_TO" take numeric values and are great
 * when you know the value you would like to use.  Macros ending with
 * "_LIKE", on the other hand, accept a type and are used when you want
 * to use the alignment of a type instead of hardcoding a value.
 *
 * Documentation for each section of the API is inline.
 *
 * True to form, MSVC is the main problem and imposes several
 * limitations on the effectiveness of the APIs.  Detailed descriptions
 * of the limitations of each macro are inline, but in general:
 *
 *  * On C11+ or C++11+ code written using this API will work.  The
 *    ASSUME macros may or may not generate a hint to the compiler, but
 *    that is only an optimization issue and will not actually cause
 *    failures.
 *  * If you're using pretty much any compiler other than MSVC,
 *    everything should basically work as well as in C11/C++11.
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* I know this seems a little silly, but some non-hosted compilers
 * don't have stddef.h, so we try to accommodate them. */

/* SIMDE_ALIGN_OF(Type)
 *
 * The SIMDE_ALIGN_OF macro works like alignof, or _Alignof, or
 * __alignof, or __alignof__, or __ALIGNOF__, depending on the compiler.
 * It isn't defined everywhere (only when the compiler has some alignof-
 * like feature we can use to implement it), but it should work in most
 * modern compilers, as well as C11 and C++11.
 *
 * If we can't find an implementation for SIMDE_ALIGN_OF then the macro
 * will not be defined, so if you can handle that situation sensibly
 * you may need to sprinkle some ifdefs into your code.
 */

/* Probably goes back much further, but MS takes down their old docs.
   * If you can verify that this works in earlier versions please let
   * me know! */

/* SIMDE_ALIGN_MAXIMUM:
 *
 * This is the maximum alignment that the compiler supports.  You can
 * define the value prior to including SIMDe if necessary, but in that
 * case *please* submit an issue so we can add the platform to the
 * detection code.
 *
 * Most compilers are okay with types which are aligned beyond what
 * they think is the maximum, as long as the alignment is a power
 * of two.  Older versions of MSVC is the exception, so we need to cap
 * the alignment requests at values that the implementation supports.
 *
 * XL C/C++ will accept values larger than 16 (which is the alignment
 * of an AltiVec vector), but will not reliably align to the larger
 * value, so so we cap the value at 16 there.
 *
 * If the compiler accepts any power-of-two value within reason then
 * this macro should be left undefined, and the SIMDE_ALIGN_CAP
 * macro will just return the value passed to it. */

// Visual studio 2017 and newer does not need a max

/* VS 2010 is really a guess based on Wikipedia; if anyone can
           * test with old VS versions I'd really appreciate it. */

/* You can mostly ignore these; they're intended for internal use.
 * If you do need to use them please let me know; if they fulfill
 * a common use case I'll probably drop the trailing underscore
 * and make them part of the public API. */

/**
 * SIMDE_ALIGN_CAP(Alignment)
 *
 * Returns the minimum of Alignment or SIMDE_ALIGN_MAXIMUM.
 */

/* SIMDE_ALIGN_TO(Alignment)
 *
 * SIMDE_ALIGN_TO is used to declare types or variables.  It basically
 * maps to the align attribute in most compilers, the align declspec
 * in MSVC, or _Alignas/alignas in C11/C++11.
 *
 * Example:
 *
 *   struct i32x4 {
 *     SIMDE_ALIGN_TO(16) int32_t values[4];
 *   }
 *
 * Limitations:
 *
 * MSVC requires that the Alignment parameter be numeric; you can't do
 * something like `SIMDE_ALIGN_TO(SIMDE_ALIGN_OF(int))`.  This is
 * unfortunate because that's really how the LIKE macros are
 * implemented, and I am not aware of a way to get anything like this
 * to work without using the C11/C++11 keywords.
 *
 * It also means that we can't use SIMDE_ALIGN_CAP to limit the
 * alignment to the value specified, which MSVC also requires, so on
 * MSVC you should use the `SIMDE_ALIGN_TO_8/16/32/64` macros instead.
 * They work like `SIMDE_ALIGN_TO(SIMDE_ALIGN_CAP(Alignment))` would,
 * but should be safe to use on MSVC.
 *
 * All this is to say that, if you want your code to work on MSVC, you
 * should use the SIMDE_ALIGN_TO_8/16/32/64 macros below instead of
 * SIMDE_ALIGN_TO(8/16/32/64).
 */

/* Unfortunately MSVC can't handle __declspec(align(__alignof(Type)));
   * the alignment passed to the declspec has to be an integer. */

/* SIMDE_ALIGN_ASSUME_TO(Pointer, Alignment)
 *
 * SIMDE_ALIGN_ASSUME_TO is semantically similar to C++20's
 * std::assume_aligned, or __builtin_assume_aligned.  It tells the
 * compiler to assume that the provided pointer is aligned to an
 * `Alignment`-byte boundary.
 *
 * If you define SIMDE_ALIGN_DEBUG prior to including this header then
 * SIMDE_ALIGN_ASSUME_TO will turn into a runtime check.   We don't
 * integrate with NDEBUG in this header, but it may be a good idea to
 * put something like this in your code:
 *
 *   #if !defined(NDEBUG)
 *     #define SIMDE_ALIGN_DEBUG
 *   #endif
 *   #include <.../simde-align.h>
 */

/* SIMDE_ALIGN_LIKE(Type)
 * SIMDE_ALIGN_LIKE_#(Type)
 *
 * The SIMDE_ALIGN_LIKE macros are similar to the SIMDE_ALIGN_TO macros
 * except instead of an integer they take a type; basically, it's just
 * a more convenient way to do something like:
 *
 *   SIMDE_ALIGN_TO(SIMDE_ALIGN_OF(Type))
 *
 * The versions with a numeric suffix will fall back on using a numeric
 * value in the event we can't use SIMDE_ALIGN_OF(Type).  This is
 * mainly for MSVC, where __declspec(align()) can't handle anything
 * other than hard-coded numeric values.
 */

/* SIMDE_ALIGN_ASSUME_LIKE(Pointer, Type)
 *
 * This is similar to SIMDE_ALIGN_ASSUME_TO, except that it takes a
 * type instead of a numeric value. */

/* SIMDE_ALIGN_CAST(Type, Pointer)
 *
 * SIMDE_ALIGN_CAST is like C++'s reinterpret_cast, but it will try
 * to silence warnings that some compilers may produce if you try
 * to assign to a type with increased alignment requirements.
 *
 * Note that it does *not* actually attempt to tell the compiler that
 * the pointer is aligned like the destination should be; that's the
 * job of the next macro.  This macro is necessary for stupid APIs
 * like _mm_loadu_si128 where the input is a __m128i* but the function
 * is specifically for data which isn't necessarily aligned to
 * _Alignof(__m128i).
 */

/* SIMDE_ALIGN_ASSUME_CAST(Type, Pointer)
 *
 * This is sort of like a combination of a reinterpret_cast and a
 * SIMDE_ALIGN_ASSUME_LIKE.  It uses SIMDE_ALIGN_ASSUME_LIKE to tell
 * the compiler that the pointer is aligned like the specified type
 * and casts the pointer to the specified type while suppressing any
 * warnings from the compiler about casting to a type with greater
 * alignment requirements.
 */

/* !defined(SIMDE_ALIGN_H) */

/* :: End simde/simde/simde-align.h :: */

/* In some situations, SIMDe has to make large performance sacrifices
 * for small increases in how faithfully it reproduces an API, but
 * only a relatively small number of users will actually need the API
 * to be completely accurate.  The SIMDE_FAST_* options can be used to
 * disable these trade-offs.
 *
 * They can be enabled by passing -DSIMDE_FAST_MATH to the compiler, or
 * the individual defines (e.g., -DSIMDE_FAST_NANS) if you only want to
 * enable some optimizations.  Using -ffast-math and/or
 * -ffinite-math-only will also enable the relevant options.  If you
 * don't want that you can pass -DSIMDE_NO_FAST_* to disable them. */

/* Most programs avoid NaNs by never passing values which can result in
 * a NaN; for example, if you only pass non-negative values to the sqrt
 * functions, it won't generate a NaN.  On some platforms, similar
 * functions handle NaNs differently; for example, the _mm_min_ps SSE
 * function will return 0.0 if you pass it (0.0, NaN), but the NEON
 * vminq_f32 function will return NaN.  Making them behave like one
 * another is expensive; it requires generating a mask of all lanes
 * with NaNs, then performing the operation (e.g., vminq_f32), then
 * blending together the result with another vector using the mask.
 *
 * If you don't want SIMDe to worry about the differences between how
 * NaNs are handled on the two platforms, define this (or pass
 * -ffinite-math-only) */

/* Many functions are defined as using the current rounding mode
 * (i.e., the SIMD version of fegetround()) when converting to
 * an integer.  For example, _mm_cvtpd_epi32.  Unfortunately,
 * on some platforms (such as ARMv8+ where round-to-nearest is
 * always used, regardless of the FPSCR register) this means we
 * have to first query the current rounding mode, then choose
 * the proper function (rounnd
 , ceil, floor, etc.) */

/* This controls how ties are rounded.  For example, does 10.5 round to
 * 10 or 11?  IEEE 754 specifies round-towards-even, but ARMv7 (for
 * example) doesn't support it and it must be emulated (which is rather
 * slow).  If you're okay with just using the default for whatever arch
 * you're on, you should definitely define this.
 *
 * Note that we don't use this macro to avoid correct implementations
 * in functions which are explicitly about rounding (such as vrnd* on
 * NEON, _mm_round_* on x86, etc.); it is only used for code where
 * rounding is a component in another function, and even then it isn't
 * usually a problem since such functions will use the current rounding
 * mode. */

/* For functions which convert from one type to another (mostly from
 * floating point to integer types), sometimes we need to do a range
 * check and potentially return a different result if the value
 * falls outside that range.  Skipping this check can provide a
 * performance boost, at the expense of faithfulness to the API we're
 * emulating. */

/* Due to differences across platforms, sometimes it can be much
 * faster for us to allow spurious floating point exceptions,
 * or to no generate them when we should. */

/* A copy of HEDLEY_STATIC_ASSERT, except we don't define an empty
 * fallback if we can't find an implementation; instead we have to
 * check if SIMDE_STATIC_ASSERT is defined before using it. */

/* Sometimes _Static_assert is defined (in cdefs.h) using a symbol which
   * starts with a double-underscore. This is a system header so we have no
   * control over it, but since it's a macro it will emit a diagnostic which
   * prevents compilation with -Werror. */

/* Statement exprs */

/* This is just a convenience macro to make it easy to call a single
 * function with a specific diagnostic disabled. */

/*  Lots of compilers support GCC-style vector extensions, but many
    don't support all the features.  Define different macros depending
    on support for

    * SIMDE_VECTOR - Declaring a vector.
    * SIMDE_VECTOR_OPS - basic operations (binary and unary).
    * SIMDE_VECTOR_NEGATE - negating a vector
    * SIMDE_VECTOR_SCALAR - For binary operators, the second argument
        can be a scalar, in which case the result is as if that scalar
        had been broadcast to all lanes of a vector.
    * SIMDE_VECTOR_SUBSCRIPT - Supports array subscript notation for
        extracting/inserting a single element.=

    SIMDE_VECTOR can be assumed if any others are defined, the
    others are independent. */

/* ICC only supports SIMDE_VECTOR_SCALAR for constants */

/* GCC and clang have built-in functions to handle shuffling and
   converting of vectors, but the implementations are slightly
   different.  This macro is just an abstraction over them.  Note that
   elem_size is in bits but vec_size is in bytes. */

/* We don't care about -Wvariadic-macros; all compilers that support
      * shufflevector/shuffle support them. */

/* TODO: this actually works on XL C/C++ without SIMDE_VECTOR_SUBSCRIPT
   but the code needs to be refactored a bit to take advantage. */

/* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93557 */

/* Since we currently require SUBSCRIPT before using a vector in a
   union, we define these as dependencies of SUBSCRIPT.  They are
   likely to disappear in the future, once SIMDe learns how to make
   use of vectors without using the union members.  Do not use them
   in your code unless you're okay with it breaking when SIMDe
   changes. */

/* Intended for checking coverage, you should never use this in
   production. */

/* GCC (and compilers masquerading as GCC) define  __BYTE_ORDER__. */

/* TI defines _BIG_ENDIAN or _LITTLE_ENDIAN */

/* We know the endianness of some common architectures.  Common
 * architectures not listed (ARM, POWER, MIPS, etc.) here are
 * bi-endian. */

/* Looks like we'll have to rely on the platform.  If we're missing a
 * platform, please let us know. */

/* Solaris */

/* TODO: we should at least make an attempt to detect the correct
   types for simde_float32/float64 instead of just assuming float and
   double. */

/* TODO: detect compilers which support this outside of C11 mode */

/* Some functions can trade accuracy for speed.  For those functions
   you can control the trade-off using this macro.  Possible values:

   0: prefer speed
   1: reasonable trade-offs
   2: prefer accuracy */

/* Try to deal with environments without a standard library. */

/* These are meant to be portable, not fast.  If you're hitting them you
     * should think about providing your own (by defining the simde_memcpy
     * macro prior to including any SIMDe files) or submitting a patch to
     * SIMDe so we can detect your system-provided memcpy/memset, like by
     * adding your compiler to the checks for __builtin_memcpy and/or
     * __builtin_memset. */

/*** Functions that quiet a signaling NaN ***/

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/check.h :: */

/* Check (assertions)
 * Portable Snippets - https://github.com/nemequ/portable-snippets
 * Created by Evan Nemerson <evan@nemerson.com>
 *
 *   To the extent possible under law, the authors have waived all
 *   copyright and related or neighboring rights to this code.  For
 *   details, see the Creative Commons Zero 1.0 Universal license at
 *   https://creativecommons.org/publicdomain/zero/1.0/
 *
 * SPDX-License-Identifier: CC0-1.0
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/debug-trap.h :: */

/* Debugging assertions and traps
 * Portable Snippets - https://github.com/nemequ/portable-snippets
 * Created by Evan Nemerson <evan@nemerson.com>
 *
 *   To the extent possible under law, the authors have waived all
 *   copyright and related or neighboring rights to this code.  For
 *   details, see the Creative Commons Zero 1.0 Universal license at
 *   https://creativecommons.org/publicdomain/zero/1.0/
 *
 * SPDX-License-Identifier: CC0-1.0
 */

/* !defined(SIMDE_DEBUG_TRAP_H) */

/* :: End simde/simde/debug-trap.h :: */

/* !defined(SIMDE_CHECK_H) */

/* :: End simde/simde/check.h :: */

/* GCC/clang have a bunch of functionality in builtins which we would
 * like to access, but the suffixes indicate whether the operate on
 * int, long, or long long, not fixed width types (e.g., int32_t).
 * we use these macros to attempt to map from fixed-width to the
 * names GCC uses.  Note that you should still cast the input(s) and
 * return values (to/from SIMDE_BUILTIN_TYPE_*_) since often even if
 * types are the same size they may not be compatible according to the
 * compiler.  For example, on x86 long and long lonsg are generally
 * both 64 bits, but platforms vary on whether an int64_t is mapped
 * to a long or long long. */

/* SIMDE_DIAGNOSTIC_DISABLE_CPP98_COMPAT_PEDANTIC_ */

/* Sometimes we run into problems with specific versions of compilers
   which make the native versions unusable for us.  Often this is due
   to missing functions, sometimes buggy implementations, etc.  These
   macros are how we check for specific bugs.  As they are fixed we'll
   start only defining them for problematic compiler versions. */

/* TODO: find relevant bug or commit */

/* TODO: find relevant bug or commit */

/* -Wsign-conversion */

// https://github.com/llvm/llvm-project/issues/47601

// https://github.com/llvm/llvm-project/issues/71362

// https://github.com/llvm/llvm-project/issues/71365

// https://github.com/llvm/llvm-project/issues/71751

/* 0464e07c8f6e3310c28eb210a4513bc2243c2a7e */

// https://github.com/llvm/llvm-project/issues/71763

/* 6afc436a7817a52e78ae7bcdc3faafd460124cac */

/* b929ad7b1726a32650a8051f69a747fb6836c540 */

/* ac9959eb533a58482ea4da6c4db1e635a98de384 */

/* eae26bf73715994c2bd145f9b6dc3836aa4ffd4f */

// https://github.com/llvm/llvm-project/issues/48017

// https://github.com/llvm/llvm-project/issues/45304

/* GCC and Clang both have the same issue:
 * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95144
 * https://bugs.llvm.org/show_bug.cgi?id=45931
 * This is just an easy way to work around it.
 */

/* Usually the shift count is signed (for example, NEON or SSE).
 * OTOH, unsigned is good for PPC (vec_srl uses unsigned), and the only option for E2K.
 * Further info: https://github.com/simd-everywhere/simde/pull/700
 */

/* Initial support for RISCV V extensions based on ZVE64D. */

/* SIMDE_DIAGNOSTIC_DISABLE_USED_BUT_MARKED_UNUSED_ */

/* !defined(SIMDE_COMMON_H) */

/* :: End simde/simde/simde-common.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/simde-f16.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Evan Nemerson <evan@nemerson.com>
 *   2023      Ju-Hung Li <jhlee@pllab.cs.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* Portable version which should work on pretty much any compiler.
 * Obviously you can't rely on compiler support for things like
 * conversion to/from 32-bit floats, so make sure you always use the
 * functions and macros in this file!
 *
 * The portable implementations are (heavily) based on CC0 code by
 * Fabian Giesen: <https://gist.github.com/rygorous/2156668> (see also
 * <https://fgiesen.wordpress.com/2012/03/28/half-to-float-done-quic/>).
 * I have basically just modified it to get rid of some UB (lots of
 * aliasing, right shifting a negative value), use fixed-width types,
 * and work in C. */

/* _Float16, per C standard (TS 18661-3;
 * <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1945.pdf>). */

/* clang >= 6.0 supports __fp16 as an interchange format on all
 * targets, but only allows you to use them for arguments and return
 * values on targets which have defined an ABI.  We get around the
 * restriction by wrapping the __fp16 in a struct, but we can't do
 * that on Arm since it would break compatibility with the NEON F16
 * functions. */

/* This is basically __fp16 as specified by Arm, where arguments and
 * return values are raw __fp16 values not structs. */

/* Choosing an implementation.  This is a bit rough, but I don't have
 * any ideas on how to improve it.  If you do, patches are definitely
 * welcome. */

/* We haven't found a better way to detect this.  It seems like defining
    * __STDC_WANT_IEC_60559_TYPES_EXT__, then including float.h, then
    * checking for defined(FLT16_MAX) should work, but both gcc and
    * clang will define the constants even if _Float16 is not
    * supported.  Ideas welcome. */

/* Reinterpret -- you *generally* shouldn't need these, they're really
 * intended for internal use.  However, on x86 half-precision floats
 * get stuffed into a __m128i/__m256i, so it may be useful. */

// a quiet Not-a-Number

/* Conversion -- convert between single-precision and half-precision
 * floats. */

/* This code is CC0, based heavily on code by Fabian Giesen. */

/* NOTE all the integer compares in this function cast the operands
    * to signed values to help compilers vectorize to SSE2, which lacks
    * unsigned comparison instructions.  This is fine since all
    * operands are below 0x80000000 (we clear the sign bit). */

/* result is Inf or NaN (all exponent bits set) */

/* NaN->qNaN and Inf->Inf */

/* (De)normalized number or zero */

/* resulting FP16 is subnormal or zero */

/* use a magic value to align our 10 mantissa bits at the bottom of
        * the float. as long as FP addition is round-to-nearest-even this
        * just works. */

/* and one integer subtract of the bias later, we have our final float! */

/* update exponent, rounding bias part 1 */

/* rounding bias part 2 */

/* take the bits! */

/* This code is CC0, based heavily on code by Fabian Giesen. */

/* exponent mask after shift */

/* exponent/mantissa bits */

/* just the exponent */

/* exponent adjust */

/* handle exponent special cases */

/* Inf/NaN? */

/* extra exp adjust */

/* Zero/Denormal? */

/* extra exp adjust */

/* renormalize */

/* sign bit */

// [14:10]

// [9:0]

/* !defined(SIMDE_FLOAT16_H) */

/* :: End simde/simde/simde-f16.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/simde-bf16.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* This implementations is based upon simde-f16.h */

/* Portable version which should work on pretty much any compiler.
 * Obviously you can't rely on compiler support for things like
 * conversion to/from 32-bit floats, so make sure you always use the
 * functions and macros in this file!
 */

/* Conversion -- convert between single-precision and brain half-precision
 * floats. */

// rounding to nearest bfloat16

// If the 17th bit of value is 1, set the rounding to 1.

// a quiet Not-a-Number

/* !defined(SIMDE_BFLOAT16_H) */

/* :: End simde/simde/simde-bf16.h :: */

// SIMDE_POWER_ALTIVEC_VECTOR(signed int) altivec;

/* SIMDE_ARM_NEON_TYPES_H */

/* :: End simde/simde/arm/neon/types.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/aba.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/abd.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/abs.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_ABS_H) */

/* :: End simde/simde/arm/neon/abs.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/subl.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/sub.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_SUB_H) */

/* :: End simde/simde/arm/neon/sub.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/movl.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/combine.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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 folhighing 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* Note: __builtin_shufflevector can have a the output contain
     * twice the number of elements, __builtin_shuffle cannot.
     * Using SIMDE_SHUFFLE_VECTOR_ here would not work. */

/* !defined(SIMDE_ARM_NEON_COMBINE_H) */

/* :: End simde/simde/arm/neon/combine.h :: */

/* !defined(SIMDE_ARM_NEON_MOVL_H) */

/* :: End simde/simde/arm/neon/movl.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/movl_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/get_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_GET_HIGH_H) */

/* :: End simde/simde/arm/neon/get_high.h :: */

/* !defined(SIMDE_ARM_NEON_MOVL_HIGH_H) */

/* :: End simde/simde/arm/neon/movl_high.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_SUBL_H) */

/* :: End simde/simde/arm/neon/subl.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/movn.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MOVN_H) */

/* :: End simde/simde/arm/neon/movn.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/reinterpret.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_TARGET_NOT_SUPPORT_INT128_TYPE) */

/* !defined(SIMDE_TARGET_NOT_SUPPORT_INT128_TYPE) */

/* :: End simde/simde/arm/neon/reinterpret.h :: */

/* https://github.com/simd-everywhere/simde/issues/855#issuecomment-881658604 */

/* !defined(SIMDE_ARM_NEON_ABD_H) */

/* :: End simde/simde/arm/neon/abd.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/add.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Ju-Hung Li <jhlee@pllab.cs.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_TARGET_NOT_SUPPORT_INT128_TYPE) */

/* !defined(SIMDE_ARM_NEON_ADD_H) */

/* :: End simde/simde/arm/neon/add.h :: */

/* !defined(SIMDE_ARM_NEON_ABA_H) */

/* :: End simde/simde/arm/neon/aba.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/abal.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/abdl.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_ABDL_H) */

/* :: End simde/simde/arm/neon/abdl.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_abal_H) */

/* :: End simde/simde/arm/neon/abal.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/abal_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_abal_H) */

/* :: End simde/simde/arm/neon/abal_high.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/abdl_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_ABDL_HIGH_H) */

/* :: End simde/simde/arm/neon/abdl_high.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/addhn.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/shr_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* https://wunkolo.github.io/post/2020/11/gf2p8affineqb-int8-shifting/ */

/* https://wunkolo.github.io/post/2020/11/gf2p8affineqb-int8-shifting/ */

/* !defined(SIMDE_ARM_NEON_SHR_N_H) */

/* :: End simde/simde/arm/neon/shr_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_ADDHN_H) */

/* :: End simde/simde/arm/neon/addhn.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/addhn_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_ADDHN_HIGH_H) */

/* :: End simde/simde/arm/neon/addhn_high.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/addl.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_ADDL_H) */

/* :: End simde/simde/arm/neon/addl.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/addlv.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/addv.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_ADDV_H) */

/* :: End simde/simde/arm/neon/addv.h :: */

/* !defined(SIMDE_ARM_NEON_ADDLV_H) */

/* :: End simde/simde/arm/neon/addlv.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/addl_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_ADDL_HIGH_H) */

/* :: End simde/simde/arm/neon/addl_high.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/addw.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_ADDW_H) */

/* :: End simde/simde/arm/neon/addw.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/addw_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_ADDW_HIGH_H) */

/* :: End simde/simde/arm/neon/addw_high.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/aes.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/simde-aes.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/*
 * Number of columns (32-bit words) comprising the State. For this
 * standard, Nb = 4.
 */

// gmult(0x02, b);

// gmult(0x01, b);

// gmult(0x01, b);

// gmult(0x03, b);

// gmult(0x0e, b);

// gmult(0x09, b);

// gmult(0x0d, b);

// gmult(0x0b, b);

/*
 * S-box transformation table
 */

// 0     1     2     3     4     5     6     7     8     9     a     b     c     d     e     f

// 0

// 1

// 2

// 3

// 4

// 5

// 6

// 7

// 8

// 9

// a

// b

// c

// d

// e

// f

/*
 * Inverse S-box transformation table
 */

// 0     1     2     3     4     5     6     7     8     9     a     b     c     d     e     f

// 0

// 1

// 2

// 3

// 4

// 5

// 6

// 7

// 8

// 9

// a

// b

// c

// d

// e

// f

/*
 * Multiplication of 4 byte words
 * m(x) = x4+1

SIMDE_FUNCTION_ATTRIBUTES
void coef_mult(uint8_t *a, uint8_t *b, uint8_t *d) {

  d[0] = gmult(a[0],b[0])^gmult(a[3],b[1])^gmult(a[2],b[2])^gmult(a[1],b[3]);
  d[1] = gmult(a[1],b[0])^gmult(a[0],b[1])^gmult(a[3],b[2])^gmult(a[2],b[3]);
  d[2] = gmult(a[2],b[0])^gmult(a[1],b[1])^gmult(a[0],b[2])^gmult(a[3],b[3]);
  d[3] = gmult(a[3],b[0])^gmult(a[2],b[1])^gmult(a[1],b[2])^gmult(a[0],b[3]);
}
*/

/* !defined(SIMDE_AES_H) */

/* :: End simde/simde/simde-aes.h :: */

/* ref: https://github.com/kokke/tiny-AES-c/blob/master/aes.c */

// AESShiftRows

/* ref: https://github.com/kokke/tiny-AES-c/blob/master/aes.c */

// AESInvShiftRows

/* ref: https://github.com/kokke/tiny-AES-c/blob/master/aes.c */

/* this last call to simde_xtime() can be omitted */

/* ref: simde/simde/x86/aes.h */

// uint8_t k[] = {0x0e, 0x09, 0x0d, 0x0b}; // a(x) = {0e} + {09}x + {0d}x2 + {0b}x3

//coef_mult(k, col, res);

/* !defined(SIMDE_ARM_NEON_AES_H) */

/* :: End simde/simde/arm/neon/aes.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/and.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_AND_H) */

/* :: End simde/simde/arm/neon/and.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/bcax.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Atharva Nimbalkar <atharvakn@gmail.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/eor.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

// Note: EOR3 instructions are implemented only when FEAT_SHA3 is implemented.

/* !defined(SIMDE_ARM_NEON_EOR_H) */

/* :: End simde/simde/arm/neon/eor.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/bic.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/dup_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_DUP_N_H) */

/* :: End simde/simde/arm/neon/dup_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_BIC_H) */

/* :: End simde/simde/arm/neon/bic.h :: */

/* !defined(SIMDE_ARM_NEON_BCAX_H) */

/* :: End simde/simde/arm/neon/bcax.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/bsl.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_BSL_H) */

/* :: End simde/simde/arm/neon/bsl.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cadd_rot270.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CADD_ROT270_H) */

/* :: End simde/simde/arm/neon/cadd_rot270.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cadd_rot90.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CADD_ROT90_H) */

/* :: End simde/simde/arm/neon/cadd_rot90.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cage.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Evan Nemerson <evan@nemerson.com>
 *   2021      Atharva Nimbalkar <atharvakn@gmail.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cge.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CGE_H) */

/* :: End simde/simde/arm/neon/cge.h :: */

/* !defined(SIMDE_ARM_NEON_CAGE_H) */

/* :: End simde/simde/arm/neon/cage.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cagt.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cgt.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/get_low.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_GET_LOW_H) */

/* :: End simde/simde/arm/neon/get_low.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* https://stackoverflow.com/a/65175746/501126 */

/* !defined(SIMDE_ARM_NEON_CGT_H) */

/* :: End simde/simde/arm/neon/cgt.h :: */

/* !defined(SIMDE_ARM_NEON_CAGT_H) */

/* :: End simde/simde/arm/neon/cagt.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cale.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_cale_H) */

/* :: End simde/simde/arm/neon/cale.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/calt.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CAGT_H) */

/* :: End simde/simde/arm/neon/calt.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ceq.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CEQ_H) */

/* :: End simde/simde/arm/neon/ceq.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ceqz.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CEQZ_H) */

/* :: End simde/simde/arm/neon/ceqz.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cgez.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CGEZ_H) */

/* :: End simde/simde/arm/neon/cgez.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cgtz.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CGTZ_H) */

/* :: End simde/simde/arm/neon/cgtz.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cle.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* http://www.alfredklomp.com/programming/sse-intrinsics/ */

/* !defined(SIMDE_ARM_NEON_CLE_H) */

/* :: End simde/simde/arm/neon/cle.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/clez.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CLEZ_H) */

/* :: End simde/simde/arm/neon/clez.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cls.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/clz.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* https://gist.github.com/animetosho/6cb732ccb5ecd86675ca0a442b3c0622 */

/* !defined(SIMDE_ARM_NEON_CLZ_H) */

/* :: End simde/simde/arm/neon/clz.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cltz.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* TODO: float fallbacks should use vclt(a, vdup_n(0.0)) */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/clt.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CLT_H) */

/* :: End simde/simde/arm/neon/clt.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CLTZ_H) */

/* :: End simde/simde/arm/neon/cltz.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mvn.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MVN_H) */

/* :: End simde/simde/arm/neon/mvn.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CLS_H) */

/* :: End simde/simde/arm/neon/cls.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cmla.h :: */

/* SPDX-License-Identifier: MIT
*
* 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.
*
* Copyright:
*   2021      Atharva Nimbalkar <atharvakn@gmail.com>
*   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CMLA_H) */

/* :: End simde/simde/arm/neon/cmla.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cmla_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cvt.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Sean Maher <seanptmaher@gmail.com>
 *   2020-2021 Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* SIMDE_ARM_NEON_CVT_H */

/* :: End simde/simde/arm/neon/cvt.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/dup_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020-2021 Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

// simde_vdup_lane_f16

//simde_vdup_lane_f32

//simde_vdup_lane_f64

//simde_vdup_lane_s32

//simde_vdup_lane_s64

//simde_vdup_lane_u32

//simde_vdup_lane_u64

//simde_vdup_laneq_f32

//simde_vdup_laneq_s32

//simde_vdup_laneq_s64

//simde_vdup_laneq_u32

//simde_vdup_laneq_u64

// simde_vdup_lane_bf16

/* !defined(SIMDE_ARM_NEON_DUP_LANE_H) */

/* :: End simde/simde/arm/neon/dup_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mul.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Yung-Cheng Su <eric20607@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* https://stackoverflow.com/a/29155682/501126 */

/* !defined(SIMDE_ARM_NEON_MUL_H) */

/* :: End simde/simde/arm/neon/mul.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CMLA_LANE_H) */

/* :: End simde/simde/arm/neon/cmla_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cmla_rot180.h :: */

/* SPDX-License-Identifier: MIT
*
* 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.
*
* Copyright:
*   2021      Atharva Nimbalkar <atharvakn@gmail.com>
*   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CMLA_ROT180_H) */

/* :: End simde/simde/arm/neon/cmla_rot180.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cmla_rot180_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CMLA_ROT180_LANE_H) */

/* :: End simde/simde/arm/neon/cmla_rot180_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cmla_rot270.h :: */

/* SPDX-License-Identifier: MIT
*
* 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.
*
* Copyright:
*   2021      Atharva Nimbalkar <atharvakn@gmail.com>
*   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CMLA_ROT270_H) */

/* :: End simde/simde/arm/neon/cmla_rot270.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cmla_rot270_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CMLA_ROT270_LANE_H) */

/* :: End simde/simde/arm/neon/cmla_rot270_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cmla_rot90.h :: */

/* SPDX-License-Identifier: MIT
*
* 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.
*
* Copyright:
*   2021      Atharva Nimbalkar <atharvakn@gmail.com>
*   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CMLA_ROT90_H) */

/* :: End simde/simde/arm/neon/cmla_rot90.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cmla_rot90_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CMLA_ROT90_LANE_H) */

/* :: End simde/simde/arm/neon/cmla_rot90_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cnt.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* The x86 implementations are stolen from
 * https://github.com/WebAssembly/simd/pull/379. They could be cleaned
 * up a bit if someone is bored; they're mostly just direct
 * translations from the assembly. */

/* !defined(SIMDE_ARM_NEON_CNT_H) */

/* :: End simde/simde/arm/neon/cnt.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cvt_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* SIMDE_ARM_NEON_CVT_N_H */

/* :: End simde/simde/arm/neon/cvt_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cvtm.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

// Hmm.. this doesn't work, unlike the signed versions

// Hmm.. this doesn't work, unlike the signed versions

/* SIMDE_ARM_NEON_CVTM_H */

/* :: End simde/simde/arm/neon/cvtm.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cvtn.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Michael R. Crusoe <crusoe@debian.org>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

// Hmm.. this doesn't work, unlike the signed versions

// Hmm.. this doesn't work, unlike the signed versions

/* SIMDE_ARM_NEON_CVTN_H */

/* :: End simde/simde/arm/neon/cvtn.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/cvtp.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

// Hmm.. this doesn't work, unlike the signed versions

// Hmm.. this doesn't work, unlike the signed versions

/* SIMDE_ARM_NEON_CVTP_H */

/* :: End simde/simde/arm/neon/cvtp.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/copy_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* SIMDE_ARM_NEON_COPY_LANE_H */

/* :: End simde/simde/arm/neon/copy_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/crc32.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CRC32_H) */

/* :: End simde/simde/arm/neon/crc32.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/create.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CREATE_H) */

/* :: End simde/simde/arm/neon/create.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/div.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MUL_H) */

/* :: End simde/simde/arm/neon/div.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/dot.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/paddl.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/padd.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020-2021 Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/uzp1.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* _mm_movelh_ps?!?! SSE is weird. */

/* !defined(SIMDE_ARM_NEON_UZP1_H) */

/* :: End simde/simde/arm/neon/uzp1.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/uzp2.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_UZP2_H) */

/* :: End simde/simde/arm/neon/uzp2.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/get_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_GET_LANE_H) */

/* :: End simde/simde/arm/neon/get_lane.h :: */

/* !defined(SIMDE_ARM_NEON_PADD_H) */

/* :: End simde/simde/arm/neon/padd.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/shl_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* https://wunkolo.github.io/post/2020/11/gf2p8affineqb-int8-shifting/ */

/* https://wunkolo.github.io/post/2020/11/gf2p8affineqb-int8-shifting/ */

/* !defined(SIMDE_ARM_NEON_SHL_N_H) */

/* :: End simde/simde/arm/neon/shl_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* SIMDE_ARM_NEON_PADDL_H */

/* :: End simde/simde/arm/neon/paddl.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mull.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_TARGET_NOT_SUPPORT_INT128_TYPE) */

/* !defined(SIMDE_ARM_NEON_MULL_H) */

/* :: End simde/simde/arm/neon/mull.h :: */

/* !defined(SIMDE_ARM_NEON_DOT_H) */

/* :: End simde/simde/arm/neon/dot.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/dot_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_DOT_LANE_H) */

/* :: End simde/simde/arm/neon/dot_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ext.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_EXT_H) */

/* :: End simde/simde/arm/neon/ext.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/fma.h :: */

/* SPDX-License-Identifier: MIT
*
* 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.
*
* Copyright:
*   2021      Atharva Nimbalkar <atharvakn@gmail.com>
*   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CMLA_H) */

/* :: End simde/simde/arm/neon/fma.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/fma_lane.h :: */

/* SPDX-License-Identifier: MIT
*
* 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.
*
* Copyright:
*   2021      Atharva Nimbalkar <atharvakn@gmail.com>
*   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mul_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Yung-Cheng Su <eric20607@gapp.nthu.edu.tw>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MUL_LANE_H) */

/* :: End simde/simde/arm/neon/mul_lane.h :: */

/* simde_vfmad_lane_f64 */

/* simde_vfmad_laneq_f64 */

/* simde_vfmah_lane_f16 */

/* simde_vfmah_laneq_f16 */

/* simde_vfmas_lane_f32 */

/* simde_vfmas_laneq_f32 */

/* simde_vfma_lane_f16 */

/* simde_vfma_lane_f32 */

/* simde_vfma_lane_f64 */

/* simde_vfma_laneq_f16 */

/* simde_vfma_laneq_f32 */

/* simde_vfma_laneq_f64 */

/* simde_vfmaq_lane_f64 */

/* simde_vfmaq_lane_f16 */

/* simde_vfmaq_lane_f32 */

/* simde_vfmaq_laneq_f16 */

/* simde_vfmaq_laneq_f32 */

/* simde_vfmaq_laneq_f64 */

/* !defined(SIMDE_ARM_NEON_FMA_LANE_H) */

/* :: End simde/simde/arm/neon/fma_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/fma_n.h :: */

/* SPDX-License-Identifier: MIT
*
* 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.
*
* Copyright:
*   2021      Evan Nemerson <evan@nemerson.com>
*   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_CMLA_H) */

/* :: End simde/simde/arm/neon/fma_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/fmlal.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_FMLAL_H) */

/* :: End simde/simde/arm/neon/fmlal.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/fmlsl.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_FMLSL_H) */

/* :: End simde/simde/arm/neon/fmlsl.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/fms.h :: */

/* SPDX-License-Identifier: MIT
*
* 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.
*
* Copyright:
*   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/neg.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_NEG_H) */

/* :: End simde/simde/arm/neon/neg.h :: */

/* !defined(SIMDE_ARM_NEON_FMS_H) */

/* :: End simde/simde/arm/neon/fms.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/fms_lane.h :: */

/* SPDX-License-Identifier: MIT
*
* 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.
*
* Copyright:
*   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* simde_vfmsd_lane_f64 */

/* simde_vfmsd_laneq_f64 */

/* simde_vfmsh_lane_f16 */

/* simde_vfmsh_laneq_f16 */

/* simde_vfmss_lane_f32 */

/* simde_vfmss_laneq_f32 */

/* simde_vfms_lane_f16 */

/* simde_vfms_lane_f32 */

/* simde_vfms_lane_f64 */

/* simde_vfms_laneq_f16 */

/* simde_vfms_laneq_f32 */

/* simde_vfms_laneq_f64 */

/* simde_vfmsq_lane_f64 */

/* simde_vfmsq_lane_f16 */

/* simde_vfmsq_lane_f32 */

/* simde_vfmsq_laneq_f16 */

/* simde_vfmsq_laneq_f32 */

/* simde_vfmsq_laneq_f64 */

/* !defined(SIMDE_ARM_NEON_FMS_LANE_H) */

/* :: End simde/simde/arm/neon/fms_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/fms_n.h :: */

/* SPDX-License-Identifier: MIT
*
* 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.
*
* Copyright:
*   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
*/

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_FMS_N_H) */

/* :: End simde/simde/arm/neon/fms_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/hadd.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* TODO: the 128-bit versions only require AVX-512 because of the final
 * conversions from larger types down to smaller ones.  We could get
 * the same results from AVX/AVX2 instructions with some shuffling
 * to extract the low half of each input element to the low half
 * of a 256-bit vector, then cast that to a 128-bit vector. */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_HADD_H) */

/* :: End simde/simde/arm/neon/hadd.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/hsub.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* TODO: the 128-bit versions only require AVX-512 because of the final
 * conversions from larger types down to smaller ones.  We could get
 * the same results from AVX/AVX2 instructions with some shuffling
 * to extract the low half of each input element to the low half
 * of a 256-bit vector, then cast that to a 128-bit vector. */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_HSUB_H) */

/* :: End simde/simde/arm/neon/hsub.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ld1.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_TARGET_NOT_SUPPORT_INT128_TYPE) */

/* !defined(SIMDE_ARM_NEON_LD1_H) */

/* :: End simde/simde/arm/neon/ld1.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ld1_dup.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2021      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_LD1_DUP_H) */

/* :: End simde/simde/arm/neon/ld1_dup.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ld1_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_LD1_LANE_H) */

/* :: End simde/simde/arm/neon/ld1_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ld1_x2.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2021      Décio Luiz Gazzoni Filho <decio@decpp.net>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_LD1_X2_H) */

/* :: End simde/simde/arm/neon/ld1_x2.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ld1_x3.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_LD1_X3_H) */

/* :: End simde/simde/arm/neon/ld1_x3.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ld1_x4.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2021      Décio Luiz Gazzoni Filho <decio@decpp.net>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_LD1_X4_H) */

/* :: End simde/simde/arm/neon/ld1_x4.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ld1q_x2.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2021      Décio Luiz Gazzoni Filho <decio@decpp.net>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_LD1Q_X2_H) */

/* :: End simde/simde/arm/neon/ld1q_x2.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ld1q_x3.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_LD1Q_X3_H) */

/* :: End simde/simde/arm/neon/ld1q_x3.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ld1q_x4.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2021      Décio Luiz Gazzoni Filho <decio@decpp.net>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_LD1Q_X4_H) */

/* :: End simde/simde/arm/neon/ld1q_x4.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ld2.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/uzp.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_UZP_H) */

/* :: End simde/simde/arm/neon/uzp.h :: */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_LD2_H) */

/* :: End simde/simde/arm/neon/ld2.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ld2_dup.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_LD2_DUP_H) */

/* :: End simde/simde/arm/neon/ld2_dup.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ld2_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_LD2_LANE_H) */

/* :: End simde/simde/arm/neon/ld2_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ld3.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_LD3_H) */

/* :: End simde/simde/arm/neon/ld3.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ld3_dup.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_LD3_DUP_H) */

/* :: End simde/simde/arm/neon/ld3_dup.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ld3_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_LD3_LANE_H) */

/* :: End simde/simde/arm/neon/ld3_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ld4.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

// Let a, b, c, d be the 4 uint8x16 to return, they are laid out in memory:

// [a0, b0, c0, d0, a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3,

//  a4, b4, c4, d4, a5, b5, c5, d5, a6, b6, c6, d6, a7, b7, c7, d7,

//  a8, b8, c8, d8, a9, b9, c9, d9, a10, b10, c10, d10, a11, b11, c11, d11,

//  a12, b12, c12, d12, a13, b13, c13, d13, a14, b14, c14, d14, a15, b15, c15, d15]

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_LD4_H) */

/* :: End simde/simde/arm/neon/ld4.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ld4_dup.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_LD3_DUP_H) */

/* :: End simde/simde/arm/neon/ld4_dup.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/ld4_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2021      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* In older versions of clang, __builtin_neon_vld4_lane_v would
 * generate a diagnostic for most variants (those which didn't
 * use signed 8-bit integers).  I believe this was fixed by
 * 78ad22e0cc6390fcd44b2b7b5132f1b960ff975d.
 *
 * Since we have to use macros (due to the immediate-mode parameter)
 * we can't just disable it once in this file; we have to use statement
 * exprs and push / pop the stack for each macro. */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_LD4_LANE_H) */

/* :: End simde/simde/arm/neon/ld4_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/max.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* https://github.com/simd-everywhere/simde/issues/855#issuecomment-881656284 */

/* https://github.com/simd-everywhere/simde/issues/855#issuecomment-881656284 */

/* !defined(SIMDE_ARM_NEON_MAX_H) */

/* :: End simde/simde/arm/neon/max.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/maxnm.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MAXNM_H) */

/* :: End simde/simde/arm/neon/maxnm.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/maxnmv.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MAXNMV_H) */

/* :: End simde/simde/arm/neon/maxnmv.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/maxv.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MAXV_H) */

/* :: End simde/simde/arm/neon/maxv.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/min.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* https://github.com/simd-everywhere/simde/issues/855#issuecomment-881656284 */

/* https://github.com/simd-everywhere/simde/issues/855#issuecomment-881656284 */

/* _mm_subs_epu32(a_.sse_m128i, b_.sse_m128i) */

/* !defined(SIMDE_ARM_NEON_MIN_H) */

/* :: End simde/simde/arm/neon/min.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/minnm.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MINNM_H) */

/* :: End simde/simde/arm/neon/minnm.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/minnmv.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MINNMV_H) */

/* :: End simde/simde/arm/neon/minnmv.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/minv.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MINV_H) */

/* :: End simde/simde/arm/neon/minv.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mla.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MLA_H) */

/* :: End simde/simde/arm/neon/mla.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mla_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MLA_LANE_H) */

/* :: End simde/simde/arm/neon/mla_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mla_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mul_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MUL_N_H) */

/* :: End simde/simde/arm/neon/mul_n.h :: */

/* !defined(SIMDE_ARM_NEON_MLA_N_H) */

/* :: End simde/simde/arm/neon/mla_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mlal.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MLAL_H) */

/* :: End simde/simde/arm/neon/mlal.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mlal_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MLAL_HIGH_H) */

/* :: End simde/simde/arm/neon/mlal_high.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mlal_high_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MLAL_HIGH_LANE_H) */

/* :: End simde/simde/arm/neon/mlal_high_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mlal_high_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Décio Luiz Gazzoni Filho <decio@decpp.net>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MLAL_HIGH_N_H) */

/* :: End simde/simde/arm/neon/mlal_high_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mlal_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MLAL_LANE_H) */

/* :: End simde/simde/arm/neon/mlal_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mlal_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MLAL_N_H) */

/* :: End simde/simde/arm/neon/mlal_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mls.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MLS_H) */

/* :: End simde/simde/arm/neon/mls.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mls_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MLS_LANE_H) */

/* :: End simde/simde/arm/neon/mls_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mls_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MLS_N_H) */

/* :: End simde/simde/arm/neon/mls_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mlsl.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MLSL_H) */

/* :: End simde/simde/arm/neon/mlsl.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mlsl_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mull_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_TARGET_NOT_SUPPORT_INT128_TYPE) */

/* !defined(SIMDE_ARM_NEON_MULL_HIGH_H) */

/* :: End simde/simde/arm/neon/mull_high.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MLSL_HIGH_H) */

/* :: End simde/simde/arm/neon/mlsl_high.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mlsl_high_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MLSL_HIGH_LANE_H) */

/* :: End simde/simde/arm/neon/mlsl_high_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mlsl_high_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Décio Luiz Gazzoni Filho <decio@decpp.net>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MLSL_HIGH_N_H) */

/* :: End simde/simde/arm/neon/mlsl_high_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mlsl_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MLSL_LANE_H) */

/* :: End simde/simde/arm/neon/mlsl_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mlsl_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mull_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MULL_H) */

/* :: End simde/simde/arm/neon/mull_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MLSL_N_H) */

/* :: End simde/simde/arm/neon/mlsl_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mmlaq.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

// I8MM is optional feature. src: https://patchwork.ffmpeg.org/project/ffmpeg/patch/20230530123043.52940-2-martin@martin.st/

/* !defined(SIMDE_ARM_NEON_MMLAQ_H) */

/* :: End simde/simde/arm/neon/mmlaq.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/movn_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MOVN_HIGH_H) */

/* :: End simde/simde/arm/neon/movn_high.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mull_high_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMULL_HIGH_LANE_H) */

/* :: End simde/simde/arm/neon/mull_high_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mull_high_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MULL_HIGH_N_H) */

/* :: End simde/simde/arm/neon/mull_high_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mull_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MULL_LANE_H) */

/* :: End simde/simde/arm/neon/mull_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mulx.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MULX_H) */

/* :: End simde/simde/arm/neon/mulx.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mulx_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MULX_LANE_H) */

/* :: End simde/simde/arm/neon/mulx_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/mulx_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_MULX_N_H) */

/* :: End simde/simde/arm/neon/mulx_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/orn.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/orr.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_ORR_H) */

/* :: End simde/simde/arm/neon/orr.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_ORN_H) */

/* :: End simde/simde/arm/neon/orn.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/padal.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* SIMDE_ARM_NEON_PADAL_H */

/* :: End simde/simde/arm/neon/padal.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/pmax.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_PMAX_H) */

/* :: End simde/simde/arm/neon/pmax.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/pmaxnm.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_PMAXNM_H) */

/* :: End simde/simde/arm/neon/pmaxnm.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/pmin.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_PMIN_H) */

/* :: End simde/simde/arm/neon/pmin.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/pminnm.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_PMINNM_H) */

/* :: End simde/simde/arm/neon/pminnm.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qabs.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QABS_H) */

/* :: End simde/simde/arm/neon/qabs.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qadd.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* https://stackoverflow.com/a/56544654/501126 */

/* normal result (possibly wraps around) */

/* If result saturates, it has the same sign as both a and b */

/* shift sign to lowest bit */

/* https://stackoverflow.com/a/56544654/501126 */

/* normal result (possibly wraps around) */

/* If result saturates, it has the same sign as both a and b */

/* shift sign to lowest bit */

/* !defined(SIMDE_ARM_NEON_QADD_H) */

/* :: End simde/simde/arm/neon/qadd.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmlal.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMLAL_H) */

/* :: End simde/simde/arm/neon/qdmlal.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmlal_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMLAL_HIGH_H) */

/* :: End simde/simde/arm/neon/qdmlal_high.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmlal_high_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMLAL_HIGH_LANE_H) */

/* :: End simde/simde/arm/neon/qdmlal_high_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmlal_high_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMLAL_HIGH_N_H) */

/* :: End simde/simde/arm/neon/qdmlal_high_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmlal_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMLAL_LANE_H) */

/* :: End simde/simde/arm/neon/qdmlal_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmlal_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMLAL_N_H) */

/* :: End simde/simde/arm/neon/qdmlal_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmlsl.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qsub.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QSUB_H) */

/* :: End simde/simde/arm/neon/qsub.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMLSL_H) */

/* :: End simde/simde/arm/neon/qdmlsl.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmlsl_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMLSL_HIGH_H) */

/* :: End simde/simde/arm/neon/qdmlsl_high.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmlsl_high_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMLSL_HIGH_LANE_H) */

/* :: End simde/simde/arm/neon/qdmlsl_high_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmlsl_high_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMLSL_HIGH_N_H) */

/* :: End simde/simde/arm/neon/qdmlsl_high_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmlsl_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDmlsl_LANE_H) */

/* :: End simde/simde/arm/neon/qdmlsl_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmlsl_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMLSL_N_H) */

/* :: End simde/simde/arm/neon/qdmlsl_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmulh.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmull.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* Implementation notes (seanptmaher):
 *
 * It won't overflow during the multiplication, it'll ever only double
 * the bit length, we only care about the overflow during the shift,
 * so do the multiplication, then the shift with saturation
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMULL_H) */

/* :: End simde/simde/arm/neon/qdmull.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMULH_H) */

/* :: End simde/simde/arm/neon/qdmulh.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmulh_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Evan Nemerson <evan@nemerson.com>
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmulh_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMULH_N_H) */

/* :: End simde/simde/arm/neon/qdmulh_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMULH_LANE_H) */

/* :: End simde/simde/arm/neon/qdmulh_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmull_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMULL_HIGH_H) */

/* :: End simde/simde/arm/neon/qdmull_high.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmull_high_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMULL_HIGH_LANE_H) */

/* :: End simde/simde/arm/neon/qdmull_high_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmull_high_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMULL_HIGH_N_H) */

/* :: End simde/simde/arm/neon/qdmull_high_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmull_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMULL_H) */

/* :: End simde/simde/arm/neon/qdmull_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qdmull_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QDMULL_N_H) */

/* :: End simde/simde/arm/neon/qdmull_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qrdmlah.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qmovn.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QMOVN_H) */

/* :: End simde/simde/arm/neon/qmovn.h :: */

/* !defined(SIMDE_ARM_NEON_QRDMLAH_H) */

/* :: End simde/simde/arm/neon/qrdmlah.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qrdmlah_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QRDMLAH_LANE_H) */

/* :: End simde/simde/arm/neon/qrdmlah_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qrdmlsh.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QRDMLSH_H) */

/* :: End simde/simde/arm/neon/qrdmlsh.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qrdmlsh_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QRDMLSH_LANE_H) */

/* :: End simde/simde/arm/neon/qrdmlsh_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qrdmulh.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* https://github.com/WebAssembly/simd/pull/365 */

/* !defined(SIMDE_ARM_NEON_QRDMULH_H) */

/* :: End simde/simde/arm/neon/qrdmulh.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qrdmulh_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QRDMULH_LANE_H) */

/* :: End simde/simde/arm/neon/qrdmulh_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qrdmulh_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QRDMULH_H) */

/* :: End simde/simde/arm/neon/qrdmulh_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qrshl.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/x86/avx.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2018-2020 Evan Nemerson <evan@nemerson.com>
 *        2020 Michael R. Crusoe <crusoe@debian.org>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/x86/sse.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2017-2020 Evan Nemerson <evan@nemerson.com>
 *   2015-2017 John W. Ratcliff <jratcliffscarab@gmail.com>
 *   2015      Brandon Rowlett <browlett@nvidia.com>
 *   2015      Ken Fast <kfast@gdeb.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/x86/mmx.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2017-2020 Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* defined(SIMDE_ARM_NEON_A32V7_NATIVE) */

/* defined(SIMDE_MIPS_LOONGSON_MMI_NATIVE) */

/* noop */

/* Set elements which are < 0 to 0 */

/* Vector with all s16 elements set to UINT8_MAX */

/* Elements which are within the acceptable range */

/* Final values as 16-bit integers */

/* !defined(SIMDE_X86_MMX_H) */

/* :: End simde/simde/x86/mmx.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* defined(SIMDE_ARM_NEON_A32V7_NATIVE) */

/* defined(SIMDE_POWER_ALTIVEC_P6_NATIVE) */

/* defined(SIMDE_LOONGARCH_LSX_NATIVE) */

/* For architectures which lack a current direction SIMD instruction.
   *
   * Note that NEON actually has a current rounding mode instruction,
   * but in ARMv8+ the rounding mode is ignored and nearest is always
   * used, so we treat ARMv7 as having a rounding mode but ARMv8 as
   * not. */

/* This function broadcasts the first element in the input vector to
   * all lanes.  It is used to avoid generating spurious exceptions in
   * *_ss functions since there may be garbage in the upper lanes. */

// the upper values in the result must be the remnants of <a>.

/* Note: we use ints instead of floats because we don't want cmpeq
     * to return false for (NaN, NaN) */

/* This function is for when you want to blend two elements together
   * according to a mask.  It is similar to _mm_blendv_ps, except that
   * it is undefined whether the blend is based on the highest bit in
   * each lane (like blendv) or just bitwise operations.  This allows
   * us to implement the function efficiently everywhere.
   *
   * Basically, you promise that all the lanes in mask are either 0 or
   * ~0. */

/* Note: NEON does not have ordered compare builtin
        Need to compare a eq a and b eq b to check for NaN
        Do AND of results to get final */

/* Clamp the input to [INT8_MIN, INT8_MAX], round, convert to i32, narrow to
      * i16, combine with an all-zero vector of i16 (which will become the upper
      * half), narrow to i8. */

/* Note: the upper half is undefined */

/* The SSE documentation says that there are no alignment requirements
   for mem_addr.  Unfortunately they used the __m64 type for the argument
   which is supposed to be 8-byte aligned, so some compilers (like clang
   with -Wcast-align) will generate a warning if you try to cast, say,
   a simde_float32* to a simde__m64* for this function.

   I think the choice of argument type is unfortunate, but I do think we
   need to stick to it here.  If there is demand I can always add something
   like simde_x_mm_loadl_f32(simde__m128, simde_float32 mem_addr[2]) */

// Shift out everything but the sign bits with a 32-bit unsigned shift right.

// Merge the two pairs together with a 64-bit unsigned shift right + add.

// Extract the result.

/* https://reviews.llvm.org/D71718 */

/* https://stackoverflow.com/questions/12227126/division-as-multiply-and-lut-fast-float-division-reciprocal/12228234#12228234 */

/* https://basesandframes.files.wordpress.com/2020/04/even_faster_math_functions_green_2020.pdf
        Pages 100 - 103 */

/* TODO: Use Hedley. */

/* !defined(SIMDE_X86_SSE_H) */

/* :: End simde/simde/x86/sse.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/x86/sse4.2.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2017      Evan Nemerson <evan@nemerson.com>
 *   2020      Hidayat Khan <huk2209@gmail.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/x86/sse4.1.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2017-2020 Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/x86/ssse3.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2017-2020 Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/x86/sse3.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2017-2020 Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/x86/sse2.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2017-2020 Evan Nemerson <evan@nemerson.com>
 *   2015-2017 John W. Ratcliff <jratcliffscarab@gmail.com>
 *   2015      Brandon Rowlett <browlett@nvidia.com>
 *   2015      Ken Fast <kfast@gdeb.com>
 *   2017      Hasindu Gamaarachchi <hasindu@unsw.edu.au>
 *   2018      Jeff Daily <jeff.daily@amd.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* defined(SIMDE_ARM_NEON_A32V7_NATIVE) */

/* defined(SIMDE_ARM_NEON_A32V7_NATIVE) */

/* This function is for when you want to blend two elements together
   * according to a mask.  It is similar to _mm_blendv_pd, except that
   * it is undefined whether the blend is based on the highest bit in
   * each lane (like blendv) or just bitwise operations.  This allows
   * us to implement the function efficiently everywhere.
   *
   * Basically, you promise that all the lanes in mask are either 0 or
   * ~0. */

/* This function broadcasts the first element in the input vector to
   * all lanes.  It is used to avoid generating spurious exceptions in
   * *_sd functions since there may be garbage in the upper lanes. */

/* SIMDE_ENDIAN_ORDER == SIMDE_ENDIAN_BIG */

/* SIMDE_ENDIAN_ORDER == SIMDE_ENDIAN_BIG */

/* Note: NEON does not have ordered compare builtin
        Need to compare a eq a and b eq b to check for NaN
        Do AND of results to get final */

/* Values below INT32_MIN saturate anyways, so we don't need to
         * test for that. */

/* ICC has trouble with _mm_movemask_epi8 at -O2 and above: */

/* https://github.com/WebAssembly/simd/pull/201#issue-380682845 */

/* Extend sign bit over entire lane */

/* Clear all but the bit we're interested in. */

/* Alternate bytes from low half and high half */

/* 3333222211110000 */

/* 7777666655554444 */

/* 3333222211110000 */

/* 7777666655554444 */

/* MSVC requires a range of (0, 255). */

/* MSVC requires a range of (0, 255). */

/* memcpy to prevent aliasing, tmp because we can't take the
     * address of a vector element. */

/* !defined(SIMDE_X86_SSE2_H) */

/* :: End simde/simde/x86/sse2.h :: */

/* !defined(SIMDE_X86_SSE3_H) */

/* :: End simde/simde/x86/sse3.h :: */

/* Mask out the bits we're not interested in.  vtbl will result in 0
       * for any values outside of [0, 15], so if the high bit is set it
       * will return 0, just like in SSSE3. */

/* Convert a from an int8x16_t to an int8x8x2_t */

/* Table lookups */

/* This is a bit ugly because of the casts and the awful type
       * macros (SIMDE_POWER_ALTIVEC_VECTOR), but it's really just
       * vec_sel(vec_perm(a, a, b), 0, vec_cmplt(b, 0)) */

/* Zero extend a */

/* Sign extend by shifting left then shifting right. */

/* multiply */

/* saturated add */

/* Multiply */

/* Rounding narrowing shift right
       * narrow = (int16_t)((mul + 16384) >> 15); */

/* Join together */

/* Multiply */

/* Rounding narrowing shift right
       * narrow = (int16_t)((mul + 16384) >> 15); */

/* Join together */

/* !defined(SIMDE_X86_SSE2_H) */

/* :: End simde/simde/x86/ssse3.h :: */

/* Use a signed shift right to create a mask with the sign bit */

/* https://software.intel.com/en-us/forums/intel-c-compiler/topic/850087 */

/* For architectures which lack a current direction SIMD instruction. */

/* (a == b) -> (a_lo == b_lo) && (a_hi == b_hi) */

/* xxxx xxxx xxxx DCBA */

/* 0x0x 0x0x 0D0C 0B0A */

/* xxxx xxxx xxxx DCBA */

/* 0x0x 0x0x 0D0C 0B0A */

/* 000D 000C 000B 000A */

/* xxxx xxxx xxxx xxBA */

/* 0x0x 0x0x 0x0x 0B0A */

/* 000x 000x 000B 000A */

/* 0000 000B 0000 000A */

/* Disabled on x86 due to lack of 64-bit arithmetic shift until
       * until AVX-512 (at which point we would be using the native
       * _mm_cvtepi_epi64 anyways). */

/* xxxx xxxx xxxx DCBA */

/* 0x0x 0x0x 0D0C 0B0A */

/* xxxx xxxx xxxx DCBA */

/* 0x0x 0x0x 0D0C 0B0A */

/* 000D 000C 000B 000A */

/* xxxx xxxx xxxx xxBA */

/* 0x0x 0x0x 0x0x 0B0A */

/* 000x 000x 000B 000A */

/* 0000 000B 0000 000A */

/* xxxx xxxx xxxx 0B0A */

/* 000x 000x 000B 000A */

/* 0000 000B 0000 000A */

/* xxxx xxxx xxxx 0B0A */

/* 000x 000x 000B 000A */

/* 0000 000B 0000 000A */

/* imm8 is a compile-time constant, so this all becomes just a load */

/* clang-3.8 returns an incompatible type, so we need the cast.  MSVC
   * can't handle the cast ("error C2440: 'type cast': cannot convert
   * from '__m128i' to '__m128i'").  */

/* https://github.com/simd-everywhere/simde/issues/855#issuecomment-881656284 */

/* https://github.com/simd-everywhere/simde/issues/855#issuecomment-881656284 */

// vmull_s32 upcasts instead of masking, so we downcast.

/* !defined(SIMDE_X86_SSE4_1_H) */

/* :: End simde/simde/x86/sse4.1.h :: */

/* https://www.pgroup.com/userforum/viewtopic.php?f=4&p=27590&sid=cf89f8bf30be801831fe4a2ff0a2fa6c */

/* https://www.pgroup.com/userforum/viewtopic.php?f=4&p=27590&sid=cf89f8bf30be801831fe4a2ff0a2fa6c */

/* https://stackoverflow.com/a/65175746/501126 */

/* https://stackoverflow.com/a/65223269/501126 */

/* !defined(SIMDE_X86_SSE4_2_H) */

/* :: End simde/simde/x86/sse4.2.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* This function is for when you want to blend two elements together
   * according to a mask.  It is similar to _mm256_blendv_ps, except that
   * it is undefined whether the blend is based on the highest bit in
   * each lane (like blendv) or just bitwise operations.  This allows
   * us to implement the function efficiently everywhere.
   *
   * Basically, you promise that all the lanes in mask are either 0 or
   * ~0. */

/* This function is for when you want to blend two elements together
   * according to a mask.  It is similar to _mm256_blendv_pd, except that
   * it is undefined whether the blend is based on the highest bit in
   * each lane (like blendv) or just bitwise operations.  This allows
   * us to implement the function efficiently everywhere.
   *
   * Basically, you promise that all the lanes in mask are either 0 or
   * ~0. */

/* This implementation does not support signaling NaNs (yet?) */

/* Prior to 9.0 clang has problems with _mm{,256}_cmp_{ps,pd} for all four of the true/false
 * comparisons, but only when AVX-512 is enabled. */

/* -Wfloat-equal */

/* !defined(SIMDE_X86_AVX_H) */

/* :: End simde/simde/x86/avx.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* https://github.com/llvm/llvm-project/commit/f0a78bdfdc6d56b25e0081884580b3960a3c2429 */

/* !defined(SIMDE_ARM_NEON_QRSHL_H) */

/* :: End simde/simde/arm/neon/qrshl.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qrshrn_high_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_RSHRN_HIGH_N_H) */

/* :: End simde/simde/arm/neon/qrshrn_high_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qrshrn_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rshr_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/tst.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_TST_H) */

/* :: End simde/simde/arm/neon/tst.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_RSHR_N_H) */

/* :: End simde/simde/arm/neon/rshr_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QRSHRN_N_H) */

/* :: End simde/simde/arm/neon/qrshrn_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qrshrun_high_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QRSHRUN_HIGH_N_H) */

/* :: End simde/simde/arm/neon/qrshrun_high_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qrshrun_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qmovun.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QMOVUN_H) */

/* :: End simde/simde/arm/neon/qmovun.h :: */

/* !defined(SIMDE_ARM_NEON_QRSHRUN_N_H) */

/* :: End simde/simde/arm/neon/qrshrun_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qmovn_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QMOVN_HIGH_H) */

/* :: End simde/simde/arm/neon/qmovn_high.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qmovun_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QMOVUN_HIGH_H) */

/* :: End simde/simde/arm/neon/qmovun_high.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qneg.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QNEG_H) */

/* :: End simde/simde/arm/neon/qneg.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qshl.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* https://github.com/llvm/llvm-project/commit/f0a78bdfdc6d56b25e0081884580b3960a3c2429 */

/* !defined(SIMDE_ARM_NEON_QSHL_H) */

/* :: End simde/simde/arm/neon/qshl.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qshl_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QSHL_N_H) */

/* :: End simde/simde/arm/neon/qshl_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qshlu_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Atharva Nimbalkar <atharvakn@gmail.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QSHLU_N_H) */

/* :: End simde/simde/arm/neon/qshlu_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qshrn_high_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QSHRN_HIGH_N_H) */

/* :: End simde/simde/arm/neon/qshrn_high_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qshrn_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2021      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QSHRN_N_H) */

/* :: End simde/simde/arm/neon/qshrn_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qshrun_high_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QSHRUN_HIGH_N_H) */

/* :: End simde/simde/arm/neon/qshrun_high_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qshrun_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_QSHRUN_N_H) */

/* :: End simde/simde/arm/neon/qshrun_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qtbl.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_QTBL_H) */

/* :: End simde/simde/arm/neon/qtbl.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/qtbx.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_QTBX_H) */

/* :: End simde/simde/arm/neon/qtbx.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/raddhn.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_RADDHN_H) */

/* :: End simde/simde/arm/neon/raddhn.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/raddhn_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_RADDHN_HIGH_H) */

/* :: End simde/simde/arm/neon/raddhn_high.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rax.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_RAX_H) */

/* :: End simde/simde/arm/neon/rax.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rbit.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* The GFNI implementation is based on Wojciech Muła's work at
 * http://0x80.pl/articles/avx512-galois-field-for-bit-shuffling.html#bit-shuffling via
 * https://github.com/InstLatx64/InstLatX64_Demo/blob/49c27effdfd5a45f27e0ccb6e2f3be5f27c3845d/GFNI_Demo.h#L173 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_RBIT_H) */

/* :: End simde/simde/arm/neon/rbit.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/recpe.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* https://stackoverflow.com/questions/12227126/division-as-multiply-and-lut-fast-float-division-reciprocal/12228234#12228234 */

/* https://stackoverflow.com/questions/12227126/division-as-multiply-and-lut-fast-float-division-reciprocal/12228234#12228234 */

/* !defined(SIMDE_ARM_NEON_RECPE_H) */

/* :: End simde/simde/arm/neon/recpe.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/recps.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_RECPS_H) */

/* :: End simde/simde/arm/neon/recps.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/recpx.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_RECPX_H) */

/* :: End simde/simde/arm/neon/recpx.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rev16.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_REV16_H) */

/* :: End simde/simde/arm/neon/rev16.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rev32.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_REV32_H) */

/* :: End simde/simde/arm/neon/rev32.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rev64.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_REV64_H) */

/* :: End simde/simde/arm/neon/rev64.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rhadd.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 */

/* Formula to average two unsigned integers without overflow is from Hacker's Delight (ISBN 978-0-321-84268-8).
 * https://web.archive.org/web/20180831033349/http://hackersdelight.org/basics2.pdf#G525596
 *     avg_u = (x | y) - ((x ^ y) >> 1);
 *
 * Formula to average two signed integers (without widening):
 *     avg_s = (x >> 1) + (y >> 1) + ((x | y) & 1); // use arithmetic shifts
 *
 * If hardware has avg_u but not avg_s then rebase input to be unsigned.
 * For example: s8 (-128..127) can be converted to u8 (0..255) by adding +128.
 * Idea borrowed from Intel's ARM_NEON_2_x86_SSE project.
 * https://github.com/intel/ARM_NEON_2_x86_SSE/blob/3c9879bf2dbef3274e0ed20f93cb8da3a2115ba1/NEON_2_SSE.h#L3171
 *     avg_s8 = avg_u8(a ^ 0x80, b ^ 0x80) ^ 0x80;
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* 0x80 */

/* 0x80 */

/* 0x8000 */

/* 0x8000 */

/* !defined(SIMDE_ARM_NEON_RHADD_H) */

/* :: End simde/simde/arm/neon/rhadd.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rnd.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_RND_H) */

/* :: End simde/simde/arm/neon/rnd.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rnd32x.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

// src: https://gcc.gnu.org/legacy-ml/gcc-patches/2019-09/msg00053.html

/* !defined(SIMDE_ARM_NEON_RND32X_H) */

/* :: End simde/simde/arm/neon/rnd32x.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rnd32z.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

// src: https://gcc.gnu.org/legacy-ml/gcc-patches/2019-09/msg00053.html

/* !defined(SIMDE_ARM_NEON_RND32Z_H) */

/* :: End simde/simde/arm/neon/rnd32z.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rnd64x.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

// src: https://gcc.gnu.org/legacy-ml/gcc-patches/2019-09/msg00053.html

/* !defined(SIMDE_ARM_NEON_RND64X_H) */

/* :: End simde/simde/arm/neon/rnd64x.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rnd64z.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

// src: https://gcc.gnu.org/legacy-ml/gcc-patches/2019-09/msg00053.html

/* !defined(SIMDE_ARM_NEON_RND64Z_H) */

/* :: End simde/simde/arm/neon/rnd64z.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rnda.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_RNDA_H) */

/* :: End simde/simde/arm/neon/rnda.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rndm.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020-2021 Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_RNDM_H) */

/* :: End simde/simde/arm/neon/rndm.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rndi.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020-2021 Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_RNDI_H) */

/* :: End simde/simde/arm/neon/rndi.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rndn.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020-2021 Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_RNDN_H) */

/* :: End simde/simde/arm/neon/rndn.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rndp.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020-2021 Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_RNDP_H) */

/* :: End simde/simde/arm/neon/rndp.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rndx.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_RNDX_H) */

/* :: End simde/simde/arm/neon/rndx.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rshl.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* Notes from the implementer (Christopher Moore aka rosbif)
 *
 * I have tried to exactly reproduce the documented behaviour of the
 * ARM NEON rshl and rshlq intrinsics.
 * This is complicated for the following reasons:-
 *
 * a) Negative shift counts shift right.
 *
 * b) Only the low byte of the shift count is used but the shift count
 * is not limited to 8-bit values (-128 to 127).
 *
 * c) Overflow must be avoided when rounding, together with sign change
 * warning/errors in the C versions.
 *
 * d) Intel SIMD is not nearly as complete as NEON and AltiVec.
 * There were no intrisics with a vector shift count before AVX2 which
 * only has 32 and 64-bit logical ones and only a 32-bit arithmetic
 * one. The others need AVX512. There are no 8-bit shift intrinsics at
 * all, even with a scalar shift count. It is surprising to use AVX2
 * and even AVX512 to implement a 64-bit vector operation.
 *
 * e) Many shift implementations, and the C standard, do not treat a
 * shift count >= the object's size in bits as one would expect.
 * (Personally I feel that > is silly but == can be useful.)
 *
 * Note that even the C17/18 standard does not define the behaviour of
 * a right shift of a negative value.
 * However Evan and I agree that all compilers likely to be used
 * implement this as an arithmetic right shift with sign extension.
 * If this is not the case it could be replaced by a logical right shift
 * if negative values are complemented before and after the shift.
 *
 * Some of the SIMD translations may be slower than the portable code,
 * particularly those for vectors with only one or two elements.
 * But I had fun writing them ;-)
 *
 */

/* !defined(SIMDE_ARM_NEON_RSHL_H) */

/* :: End simde/simde/arm/neon/rshl.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rshrn_high_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rshrn_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_RSHRN_N_H) */

/* :: End simde/simde/arm/neon/rshrn_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_RSHRN_HIGH_N_H) */

/* :: End simde/simde/arm/neon/rshrn_high_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rsqrte.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* https://basesandframes.files.wordpress.com/2020/04/even_faster_math_functions_green_2020.pdf
        Pages 100 - 103 */

//https://www.mdpi.com/1099-4300/23/1/86/htm

/* https://basesandframes.files.wordpress.com/2020/04/even_faster_math_functions_green_2020.pdf
        Pages 100 - 103 */

//https://www.mdpi.com/1099-4300/23/1/86/htm

/* https://basesandframes.files.wordpress.com/2020/04/even_faster_math_functions_green_2020.pdf
        Pages 100 - 103 */

//https://www.mdpi.com/1099-4300/23/1/86/htm

/* !defined(SIMDE_ARM_NEON_RSQRTE_H) */

/* :: End simde/simde/arm/neon/rsqrte.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rsqrts.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2021      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_RSQRTS_H) */

/* :: End simde/simde/arm/neon/rsqrts.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rsra_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* Remark: For these instructions
 *    1 <= n     <= data element size in bits
 * so 0 <= n - 1 <  data element size in bits
 */

/* !defined(SIMDE_ARM_NEON_RSRA_N_H) */

/* :: End simde/simde/arm/neon/rsra_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rsubhn.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_RSUBHN_H) */

/* :: End simde/simde/arm/neon/rsubhn.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/rsubhn_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_RSUBHN_HIGH_H) */

/* :: End simde/simde/arm/neon/rsubhn_high.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/set_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_SET_LANE_H) */

/* :: End simde/simde/arm/neon/set_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/sha1.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_SHA1_H) */

/* :: End simde/simde/arm/neon/sha1.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/sha256.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_SHA256_H) */

/* :: End simde/simde/arm/neon/sha256.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/sha512.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_SHA512_H) */

/* :: End simde/simde/arm/neon/sha512.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/shl.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* Notes from the implementer (Christopher Moore aka rosbif)
 *
 * I have tried to exactly reproduce the documented behaviour of the
 * ARM NEON shl and shlq intrinsics.
 * This is complicated for the following reasons:-
 *
 * a) Negative shift counts shift right.
 *
 * b) Only the low byte of the shift count is used but the shift count
 * is not limited to 8-bit values (-128 to 127).
 *
 * c) Intel SIMD is not nearly as complete as NEON and AltiVec.
 * There were no intrisics with a vector shift count before AVX2 which
 * only has 32 and 64-bit logical ones and only a 32-bit arithmetic
 * one. The others need AVX512. There are no 8-bit shift intrinsics at
 * all, even with a scalar shift count. It is surprising to use AVX2
 * and even AVX512 to implement a 64-bit vector operation.
 *
 * d) Many shift implementations, and the C standard, do not treat a
 * shift count >= the object's size in bits as one would expect.
 * (Personally I feel that > is silly but == can be useful.)
 *
 * Maybe it would be useful for SIMDe to have a flag enabling a fast
 * implementation where the result is only guaranteed for shift counts
 * conforming to the C standard.
 *
 * Note that even the C17/18 standard does not define the behaviour of
 * a right shift of a negative value.
 * However Evan and I agree that all compilers likely to be used
 * implement this as an arithmetic right shift with sign extension.
 * If this is not the case it could be replaced by a logical right shift
 * if negative values are complemented before and after the shift.
 *
 * Some of the SIMD translations may be slower than the portable code,
 * particularly those for vectors with only one or two elements.
 * But I had fun writing them ;-)
 *
 */

/* !defined(SIMDE_ARM_NEON_SHL_H) */

/* :: End simde/simde/arm/neon/shl.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/shll_high_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/*
 * The constant range requirements for the shift amount *n* looks strange.
 * The ARM Neon Intrinsics Reference states that for *_s8, 0 << n << 7. This
 * does not match the actual instruction decoding in the ARM Reference manual,
 * which states that the shift amount "must be equal to the source element width
 * in bits" (ARM DDI 0487F.b C7-1959). So for *_s8 instructions, *n* must be 8,
 * for *_s16, it must be 16, and *_s32 must be 32 (similarly for unsigned).
 */

/* !defined(SIMDE_ARM_NEON_SHLL_HIGH_N_H) */

/* :: End simde/simde/arm/neon/shll_high_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/shll_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/*
 * The constant range requirements for the shift amount *n* looks strange.
 * The ARM Neon Intrinsics Reference states that for *_s8, 0 << n << 7. This
 * does not match the actual instruction decoding in the ARM Reference manual,
 * which states that the shift amount "must be equal to the source element width
 * in bits" (ARM DDI 0487F.b C7-1959). So for *_s8 instructions, *n* must be 8,
 * for *_s16, it must be 16, and *_s32 must be 32 (similarly for unsigned).
 */

/* !defined(SIMDE_ARM_NEON_SHLL_N_H) */

/* :: End simde/simde/arm/neon/shll_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/shrn_high_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/shrn_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_SHRN_N_H) */

/* :: End simde/simde/arm/neon/shrn_n.h :: */

/* !defined(SIMDE_ARM_NEON_SHRN_HIGH_N_H) */

/* :: End simde/simde/arm/neon/shrn_high_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/sli_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_SLI_N_H) */

/* :: End simde/simde/arm/neon/sli_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/sm3.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_SM3_H) */

/* :: End simde/simde/arm/neon/sm3.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/sm4.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_SM4_H) */

/* :: End simde/simde/arm/neon/sm4.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/sqadd.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Atharva Nimbalkar <atharvakn@gmail.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

// Workaround on ARM64 windows due to windows SDK bug

// https://developercommunity.visualstudio.com/t/In-arm64_neonh-vsqaddb_u8-vsqaddh_u16/10271747?sort=newest

/* !defined(SIMDE_ARM_NEON_SQADD_H) */

/* :: End simde/simde/arm/neon/sqadd.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/sqrt.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_SQRT_H) */

/* :: End simde/simde/arm/neon/sqrt.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/sra_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_SRA_N_H) */

/* :: End simde/simde/arm/neon/sra_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/sri_n.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2021      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_SRI_N_H) */

/* :: End simde/simde/arm/neon/sri_n.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/st1.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_TARGET_NOT_SUPPORT_INT128_TYPE) */

/* !defined(SIMDE_ARM_NEON_ST1_H) */

/* :: End simde/simde/arm/neon/st1.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/st1_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_ST1_LANE_H) */

/* :: End simde/simde/arm/neon/st1_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/st1_x2.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2021      Décio Luiz Gazzoni Filho <decio@decpp.net>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_ST1_X2_H) */

/* :: End simde/simde/arm/neon/st1_x2.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/st1_x3.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2021      Décio Luiz Gazzoni Filho <decio@decpp.net>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_ST1_X3_H) */

/* :: End simde/simde/arm/neon/st1_x3.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/st1_x4.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2021      Décio Luiz Gazzoni Filho <decio@decpp.net>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_ST1_X4_H) */

/* :: End simde/simde/arm/neon/st1_x4.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/st1q_x2.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_ST1Q_X2_H) */

/* :: End simde/simde/arm/neon/st1q_x2.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/st1q_x3.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_ST1Q_X3_H) */

/* :: End simde/simde/arm/neon/st1q_x3.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/st1q_x4.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2021      Décio Luiz Gazzoni Filho <decio@decpp.net>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_ST1Q_X4_H) */

/* :: End simde/simde/arm/neon/st1q_x4.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/st2.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/zip.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/zip1.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_ZIP1_H) */

/* :: End simde/simde/arm/neon/zip1.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/zip2.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_ZIP2_H) */

/* :: End simde/simde/arm/neon/zip2.h :: */

/* !defined(SIMDE_ARM_NEON_ZIP_H) */

/* :: End simde/simde/arm/neon/zip.h :: */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_ST2_H) */

/* :: End simde/simde/arm/neon/st2.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/st2_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_ST2_LANE_H) */

/* :: End simde/simde/arm/neon/st2_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/st3.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

// r0 = [a0, b0, a6, a1, b1, a7, a2, b2, a8, a3, b3, a9, a4, b4, a10, a5]

// m0 = [a0, b0, c0, a1, b1, c1, a2, b2, c2, a3, b3, c3, a4, b4, c4, a5]

// r1 = [b5, c5, b11, b6, c6, b12, b7, c7, b13, b8, c8, b14, b9, c9, b15,

// b10]

// m1 = [b5, c5, a6, b6, c6, a7, b7, c7, a8, b8, c8, a9, b9, c9, a10, b10]

// r2 = [c10, a11, X, c11, a12, X, c12, a13, X, c13, a14, X, c14, a15, X,

// c15]

// m2 = [c10, a11, b11, c11, a12, b12, c12, a13, b13, c13, a14, b14, c14,

// a15, b15, c15]

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_ST3_H) */

/* :: End simde/simde/arm/neon/st3.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/st3_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

//SIMDE_REQUIRE_CONSTANT_RANGE(lane, 0, 1) {

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_ST3_LANE_H) */

/* :: End simde/simde/arm/neon/st3_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/st4.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 *   2023      Chi-Wei Chu <wewe5215@gapp.nthu.edu.tw> (Copyright owned by NTHU pllab)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_ST4_H) */

/* :: End simde/simde/arm/neon/st4.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/st4_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Evan Nemerson <evan@nemerson.com>
 *   2021      Zhi An Ng <zhin@google.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_ST4_LANE_H) */

/* :: End simde/simde/arm/neon/st4_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/subhn.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_SUBHN_H) */

/* :: End simde/simde/arm/neon/subhn.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/subhn_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_SUBHN_HIGH_H) */

/* :: End simde/simde/arm/neon/subhn_high.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/subl_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Décio Luiz Gazzoni Filho <decio@decpp.net>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_SUBL_HIGH_H) */

/* :: End simde/simde/arm/neon/subl_high.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/subw.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_SUBW_H) */

/* :: End simde/simde/arm/neon/subw.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/subw_high.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_SUBW_HIGH_H) */

/* :: End simde/simde/arm/neon/subw_high.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/sudot_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_SUDOT_LANE_H) */

/* :: End simde/simde/arm/neon/sudot_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/tbl.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_TBL_H) */

/* :: End simde/simde/arm/neon/tbl.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/tbx.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Christopher Moore <moore@free.fr>
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_BUG_INTEL_857088) */

/* !defined(SIMDE_ARM_NEON_TBX_H) */

/* :: End simde/simde/arm/neon/tbx.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/trn.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/trn1.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_TRN1_H) */

/* :: End simde/simde/arm/neon/trn1.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/trn2.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 *   2020      Sean Maher <seanptmaher@gmail.com> (Copyright owned by Google, LLC)
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_TRN2_H) */

/* :: End simde/simde/arm/neon/trn2.h :: */

/* !defined(SIMDE_ARM_NEON_TRN_H) */

/* :: End simde/simde/arm/neon/trn.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/uqadd.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2020      Evan Nemerson <evan@nemerson.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

// Workaround on ARM64 windows due to windows SDK bug

// https://developercommunity.visualstudio.com/t/In-arm64_neonh-vsqaddb_u8-vsqaddh_u16/10271747?sort=newest

/* TODO: I suspect there is room for improvement here.  This is
     * just the first thing that worked, and I don't feel like messing
     * with it now. */

/* !defined(SIMDE_ARM_NEON_UQADD_H) */

/* :: End simde/simde/arm/neon/uqadd.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/usdot.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_USDOT_H) */

/* :: End simde/simde/arm/neon/usdot.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/usdot_lane.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2023      Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology)
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_USDOT_LANE_H) */

/* :: End simde/simde/arm/neon/usdot_lane.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* :: Begin simde/simde/arm/neon/xar.h :: */

/* SPDX-License-Identifier: MIT
 *
 * 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.
 *
 * Copyright:
 *   2021      Atharva Nimbalkar <atharvakn@gmail.com>
 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* !defined(SIMDE_ARM_NEON_XAR_H) */

/* :: End simde/simde/arm/neon/xar.h :: */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */

/* 71fd833d9666141edcd1d3c109a80e228303d8d7 */

/* SIMDE_ARM_NEON_H */

/* :: End simde/simde/arm/neon.h :: */


=== system/include/compat/avx2intrin.h ===
SHA256: ac704abbc60147b9bdad6487752ed87c590b447bb759591d517abc4abd81a4ff
/*
 * Copyright 2024 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

/* __emscripten_avx2intrin_h__ */


=== system/include/compat/avxintrin.h ===
SHA256: b1b1096f0bca3ab3aee0df8900af75f65b6705f14d5e846e339deabc759c1637
/*
 * Copyright 2020 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Do nothing

// when porting any assembly code that would have calls to these functions

// around, that assembly code in the first place will not compile.

// Do nothing

// when porting any assembly code that would have calls to these functions

// around, that assembly code in the first place will not compile.

// This may cause an out-of-bounds memory load since we first load and

// then mask, but since there are no segmentation faults in Wasm memory

// accesses, that is ok (as long as we are within the heap bounds -

// a negligible limitation in practice)

// This may cause an out-of-bounds memory load since we first load and

// then mask, but since there are no segmentation faults in Wasm memory

// accesses, that is ok (as long as we are within the heap bounds -

// a negligible limitation in practice)

/* __emscripten_avxintrin_h__ */


=== system/include/compat/emmintrin.h ===
SHA256: ca357b61aa173bd5e617bc0b149c0165b57d21210787eeff5367175dfe63c947
/*
 * Copyright 2020 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Alias different (functionally) equivalent intrinsics.

//  return (__m128d)wasm_f32x4_pmin((v128_t)__a, (v128_t)__b); // TODO: Migrate to this, once it works in VMs

//  return (__m128)wasm_f32x4_pmax((v128_t)__a, (v128_t)__b); // TODO: Migrate to this, once it works in VMs

// TODO: OPTIMIZE!

// TODO: OPTIMIZE!

// TODO: OPTIMIZE!

// Use the trapping instruction here since we have explicit bounds checks

// above.

// TODO: OPTIMIZE!

// Use the trapping instruction here since we have explicit bounds checks

// above.

// aligned load

// TODO: optimize

// TODO: optimize

// TODO: optimize

// Use the trapping instruction here since we have explicit bounds checks

// above

// TODO: optimize

// TODO: optimize

// Use the trapping instruction here since we have explicit bounds checks

// above.

// UB-free unaligned access copied from wasm_simd128.h

// UB-free unaligned access copied from wasm_simd128.h

// TODO: optimize

// Emscripten/SIMD.js does not have cache hinting.

// Emscripten/SIMD.js does not have cache hinting.

// No cache hinting available.

// No cache hinting available.

// Wasm SIMD does not have cache hinting

// Wasm/SharedArrayBuffer has only a full barrier instruction, which gives a stronger guarantee.

// Wasm/SharedArrayBuffer has only a full barrier instruction, which gives a stronger guarantee.

// No pause/wait instruction in Wasm/SIMD.

// Must be in the very end as it uses other SSE2 intrinsics

/* __emscripten_emmintrin_h__ */


=== system/include/compat/immintrin.h ===
SHA256: bc3e199d420918b4f2f4a632907594a0a47b704e3592c95bdda84482fffe1590
/*
 * Copyright 2020 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

/* __emscripten_immintrin_h__ */


=== system/include/compat/malloc.h ===
SHA256: ffd88719371583d2866f20cc285ce48f5c03a23b4d4be1796a2cf1363bdaf5ab
/* This version of struct mallinfo must match the one in
   system/lib/dlmalloc.c.  */

/* total space allocated from system */

/* number of non-inuse chunks */

/* unused -- always zero */

/* number of mmapped regions */

/* total space in mmapped regions */

/* unused -- always zero */

/* unused -- always zero */

/* total allocated space */

/* total non-inuse space */

/* top-most, releasable (via malloc_trim) space */

/* The routines.  */

/* mallopt options */

/* _COMPAT_MALLOC_H_ */


=== system/include/compat/math.h ===
SHA256: 4e014c8d3ada95dca4ea31ed403f0b11998e5c8ad462e6321de5579ad8aad7e0
/* _COMPAT_MATH_H_ */


=== system/include/compat/netdb.h ===
SHA256: 7bdcecbcf00e1ae16bfc17e348e3fca2c84eca627bd374bf70b15e03fe002871
/* The musl includes only define these things for old sources or
   when certain flags are activated. We want these available
   all of the time for now. */

/* _COMPAT_NETDB_H_ */


=== system/include/compat/nmmintrin.h ===
SHA256: a4af1cdcf40486f96abb7107ae9c14f1cb734e55af2141cc84f081806453f98b
/*
 * Copyright 2020 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Unsupported functions:

// _mm_cmpestra

// _mm_cmpestrc

// _mm_cmpestri

// _mm_cmpestrm

// _mm_cmpestro

// _mm_cmpestrs

// _mm_cmpestrz

// _mm_cmpistra

// _mm_cmpistrc

// _mm_cmpistri

// _mm_cmpistrm

// _mm_cmpistro

// _mm_cmpistrs

// _mm_cmpistrz

// _mm_crc32_u16

// _mm_crc32_u32

// _mm_crc32_u64

// _mm_crc32_u8

/* __emscripten_nmmintrin_h__ */


=== system/include/compat/pmmintrin.h ===
SHA256: a516eeb25fb87467c9758fcd7fecc3fc4f6c2acdb05284dd9a5e819b3d36fd60
/*
 * Copyright 2020 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Unavailable functions:

// #define _MM_SET_DENORMALS_ZERO_MODE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_DENORMALS_ZERO_MASK) | (x)))

// void _mm_monitor(void const *__p, unsigned __extensions, unsigned __hints);

// void _mm_mwait(unsigned __extensions, unsigned __hints);

/* __emscripten_pmmintrin_h__ */


=== system/include/compat/smmintrin.h ===
SHA256: 7b7b7f1d0754c2366903b2cf224e56f409ff70d7e73a3921042b0fcbb0d53ac3
/*
 * Copyright 2020 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// For rint and rintf

// _MM_FROUND_TO_NEAREST_INT and _MM_FROUND_CUR_DIRECTION (which is always nearest in Wasm SIMD)

// SSE implements "Banker's rounding", where even half-ways, e.g. 2.5 are rounded down,

// and odd numbers e.g. 3.5 are rounded up.

// _MM_FROUND_TO_NEAREST_INT and _MM_FROUND_CUR_DIRECTION (which is always nearest in Wasm SIMD)

// SSE implements "Banker's rounding", where even half-ways, e.g. 2.5 are rounded down,

// and odd numbers e.g. 3.5 are rounded up.

// Clang and GCC compatibility: Both Clang and GCC include SSE4.2 headers from SSE4.1 headers

/* __emscripten_smmintrin_h__ */


=== system/include/compat/sys/random.h ===
SHA256: f0d66fa30d374276f29e5bf69dd0d8a6c1f46b0388ada2d7c6e96c1d5472e73c
// This is used by libc++ as an efficient way to get high-quality random data

// (more efficiently than via the filesystem using /dev/urandom).

// Upstream musl added support for this, so we can switch to that, but it isn't

// where libc++ looks for it (which is here and not unistd.h), and it uses a

// syscall which is unnecessary indirection for us.


=== system/include/compat/sys/timeb.h ===
SHA256: 3847c14f09f156fb435fe8564bba49fab2e9a12724b481c480d4a57d08e74afe
/* timeb.h -- An implementation of the standard Unix <sys/timeb.h> file.
   Written by Ian Lance Taylor <ian@cygnus.com>
   Public domain; no rights reserved.

   <sys/timeb.h> declares the structure used by the ftime function, as
   well as the ftime function itself.  Newlib does not provide an
   implementation of ftime.  */

/* ! defined (_SYS_TIMEB_H) */


=== system/include/compat/tmmintrin.h ===
SHA256: dee25e8b78bc72d0151dc2465c4ce0bc2961a0c8c1bf360bab7c6ef8d448a35d
/*
 * Copyright 2020 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Unavailable functions:

// _mm_abs_pi8

// _mm_abs_pi16

// _mm_abs_pi32

// _mm_alignr_pi8

// _mm_hadd_pi16

// _mm_hadd_pi32

// _mm_hadds_pi16

// _mm_hsub_pi16

// _mm_hsub_pi32

// _mm_hsubs_pi16

// _mm_maddubs_pi16

// _mm_mulhrs_pi16

// _mm_shuffle_pi8

// _mm_sign_pi8

// _mm_sign_pi16

// _mm_sign_pi32

/* __emscripten_tmmintrin_h__ */


=== system/include/compat/xlocale.h ===
SHA256: bae1b0e50773d95b7ba290e6e1ffd233f739e9e870801ccaa7e80c8dc80b1399
/* _COMPAT_XLOCALE_H_ */


=== system/include/compat/xmmintrin.h ===
SHA256: 9d3ebd5ec58e07bc97a788cd0ef21559adcbbc5f11bb779eb1864f45f8d167b9
/*
 * Copyright 2020 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Emscripten SIMD support doesn't support MMX/float32x2/__m64.

// However, we support loading and storing 2-vectors, so

// recognize the type at least.

// This is defined as a macro because __builtin_shufflevector requires its

// mask argument to be a compile-time constant.

/*__m64*/

/*__m64*/

// No NTA cache hint available.

// No prefetch available, dummy it out.

// Wasm/SharedArrayBuffer memory model is sequentially consistent.

// Perhaps a future version of the spec can provide a related fence.

//  return (__m128)wasm_f32x4_pmin((v128_t)__a, (v128_t)__b); // TODO: Migrate to this, once it works in VMs

//  return (__m128)wasm_f32x4_pmax((v128_t)__a, (v128_t)__b); // TODO: Migrate to this, once it works in VMs

// Unavailable functions:

// void _MM_SET_EXCEPTION_STATE(unsigned int __a);

// void _MM_SET_EXCEPTION_MASK(unsigned int __a);

// void _MM_GET_ROUNDING_MODE(unsigned int __a);

// void _MM_GET_FLUSH_ZERO_MODE(unsigned int __a);

/* __emscripten_xmmintrin_h__ */


=== system/include/emscripten/atomic.h ===
SHA256: 6139513bdd7bc18fa1f600165d565623e0daaa845835c3d1e55c5a438293aca0
/*
 * Copyright 2015 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Note on 64bit atomics ops: All 64-bit atomic ops defined here, while single

// instruction under wasm, will be emulated by using locks in wasm2js mode.

// This is also true for C/C++ native atomics as well as intrinsics.

// Atomically stores the given value to the memory location, and returns the

// value that was there prior to the store.

/*uint8_t*/

/*uint16_t*/

/*uint32_t*/

/*uint64_t*/

// CAS returns the *old* value that was in the memory location before the

// operation took place.

// That is, if the return value when calling this function equals to 'oldVal',

// then the operation succeeded, otherwise it was ignored.

/*uint8_t*/

/*uint16_t*/

/*uint32_t*/

/*uint64_t*/

/*uint8_t*/

/*uint16_t*/

/*uint32_t*/

/*float*/

/*uint64_t*/

/*double*/

// Returns the value that was stored (i.e. 'val')

/*uint8_t*/

/*uint16_t*/

/*uint32_t*/

/*float*/

/*uint64_t*/

/*double*/

// Each of the functions below (add, sub, and, or, xor) return the value that

// was in the memory location before the operation occurred.

/*uint8_t*/

/*uint16_t*/

/*uint32_t*/

/*uint64_t*/

/*uint8_t*/

/*uint16_t*/

/*uint32_t*/

/*uint64_t*/

/*uint8_t*/

/*uint16_t*/

/*uint32_t*/

/*uint64_t*/

/*uint8_t*/

/*uint16_t*/

/*uint32_t*/

/*uint64_t*/

/*uint8_t*/

/*uint16_t*/

/*uint32_t*/

/*uint64_t*/

// Fake a fence with an arbitrary atomic operation

// Numbering dictated by https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wait

// Issues the wasm 'memory.atomic.wait32' instruction:

// If the given memory address contains value 'expectedValue', puts the calling

// thread to sleep to wait for that address to be notified.

// Returns one of the ATOMICS_WAIT_* return codes.

// NOTE: This function takes in the wait value in int64_t nanosecond units. Pass

// in maxWaitNanoseconds = -1 (or ATOMICS_WAIT_DURATION_INFINITE) to wait

// infinitely long.

// NOTE: This function is thin wrapper around the Wasm atomic.wait instruction

// and therefore cannot be used on the main browser thread, or in Audio Worklets.

// If you need a wait primitive that works everywhere you can use

// `emscripten_futex_wait`.

/*uint32_t*/

// Issues the wasm 'memory.atomic.wait64' instruction:

// If the given memory address contains value 'expectedValue', puts the calling

// thread to sleep to wait for that address to be notified.

// Returns one of the ATOMICS_WAIT_* return codes.

// NOTE: This function takes in the wait value in int64_t nanosecond units. Pass

// in maxWaitNanoseconds = -1 (or ATOMICS_WAIT_DURATION_INFINITE) to wait

// infinitely long.

// NOTE: This function is thin wrapper around the Wasm atomic.wait instruction

// and therefore cannot be used on the main browser thread, or in Audio Worklets.

// If you need a wait primitive that works everywhere you can use

// `emscripten_futex_wait`.

/*uint64_t*/

// Issues the wasm 'memory.atomic.notify' instruction:

// Notifies the given number of threads waiting on a location.

// Pass count == EMSCRIPTEN_NOTIFY_ALL_WAITERS to notify all waiters on the

// given location.

// Returns the number of threads that were woken up.

// Note: this function is used to notify both waiters waiting on an u32 and u64

// addresses.

// Represents a pending 'Atomics.waitAsync' wait operation.

// Issues the JavaScript 'Atomics.waitAsync' instruction:

// performs an asynchronous wait operation on the main thread. If the given

// 'addr' contains 'value', issues a deferred wait that will invoke the

// specified callback function 'asyncWaitFinished' once that address has been

// notified by another thread.

// NOTE: Unlike functions emscripten_atomic_wait_u32() and

// emscripten_atomic_wait_u64() which take in the wait timeout parameter as int64

// nanosecond units, this function takes in the wait timeout parameter as double

// millisecond units. See https://github.com/WebAssembly/threads/issues/175 for

// more information.

// Pass in maxWaitMilliseconds == EMSCRIPTEN_WAIT_ASYNC_INFINITY

// (==__builtin_inf()) to wait infinitely long.

// Returns one of:

//  - ATOMICS_WAIT_NOT_EQUAL if the waitAsync operation could not be registered

//    since the memory value did not contain the value 'value'.

//  - ATOMICS_WAIT_TIMED_OUT if the waitAsync operation timeout parameter was <= 0.

//  - Any other value: denotes a 'wait token' that can be passed to function

//    emscripten_atomic_cancel_wait_async() to unregister an asynchronous wait.

//    You can use the macro EMSCRIPTEN_IS_VALID_WAIT_TOKEN(retval) to check if

//    this function returned a valid wait token.

// Unregisters a pending Atomics.waitAsync operation that was established via a

// call to emscripten_atomic_wait_async() in the calling thread. Pass in the

// wait token handle that was received as the return value from the wait

// function.  Returns EMSCRIPTEN_RESULT_SUCCESS if the cancellation was

// successful, or EMSCRIPTEN_RESULT_INVALID_PARAM if the asynchronous wait has

// already resolved prior and the callback has already been called.

// NOTE: Because of needing to work around issue

// https://github.com/WebAssembly/threads/issues/176, calling this function has

// an effect of introducing spurious wakeups to any other threads waiting on the

// same address that the async wait denoted by the token does. This means that

// in order to safely use this function, the mechanisms used in any wait code on

// that address must be written to be spurious wakeup safe. (this is the case

// for all the synchronization primitives declared in this header, but if you

// are rolling out your own, you need to be aware of this). If

// https://github.com/tc39/proposal-cancellation/issues/29 is resolved, then the

// spurious wakeups can be avoided.

// Cancels all pending async waits in the calling thread. Because of

// https://github.com/WebAssembly/threads/issues/176, if you are using

// asynchronous waits in your application, and need to be able to let GC reclaim

// Wasm heap memory when deinitializing an application, you *must* call this

// function to help the GC unpin all necessary memory.  Otherwise, you can wrap

// the Wasm content in an iframe and unload the iframe to let GC occur.

// (navigating away from the page or closing that tab will also naturally

// reclaim the memory)

// Cancels all pending async waits in the calling thread to the given memory

// address.  Returns the number of async waits canceled.

// Returns the value of the expression "Atomics.isLockFree(byteWidth)": true if

// the given memory access width can be accessed atomically, and false

// otherwise. Generally will return true on 1, 2 and 4 byte accesses. On 8 byte

// accesses, behavior differs across browsers, see

//  - https://bugzil.la/1246139

//  - https://bugs.chromium.org/p/chromium/issues/detail?id=1167449


=== system/include/emscripten/bind.h ===
SHA256: 713c884df1ed72470b4049765b56c02ad4602776fe5eebde438c515e18442a0c
/*
 * Copyright 2012 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Implemented in JavaScript.  Don't call these directly.

// Register an InitFunc in the global linked list of init functions.

// Binding initialization functions registered by EMSCRIPTEN_BINDINGS macro

// below.  Stored as linked list of static data object avoiding std containers

// to avoid static constructor ordering issues.

// This calls the function immediately upon construction, and also registers

// it so that it can be called again on each worker that starts.

// end extern "C"

// end namespace internal

////////////////////////////////////////////////////////////////////////////////

// select_overload and select_const

////////////////////////////////////////////////////////////////////////////////

// this should be in <type_traits>, but alas, it's not

// end namespace internal

// requires captureless lambda because implicitly coerces to function pointer

////////////////////////////////////////////////////////////////////////////////

// Invoker

////////////////////////////////////////////////////////////////////////////////

// end namespace internal

////////////////////////////////////////////////////////////////////////////////

// SignatureCode, SignatureString

////////////////////////////////////////////////////////////////////////////////

// TODO: this is a historical default, but we should probably use 'p' instead,

// and only enable it for smart_ptr_trait<> descendants.

// end namespace internal

////////////////////////////////////////////////////////////////////////////////

// FUNCTIONS

////////////////////////////////////////////////////////////////////////////////

// TODO: This could do a reinterpret-cast if sizeof(T) === sizeof(void*)

// not a leak because this is called once per binding

// end namespace internal

////////////////////////////////////////////////////////////////////////////////

// VALUE TUPLES

////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////

// VALUE STRUCTS

////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////

// SMART POINTERS

////////////////////////////////////////////////////////////////////////////////

// no sharing

// specialize if you have a different pointer type

// eventually we'll need to support emptied out val

////////////////////////////////////////////////////////////////////////////////

// CLASSES

////////////////////////////////////////////////////////////////////////////////

// end namespace internal

// abstract classes

// NOTE: this returns the class type, not the pointer type

// end namespace internal

// end namespace internal

////////////////////////////////////////////////////////////////////////////

// RegisterClassConstructor

////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////

// RegisterClassMethod

////////////////////////////////////////////////////////////////////////////

// Helper structs for shifting argument indices when a policy is applied.

// end namespace internal

// Prevent the template from wrongly matching the getter function

// overload.

// Prevent the template from wrongly matching the getter function

// overload.

// Prevent the template from wrongly matching the getter/setter overload

// of this function.

// Similar to the other variadic property overloads this can greedily

// match the wrong overload so we need to ensure the setter is not a

// policy argument.

// XXX: This currently applies all the policies (including return value policies) to the

// setter function argument to allow pointers. Using return value policies doesn't really

// make sense on an argument, but we don't have separate argument policies yet.

// Optional types are automatically registered for some internal types so

// only run the register method once so we don't conflict with a user's

// bindings if they also register the optional type.

////////////////////////////////////////////////////////////////////////////////

// VECTORS

////////////////////////////////////////////////////////////////////////////////

// end namespace internal

////////////////////////////////////////////////////////////////////////////////

// MAPS

////////////////////////////////////////////////////////////////////////////////

// end namespace internal

////////////////////////////////////////////////////////////////////////////////

// ENUMS

////////////////////////////////////////////////////////////////////////////////

// TODO: there's still an issue here.

// if EnumType is an unsigned long, then JS may receive it as a signed long

////////////////////////////////////////////////////////////////////////////////

// CONSTANTS

////////////////////////////////////////////////////////////////////////////////

// EMSCRIPTEN_BINDINGS creates a static struct to initialize the binding which

// will get included in the program if the translation unit in which it is

// defined gets linked into the program. Using a C++ constructor here ensures it

// occurs after any other C++ constructors in this file, which is not true for

// __attribute__((constructor)) (they run before C++ constructors in the same

// file).

// end namespace emscripten


=== system/include/emscripten/console.h ===
SHA256: 8419a7d7d0284aa5a09d35488573a4e71b31a13f71a498aeec09bebda83f5343
/*
 * Copyright 2021 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// for size_t

// Write directly to the JavaScript console.  This can be useful for debugging since it

// bypasses the stdio and filesystem sub-systems.

// Write to the out(), err() and dbg() JS functions directly.

// These are defined in shell.js and have different behavior compared

// to console.log/err.  Under node, they write to stdout and stderr which is a

// more direct way to write output especially from worker threads.  The default

// behavior of these functions can be overridden by print and printErr, if

// provided on the Module object.  These functions are mainly intended for

// internal use.

// Same as above but only with the length of string specified by the second

// argument.  This allows for non-NULL-terminated strings to be passed.

// Legacy/internal names for the above

// Similar to the above functions but operate with printf-like semantics.

// Legacy/internal names for the above


=== system/include/emscripten/dom_pk_codes.h ===
SHA256: 0bcd6a59b6102453ed03a9fd94e517afbc57ffd5fa49e15a764a5bb64bd3845e
/*
 * Copyright 2018 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 *
 * This file was automatically generated from script
 * tools/maint/create_dom_pk_codes.py. Edit that file to make changes here.
 * Then run:
 *
 *   tools/maint/create_dom_pk_codes.py
 *
 * in Emscripten root directory to regenerate this file.
 */

/* "Unidentified"       */

/* "Escape"             */

/* "Digit0"             */

/* "Digit1"             */

/* "Digit2"             */

/* "Digit3"             */

/* "Digit4"             */

/* "Digit5"             */

/* "Digit6"             */

/* "Digit7"             */

/* "Digit8"             */

/* "Digit9"             */

/* "Minus"              */

/* "Equal"              */

/* "Backspace"          */

/* "Tab"                */

/* "KeyQ"               */

/* "KeyW"               */

/* "KeyE"               */

/* "KeyR"               */

/* "KeyT"               */

/* "KeyY"               */

/* "KeyU"               */

/* "KeyI"               */

/* "KeyO"               */

/* "KeyP"               */

/* "BracketLeft"        */

/* "BracketRight"       */

/* "Enter"              */

/* "ControlLeft"        */

/* "KeyA"               */

/* "KeyS"               */

/* "KeyD"               */

/* "KeyF"               */

/* "KeyG"               */

/* "KeyH"               */

/* "KeyJ"               */

/* "KeyK"               */

/* "KeyL"               */

/* "Semicolon"          */

/* "Quote"              */

/* "Backquote"          */

/* "ShiftLeft"          */

/* "Backslash"          */

/* "KeyZ"               */

/* "KeyX"               */

/* "KeyC"               */

/* "KeyV"               */

/* "KeyB"               */

/* "KeyN"               */

/* "KeyM"               */

/* "Comma"              */

/* "Period"             */

/* "Slash"              */

/* "ShiftRight"         */

/* "NumpadMultiply"     */

/* "AltLeft"            */

/* "Space"              */

/* "CapsLock"           */

/* "F1"                 */

/* "F2"                 */

/* "F3"                 */

/* "F4"                 */

/* "F5"                 */

/* "F6"                 */

/* "F7"                 */

/* "F8"                 */

/* "F9"                 */

/* "F10"                */

/* "Pause"              */

/* "ScrollLock"         */

/* "Numpad7"            */

/* "Numpad8"            */

/* "Numpad9"            */

/* "NumpadSubtract"     */

/* "Numpad4"            */

/* "Numpad5"            */

/* "Numpad6"            */

/* "NumpadAdd"          */

/* "Numpad1"            */

/* "Numpad2"            */

/* "Numpad3"            */

/* "Numpad0"            */

/* "NumpadDecimal"      */

/* "PrintScreen"        */

/* "IntlBackslash"      */

/* "F11"                */

/* "F12"                */

/* "NumpadEqual"        */

/* "F13"                */

/* "F14"                */

/* "F15"                */

/* "F16"                */

/* "F17"                */

/* "F18"                */

/* "F19"                */

/* "F20"                */

/* "F21"                */

/* "F22"                */

/* "F23"                */

/* "KanaMode"           */

/* "Lang2"              */

/* "Lang1"              */

/* "IntlRo"             */

/* "F24"                */

/* "Convert"            */

/* "NonConvert"         */

/* "IntlYen"            */

/* "NumpadComma"        */

/* "Paste"              */

/* "MediaTrackPrevious" */

/* "Cut"                */

/* "Copy"               */

/* "MediaTrackNext"     */

/* "NumpadEnter"        */

/* "ControlRight"       */

/* "AudioVolumeMute"    */

/* "VolumeMute"         */

/* "LaunchApp2"         */

/* "MediaPlayPause"     */

/* "MediaStop"          */

/* "Eject"              */

/* "AudioVolumeDown"    */

/* "VolumeDown"         */

/* "AudioVolumeUp"      */

/* "VolumeUp"           */

/* "BrowserHome"        */

/* "NumpadDivide"       */

/* "AltRight"           */

/* "Help"               */

/* "NumLock"            */

/* "Home"               */

/* "ArrowUp"            */

/* "PageUp"             */

/* "ArrowLeft"          */

/* "ArrowRight"         */

/* "End"                */

/* "ArrowDown"          */

/* "PageDown"           */

/* "Insert"             */

/* "Delete"             */

/* "MetaLeft"           */

/* "OSLeft"             */

/* "MetaRight"          */

/* "OSRight"            */

/* "ContextMenu"        */

/* "Power"              */

/* "BrowserSearch"      */

/* "BrowserFavorites"   */

/* "BrowserRefresh"     */

/* "BrowserStop"        */

/* "BrowserForward"     */

/* "BrowserBack"        */

/* "LaunchApp1"         */

/* "LaunchMail"         */

/* "LaunchMediaPlayer"  */

/* "MediaSelect"        */

/* Maps the EmscriptenKeyboardEvent::code field from emscripten/html5.h to one of the DOM_PK codes above. */

/* Returns the string representation of the given key code ID. Useful for debug printing. */


=== system/include/emscripten/em_asm.h ===
SHA256: b1abd1db490734c0a834150380d0a10d7bfb53e3b91a3238cbab643d13e5d08d
/*
 * Copyright 2017 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// __cplusplus

// You can use these functions by passing format string to arg_sigs.

// Note that `code` requires you to provide a const C string known at compile

// time, otherwise the "unable to find data for ASM/EM_JS const" error will be

// thrown.

// https://github.com/WebAssembly/binaryen/blob/51c8f2469f8fd05197b7694c65041b1567f2c6b5/src/wasm/wasm-emscripten.cpp#L183

// C++ needs the nothrow attribute so -O0 doesn't lower these calls as invokes.

// __cplusplus

// EM_ASM does not work in strict C mode.

// In wasm backend, we need to call the emscripten_asm_const_* functions with

// the C vararg calling convention, because we will call it with a variety of

// arguments, but need to generate a coherent import for the wasm module before

// binaryen can run over it to fix up any calls to emscripten_asm_const_*.  In

// order to read from a vararg buffer, we need to know the signatures to read.

// We can use compile-time trickery to generate a format string, and read that

// in JS in order to correctly handle the vararg buffer.

// We can use the generic selection C11 feature (that clang supports pre-C11

// as an extension) to emulate function overloading in C.

// All other types, including *all* pointer types go through the default case

// This indirection is needed to allow us to concatenate computed results, e.g.

//   #define BAR(N) _EM_ASM_CONCATENATE(FOO_, N)

//   BAR(3) // rewritten to BAR_3

// whereas using ## or _EM_ASM_CONCATENATE_ directly would result in BAR_N

// Counts arguments. We use $$ as a sentinel value to enable using ##__VA_ARGS__

// which omits a comma in the event that we have 0 arguments passed, which is

// necessary to keep the count correct.

// Find the corresponding char for each argument.

// We lead with commas to avoid adding an extra comma in the 0-argument case.

// __cplusplus

// C++ needs to support vararg template parameter packs, e.g. like in

// test/core/test_em_asm_parameter_pack.cpp. Because of that, a macro-only

// approach doesn't work (a macro applied to a parameter pack would expand

// incorrectly). So we can use a template class instead to build a temporary

// buffer of characters.

// As emscripten is required to build successfully with -std=c++03, we cannot

// use std::tuple or std::integral_constant. Using C++11 features is only a

// warning in modern Clang, which are ignored in system headers.

// Explicit support for enums, they're passed as int via variadic arguments.

// Instead of std::tuple

// Instead of std::make_tuple

// We move to type level with decltype(make_tuple(...)) to avoid double

// evaluation of arguments. Use __typeof__ instead of decltype, though,

// because the header should be able to compile with clang's -std=c++03.

// __cplusplus

// Note: If the code block in the EM_ASM() family of functions below contains a

// comma, then wrap the whole code block inside parentheses (). See

// test/core/test_em_asm_2.cpp for example code snippets.

// Runs the given JavaScript code on the calling thread (synchronously), and

// returns no value back.

// Runs the given JavaScript code on the calling thread (synchronously), and

// returns an i32 back.

// Runs the given JavaScript code on the calling thread (synchronously), and

// returns an pointer back.

// On wasm32 this is the same as emscripten_asm_const_int but on wasm64 it

// returns an i64.

// Runs the given JavaScript code on the calling thread (synchronously), and

// returns a double back.

// Runs the given JavaScript code synchronously on the main browser thread, and

// returns no value back.

// Call this function for example to access DOM elements in a pthread when

// building with -pthread.

// Avoid calling this function in performance sensitive code, because this will

// effectively sleep the calling thread until the main browser thread is able to

// service the proxied function call. If you have multiple MAIN_THREAD_EM_ASM()

// code blocks to call in succession, it will likely be much faster to coalesce

// all the calls to a single MAIN_THREAD_EM_ASM() block. If you do not need

// synchronization nor a return value back, consider using the function

// MAIN_THREAD_ASYNC_EM_ASM() instead, which will not block.

// In single-threaded builds (including proxy-to-worker), MAIN_THREAD_EM_ASM*()

// functions are direct aliases to the corresponding EM_ASM*() family of

// functions.

// Runs the given JavaScript code synchronously on the main browser thread, and

// returns an integer back.

// The same considerations apply as with MAIN_THREAD_EM_ASM().

// Runs the given JavaScript code synchronously on the main browser thread, and

// returns an pointer back.

// The same considerations apply as with MAIN_THREAD_EM_ASM().

// On wasm32 this is the same as emscripten_asm_const_int but on wasm64 it

// returns an i64.

// Runs the given JavaScript code synchronously on the main browser thread, and

// returns a double back.

// The same considerations apply as with MAIN_THREAD_EM_ASM().

// Asynchronously dispatches the given JavaScript code to be run on the main

// browser thread.

// If the calling thread is the main browser thread, then the specified

// JavaScript code is executed synchronously. Otherwise an event will be queued

// on the main browser thread to execute the call later (think postMessage()),

// and this call will immediately return without waiting. Be sure to guard any

// accesses to shared memory on the heap inside the JavaScript code with

// appropriate locking.

// Old forms for compatibility, no need to use these.

// Replace EM_ASM_, EM_ASM_ARGS and EM_ASM_INT_V with EM_ASM_INT,

// and EM_ASM_DOUBLE_V with EM_ASM_DOUBLE.

// Normally macros like `true` and `false` are not expanded inside

// of `EM_JS` or `EM_ASM` blocks.  However, in the case then an

// additional macro later is added these will be expanded and we want

// to make sure the resulting expansion doesn't break the expectations

// of JS code

// These work for both C and javascript.

// In C !!0 ==> 0 and in javascript !!0 ==> false

// In C !!1 ==> 1 and in javascript !!1 ==> true

// !defined(__cplusplus) && defined(__STRICT_ANSI__)


=== system/include/emscripten/em_js.h ===
SHA256: 36e396b1a5616eb1f23a5aab003dd45e857ef6c83e2e026ac0104229b7ca52a1
/*
 * Copyright 2018 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// EM_JS declares JS functions in C code.

// Example uses can be found in test/core/test_em_js.cpp

// Implementation details:

// The EM_JS macro is specified as:

//   EM_JS(return type, function name, (arguments), {body})

// but the macro uses __VA_ARGS__ instead of a fourth argument. This is so that

// function bodies containing commas are seamlessly handled.

// EM_JS declares the JS function with a C function prototype, which becomes a

// function import in wasm. It also declares an __em_js__-prefixed string constant,

// which we can use to pass information to the Emscripten compiler that survives

// going through LLVM.

// Example:

//

//   EM_JS(int, foo, (int x, int y), { return 2 * x + y; })

//

// would get translated into:

//

//   __attribute__((import_name("foo"))) int foo(int x, int y);

//

//   __attribute__((used)) static void* __em_js_ref_foo = (void*)&foo;

//

//   __attribute__((used, visibility("default")))

//   char __em_js__foo[] = "(int x, int y)<::>{ return 2 * x + y; }";

//

// We pack the arguments and function body into a constant string so it's

// readable during wasm post-processing.

// Later we see an export called __em_js__foo, meaning we need to create a JS

// function:

//   function foo(x, y) { return 2 * x + y; }

// We use <::> to separate the arguments from the function body because it isn't

// valid anywhere in a C function declaration.

// The __em_js_ref_foo pointer simply exists in order to force a reference to

// `foo` to exist in the object file, even if there are no other local uses.

// This means the linker will always use the import_name attribute for this

// function even if it is not locally used.

// Generated __em_js__-prefixed symbols are read by binaryen, and the string

// data is extracted into the Emscripten metadata dictionary under the

// "emJsFuncs" key. emJsFuncs itself is a dictionary where the keys are function

// names (not prefixed with __em_js__), and the values are the <::>-including

// description strings.

// emJsFuncs metadata is read in emscripten.py's create_em_js, which creates an

// array of JS function strings to be included in the JS output.

// Normally macros like `true` and `false` are not expanded inside

// of `EM_JS` or `EM_ASM` blocks.  However, in the case when an

// additional macro later is added these will be expanded and we want

// to make sure the resulting expansion doesn't break the expectations

// of JS code

// These work for both C and javascript.

// In C !!0 ==> 0 and in javascript !!0 ==> false

// In C !!1 ==> 1 and in javascript !!1 ==> true


=== system/include/emscripten/em_macros.h ===
SHA256: 2fb1dac0626934fef12ed844e4825a6021482cabcc6af2fd38877aba3376beea
/*
 * Copyright 2020 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// __cplusplus

// __cplusplus

/*
 * EM_JS_DEPS: Use this macro to declare indirect dependencies on JS symbols.
 * The first argument is just a unique name for the set of dependencies.  The
 * second argument is a C string that lists JS library symbols in the same way
 * they would be specified in the DEFAULT_LIBRARY_FUNCS_TO_INCLUDE command line
 * setting.
 *
 * For example, if your code contains an EM_ASM or EM_JS block that make use of
 * the allocate and stackSave JS library functions then you might write this in
 * your library source code:
 *
 *   EM_JS_DEPS(mylib_dep, "$allocate,$stackSave");
 *
 * The emscripten linker will then pick this up and make sure those symbols get
 * included in the JS support library.
 *
 * Dependencies declared in this way will be included if-and-only-if the object
 * file (translation unit) in which they exist is included by the linker, so
 * it makes sense co-locate them with the EM_JS or EM_ASM code they correspond
 * to.
 */


=== system/include/emscripten/em_math.h ===
SHA256: f9912b156241a8fd3a696b4ef925d6cef35dffaa1136287b444bb5f3168b8bbc
/*
 * Copyright 2020 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

/**
 * This file contains C functions to access the JavaScript Math API via Emscripten.
 * Please note that accessing these functions is relatively slow, since they each
 * incur a language boundary crossing call from WebAssembly out to JavaScript.

 * These functions are best used in scenarios where small code size is more desirable
 * than performance.

 * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math
 * for details. */

// The following operations have very fast WebAssembly opcodes. Therefore they are not

// exposed as individual functions:

// Math.abs(x) -> f32.abs and f64.abs. (use fabsf() and fabs() from math.h)

// Math.ceil -> f32.ceil and f64.ceil (ceil() and ceilf() in math.h)

// Math.clz32(x) -> i32.clz and i64.clz (call __builtin_clz() and __builtin_clzll())

// Math.floor -> f32.floor and f64.floor (floor() and floorf() in math.h)

// Math.fround -> f64.promote_f32(f32.demote_f64()) (double d = (double)(float)someDouble;)

// Math.imul(x, y) -> i32.mul and i64.mul (directly multiply two signed integers)

// Math.min -> f32.min and f64.min (fminf() and fmin() in math.h)

// Math.max -> f32.max and f64.max (fmaxf() and fmax() in math.h)

// Math.trunc -> f32.trunc and f64.trunc (truncf() and trunc() in math.h)

// The following constants are available on the JS Math object, mirrored here for convenience.

// The following Math operations do not have native WebAssembly opcodes, and

// are provided here as small sized alternatives to their libc counterparts.

// acos() in math.h

// acosh() in math.h

// asin() in math.h

// asinh() in math.h

// atan() in math.h

// atan2() in math.h

// atanh() in math.h

// cbrt() in math.h

// cos() in math.h

// cosh() in math.h

// exp() in math.h

// expm1() in math.h

// fmod() in math.h, not a function on Math, but calls JS "x % y" operator.

// hypot() in math.h (although only for fixed 2 arguments)

// log() in math.h

// log1p() in math.h

// log10() in math.h

// log2() in math.h

// pow(x, y) in math.h

// N.b. emscripten_random() in emscripten.h returns a single-precision float!

// round() in math.h

// No equivalent in libc

// sin() in math.h

// sinh() in math.h

// sqrt() in math.h

// tan() in math.h

// tanh() in math.h


=== system/include/emscripten/em_types.h ===
SHA256: bc3ae71ad08f1ae0c987d7efec0fbc7eaa2d4c504ee113fadb0025013c912d57
/*
 * Copyright 2012 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

/* Typedefs */

/* Legacy EM_BOOL type. Emscripten no longer uses this */


=== system/include/emscripten/emmalloc.h ===
SHA256: 018d3fb45e17f3d0a9f2edcdab7f5b3be2479e193f38e076d72bf970418ee427
// emmalloc: A lightweight web-friendly memory allocator suitable for very small applications.

// Enable the usage of emmalloc by passing the linker flag -sMALLOC=emmalloc to the application.

// A debug function that dumps the whole structure of malloc internal memory blocks to console.

// *extremely slow*, use for debugging allocation test cases.

// Allocates size bytes with the given pow-2 alignment. If the WebAssembly memory runs out of

// free bytes, this function will abort execution, or if building with -sABORTING_MALLOC=0,

// return a null pointer.

// Allocates size bytes with default alignment (8 bytes). Like above, either aborts or returns

// null on OOM.

// Returns the number of bytes that are actually allocated to the given pointer ptr.

// E.g. due to alignment or size requirements, the actual size of the allocation can be

// larger than what was requested. It is ok to pass a null pointer to these functions, in which

// case 0 will be returned.

// Frees a memory pointer allocated with any of the memory allocation functions declared

// in this file, e.g.

// (emmalloc_)memalign, (emmalloc_)malloc, (emmalloc_)calloc, aligned_alloc,

// (emmalloc_)realloc, emmalloc_realloc_try, emmalloc_realloc_uninitialized, (emmalloc_)aligned_realloc

// It is ok to pass null in ptr, which will be a no-op.

// Performs a reallocation of the given memory pointer to a new size. If the memory region

// pointed by ptr cannot be resized in place, a new memory region will be allocated, old

// memory copied over, and the old memory area freed. The pointer ptr must have been

// allocated with one of the emmalloc memory allocation functions (malloc, memalign, ...).

// If called with size == 0, the pointer ptr is freed, and a null pointer is returned.

// If called with null ptr, a new pointer is allocated.

// If there is not enough memory, the old memory block is not freed and null pointer is

// returned.

// emmalloc_realloc_try() is like realloc(), but only attempts to try to resize the existing

// memory area. If resizing the existing memory area fails, then realloc_try() will return 0

// (the original memory block is not freed or modified). If resizing succeeds, previous

// memory contents will be valid up to min(old length, new length) bytes.

// If a null pointer is passed, no allocation is attempted but the function will return 0.

// If zero size is passed, the function will behave like free().

// emmalloc_realloc_uninitialized() is like realloc(), but old memory contents

// will be undefined after reallocation. (old memory is not preserved in any case)

// Like realloc(), but allows specifying the alignment to allocate to. This function cannot

// be used to change the alignment of an existing allocation, but the original pointer should

// be aligned to the given alignment already.

// emmalloc_aligned_realloc_uninitialized() is like aligned_realloc(), but old memory contents

// will be undefined after reallocation. (old memory is not preserved in any case)

// posix_memalign allocates memory with a given alignment, like memalign, but with a slightly

// different usage signature.

// calloc allocates memory that is initialized to zero.

// mallinfo() returns information about current emmalloc allocation state. This function

// is very slow, only good for debugging. Avoid calling it for "routine" diagnostics.

// malloc_trim() returns unused dynamic memory back to the WebAssembly heap. Returns 1 if it

// actually freed any memory, and 0 if not. Note: this function does not release memory back to

// the system, but it only marks memory held by emmalloc back to unused state for other users

// of sbrk() to claim.

// Validates the consistency of the malloc heap. Returns non-zero and prints an error to console

// if memory map is corrupt. Returns 0 (and does not print anything) if memory is intact.

// Computes the size of the dynamic memory region governed by emmalloc. This represents the

// amount of memory that emmalloc has sbrk()ed in for itself to manage. Use this function

// for memory statistics tracking purposes. Calling this function is quite fast, practically

// O(1) time.

// Computes the amount of memory currently reserved under emmalloc's governance  that is free

// for the application to allocate. Use this function for memory statistics tracking purposes.

// Note that calling this function is very slow, as it walks through each free memory block in

// linear time.

// Estimates the amount of untapped memory that emmalloc could expand its dynamic memory area

// via sbrk()ing. Theoretically the maximum amount of memory that can still be malloc()ed can

// be calculated via emmalloc_free_dynamic_memory() + emmalloc_unclaimed_heap_memory().

// Calling this function is very fast constant time lookup.

// Computes a detailed fragmentation map of available free memory. Pass in a pointer to a

// 32 element long array. This function populates into each array index i the number of free

// memory regions that have a size 2^i <= size < 2^(i+1), and returns the total number of

// free memory regions (the sum of the array entries). This function runs very slowly, as it

// iterates through all free memory blocks.

// Same as above, but instead of returning the information in an array, prints it directly

// to stdout.


=== system/include/emscripten/emscripten.h ===
SHA256: 6650ff82f88bd07786188a95cdf3bd27aaaa5ec6982d0727d8eae0e390c48d6e
/*
 * Copyright 2012 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

/**
 * This file contains a few useful things for compiling C/C++ code
 * with Emscripten.
 *
 * Documentation for the public APIs defined in this file must be updated in: 
 *    site/source/docs/api_reference/emscripten.h.rst
 * A prebuilt local version of the documentation is available at: 
 *    site/build/text/docs/api_reference/emscripten.h.txt
 * You can also build docs locally as HTML or other formats in site/
 * An online HTML version (which may be of a different version of Emscripten)
 *    is up at http://kripken.github.io/emscripten-site/docs/api_reference/emscripten.h.html
 */

// Pass a null pointer to skip receiving that particular value

// IDB

// IDB "sync"

// other async utilities

// show an error on some renamed methods

// worker APIs

// misc.

// Returns the value of -sASYNCIFY.  Can be 0, 1, or 2 (in the case of JSPI).

// Forward declare FILE from musl libc headers to avoid needing to #include <stdio.h> from emscripten.h

// deprecated

// deprecated

// Asynchronous version of dlopen.  Since WebAssembly module loading in general

// is asynchronous the normal dlopen function can't be used in all situations.

// Promisified version of emscripten_dlopen

// The returned promise will resolve once the dso has been loaded.  It's up to

// the caller to call emscripten_promise_destroy on this promise.

/* ===================================== */

/* Internal APIs. Be careful with these. */

/* ===================================== */


=== system/include/emscripten/eventloop.h ===
SHA256: 0fd970768575a93bd540ed0b9ab29713e3a3945caf8e984f3ef507d22f03ab7a
/*
 * Copyright 2021 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */


=== system/include/emscripten/exports.h ===
SHA256: b86cca73fbaf078d1fd5d2a8e99991e18e5bfda5d15f164136499046b6947866
/*
 * Copyright 2012 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// API that gives access to the function exports of a Wasm module. Build with

// -lexports.js to use this API.

// Returns a function pointer to the given exported function by name. Cast the returned pointer

// to its proper signature before calling the function.


=== system/include/emscripten/fetch.h ===
SHA256: f12eb0daae1b3af6025cf5f927cfd811f593fceebc9f0d86ee75c326b36ae295
/*
 * Copyright 2016 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Emscripten fetch attributes:

// If passed, the body of the request will be present in full in the onsuccess()

// handler.

// If passed, the intermediate streamed bytes will be passed in to the

// onprogress() handler. If not specified, the onprogress() handler will still

// be called, but without data bytes.  Note: Firefox only as it depends on

// 'moz-chunked-arraybuffer'.

// If passed, the final download will be stored in IndexedDB. If not specified,

// the file will only reside in browser memory.

// Looks up if the file already exists in IndexedDB, and if so, it is returned

// without redownload. If a partial transfer exists in IndexedDB, the download

// will resume from where it left off and run to completion.

// EMSCRIPTEN_FETCH_APPEND, EMSCRIPTEN_FETCH_REPLACE and

// EMSCRIPTEN_FETCH_NO_DOWNLOAD are mutually exclusive.  If none of these three

// flags is specified, the fetch operation is implicitly treated as if

// EMSCRIPTEN_FETCH_APPEND had been passed.

// If the file already exists in IndexedDB, the old file will be deleted and a

// new download is started.

// EMSCRIPTEN_FETCH_APPEND, EMSCRIPTEN_FETCH_REPLACE and

// EMSCRIPTEN_FETCH_NO_DOWNLOAD are mutually exclusive.  If you would like to

// perform an XHR that neither reads or writes to IndexedDB, pass this flag

// EMSCRIPTEN_FETCH_REPLACE, and do not pass the flag

// EMSCRIPTEN_FETCH_PERSIST_FILE.

// If specified, the file will only be looked up in IndexedDB, but if it does

// not exist, it is not attempted to be downloaded over the network but an error

// is raised.

// EMSCRIPTEN_FETCH_APPEND, EMSCRIPTEN_FETCH_REPLACE and

// EMSCRIPTEN_FETCH_NO_DOWNLOAD are mutually exclusive.

// If specified, emscripten_fetch() will synchronously run to completion before

// returning.  The callback handlers will be called from within

// emscripten_fetch() while the operation is in progress.

// Specifies the parameters for a newly initiated fetch operation.

// 'POST', 'GET', etc.

// Custom data that can be tagged along the process.

// EMSCRIPTEN_FETCH_* attributes

// Specifies the amount of time the request can take before failing due to a

// timeout.

// Indicates whether cross-site access control requests should be made using

// credentials.

// Specifies the destination path in IndexedDB where to store the downloaded

// content body. If this is empty, the transfer is not stored to IndexedDB at

// all.  Note that this struct does not contain space to hold this string, it

// only carries a pointer.

// Calling emscripten_fetch() will make an internal copy of this string.

// Specifies the authentication username to use for the request, if necessary.

// Note that this struct does not contain space to hold this string, it only

// carries a pointer.

// Calling emscripten_fetch() will make an internal copy of this string.

// Specifies the authentication username to use for the request, if necessary.

// Note that this struct does not contain space to hold this string, it only

// carries a pointer.

// Calling emscripten_fetch() will make an internal copy of this string.

// Points to an array of strings to pass custom headers to the request. This

// array takes the form

// {"key1", "value1", "key2", "value2", "key3", "value3", ..., 0 }; Note

// especially that the array needs to be terminated with a null pointer.

// Pass a custom MIME type here to force the browser to treat the received

// data with the given type.

// If non-zero, specifies a pointer to the data that is to be passed as the

// body (payload) of the request that is being performed. Leave as zero if no

// request body needs to be sent.  The memory pointed to by this field is

// provided by the user, and needs to be valid throughout the duration of the

// fetch operation. If passing a non-zero pointer into this field, make sure

// to implement *both* the onsuccess and onerror handlers to be notified when

// the fetch finishes to know when this memory block can be freed. Do not pass

// a pointer to memory on the stack or other temporary area here.

// Specifies the length of the buffer pointed by 'requestData'. Leave as 0 if

// no request body needs to be sent.

// Unique identifier for this fetch in progress.

// Custom data that can be tagged along the process.

// The remote URL set in the original request.

// In onsuccess() handler:

//   - If the EMSCRIPTEN_FETCH_LOAD_TO_MEMORY attribute was specified for the

//     transfer, this points to the body of the downloaded data. Otherwise

//     this will be null.

// In onprogress() handler:

//   - If the EMSCRIPTEN_FETCH_STREAM_DATA attribute was specified for the

//     transfer, this points to a partial chunk of bytes related to the

//     transfer. Otherwise this will be null.

// The data buffer provided here has identical lifetime with the

// emscripten_fetch_t object itself, and is freed by calling

// emscripten_fetch_close() on the emscripten_fetch_t pointer.

// Specifies the length of the above data block in bytes. When the download

// finishes, this field will be valid even if EMSCRIPTEN_FETCH_LOAD_TO_MEMORY

// was not specified.

// If EMSCRIPTEN_FETCH_STREAM_DATA is being performed, this indicates the byte

// offset from the start of the stream that the data block specifies. (for

// onprogress() streaming XHR transfer, the number of bytes downloaded so far

// before this chunk)

// Specifies the total number of bytes that the response body will be.

// Note: This field may be zero, if the server does not report the

// Content-Length field.

// Specifies the readyState of the XHR request:

// 0: UNSENT: request not sent yet

// 1: OPENED: emscripten_fetch has been called.

// 2: HEADERS_RECEIVED: emscripten_fetch has been called, and headers and

//    status are available.

// 3: LOADING: download in progress.

// 4: DONE: download finished.

// See https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState

// Specifies the status code of the response.

// Specifies a human-readable form of the status code.

// For internal use only.

// The response URL set by the fetch. It will be null until HEADERS_RECEIVED

// readyState in async, or until completion in sync.

// Clears the fields of an emscripten_fetch_attr_t structure to their default

// values in a future-compatible manner.

// Initiates a new Emscripten fetch operation, which downloads data from the

// given URL or from IndexedDB database.

// Closes a finished or an executing fetch operation and frees up all memory. If

// the fetch operation was still executing, the onerror() handler will be called

// in the calling thread before this function returns.

// Gets the size (in bytes) of the response headers as plain text.

// This must be called on the same thread as the fetch originated on.

// Note that this will return 0 if readyState < HEADERS_RECEIVED.

// Gets the response headers as plain text. dstSizeBytes should be

// headers_length + 1 (for the null terminator).

// This must be called on the same thread as the fetch originated on.

// Converts the plain text headers into an array of strings. This array takes

// the form {"key1", "value1", "key2", "value2", "key3", "value3", ..., 0 };

// Note especially that the array is terminated with a null pointer.

// This frees the memory used by the array of headers. Call this when finished

// with the data returned by emscripten_fetch_unpack_response_headers.


=== system/include/emscripten/fiber.h ===
SHA256: 1b8a3fdef50627784ec9cf4eadc0420e235fe3761e42fc6f07c0f48ae3cedffb
/*
 * Copyright 2019 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

/** Current position in the Asyncify stack (*not* the C stack) */

/** Where the Asyncify stack ends. */

/** Interned ID of the rewind entry point; opaque to application. */

/** Where the C stack starts (NOTE: grows down). */

/** Where the C stack ends. */

/** Current position in the C stack. */

/** Function to call when resuming this context. If NULL, asyncify_data is used to rewind the call stack. */

/** Opaque pointer, passed as-is to the entry function. */


=== system/include/emscripten/heap.h ===
SHA256: c7ae99c29f94b6a2ea803c7e7e790e87e7078460980e2a68db98a8be7ee8fbde
/*
 * Copyright 2020 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Returns a pointer to a memory location that contains the current sbrk

// location (which marks the end of the dynamic memory region used for malloc,

// etc).

// Attempts to geometrically or linearly increase the size of the WebAssembly

// memory (referred to as heap for legacy reason) so that its new size is at

// least `requested_size` bytes. The size may be overallocated, see

// src/settings.js variables MEMORY_GROWTH_GEOMETRIC_STEP,

// MEMORY_GROWTH_GEOMETRIC_CAP and MEMORY_GROWTH_LINEAR_STEP. This function

// cannot be used to shrink the size of the memory.

// Returns true on success, false otherwise.

// Returns the current size of the WebAssembly memory (referred to as heap for

// legacy reason).

// Returns the max size of the WebAssembly memory (referred to as heap for

// legacy reason).

// Direct access to the system allocator.  Use these to access that underlying

// allocator when intercepting/wrapping the allocator API.  Works with both

// dlmalloc and emmalloc.


=== system/include/emscripten/html5.h ===
SHA256: 14ca03a479844cb0b5fbb15f2a00c3764cc7c96fb37120a4f7e87befcf14b402
/*
 * Copyright 2014 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Include eventloop.h, console.h and html5_webgl.h for compat with older

// version of this header that used to define these functions.

/*
 * This file defines Emscripten low-level glue bindings for interfacing with HTML5 APIs
 *
 * Documentation for the public APIs defined in this file must be updated in:
 *    site/source/docs/api_reference/html5.h.rst
 * You can also build docs locally as HTML or other formats in site/
 * An online HTML version (which may be of a different version of Emscripten)
 *    is up at http://kripken.github.io/emscripten-site/docs/api_reference/html5.h.html
 */

// canvasX and canvasY are deprecated - there no longer exists a Module['canvas'] object, so canvasX/Y are no longer reported (register a listener on canvas directly to get canvas coordinates, or translate manually)

// canvasX and canvasY are deprecated - there no longer exists a Module['canvas'] object, so canvasX/Y are no longer reported (register a listener on canvas directly to get canvas coordinates, or translate manually)

// Sets the canvas.width & canvas.height properties.

// Returns the canvas.width & canvas.height properties.

// Legacy name for EM_CALLBACK_THREAD_CONTEXT_MAIN_RUNTIME_THREAD

// ~extern "C"


=== system/include/emscripten/html5_webgl.h ===
SHA256: b946c14a9a1f2ac9717f5d5f84c04d84e40c7cc2701ad456102e3b1c7e1cd21a
/*
 * Copyright 2020 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Returns function pointers to WebGL 1 functions. Please avoid using this function ever - all WebGL1/GLES2 functions, even those for WebGL1 extensions, are available to user code via static linking. Calling GL functions

// via function pointers obtained here is slow, and using this function can greatly increase resulting compiled program size. This functionality is available only for easier program code porting purposes, but be aware

// that calling this is causing a noticeable performance and compiled code size hit.

// Returns function pointers to WebGL 2 functions. Please avoid using this function ever - all WebGL2/GLES3 functions, even those for WebGL2 extensions, are available to user code via static linking. Calling GL functions

// via function pointers obtained here is slow, and using this function can greatly increase resulting compiled program size. This functionality is available only for easier program code porting purposes, but be aware

// that calling this is causing a noticeable performance and compiled code size hit.

// Combines emscripten_webgl1_get_proc_address() and emscripten_webgl2_get_proc_address() to return function pointers to both WebGL1 and WebGL2 functions. Same drawbacks apply.

// Calls GLctx.getSupportedExtensions():

// Returns a newly allocated string that contains all supported WebGL extensions by the currently active WebGL context,

// separated by a space character ' '. Call free() to deallocate the string.

// Calls GLctx.getShaderParameter():

// Returns a parameter of a WebGL shader as a double.

// Call this function only for values of 'param' that return a Number type.

// Calls GLctx.getShaderInfoLog():

// Returns a newly allocated string that contains the shader info log of the given shader. Call free() to deallocate the string.

// Calls GLctx.getShaderSource():

// Returns a newly allocated string that contains the shader source the given shader. Call free() to deallocate the string.

// Calls GLctx.getProgramParameter():

// Returns a parameter of a WebGL shader program as a double.

// Call this function only for values of 'param' that return a Number type.

// Calls GLctx.getProgramInfoLog():

// Returns a newly allocated string that contains the info log of the given program. Call free() to deallocate the string.

// Calls GLctx.getVertexAttrib():

// Returns the given vertex attribute as a double.

// Call this function only for values of 'param' that return a Number type.

// Calls GLctx.getVertexAttrib():

// Returns the WebGL object name bound to the given vertex attribute.

// Call this function only for values of 'param' that return a WebGL object type.

// Calls GLctx.getVertexAttrib():

// Gets an array of currently active vertex attributes.

// Call this function only for values of 'param' that return an array of types.

// Use dstType to specify whether to read an array of ints or floats.

// The function writes at most dstLength array elements to array dst.

// The actual length of the state array is returned (not the number of elements written)

// Calls GLctx.getUniform():

// Returns the value of a uniform set in a program in the given location.

// Call this function only for scalar uniform types. (float and int)

// Calls GLctx.getUniform():

// Gets an array set to a uniform in a program in the given location.

// Call this function only for array uniform types. (vec2, ivec2 and so on)

// Use dstType to specify whether to read in ints or floats.

// The function writes at most dstLength array elements to array dst.

// The actual length of the state array is returned (not the number of elements written)

// Calls GLctx.getParameter():

// Gets an array of state set to the active WebGL context.

// Call this function only for values of 'param' that return an array of types.

// Use dstType to specify whether to read in ints or floats.

// The function writes at most dstLength array elements to array dst.

// The actual length of the state array is returned (not the number of elements written)

// Calls GLctx.getParameter():

// Returns the given WebGL context state as double.

// Call this function only for values of 'param' that return a Number type.

// Calls GLctx.getParameter():

// Returns the WebGL object name bound to the given WebGL context state binding point.

// Call this function only for values of 'param' that return a WebGL object type.

// Calls GLctx.getParameter():

// Returns a newly allocated string containing the WebGL state associated with the given parameter.

// Call free() to deallocate the string.

// Call this function only for values of 'param' that return a WebGL string type.

// Calls GLctx.getParameter():

// Returns the given WebGL context state as GLint64, written to the given heap location.

// Call this function only for values of 'param' that return a WebGL Number type.

// ~extern "C"


=== system/include/emscripten/key_codes.h ===
SHA256: 1f951fd8d9d00909a3e80d35e37015f17545cb3e67f9ab6e083ca4876264a37d
/*
 * Copyright 2017 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// The following are definitions of "virtual" key codes from

// https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode

// In keydown and keyup events, the EmscriptenKeyboardEvent::keyCode field

// has one of these values. In keypress events, the keyCode field may no

// longer be present.

// ~extern "C"


=== system/include/emscripten/promise.h ===
SHA256: 04a794dc4a3fa6c127057b4e4cd784ace14012eb0410785231767440467cd5a8
/*
 * Copyright 2023 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// EXPERIMENTAL AND SUBJECT TO CHANGE!

// An opaque handle to a JS Promise object.

// A callback passed to `emscripten_promise_then` to be invoked once a promise

// is fulfilled or rejected. `data` is arbitrary user-provided data provided

// when `emscripten_promise_then` is called to install the callback and `value`

// is the value the promise was fulfilled or rejected with.

//

// The callback can signal how to resolve the new promise returned from

// `emscripten_promise_then` via its return and by writing a new result to

// outparam `result`. The behavior depends on the returned `em_promise_result_t`

// value:

//

//  - `EM_PROMISE_FULFILL`: The new promise is fulfilled with the value written

//    to `result` or NULL if no value is written.

//

//  - `EM_PROMISE_MATCH` or `EM_PROMISE_MATCH_RELEASE`: The callback must write

//    a promise handle to `result` and the new promise is resolved to match the

//    eventual state of that promise. `EM_PROMISE_MATCH_RELEASE` will also cause

//    the written promise handle to be destroyed so that the user does not have

//    to arrange for it to be destroyed after the callback is executed.

//

//  - `EM_PROMISE_REJECT`: The new promise is rejected with the reason written

//    to `result` or NULL if no reason is written.

//

// If the callback throws a number (or bigint in the case of memory64), the new

// promise will be rejected with that number converted to a pointer as its

// rejection reason. If the callback throws any other value, the new promise

// will be rejected with a NULL rejection reason.

// Create a new promise that can be explicitly resolved or rejected using

// `emscripten_promise_resolve`. The returned promise handle must eventually be

// freed with `emscripten_promise_destroy`.

// Release the resources associated with this promise. This must be called on

// every promise handle created, whether by `emscripten_promise_create` or any

// other function that returns a fresh promise, such as

// `emscripten_promise_then`. It is fine to call `emscripten_promise_destroy` on

// a promise handle before the promise is resolved; the configured callbacks

// will still be called.

// Explicitly resolve the `promise` created by `emscripten_promise_create`. If

// `result` is `EM_PROMISE_FULFILL`, then the promise is fulfilled with the

// given `value`. If `result` is `EM_PROMISE_MATCH`, then the promise is

// resolved to match the eventual state of `value` interpreted as a promise

// handle. Finally, if `result` is `EM_PROMISE_REJECT`, then the promise is

// rejected with the given value. Promises not created by

// `emscripten_promise_create` should not be passed to this function.

// Install `on_fulfilled` and `on_rejected` callbacks on the given `promise`,

// creating and returning a handle to a new promise. See `em_promise_callback_t`

// for documentation on how the callbacks work. `data` is arbitrary user data

// that will be passed to the callbacks. The returned promise handle must

// eventually be freed with `emscripten_promise_destroy`.

// Call Promise.all to create and return a new promise that is either fulfilled

// once the `num_promises` input promises passed in `promises` have been

// fulfilled or is rejected once any of the input promises has been rejected.

// When the returned promise is fulfilled, the values each of the input promises

// were resolved with will be written to the `results` array if it is non-null

// and the returned promise will be fulfilled with the address of that array as

// well.

// Call Promise.allSettled to create and return a new promise that is fulfilled

// once the `num_promises` input promises passed in `promises` have been

// settled. When the returned promise is fulfilled, the `results` buffer will be

// filled with the result comprising of either EM_PROMISE_FULFILL and the

// fulfilled value or EM_PROMISE_REJECT and the rejection reason for each of the

// input promises if `results` is non-null. The returned promise will be

// fulfilled with the value of `results` as well.

// Call Promise.any to create and return a new promise that is fulfilled once

// any of the `num_promises` input promises passed in `promises` has been

// fulfilled or is rejected once all of the input promises have been rejected.

// If the returned promise is fulfilled, it will be fulfilled with the same

// value as the first fulfilled input promise. Otherwise, if the returned

// promise is rejected, the rejection reasons for each input promise will be

// written to the `errors` buffer if it is non-null. The rejection reason for

// the returned promise will also be the address of the `errors` buffer.

// Call Promise.race to create and return a new promise that settles once any of

// the `num_promises` input promises passed in `promises` has been settled. If

// the first input promise to settle is fulfilled, the resulting promise is

// fulfilled with the same value. Otherwise, if the first input promise to

// settle is rejected, the resulting promise is rejected with the same reason.

// Suspend the current Wasm execution context until the given promise has been

// settled.

//

// Since the stack is not unwound while Wasm execution is suspended, it is

// safe to pass pointers to the stack to asynchronous work that is waited on

// with this function.

//

// This function can only be used in programs that were built with `-sASYNCIFY`.


=== system/include/emscripten/proxying.h ===
SHA256: a96305ebc27f9df0904f2fd113ef8cec22873e9c61bac4ddba7d65f5f37d86d7
/*
 * Copyright 2021 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Opaque handle to a set of thread-local work queues to which work can be

// asynchronously or synchronously proxied from other threads. When work is

// proxied to a queue on a particular thread, that thread is notified to start

// processing work from that queue if it is not already doing so.

//

// Proxied work can only be completed on live thread runtimes, so users must

// ensure either that all proxied work is completed before a thread exits or

// that the thread exits with a live runtime, e.g. via

// `emscripten_exit_with_live_runtime` to avoid dropped work.

// Create and destroy proxying queues.

// Get the queue used for proxying low-level runtime work. Work on this queue

// may be processed at any time inside system functions, so it must be

// nonblocking and safe to run at any time, similar to a native signal handler.

// Execute all the tasks enqueued for the current thread on the given queue. New

// tasks that are enqueued concurrently with this execution will be executed as

// well. This function returns once it observes an empty queue.

// Opaque handle to a currently-executing proxied task, used to signal the end

// of the task.

// Signal the end of a task proxied with `emscripten_proxy_sync_with_ctx`.

// Enqueue `func` on the given queue and thread and return immediately. Returns

// true if the work was successfully enqueued and the target thread notified or

// false otherwise.

// Enqueue `func` on the given queue and thread and wait for it to finish

// executing before returning. Returns true if the task was successfully

// completed and false otherwise, including if the target thread is canceled or

// exits before the work is completed.

// Enqueue `func` on the given queue and thread and wait for it to be executed

// and for the task to be marked finished with `emscripten_proxy_finish` before

// returning. `func` need not call `emscripten_proxy_finish` itself; it could

// instead store the context pointer and call `emscripten_proxy_finish` at an

// arbitrary later time. Returns true if the task was successfully completed and

// false otherwise, including if the target thread is canceled or exits before

// the work is completed.

// Enqueue `func` on the given queue and thread. Once (and if) it finishes

// executing, it will asynchronously proxy `callback` back to the current thread

// on the same queue, or if the target thread dies before the work can be

// completed, `cancel` will be proxied back instead. All three functions will

// receive the same argument, `arg`. Returns true if `func` was successfully

// enqueued and the target thread notified or false otherwise.

// Enqueue `func` on the given queue and thread. Once (and if) it finishes the

// task by calling `emscripten_proxy_finish` on the given `em_proxying_ctx`, it

// will asynchronously proxy `callback` back to the current thread on the same

// queue, or if the target thread dies before the work can be completed,

// `cancel` will be proxied back instead. All three functions will receive the

// same argument, `arg`. Returns true if `func` was successfully enqueued and

// the target thread notified or false otherwise.

// extern "C"

// A thin C++ wrapper around the underlying C API.

// Simple wrapper around `em_proxying_ctx*` providing a `finish` method as an

// alternative to `emscripten_proxy_finish`.

// ProxyingQueue can be moved but not copied. It is not valid to call any

// methods on ProxyingQueues that have been moved out of.

// Return true if the work was successfully enqueued and false otherwise.

// Refer to the corresponding C API documentation.

// namespace emscripten

// __cplusplus < 201103L

// __cplusplus


=== system/include/emscripten/stack.h ===
SHA256: 934491226885f09bd8e814e9f6ef2bedee399b45523046ff2dbab8d9ee065f59
/*
 * Copyright 2020 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// API that gives access to introspecting the Wasm data stack.

// Returns the starting address of the stack. This is the address

// that the stack pointer would point to when no bytes are in use on the stack.

// Returns the end address of the stack. This is the address that the stack

// pointer would point to when the whole stack is in use.  (the address pointed

// to by the end is not part of the stack itself). Note that the stack grows

// down so the address returned by emscripten_stack_get_end() is smaller than

// emscripten_stack_get_base().

// Setup internal base/end values based on the initial values that were either

// set at compile time (in static linking) or instantiation time (for dynamic

// linking).

// Sets the internal values reported by emscripten_stack_get_base() and

// emscripten_stack_get_end().  This should be only used by low level libraries

// such as asyncify fibers.

// Returns the current stack pointer.

// Returns the number of free bytes left on the stack.  This is required to be

// fast so that it can be called frequently.


=== system/include/emscripten/threading.h ===
SHA256: aac9ad531b0d4e561966994a34356cb33e36df12c41b8faf4f08d4d493e2159a
/*
 * Copyright 2015 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Legacy proxying functions.  See proxying.h for the new proxying system.

// Returns true if the current runtime is able to spawn threads with shared

// memory.  If this function returns false then it will not be possible to

// create new pthreads or Wasm Workers.

// Returns the number of logical cores on the system.

// Returns true if the current thread is the thread that hosts the Emscripten

// runtime.

// Returns false on pthreads and Wasm Workers.

// Returns true if the current thread is the main browser thread.  In the case

// that the Emscripten module is started in a worker there will be no thread

// for which this returns true.

// Returns false on pthreads and Wasm Workers.

// A temporary workaround to issue

// https://github.com/emscripten-core/emscripten/issues/3495:

// Call this in the body of all lock-free atomic (cas) loops that the main

// thread might enter which don't otherwise call to any pthread api calls

// (mutexes) or C runtime functions that are considered cancellation points.

// Returns the thread ID of the thread that hosts the Emscripten runtime.

// Synchronously sleeps the calling thread for the given number of milliseconds.

// Note: Calling this on the main browser thread is _very_ _very_ bad for

// application logic throttling, because it does not save any battery, it will

// spin up the CPU at 100%, lock up the UI, printfs will not come through on web

// page or the console, and eventually it will show up the slow script dialog.

// Calling this function in a pthread (Web Worker) is fine, and a good way to go

// if you need to synchronously sleep for a specific amount of time while saving

// power.

// Note 2: This function will process the pthread-specific event queue for the

//         calling thread while sleeping, and this function also acts as a

//         cancellation point.

// Note 3: This function is enabled when targeting pthreads (SharedArrayBuffer),

//         not to be confused with

//         similarly named function emscripten_sleep(), which is intended for

//         Asyncify builds.

// Sets the name of the given thread. Pass pthread_self() as the thread ID to

// set the name of the calling thread.

// The name parameter is a UTF-8 encoded string which is truncated to 32 bytes.

// When thread profiler is not enabled (not building with --threadprofiler),

// this is a no-op.

// Gets the stored pointer to a string representing the canvases to transfer to

// the created thread.

// Specifies a comma-delimited list of canvas DOM element IDs to transfer to the

// thread to be created.

// Note: this pointer is weakly stored (not copied) to the given pthread_attr_t,

// so must be held alive until pthread_create() has been called. If 0 or "", no

// canvases are transferred.

// The special value "#canvas" denotes the element stored in Module.canvas.

// Called when blocking on the main thread. This will error if main thread

// blocking is not enabled, see ALLOW_BLOCKING_ON_MAIN_THREAD.


=== system/include/emscripten/threading_legacy.h ===
SHA256: a8d7f456893b1cb5f86b02b6d98c66daa3e79885ede8d31a4ca8d9a7fe9cb19a
/*
 * Copyright 2015 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 *
 * Legacy proxying functions.  See proxying.h for the new proxying system.
 */

// Encode function signatures into a single uint32_t integer.

// N.B. This encoding scheme is internal to the implementation, and can change

// in the future. Do not depend on the exact numbers in this scheme.

// Proxied JS function can support a few more arguments than proxied C/C++

// functions, because the dispatch is variadic and signature independent.

// The encoding scheme is as follows:

// - highest three bits identify the type of the return value

// - next highest four bits specify the number of input parameters to the

//   function (allowed values are 0-12, inclusively)

// - starting from the lowest bits upwards, each pair of two subsequent bits

//   specifies the type of an input parameter.

//   That is, bits 1:0 encode the type of the first input, bits 3:2 encode the

//   type of the second input, and so on.

// Extra types used in WebGL glGet*() calls (not used in proxying)

// In total, the above encoding scheme gives the following 32-bit structure for

// the proxied function signatures (highest -> lowest bit order):

// RRRiiiiSbbaa99887766554433221100

// where RRR is return type

// iiii is the number of inputs

// S denotes a special function (internal proxying mechanism for functions

// related to built-in threading APIs, like thread creation itself)

// 00-bb encode the type of up to 12 function parameters

// There are some built-in special proxied functions, that embed the signatures

// inside the above encoding scheme

// Runs the given function synchronously on the main Emscripten runtime thread.

// If this thread is the main thread, the operation is immediately performed,

// and the result is returned.

// If the current thread is not the main Emscripten runtime thread (but a

// pthread), the function

// will be proxied to be called by the main thread.

//  - Calling emscripten_sync_* functions requires that the application was

//    compiled with pthreads support enabled (-pthread) and that the

//    browser supports SharedArrayBuffer specification.

// The 'async' variant of the run_in_main_thread functions are otherwise the

// same as the synchronous ones, except that the operation is performed in a

// fire and forget manner. The call is placed to the command queue of the main

// Emscripten runtime thread, but its completion is not waited for. As a result,

// if the function did have a return value, the return value is not received.

//  - Note that multiple asynchronous commands from a single pthread/Worker are

//    guaranteed to be executed on the main thread in the program order they

//    were called in.

// The 'async_waitable' variant of the run_in_main_runtime_thread functions run

// like the 'async' variants, except that while the operation starts off

// asynchronously, the result is then later waited upon to receive the return

// value.

//  - The object returned by this function call is dynamically allocated, and

//    should be freed up via a call to emscripten_async_waitable_close() after

//    the wait has been performed.

// Since we can't validate the function pointer type, allow implicit casting of

// functions to void* without complaining.

// For wasm64 we need to special handling of pointer (P) return types since

// int and pointer have different widths

// Runs the given function on the specified thread. If we are currently on

// that target thread then we just execute the call synchronously; otherwise it

// is queued on that thread to execute asynchronously.

// Returns 1 if it executed the code (i.e., it was on the target thread), and 0

// otherwise.

// Similar to emscripten_dispatch_to_thread, but always runs the

// function asynchronously, even if on the same thread. This is less efficient

// but may be simpler to reason about in some cases.


=== system/include/emscripten/threading_primitives.h ===
SHA256: 0ade1ccacf5588a48886c2976ae069e004133f8210238f8c8b0435dafdc1538e
/*
 * Copyright 2026 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Use with syntax "emscripten_lock_t l = EMSCRIPTEN_LOCK_T_STATIC_INITIALIZER;"

// Attempts to acquire the specified lock. If the lock is free, then this

// function acquires the lock and immediately returns true. If the lock is

// not free at the time of the call, the calling thread is set to synchronously

// sleep for at most maxWaitNanoseconds long, until another thread releases the

// lock. If the lock is acquired within that period, the function returns

// true. If the lock is not acquired within the specified period, then the

// wait times out and false is returned.

// NOTE: This function can be only called in a Worker, and not on the main

//       browser thread, because the main browser thread cannot synchronously

//       sleep to wait for locks.

// Similar to emscripten_lock_wait_acquire(), but instead of waiting for at most

// a specified timeout value, the thread will wait indefinitely long until the

// lock can be acquired.

// NOTE: The only way to abort this wait is to call

//       emscripten_terminate_wasm_worker() on the Worker.

// NOTE: This function can be only called in a Worker, and not on the main

//       browser thread, because the main browser thread cannot synchronously

//       sleep to wait for locks.

// Similar to emscripten_lock_wait_acquire(), but instead of placing the calling

// thread to sleep until the lock can be acquired, this function will burn CPU

// cycles attempting to acquire the lock, until the given timeout is met.

// This function can be called in both main thread and in Workers.

// NOTE: The wait period used for this function is specified in milliseconds

//       instead of nanoseconds, see

//       https://github.com/WebAssembly/threads/issues/175 for details.

// NOTE: If this function is called on the main thread, be sure to use a

//       reasonable max wait value, or otherwise a "slow script dialog"

//       notification can pop up, and can cause the browser to stop executing

//       the page.

// Similar to emscripten_lock_wait_acquire(), but instead of placing the calling

// thread to sleep until the lock can be acquired, this function will burn CPU

// cycles indefinitely until the given lock can be acquired.

// This function can be called in both main thread and in Workers.

// NOTE: The only way to abort this wait is to call

//       emscripten_terminate_wasm_worker() on the Worker. If called on the main

//       thread, and the lock cannot be acquired within a reasonable time

//       period, this function will *HANG* the browser page content process, and

//       show up a "slow script dialog", and/or cause the browser to stop the

//       page. If you call this function on the main browser thread, be extra

//       careful to analyze that the given lock will be extremely fast to

//       acquire without contention from other threads.

// Similar to emscripten_async_wait_callback_t but with a volatile first

// argument.

// Registers an *asynchronous* lock acquire operation. The calling thread will

// asynchronously try to obtain the given lock after the calling thread yields

// back to the event loop. If the attempt is successful within

// maxWaitMilliseconds period, then the given callback asyncWaitFinished is

// called with waitResult == ATOMICS_WAIT_OK. If the lock is not acquired within

// the timeout period, then the callback asyncWaitFinished is called with

// waitResult == ATOMICS_WAIT_TIMED_OUT.

// NOTE: Unlike function emscripten_lock_wait_acquire() which takes in the wait

// timeout parameter as int64 nanosecond units, this function takes in the wait

// timeout parameter as double millisecond units. See

// https://github.com/WebAssembly/threads/issues/175 for more information.

// NOTE: This function can be called in both main thread and in Workers.

// NOTE 2: This function will always acquire the lock asynchronously. That is,

//         the lock will only be attempted to acquire after current control flow

//         yields back to the browser, so that the Wasm call stack is empty.

//         This is to guarantee a uniform control flow. If you use this API in

//         a Worker, you cannot utilise an infinite loop programming model.

// Attempts to acquire a lock, returning true if successful. If the lock is

// already held, this function will not sleep to wait until the lock is

// released, but immediately returns false.

// This function can be called on both main thread and in Workers.

// Unlocks the specified lock for another thread to access. Note that locks are

// extremely lightweight, there is no "lock owner" tracking: this function does

// not actually check whether the calling thread owns the specified lock, but

// any thread can call this function to release a lock on behalf of whichever

// thread owns it.  This function can be called on both main thread and in

// Workers.

// Use with syntax emscripten_semaphore_t s = EMSCRIPTEN_SEMAPHORE_T_STATIC_INITIALIZER(num);

// main thread, try acquire num instances, but do not sleep to wait if not

// available.

// Returns idx that was acquired or -1 if acquire failed.

// main thread, poll to try acquire num instances. Returns idx that was

// acquired. If you use this API in Worker, you cannot run an infinite loop.

// worker, sleep to acquire num instances. Returns idx that was acquired, or -1

// if timed out unable to acquire.

// worker, sleep infinitely long to acquire num instances. Returns idx that was

// acquired.

// Releases the given number of resources back to the semaphore. Note that the

// ownership of resources is completely conceptual - there is no actual checking

// that the calling thread had previously acquired that many resources, so

// programs need to keep check of their semaphore usage consistency themselves.

// Returns how many resources were available in the semaphore before the new

// resources were released back to the semaphore. (i.e. the index where the

// resource was put back to)

// [main thread or worker]

// Condition variable is an object that can be waited on, and another thread can

// signal, while coordinating an access to a related mutex.

// Use with syntax emscripten_condvar_t cv = EMSCRIPTEN_CONDVAR_T_STATIC_INITIALIZER;

// Creates a new condition variable to the given memory location.

// Atomically performs the following:

// 1. releases the given lock. The lock should (but does not strictly need to)

//    be held by the calling thread prior to this call.

// 2. sleep the calling thread to wait for the specified condition variable to

//    be signaled.

// 3. once the sleep has finished (another thread has signaled the condition

//    variable), the calling thread wakes up and reacquires the lock prior to

//    returning from this function.

// Same as the above, except that an attempt to wait for the condition variable

// to become true is only performed for a maximum duration.

// On success (no timeout), this function will return true. If the wait times

// out, this function will return false. In this case,

// the calling thread will not try to reacquire the lock.

// Asynchronously wait for the given condition variable to signal.

// Signals the given number of waiters on the specified condition variable.

// Pass numWaitersToSignal == EMSCRIPTEN_NOTIFY_ALL_WAITERS to wake all waiters

// ("broadcast" operation).

// If the given memory address contains value val, puts the calling thread to

// sleep waiting for that address to be notified.

// Returns -EINVAL if addr is null.

/*uint32_t*/

// Wakes the given number of threads waiting on a location. Pass count ==

// INT_MAX to wake all waiters on that location.

// Returns -EINVAL if addr is null.

/*uint32_t*/


=== system/include/emscripten/trace.h ===
SHA256: 3da54341a6aed6e7234a01faf1c980f4f8388ac6644ab7cc21e23b2697cdcdf2
/*
 * Copyright 2014 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// ~extern "C"


=== system/include/emscripten/val.h ===
SHA256: 16ba45962f0d8f5b88b6760d62aa86fc1cafd0130c1612880ae403224632fbd6
/*
 * Copyright 2012 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// uintptr_t

// Implemented in JavaScript.  Don't call these directly.

// DO NOT call this more than once per signature. It will

// leak generated function objects!

// including return value

// extern "C"

// Explicit overload for size_t to prevent fallback to the 32-bit generic template

// Uses the size_t member (64-bit in Memory64)

// end namespace internal

// missing operators:

// * ~ - + ++ --

// * * / %

// * + -

// * << >> >>>

// * & ^ | && || ?:

//

// exposing void, comma, and conditional is unnecessary

// same with: = += -= *= /= %= <<= >>= >>>= &= ^= |=

// For numeric arrays, the following code is unreachable and the compiler

// will do 'dead code elimination'.

// Others fallback old way.

// for numeric types, pass memory view and copy in JS side one-off

// Note: unlike other constructors, this doesn't use as_handle() because

// it just moves a value and doesn't need to go via incref/decref.

// This means it's safe to move values across threads - an error will

// only arise if you access or free it from the wrong thread later.

// Add an explicit overload for `val&` as well.

// Without it, C++ will try to use the `T&&` constructor instead of the more

// efficient `val(const val&)` when trying to copy a `val` instance.

// Takes ownership of the handle away from, and invalidates, this instance.

// Prefer calling val::typeOf() over val::typeof(), since this form works in both C++11 and GNU++11 build modes. "typeof" is a reserved word in GNU++11 extensions.

// If code is not being compiled with GNU extensions enabled, typeof() is a valid identifier, so support that as a member function.

// our iterators are sentinel-based range iterators; use nullptr as the end sentinel

// takes ownership, assumes handle already incref'd and lives on the same thread

// Whether this value is a uses incref/decref (true) or is a special reserved

// value (false).

// 64-bit integers can't go through "generic wire type" because double and int64 have different ABI.

// Make sure iterator is only moveable, not copyable as it represents a mutable state.

// Awaiter defines a set of well-known methods that compiler uses

// to drive the argument of the `co_await` operator (regardless

// of the type of the parent coroutine).

// This one is used for Promises represented by the `val` type.

// State machine holding awaiter's current state. One of:

//  - initially created with promise

//  - waiting with a given coroutine handle

//  - completed with a result

// just in case, ensure nobody moves / copies this type around

// Promises don't have a synchronously accessible "ready" state.

// On suspend, store the coroutine handle and invoke a helper that will do

// a rough equivalent of

// `promise.then(value => this.resume_with(value)).catch(error => this.reject_with(error))`.

// When JS invokes `resume_with` with some value, store that value and resume

// the coroutine.

// When JS invokes `reject_with` with some error value, reject currently suspended

// coroutine's promise with the error value and destroy coroutine frame, because

// in this scenario coroutine never reaches final_suspend point to be destroyed automatically.

// `await_resume` finalizes the awaiter and should return the result

// of the `co_await ...` expression - in our case, the stored value.

// `promise_type` is a well-known subtype with well-known method names

// that compiler uses to drive the coroutine itself

// (`T::promise_type` is used for any coroutine with declared return type `T`).

// Create a `new Promise` and store it alongside the `resolve` and `reject`

// callbacks that can be used to fulfill it.

// Return the stored promise as the actual return value of the coroutine.

// For similarity with JS async functions, our coroutines are eagerly evaluated.

// When exceptions are disabled we don't define unhandled_exception and rely

// on the default terminate behavior.

// On an unhandled exception, reject the stored promise instead of throwing

// it asynchronously where it can't be handled.

// Reject the stored promise due to rejection deeper in the call chain

// Resolve the stored promise on `co_return value`.

// Declare a custom type that can be used in conjunction with

// emscripten::register_type to emit custom TypeScript definitions for val

// types.

// Marshal to JS with move semantics when we can invalidate the temporary val

// object.

// Marshal to JS with copy semantics when we cannot transfer the val object's

// reference count.

// Copy the array into our vector through the use of typed arrays.

// It will try to convert each element through Number().

// See https://www.ecma-international.org/ecma-262/6.0/#sec-%typedarray%.prototype.set-array-offset

// and https://www.ecma-international.org/ecma-262/6.0/#sec-tonumber

// end namespace emscripten


=== system/include/emscripten/version.h ===
SHA256: c9e902fd21f449dd4037368772d2eaf78eaebe70ae9f3dcdb57da5add1b1f849
/*
 * If anyone ever ends up including this file it would be an error
 * since this directory should never be in the include path.
 * The real version of this file gets auto-generated inside the
 * `sysroot/include` directory (which should be in the include path
 * instead).
 */


=== system/include/emscripten/wasm_worker.h ===
SHA256: 7532d7bc4d80d08177c9b4a48c3c848dc9502e6330e1b7daee6a89e3160acc21
/*
 * Copyright 2022 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Creates a new Worker() that is attached to executing this

// WebAssembly.Instance and WebAssembly.Memory.

//

// emscripten_malloc_wasm_worker:

//   Creates a new Worker, dynamically allocating stack and TLS for it.

//   Unfortunately due to the asynchronous no-notifications nature of how Worker

//   API specification teardown behaves, the dynamically allocated memory can

//   never be freed, so use this function only in scenarios where the page does

//   not need to deinitialize/tear itself down.

//

// emscripten_create_wasm_worker:

//   Creates a Wasm Worker given a preallocated region for stack and TLS data.

//   Use this function to manually manage the memory that a Worker should use.

//   This function does not use any dynamic memory allocation.

//   Unlike with the above function, this variant requires that size of the

//   region provided is large enough to hold both stack and TLS area.

//   The size of the TLS area can be determined at runtime by calling

//   __builtin_wasm_tls_size().

//

// Returns an ID that represents the given Worker. If not building with Wasm

// workers enabled (-sWASM_WORKERS=0), these functions will return 0 to denote

// failure.

// Note that the Worker will be loaded up asynchronously, and initially will not

// be executing any code. Use emscripten_wasm_worker_post_function_*() set of

// functions to start executing code on the Worker.

// Terminates the given Wasm Worker some time after it has finished executing

// its current, or possibly some subsequent posted functions. Note that this

// function is not C++ RAII safe, but you must manually coordinate to release

// any resources from the given Worker that it may have allocated from the heap

// or may have stored on its TLS slots.  There are no TLS destructors that would

// execute.

// Exists, but is a no-op if not building with Wasm Workers enabled

// (-sWASM_WORKERS=0)

// Note the comment on emscripten_terminate_wasm_worker(id) about thread

// destruction.

// Exists, but is a no-op if not building with Wasm Workers enabled

// (-sWASM_WORKERS=0)

// Returns true if the current thread is executing a Wasm Worker, false

// otherwise.  Note that calling this function can be relatively slow as it

// incurs a Wasm->JS transition, so avoid calling it in hot paths.

// Returns a unique ID that identifies the calling Wasm Worker. Similar to

// pthread_self().  The main browser thread will return 0 as the ID. First Wasm

// Worker will return 1, and so on.

// emscripten_wasm_worker_post_function_*: Post a pointer to a C/C++ function to

// be executed on the target Wasm Worker (via sending a postMessage() to the

// target thread). Notes: If running inside a Wasm Worker, specify worker ID 0

// to pass a message to the parent thread.  When specifying non-zero ID, the

// target worker must have been created by the calling thread. That is, a Wasm

// Worker can only send a message to its parent or its children, but not to its

// siblings.  The target function pointer will be executed on the target Worker

// only after it yields back to its event loop. If the target Wasm Worker

// executes an infinite loop that never yields, then the function pointer will

// never be called.

// Passing messages between threads with this family of functions is relatively

// slow and has a really high latency cost compared to direct coordination using

// atomics and synchronization primitives like mutexes. Additionally these 

// functions will generate garbage on the JS heap.  Therefore avoid using these 

// functions where performance is critical.

// Sleeps the calling wasm worker for the given nanoseconds. Calling this

// function on the main thread either results in a TypeError exception

// (Firefox), or a silent return without waiting (Chrome), see

// https://github.com/WebAssembly/threads/issues/174

// Returns the value of navigator.hardwareConcurrency, i.e. the number of

// logical threads available for the user agent. NOTE: If the execution

// environment does not support navigator.hardwareConcurrency, this function

// will return zero to signal no support. (If the value 1 is returned, then it

// means that navigator.hardwareConcurrency is supported, but there is only one

// logical thread of concurrency available)

// Legacy names for emscripten_atomic_wait/notify functions, defined in

// emscripten/atomic.h


=== system/include/emscripten/wasmfs.h ===
SHA256: 302665f760308f16ed8272a90c94dc4a2d53e868e21e0c4ad7143ab206fca876
/*
 * Copyright 2021 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Obtains the backend_t of a specified path.

// Obtains the backend_t of a specified fd.

// Creates and opens a new file using a specific backend.

// Returns the file descriptor for the new file like `open`. Returns a negative

// value on error. TODO: It might be worth returning a more specialized type

// like __wasi_fd_t here.

// TODO: Remove this function so that only directories can be mounted.

// Creates a new directory using a specific backend.

// Returns 0 on success like `mkdir`, or a negative value on error.

// TODO: Add an alias with wasmfs_mount.

// Unmounts the directory (Which must be a valid mountpoint) at a specific path.

// Returns 0 on success, or a negative value on error.

// Backend creation

// Creates a new JSFile Backend

// A function that receives a void* and returns a backend.

// Fetch backend

//

// Creates a new fetchfs backend.  FetchFS will backstop filesystem

// reads to HTTP fetch requests, which will download just specific

// ranges of the requested files.  FetchFS works best when your web

// server supports HTTP range requests, and it's important that those

// files are not stored encrypted or compressed at rest.  FetchFS by

// default will dispatch HTTP requests to URLs beginning with base_url

// and ending with whatever the file's path is relative to where the

// fetchfs directory is mounted.

//

// Individual range requests will be no bigger than chunk_size, and will

// be aligned to boundaries of chunk_size.  Files smaller than chunk_size

// will be downloaded all at once.

//

// If chunk_size is 0, a reasonable default value will be used.

//

// Note: this cannot be called on the browser main thread because it might

// deadlock while waiting for its dedicated worker thread to be spawned.

//

// Note: This function blocks on the main browser thread returning to its event

// loop. Calling this function while holding a lock the main thread is waiting

// to acquire will cause a deadlock.

//

// TODO: Add an async version of this function that will work on the main

// thread.

//

// Note: this cannot be called on the browser main thread because it might

// deadlock while waiting for the OPFS dedicated worker thread to be spawned.

//

// Note: This function blocks on the main browser thread returning to its event

// loop. Calling this function while holding a lock the main thread is waiting

// to acquire will cause a deadlock.

//

// TODO: Add an async version of this function that will work on the main

// thread.

// Creates a generic JSIMPL backend

// Similar to fflush(0), but also flushes all internal buffers inside WasmFS.

// This is necessary because in a Web environment we must buffer at an

// additional level after libc, since console.log() prints entire lines, that

// is, we can't print individual characters as libc feeds them to us, so we

// buffer them and call console.log() only after a newline. This function will

// actually flush all buffers and add newlines as necessary to get everything

// printed out.

// Hooks

// A hook users can do to create the root directory. Overriding this allows the

// user to set a particular backend as the root. If this is not set then the

// default backend is used.

// A hook users can do to run code during WasmFS startup. This hook happens

// before file preloading, so user code could create backends and mount them,

// which would then affect in which backend the preloaded files are loaded (the

// preloaded files have paths, and so they are added to that path and whichever

// backend is present there).


=== system/include/emscripten/webaudio.h ===
SHA256: 0b91fdb8fbd416e435d08e6037de03930170017801c0cd69ca5f15180ea379d9
/*
 * Copyright 2022 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Default render size of 128 frames

// Let the hardware determine the best render size

// Specify one of "balanced", "interactive" or "playback"

// E.g. 44100 or 48000

// AUDIO_CONTEXT_RENDER_SIZE_* or number of samples

// Creates a new Web Audio AudioContext, and returns a handle to it.

// Resumes the given AudioContext. The specified callback will fire when the AudioContext has completed resuming. Call this function

// inside a user event handler (mousedown, button click, etc.)

// userData1: A custom userdata pointer to pass to the callback function. This value will be passed on to the call to the given EmscriptenResumeAudioContextCallback callback function.

// Synchronously attempts to resume the given AudioContext.

// Returns the current AudioContext state.

// Calls .suspend() on the given AudioContext and releases the JS object table

// reference to the given audio context. The specified handle is invalid

// after calling this function.

// Disconnects the given audio node from its audio graph, and then releases

// the JS object table reference to the given audio node. The specified handle

// is invalid after calling this function.

// Create Wasm AudioWorklet thread. Call this function once at application startup to establish an AudioWorkletGlobalScope for your app.

// After the scope has been initialized, the given callback will fire.

// audioContext: The Web Audio context object to initialize the Wasm AudioWorklet thread on. Each AudioContext can have only one AudioWorklet

//               thread running, so do not call this function multiple times on the same AudioContext.

// stackLowestAddress: The base address for the thread's stack. Must be aligned to 16 bytes. Use e.g. memalign(16, 1024) to allocate a 1KB stack for the thread.

// stackSize: The size of the thread's stack. Must be a multiple of 16 bytes.

// callback: The callback function that will be run when thread creation either succeeds or fails.

// userData2: A custom userdata pointer to pass to the callback function. This value will be passed on to the call to the given EmscriptenStartWebAudioWorkletCallback callback function.

// Default == 0.0

// Default = -3.4028235e38

// Default = 3.4028235e38

// Either WEBAUDIO_PARAM_A_RATE or WEBAUDIO_PARAM_K_RATE. Default = WEBAUDIO_PARAM_A_RATE

// The name of the AudioWorkletProcessor that is being created.

// Creates a new AudioWorkletProcessor with the given name and specified set of control parameters.

// userData3: A custom userdata pointer to pass to the callback function. This value will be passed on to the call to the given EmscriptenWorkletProcessorCreatedCallback callback function.

// Returns the number of samples processed per channel in an AudioSampleFrame, fixed at 128 in the Web Audio API 1.0 specification, and valid for the lifetime of the audio context.

// For this to differ from the default 128, the context would need to be created with a WebAudioWorkletProcessorCreateOptions renderSizeHint, part of the 1.1 Web Audio API.

// Returns the sampling rate of the given Audio Context, e.g. 48000 or 44100 or similar.

// Number of audio channels to process (multiplied by samplesPerChannel gives the elements in data)

// Number of samples per channel in data

// An array of length numberOfChannels*samplesPerChannel elements. Samples are always arranged in a planar fashion,

// where data[channelIndex*samplesPerChannel+i] locates the data of the i'th sample of channel channelIndex.

// Specifies the length of the input array data (in float elements). This will be guaranteed to either have

// a value of 1, for a parameter valid for the entire frame, or emscripten_audio_context_quantum_size() for a parameter that changes per sample during the frame.

// An array of length specified in 'length'.

// How many audio nodes does this node take inputs from? Default=1

// How many audio nodes does this node output to? Default=1

// For each output, specifies the number of audio channels (1=mono/2=stereo/etc.) for that output. Default=an array of ones for each output channel.

// Number of channels used when up-mixing and down-mixing connections to any inputs to the node. Default=2

// How channels will be counted when up-mixing and down-mixing connections to any inputs to the node? Default=max

// How individual channels will be treated when up-mixing and down-mixing connections to any inputs to the node? Default=speakers

// Instantiates the given AudioWorkletProcessor as an AudioWorkletNode, which continuously calls the specified processCallback() function on the browser's audio thread to perform audio processing.

// userData4: A custom userdata pointer to pass to the callback function. This value will be passed on to the call to the given EmscriptenWorkletNodeProcessCallback callback function.

// Connects a node's output to a target, e.g., connect the worklet node to the context.

// For outputIndex and inputIndex, see the AudioNode.connect() documentation (setting 0 as the default values)

// Returns true if the current thread is executing a Wasm AudioWorklet, false otherwise.

// Note that calling this function can be relatively slow as it incurs a Wasm->JS transition,

// so avoid calling it in hot paths.

/* emscripten_audio_worklet_function_*: Post a pointer to a C/C++ function to be executed on the Audio Worklet 
   thread of the given Web Audio context. Notes:
 - If running inside an Audio Worklet thread, specify ID EMSCRIPTEN_AUDIO_MAIN_THREAD (== 0) to pass a message
   from the audio worklet to the main thread.
 - When specifying non-zero ID, the Audio Context denoted by the ID must have been created by the calling thread.
 - Passing messages between audio thread and main thread with this family of functions is relatively slow and has
   a really high latency cost compared to direct coordination using atomics and synchronization primitives like
   mutexes. Additionally these functions will generate garbage on the JS heap. Therefore avoid using these
   functions where performance is critical. */

// ~extern "C"


=== system/include/emscripten/websocket.h ===
SHA256: f25df8b38e0245c9936b6c2bb7c1132210d779b7932ef455de0dc0e2a8833820
/*
 * Copyright 2018 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Returns the WebSocket.readyState field into readyState. readyState must not be a null pointer.

// Returns the WebSocket.bufferedAmount field into bufferedAmount. bufferedAmount must not be a null pointer.

// Writes the WebSocket.url field as a UTF-8 string to the memory area pointed by url. The memory area must contain at least urlLength bytes of free space. If this memory area cannot

// fit the url string, it will be truncated. Call emscripten_websocket_get_url_length() to determine how large memory area will be required to store the url.

// url must not be a null pointer.

// Returns the byte length needed to store WebSocket.url string in Wasm heap. This length can be passed to emscripten_websocket_get_url as it includes the null byte in the count.

// urlLength must not be a null pointer.

// Similar to emscripten_websocket_get_url(), but returns WebSocket.extensions field instead.

// Similar to emscripten_websocket_get_url(), but returns WebSocket.protocol field instead.

// WebSockets spec enforces this can be max 123 characters, so as UTF-8 at most 123*4 bytes < 512.

// The target URL to connect to. This string can point to a stack local variable, the string is read immediately at a call to emscripten_websocket_new().

// A comma-separated list of protocol strings. Set to e.g. "binary,base64" to create a WebSocket connection with two supported protocols "binary" and "base64".

// Be careful to avoid leading and trailing spaces, e.g. "binary, base64" may not be interpreted properly.

// This string can point to a stack local variable, the string is read immediately at a call to emscripten_websocket_new().

// If true, the created socket will reside on the main browser thread. If false, the created socket is bound to the calling thread.

// If you want to share the created EMSCRIPTEN_WEBSOCKET_T structure across multiple threads, or are running your own main loop in the

// pthread that you create the socket, set createOnMainThread to true. If the created WebSocket only needs to be accessible on the thread

// that created it, and the creating thread is an event based thread (meaning it regularly yields back to the browser event loop), then

// it is more efficient to set this to false.

//extern void emscripten_websocket_init_create_attributes(EmscriptenWebSocketCreateAttributes *attributes);

// Returns true if WebSockets are supported by the current browser

// Creates a new WebSocket and connects it to the given remote host.

// If the return value of this function is > 0, the function has succeeded and the return value represents a handle to the WebSocket object.

// If the return value of this function is < 0, then the function has failed, and the return value can be interpreted as a EMSCRIPTEN_RESULT code

// representing the cause of the failure. If the function returns 0, then the call has failed with an unknown reason (build with -sWEBSOCKET_DEBUG for more information)

// Sends the given string of null-delimited UTF8 encoded text data to the connected server.

// Sends the given block of raw memory data out to the connected server.

// Closes the specified WebSocket. N.B.: the meaning of "closing" a WebSocket means "eager read/lazy write"-closing the socket. That is, all still

// pending untransferred outbound bytes will continue to transfer out, but after calling close on the socket, any pending bytes still in the process

// of being received will never be available. See https://html.spec.whatwg.org/multipage/web-sockets.html#dom-websocket-sclose

// After calling close(), it is no longer possible to send() on the WebSocket to send more bytes.

// Releases the given WebSocket object and all associated allocated memory for garbage collection. This effectively frees the socket handle, after calling

// this function the given handle no longer exists.

// This function close()s and releases all created WebSocket connections for the current thread. You can call this at application exit time to enforce

// teardown of all active sockets, although it is optional. When a pthread terminates, it will call this function to delete all active connections bound to

// that specific pthread (sockets created with createOnMainThread=false). Any WebSockets created by a pthread with createOnMainThread=true will remain alive

// even after the pthread quits, although be warned that if the target thread that was registered to handle events for a given WebSocket quits, then those

// events will stop from being delivered altogether.

// ~extern "C"


=== system/include/emscripten/wget.h ===
SHA256: 7bcf5e98180ee6e733264d651489bcf330e5bd53ed815efa67dfacf219306295
/*
 * Copyright 2012 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// wget

// wget "sync"


=== system/include/emscripten/wire.h ===
SHA256: 68a06f7946266fc55034562f07b6ba43e9bae31ddb8759c4ac2874efb0ebb8ba
/*
 * Copyright 2012 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// A value moving between JavaScript and C++ has three representations:

// - The original JS value: a String

// - The native on-the-wire value: a stack-allocated char*, say

// - The C++ value: std::string

//

// We'll call the on-the-wire type WireType.

// We don't need the full std::type_info implementation.  We

// just need a unique identifier per type and polymorphic type

// identification.

// The second typename is an unused stub so it's possible to

// specialize groups of classes via SFINAE.

// end namespace rvp

// ExecutePolicies<>

// TypeList<>

// Cons :: T, TypeList<types...> -> Cons<T, types...>

// Apply :: T, TypeList<types...> -> T<types...>

// MapWithIndex_

// WithPolicies<...>::ArgTypeList<...>

// BindingType<T>

// The second typename is an unused stub so it's possible to

// specialize groups of classes via SFINAE.

// Using empty struct instead of void is ABI-compatible, but makes it easier

// to work with wire types in a generic template context, as void can't be

// stored in local variables or passed around but empty struct can.

// TODO: switch to std::monostate when we require C++17.

// No-op, as void has no value.

// trailing data

// catch-all generic binding

// namespace internal

// in elements, not bytes

// Note that 'data' is marked const just so it can accept both

// const and nonconst pointers.  It is certainly possible for

// JavaScript to modify the C heap through the typed array given,

// as it merely aliases the C heap.

// This non-word-sized WireType only works because I

// happen to know that clang will pass aggregates as

// pointers to stack elements and we never support

// converting JavaScript typed arrays back into

// memory_view.  (That is, fromWireType is not implemented

// on the C++ side, nor is toWireType implemented in

// JavaScript.)

////////////////////////////////////////////////////////////////////////////////

// POLICIES

////////////////////////////////////////////////////////////////////////////////

// Use decay to handle references to pointers e.g.(T*&)->(T*).

// namespace internal

// allow all raw pointers

// end namespace return_value_policy

// Build a tuple type that contains all the types where the predicate is true.

// e.g. FilterTypes<std::is_integral, int, char, float> would return std::tuple<int, char>.

// Build a tuple that contains all the args where the predicate is true.

// namespace internal

// namespace emscripten


=== system/include/uuid/uuid.h ===
SHA256: 37f416f4e099b397bf821a03529c058ec7a86cf65d10972bda43abeef432fd89
/* _UUID_H */


=== system/include/wasi/api.h ===
SHA256: ed9dd6b6c20a48aab7c4d2b3eb9e2444543c49d22ae625da80532427caae964b
/**
 * THIS FILE IS AUTO-GENERATED from the following files:
 *   typenames.witx, wasi_snapshot_preview1.witx
 *
 * @file
 * This file describes the [WASI] interface, consisting of functions, types,
 * and defined values (macros).
 *
 * The interface described here is greatly inspired by [CloudABI]'s clean,
 * thoughtfully-designed, capability-oriented, POSIX-style API.
 *
 * [CloudABI]: https://github.com/NuxiNL/cloudlibc
 * [WASI]: https://github.com/WebAssembly/WASI/
 */

/*
 * File origin:
 *   https://github.com/WebAssembly/wasi-libc/blob/main/libc-bottom-half/headers/public/wasi/api.h
 * Revision:
 *   2c2fc9a2fddd0927a66f1c142e65c8dab6f5c5d7
 * License:
 *   CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
 *   https://creativecommons.org/publicdomain/zero/1.0/
 */

// TODO: Encoding this in witx.

/**
 * Non-negative file size or length of a region within a file.
 */

/**
 * Timestamp in nanoseconds.
 */

/**
 * Identifiers for clocks.
 */

/**
 * The clock measuring real time. Time value zero corresponds with
 * 1970-01-01T00:00:00Z.
 */

/**
 * The store-wide monotonic clock, which is defined as a clock measuring
 * real time, whose value cannot be adjusted and which cannot have negative
 * clock jumps. The epoch of this clock is undefined. The absolute time
 * value of this clock therefore has no meaning.
 */

/**
 * The CPU-time clock associated with the current process.
 */

/**
 * The CPU-time clock associated with the current thread.
 */

/**
 * Error codes returned by functions.
 * Not all of these error codes are returned by the functions provided by this
 * API; some are used in higher-level library layers, and others are provided
 * merely for alignment with POSIX.
 */

/**
 * No error occurred. System call completed successfully.
 */

/**
 * Argument list too long.
 */

/**
 * Permission denied.
 */

/**
 * Address in use.
 */

/**
 * Address not available.
 */

/**
 * Address family not supported.
 */

/**
 * Resource unavailable, or operation would block.
 */

/**
 * Connection already in progress.
 */

/**
 * Bad file descriptor.
 */

/**
 * Bad message.
 */

/**
 * Device or resource busy.
 */

/**
 * Operation canceled.
 */

/**
 * No child processes.
 */

/**
 * Connection aborted.
 */

/**
 * Connection refused.
 */

/**
 * Connection reset.
 */

/**
 * Resource deadlock would occur.
 */

/**
 * Destination address required.
 */

/**
 * Mathematics argument out of domain of function.
 */

/**
 * Reserved.
 */

/**
 * File exists.
 */

/**
 * Bad address.
 */

/**
 * File too large.
 */

/**
 * Host is unreachable.
 */

/**
 * Identifier removed.
 */

/**
 * Illegal byte sequence.
 */

/**
 * Operation in progress.
 */

/**
 * Interrupted function.
 */

/**
 * Invalid argument.
 */

/**
 * I/O error.
 */

/**
 * Socket is connected.
 */

/**
 * Is a directory.
 */

/**
 * Too many levels of symbolic links.
 */

/**
 * File descriptor value too large.
 */

/**
 * Too many links.
 */

/**
 * Message too large.
 */

/**
 * Reserved.
 */

/**
 * Filename too long.
 */

/**
 * Network is down.
 */

/**
 * Connection aborted by network.
 */

/**
 * Network unreachable.
 */

/**
 * Too many files open in system.
 */

/**
 * No buffer space available.
 */

/**
 * No such device.
 */

/**
 * No such file or directory.
 */

/**
 * Executable file format error.
 */

/**
 * No locks available.
 */

/**
 * Reserved.
 */

/**
 * Not enough space.
 */

/**
 * No message of the desired type.
 */

/**
 * Protocol not available.
 */

/**
 * No space left on device.
 */

/**
 * Function not supported.
 */

/**
 * The socket is not connected.
 */

/**
 * Not a directory or a symbolic link to a directory.
 */

/**
 * Directory not empty.
 */

/**
 * State not recoverable.
 */

/**
 * Not a socket.
 */

/**
 * Not supported, or operation not supported on socket.
 */

/**
 * Inappropriate I/O control operation.
 */

/**
 * No such device or address.
 */

/**
 * Value too large to be stored in data type.
 */

/**
 * Previous owner died.
 */

/**
 * Operation not permitted.
 */

/**
 * Broken pipe.
 */

/**
 * Protocol error.
 */

/**
 * Protocol not supported.
 */

/**
 * Protocol wrong type for socket.
 */

/**
 * Result too large.
 */

/**
 * Read-only file system.
 */

/**
 * Invalid seek.
 */

/**
 * No such process.
 */

/**
 * Reserved.
 */

/**
 * Connection timed out.
 */

/**
 * Text file busy.
 */

/**
 * Cross-device link.
 */

/**
 * Extension: Capabilities insufficient.
 */

/**
 * File descriptor rights, determining which actions may be performed.
 */

/**
 * The right to invoke `fd_datasync`.
 * If `path_open` is set, includes the right to invoke
 * `path_open` with `fdflags::dsync`.
 */

/**
 * The right to invoke `fd_read` and `sock_recv`.
 * If `rights::fd_seek` is set, includes the right to invoke `fd_pread`.
 */

/**
 * The right to invoke `fd_seek`. This flag implies `rights::fd_tell`.
 */

/**
 * The right to invoke `fd_fdstat_set_flags`.
 */

/**
 * The right to invoke `fd_sync`.
 * If `path_open` is set, includes the right to invoke
 * `path_open` with `fdflags::rsync` and `fdflags::dsync`.
 */

/**
 * The right to invoke `fd_seek` in such a way that the file offset
 * remains unaltered (i.e., `whence::cur` with offset zero), or to
 * invoke `fd_tell`.
 */

/**
 * The right to invoke `fd_write` and `sock_send`.
 * If `rights::fd_seek` is set, includes the right to invoke `fd_pwrite`.
 */

/**
 * The right to invoke `fd_advise`.
 */

/**
 * The right to invoke `fd_allocate`.
 */

/**
 * The right to invoke `path_create_directory`.
 */

/**
 * If `path_open` is set, the right to invoke `path_open` with `oflags::creat`.
 */

/**
 * The right to invoke `path_link` with the file descriptor as the
 * source directory.
 */

/**
 * The right to invoke `path_link` with the file descriptor as the
 * target directory.
 */

/**
 * The right to invoke `path_open`.
 */

/**
 * The right to invoke `fd_readdir`.
 */

/**
 * The right to invoke `path_readlink`.
 */

/**
 * The right to invoke `path_rename` with the file descriptor as the source directory.
 */

/**
 * The right to invoke `path_rename` with the file descriptor as the target directory.
 */

/**
 * The right to invoke `path_filestat_get`.
 */

/**
 * The right to change a file's size (there is no `path_filestat_set_size`).
 * If `path_open` is set, includes the right to invoke `path_open` with `oflags::trunc`.
 */

/**
 * The right to invoke `path_filestat_set_times`.
 */

/**
 * The right to invoke `fd_filestat_get`.
 */

/**
 * The right to invoke `fd_filestat_set_size`.
 */

/**
 * The right to invoke `fd_filestat_set_times`.
 */

/**
 * The right to invoke `path_symlink`.
 */

/**
 * The right to invoke `path_remove_directory`.
 */

/**
 * The right to invoke `path_unlink_file`.
 */

/**
 * If `rights::fd_read` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype::fd_read`.
 * If `rights::fd_write` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype::fd_write`.
 */

/**
 * The right to invoke `sock_shutdown`.
 */

/**
 * A file descriptor index.
 */

/**
 * A region of memory for scatter/gather reads.
 */

/**
     * The address of the buffer to be filled.
     */

/**
     * The length of the buffer to be filled.
     */

/**
 * A region of memory for scatter/gather writes.
 */

/**
     * The address of the buffer to be written.
     */

/**
     * The length of the buffer to be written.
     */

/**
 * Relative offset within a file.
 */

/**
 * The position relative to which to set the offset of the file descriptor.
 */

/**
 * Seek relative to start-of-file.
 */

/**
 * Seek relative to current position.
 */

/**
 * Seek relative to end-of-file.
 */

/**
 * A reference to the offset of a directory entry.
 * 
 * The value 0 signifies the start of the directory.
 */

/**
 * The type for the $d_namlen field of $dirent.
 */

/**
 * File serial number that is unique within its file system.
 */

/**
 * The type of a file descriptor or file.
 */

/**
 * The type of the file descriptor or file is unknown or is different from any of the other types specified.
 */

/**
 * The file descriptor or file refers to a block device inode.
 */

/**
 * The file descriptor or file refers to a character device inode.
 */

/**
 * The file descriptor or file refers to a directory inode.
 */

/**
 * The file descriptor or file refers to a regular file inode.
 */

/**
 * The file descriptor or file refers to a datagram socket.
 */

/**
 * The file descriptor or file refers to a byte-stream socket.
 */

/**
 * The file refers to a symbolic link inode.
 */

/**
 * A directory entry.
 */

/**
     * The offset of the next directory entry stored in this directory.
     */

/**
     * The serial number of the file referred to by this directory entry.
     */

/**
     * The length of the name of the directory entry.
     */

/**
     * The type of the file referred to by this directory entry.
     */

/**
 * File or memory access pattern advisory information.
 */

/**
 * The application has no advice to give on its behavior with respect to the specified data.
 */

/**
 * The application expects to access the specified data sequentially from lower offsets to higher offsets.
 */

/**
 * The application expects to access the specified data in a random order.
 */

/**
 * The application expects to access the specified data in the near future.
 */

/**
 * The application expects that it will not access the specified data in the near future.
 */

/**
 * The application expects to access the specified data once and then not reuse it thereafter.
 */

/**
 * File descriptor flags.
 */

/**
 * Append mode: Data written to the file is always appended to the file's end.
 */

/**
 * Write according to synchronized I/O data integrity completion. Only the data stored in the file is synchronized.
 */

/**
 * Non-blocking mode.
 */

/**
 * Synchronized read I/O operations.
 */

/**
 * Write according to synchronized I/O file integrity completion. In
 * addition to synchronizing the data stored in the file, the implementation
 * may also synchronously update the file's metadata.
 */

/**
 * File descriptor attributes.
 */

/**
     * File type.
     */

/**
     * File descriptor flags.
     */

/**
     * Rights that apply to this file descriptor.
     */

/**
     * Maximum set of rights that may be installed on new file descriptors that
     * are created through this file descriptor, e.g., through `path_open`.
     */

/**
 * Identifier for a device containing a file system. Can be used in combination
 * with `inode` to uniquely identify a file or directory in the filesystem.
 */

/**
 * Which file time attributes to adjust.
 */

/**
 * Adjust the last data access timestamp to the value stored in `filestat::atim`.
 */

/**
 * Adjust the last data access timestamp to the time of clock `clockid::realtime`.
 */

/**
 * Adjust the last data modification timestamp to the value stored in `filestat::mtim`.
 */

/**
 * Adjust the last data modification timestamp to the time of clock `clockid::realtime`.
 */

/**
 * Flags determining the method of how paths are resolved.
 */

/**
 * As long as the resolved path corresponds to a symbolic link, it is expanded.
 */

/**
 * Open flags used by `path_open`.
 */

/**
 * Create file if it does not exist.
 */

/**
 * Fail if not a directory.
 */

/**
 * Fail if file already exists.
 */

/**
 * Truncate file to size 0.
 */

/**
 * Number of hard links to an inode.
 */

/**
 * File attributes.
 */

/**
     * Device ID of device containing the file.
     */

/**
     * File serial number.
     */

/**
     * File type.
     */

/**
     * Number of hard links to the file.
     */

/**
     * For regular files, the file size in bytes. For symbolic links, the length in bytes of the pathname contained in the symbolic link.
     */

/**
     * Last data access timestamp.
     */

/**
     * Last data modification timestamp.
     */

/**
     * Last file status change timestamp.
     */

/**
 * User-provided value that may be attached to objects that is retained when
 * extracted from the implementation.
 */

/**
 * Type of a subscription to an event or its occurrence.
 */

/**
 * The time value of clock `subscription_clock::id` has
 * reached timestamp `subscription_clock::timeout`.
 */

/**
 * File descriptor `subscription_fd_readwrite::file_descriptor` has data
 * available for reading. This event always triggers for regular files.
 */

/**
 * File descriptor `subscription_fd_readwrite::file_descriptor` has capacity
 * available for writing. This event always triggers for regular files.
 */

/**
 * The state of the file descriptor subscribed to with
 * `eventtype::fd_read` or `eventtype::fd_write`.
 */

/**
 * The peer of this socket has closed or disconnected.
 */

/**
 * The contents of an $event when type is `eventtype::fd_read` or
 * `eventtype::fd_write`.
 */

/**
     * The number of bytes available for reading or writing.
     */

/**
     * The state of the file descriptor.
     */

/**
 * The contents of an $event.
 */

/**
     * When type is `eventtype::fd_read` or `eventtype::fd_write`:
     */

/**
 * An event that occurred.
 */

/**
     * User-provided value that got attached to `subscription::userdata`.
     */

/**
     * If non-zero, an error that occurred while processing the subscription request.
     */

/**
     * The type of the event that occurred.
     */

/**
     * The contents of the event.
     */

/**
 * Flags determining how to interpret the timestamp provided in
 * `subscription_clock::timeout`.
 */

/**
 * If set, treat the timestamp provided in
 * `subscription_clock::timeout` as an absolute timestamp of clock
 * `subscription_clock::id`. If clear, treat the timestamp
 * provided in `subscription_clock::timeout` relative to the
 * current time value of clock `subscription_clock::id`.
 */

/**
 * The contents of a $subscription when type is `eventtype::clock`.
 */

/**
     * The clock against which to compare the timestamp.
     */

/**
     * The absolute or relative timestamp.
     */

/**
     * The amount of time that the implementation may wait additionally
     * to coalesce with other events.
     */

/**
     * Flags specifying whether the timeout is absolute or relative
     */

/**
 * The contents of a $subscription when type is
 * `eventtype::fd_read` or `eventtype::fd_write`.
 */

/**
     * The file descriptor on which to wait for it to become ready for reading or writing.
     */

/**
 * The contents of a $subscription.
 */

/**
     * When type is `eventtype::clock`:
     */

/**
     * When type is `eventtype::fd_read` or `eventtype::fd_write`:
     */

/**
 * Subscription to an event.
 */

/**
     * User-provided value that is attached to the subscription in the
     * implementation and returned through `event::userdata`.
     */

/**
     * The type of the event to which to subscribe.
     */

/**
     * The contents of the subscription.
     */

/**
 * Exit code generated by a process when exiting.
 */

/**
 * Signal condition.
 */

/**
 * No signal. Note that POSIX has special semantics for `kill(pid, 0)`,
 * so this value is reserved.
 */

/**
 * Hangup.
 * Action: Terminates the process.
 */

/**
 * Terminate interrupt signal.
 * Action: Terminates the process.
 */

/**
 * Terminal quit signal.
 * Action: Terminates the process.
 */

/**
 * Illegal instruction.
 * Action: Terminates the process.
 */

/**
 * Trace/breakpoint trap.
 * Action: Terminates the process.
 */

/**
 * Process abort signal.
 * Action: Terminates the process.
 */

/**
 * Access to an undefined portion of a memory object.
 * Action: Terminates the process.
 */

/**
 * Erroneous arithmetic operation.
 * Action: Terminates the process.
 */

/**
 * Kill.
 * Action: Terminates the process.
 */

/**
 * User-defined signal 1.
 * Action: Terminates the process.
 */

/**
 * Invalid memory reference.
 * Action: Terminates the process.
 */

/**
 * User-defined signal 2.
 * Action: Terminates the process.
 */

/**
 * Write on a pipe with no one to read it.
 * Action: Ignored.
 */

/**
 * Alarm clock.
 * Action: Terminates the process.
 */

/**
 * Termination signal.
 * Action: Terminates the process.
 */

/**
 * Child process terminated, stopped, or continued.
 * Action: Ignored.
 */

/**
 * Continue executing, if stopped.
 * Action: Continues executing, if stopped.
 */

/**
 * Stop executing.
 * Action: Stops executing.
 */

/**
 * Terminal stop signal.
 * Action: Stops executing.
 */

/**
 * Background process attempting read.
 * Action: Stops executing.
 */

/**
 * Background process attempting write.
 * Action: Stops executing.
 */

/**
 * High bandwidth data is available at a socket.
 * Action: Ignored.
 */

/**
 * CPU time limit exceeded.
 * Action: Terminates the process.
 */

/**
 * File size limit exceeded.
 * Action: Terminates the process.
 */

/**
 * Virtual timer expired.
 * Action: Terminates the process.
 */

/**
 * Profiling timer expired.
 * Action: Terminates the process.
 */

/**
 * Window changed.
 * Action: Ignored.
 */

/**
 * I/O possible.
 * Action: Terminates the process.
 */

/**
 * Power failure.
 * Action: Terminates the process.
 */

/**
 * Bad system call.
 * Action: Terminates the process.
 */

/**
 * Flags provided to `sock_recv`.
 */

/**
 * Returns the message without removing it from the socket's receive queue.
 */

/**
 * On byte-stream sockets, block until the full amount of data can be returned.
 */

/**
 * Flags returned by `sock_recv`.
 */

/**
 * Returned by `sock_recv`: Message data has been truncated.
 */

/**
 * Flags provided to `sock_send`. As there are currently no flags
 * defined, it must be set to zero.
 */

/**
 * Which channels on a socket to shut down.
 */

/**
 * Disables further receive operations.
 */

/**
 * Disables further send operations.
 */

/**
 * Identifiers for preopened capabilities.
 */

/**
 * A pre-opened directory.
 */

/**
 * The contents of a $prestat when type is `preopentype::dir`.
 */

/**
     * The length of the directory name for use with `fd_prestat_dir_name`.
     */

/**
 * The contents of an $prestat.
 */

/**
     * When type is `preopentype::dir`:
     */

/**
 * Information about a pre-opened capability.
 */

/**
     * The type of the pre-opened capability.
     */

/**
     * The contents of the information.
     */

/**
 * @defgroup wasi_snapshot_preview1
 * @{
 */

/**
 * Read command-line argument data.
 * The size of the array should match that returned by `args_sizes_get`
 */

/**
 * Return command-line argument data sizes.
 */

/**
     * The number of arguments.
     */

/**
     * The size of the argument string data.
     */

/**
 * Read environment variable data.
 * The sizes of the buffers should match that returned by `environ_sizes_get`.
 */

/**
 * Return command-line argument data sizes.
 */

/**
     * The number of arguments.
     */

/**
     * The size of the argument string data.
     */

/**
 * Return the resolution of a clock.
 * Implementations are required to provide a non-zero value for supported clocks. For unsupported clocks,
 * return `errno::inval`.
 * Note: This is similar to `clock_getres` in POSIX.
 */

/**
     * The clock for which to return the resolution.
     */

/**
     * The resolution of the clock.
     */

/**
 * Return the time value of a clock.
 * Note: This is similar to `clock_gettime` in POSIX.
 */

/**
     * The clock for which to return the time.
     */

/**
     * The maximum lag (exclusive) that the returned time value may have, compared to its actual value.
     */

/**
     * The time value of the clock.
     */

/**
 * Provide file advisory information on a file descriptor.
 * Note: This is similar to `posix_fadvise` in POSIX.
 */

/**
     * The offset within the file to which the advisory applies.
     */

/**
     * The length of the region to which the advisory applies.
     */

/**
     * The advice.
     */

/**
 * Force the allocation of space in a file.
 * Note: This is similar to `posix_fallocate` in POSIX.
 */

/**
     * The offset at which to start the allocation.
     */

/**
     * The length of the area that is allocated.
     */

/**
 * Close a file descriptor.
 * Note: This is similar to `close` in POSIX.
 */

/**
 * Synchronize the data of a file to disk.
 * Note: This is similar to `fdatasync` in POSIX.
 */

/**
 * Get the attributes of a file descriptor.
 * Note: This returns similar flags to `fsync(fd, F_GETFL)` in POSIX, as well as additional fields.
 */

/**
     * The buffer where the file descriptor's attributes are stored.
     */

/**
 * Adjust the flags associated with a file descriptor.
 * Note: This is similar to `fcntl(fd, F_SETFL, flags)` in POSIX.
 */

/**
     * The desired values of the file descriptor flags.
     */

/**
 * Adjust the rights associated with a file descriptor.
 * This can only be used to remove rights, and returns `errno::notcapable` if called in a way that would attempt to add rights
 */

/**
     * The desired rights of the file descriptor.
     */

/**
 * Return the attributes of an open file.
 */

/**
     * The buffer where the file's attributes are stored.
     */

/**
 * Adjust the size of an open file. If this increases the file's size, the extra bytes are filled with zeros.
 * Note: This is similar to `ftruncate` in POSIX.
 */

/**
     * The desired file size.
     */

/**
 * Adjust the timestamps of an open file or directory.
 * Note: This is similar to `futimens` in POSIX.
 */

/**
     * The desired values of the data access timestamp.
     */

/**
     * The desired values of the data modification timestamp.
     */

/**
     * A bitmask indicating which timestamps to adjust.
     */

/**
 * Read from a file descriptor, without using and updating the file descriptor's offset.
 * Note: This is similar to `preadv` in POSIX.
 */

/**
     * List of scatter/gather vectors in which to store data.
     */

/**
     * The length of the array pointed to by `iovs`.
     */

/**
     * The offset within the file at which to read.
     */

/**
     * The number of bytes read.
     */

/**
 * Return a description of the given preopened file descriptor.
 */

/**
     * The buffer where the description is stored.
     */

/**
 * Return a description of the given preopened file descriptor.
 */

/**
     * A buffer into which to write the preopened directory name.
     */

/**
 * Write to a file descriptor, without using and updating the file descriptor's offset.
 * Note: This is similar to `pwritev` in POSIX.
 */

/**
     * List of scatter/gather vectors from which to retrieve data.
     */

/**
     * The length of the array pointed to by `iovs`.
     */

/**
     * The offset within the file at which to write.
     */

/**
     * The number of bytes written.
     */

/**
 * Read from a file descriptor.
 * Note: This is similar to `readv` in POSIX.
 */

/**
     * List of scatter/gather vectors to which to store data.
     */

/**
     * The length of the array pointed to by `iovs`.
     */

/**
     * The number of bytes read.
     */

/**
 * Read directory entries from a directory.
 * When successful, the contents of the output buffer consist of a sequence of
 * directory entries. Each directory entry consists of a dirent_t object,
 * followed by dirent_t::d_namlen bytes holding the name of the directory
 * entry.
 * This function fills the output buffer as much as possible, potentially
 * truncating the last directory entry. This allows the caller to grow its
 * read buffer size in case it's too small to fit a single large directory
 * entry, or skip the oversized directory entry.
 */

/**
     * The buffer where directory entries are stored
     */

/**
     * The location within the directory to start reading
     */

/**
     * The number of bytes stored in the read buffer. If less than the size of the read buffer, the end of the directory has been reached.
     */

/**
 * Atomically replace a file descriptor by renumbering another file descriptor.
 * Due to the strong focus on thread safety, this environment does not provide
 * a mechanism to duplicate or renumber a file descriptor to an arbitrary
 * number, like `dup2()`. This would be prone to race conditions, as an actual
 * file descriptor with the same number could be allocated by a different
 * thread at the same time.
 * This function provides a way to atomically renumber file descriptors, which
 * would disappear if `dup2()` were to be removed entirely.
 */

/**
     * The file descriptor to overwrite.
     */

/**
 * Move the offset of a file descriptor.
 * Note: This is similar to `lseek` in POSIX.
 */

/**
     * The number of bytes to move.
     */

/**
     * The base from which the offset is relative.
     */

/**
     * The new offset of the file descriptor, relative to the start of the file.
     */

/**
 * Synchronize the data and metadata of a file to disk.
 * Note: This is similar to `fsync` in POSIX.
 */

/**
 * Return the current offset of a file descriptor.
 * Note: This is similar to `lseek(fd, 0, SEEK_CUR)` in POSIX.
 */

/**
     * The current offset of the file descriptor, relative to the start of the file.
     */

/**
 * Write to a file descriptor.
 * Note: This is similar to `writev` in POSIX.
 */

/**
     * List of scatter/gather vectors from which to retrieve data.
     */

/**
     * The length of the array pointed to by `iovs`.
     */

/**
     * The number of bytes written.
     */

/**
 * Create a directory.
 * Note: This is similar to `mkdirat` in POSIX.
 */

/**
     * The path at which to create the directory.
     */

/**
     * The length of the buffer pointed to by `path`.
     */

/**
 * Return the attributes of a file or directory.
 * Note: This is similar to `stat` in POSIX.
 */

/**
     * Flags determining the method of how the path is resolved.
     */

/**
     * The path of the file or directory to inspect.
     */

/**
     * The length of the buffer pointed to by `path`.
     */

/**
     * The buffer where the file's attributes are stored.
     */

/**
 * Adjust the timestamps of a file or directory.
 * Note: This is similar to `utimensat` in POSIX.
 */

/**
     * Flags determining the method of how the path is resolved.
     */

/**
     * The path of the file or directory to operate on.
     */

/**
     * The length of the buffer pointed to by `path`.
     */

/**
     * The desired values of the data access timestamp.
     */

/**
     * The desired values of the data modification timestamp.
     */

/**
     * A bitmask indicating which timestamps to adjust.
     */

/**
 * Create a hard link.
 * Note: This is similar to `linkat` in POSIX.
 */

/**
     * Flags determining the method of how the path is resolved.
     */

/**
     * The source path from which to link.
     */

/**
     * The length of the buffer pointed to by `old_path`.
     */

/**
     * The working directory at which the resolution of the new path starts.
     */

/**
     * The destination path at which to create the hard link.
     */

/**
     * The length of the buffer pointed to by `new_path`.
     */

/**
 * Open a file or directory.
 * The returned file descriptor is not guaranteed to be the lowest-numbered
 * file descriptor not currently open; it is randomized to prevent
 * applications from depending on making assumptions about indexes, since this
 * is error-prone in multi-threaded contexts. The returned file descriptor is
 * guaranteed to be less than 2**31.
 * Note: This is similar to `openat` in POSIX.
 */

/**
     * Flags determining the method of how the path is resolved.
     */

/**
     * The relative path of the file or directory to open, relative to the
     * `path_open::fd` directory.
     */

/**
     * The length of the buffer pointed to by `path`.
     */

/**
     * The method by which to open the file.
     */

/**
     * The initial rights of the newly created file descriptor. The
     * implementation is allowed to return a file descriptor with fewer rights
     * than specified, if and only if those rights do not apply to the type of
     * file being opened.
     * The *base* rights are rights that will apply to operations using the file
     * descriptor itself, while the *inheriting* rights are rights that apply to
     * file descriptors derived from it.
     */

/**
     * The file descriptor of the file that has been opened.
     */

/**
 * Read the contents of a symbolic link.
 * Note: This is similar to `readlinkat` in POSIX.
 */

/**
     * The path of the symbolic link from which to read.
     */

/**
     * The length of the buffer pointed to by `path`.
     */

/**
     * The buffer to which to write the contents of the symbolic link.
     */

/**
     * The number of bytes placed in the buffer.
     */

/**
 * Remove a directory.
 * Return `errno::notempty` if the directory is not empty.
 * Note: This is similar to `unlinkat(fd, path, AT_REMOVEDIR)` in POSIX.
 */

/**
     * The path to a directory to remove.
     */

/**
     * The length of the buffer pointed to by `path`.
     */

/**
 * Rename a file or directory.
 * Note: This is similar to `renameat` in POSIX.
 */

/**
     * The source path of the file or directory to rename.
     */

/**
     * The length of the buffer pointed to by `old_path`.
     */

/**
     * The working directory at which the resolution of the new path starts.
     */

/**
     * The destination path to which to rename the file or directory.
     */

/**
     * The length of the buffer pointed to by `new_path`.
     */

/**
 * Create a symbolic link.
 * Note: This is similar to `symlinkat` in POSIX.
 */

/**
     * The contents of the symbolic link.
     */

/**
     * The length of the buffer pointed to by `old_path`.
     */

/**
     * The destination path at which to create the symbolic link.
     */

/**
     * The length of the buffer pointed to by `new_path`.
     */

/**
 * Unlink a file.
 * Return `errno::isdir` if the path refers to a directory.
 * Note: This is similar to `unlinkat(fd, path, 0)` in POSIX.
 */

/**
     * The path to a file to unlink.
     */

/**
     * The length of the buffer pointed to by `path`.
     */

/**
 * Concurrently poll for the occurrence of a set of events.
 */

/**
     * The events to which to subscribe.
     */

/**
     * The events that have occurred.
     */

/**
     * Both the number of subscriptions and events.
     */

/**
     * The number of events stored.
     */

/**
 * Terminate the process normally. An exit code of 0 indicates successful
 * termination of the program. The meanings of other values is dependent on
 * the environment.
 */

/**
     * The exit code returned by the process.
     */

/**
 * Send a signal to the process of the calling thread.
 * Note: This is similar to `raise` in POSIX.
 */

/**
     * The signal condition to trigger.
     */

/**
 * Temporarily yield execution of the calling thread.
 * Note: This is similar to `sched_yield` in POSIX.
 */

/**
 * Write high-quality random data into a buffer.
 * This function blocks when the implementation is unable to immediately
 * provide sufficient high-quality random data.
 * This function may execute slowly, so when large mounts of random data are
 * required, it's advisable to use this function to seed a pseudo-random
 * number generator, rather than to provide the random data directly.
 */

/**
     * The buffer to fill with random data.
     */

/**
 * Receive a message from a socket.
 * Note: This is similar to `recv` in POSIX, though it also supports reading
 * the data into multiple buffers in the manner of `readv`.
 */

/**
     * List of scatter/gather vectors to which to store data.
     */

/**
     * The length of the array pointed to by `ri_data`.
     */

/**
     * Message flags.
     */

/**
     * Number of bytes stored in ri_data.
     */

/**
     * Message flags.
     */

/**
 * Send a message on a socket.
 * Note: This is similar to `send` in POSIX, though it also supports writing
 * the data from multiple buffers in the manner of `writev`.
 */

/**
     * List of scatter/gather vectors to which to retrieve data
     */

/**
     * The length of the array pointed to by `si_data`.
     */

/**
     * Message flags.
     */

/**
     * Number of bytes transmitted.
     */

/**
 * Shut down socket send and receive channels.
 * Note: This is similar to `shutdown` in POSIX.
 */

/**
     * Which channels on the socket to shut down.
     */

/** @} */


=== system/include/wasi/wasi-helpers.h ===
SHA256: 3cfdc700ba4d1db6b0d5c31461d6aa3efe2a67de8e0af3de112b9ead600e96bb
/*
 * Copyright 2019 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Converts a wasi return code to a musl syscall return code (-1 if

// error, 0 otherwise), and sets errno accordingly.

// Check if a wasi file descriptor is valid, returning 1 if valid and 0 if

// not. If not, also sets errno to EBADF.

// __wasi_emscripten_helpers_h


=== system/include/wasm_simd128.h ===
SHA256: 2ceaf7306d578bff6fda77d36794b66c38a4b4ffd61c7aced929d8ed6b676f47
/*
 * Copyright 2019 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// This header has been moved to the LLVM project:

// https://github.com/llvm/llvm-project/blob/main/clang/lib/Headers/wasm_simd128.h


=== system/include/webgl/webgl1_ext.h ===
SHA256: 0cd6430a078da98516a53f69d7027ab0ecb2de8d16960b22c9f8c3436083a8c5
/* This header webgl1_ext.h provides static linkage entry points to all WebGL extensions that
  the Khronos WebGL registry adds on top of the WebGL 1 API.

  In Emscripten, all GL extension function entry points are provided via static linkage.
  For best WebGL performance, call the statically linked gl*() functions in this header
  instead of using a dynamic function pointers via the glGetProcAddress() function.

  Include this header instead of the headers GLES2/gl2ext.h or GL/glext.h if you are
  developing a WebGL renderer as a first tier platform, and want to get "fail fast"
  compiler errors of GL symbols that are not supported on WebGL.

  Other features:
  - If you want to use one of the WebGL specific extensions that do not exist in
    GLES or desktop GL (such as WEBGL_lose_context or WEBGL_debug_shaders), include
    this header to get the function declarations and defines.

  - Unlike GLES and desktop GL, in WebGL one must explicitly enable an extension
    before using it. See below in the section of each extension for instructions
    on how to enable it, or link with -sGL_SUPPORT_AUTOMATIC_ENABLE_EXTENSIONS=1
    to automatically enable all non-debugging related WebGL extensions at startup.

  - If you are targeting multiple Emscripten compiler versions (e.g. a rendering
    library middleware), you can query whether static linkage to a particular
    extension is provided, by including this header and then checking

        #if EMSCRIPTEN_GL_WEBGL_polygon_mode
            // we can call glPolygonModeWEBGL() function
        #endif

  - To disable a particular WebGL extension from being declared in this header,
    you can add e.g.
       #define EMSCRIPTEN_GL_OES_texture_float 0
    before including this header.

  - For technical reasons, each function declaration comes in two variants:
      a glFoo() declaration, and a second emscripten_glFoo() copy.
    The emscripten_glFoo() variants exist for internal *GetProcAddress() and
    Emscripten -sOFFSCREEN_FRAMEBUFFER=1 features linkage purposes, and should
    be ignored by end users.
*/

// 1. https://www.khronos.org/registry/webgl/extensions/OES_texture_float/

// To enable: call emscripten_webgl_enable_extension(ctx, "OES_texture_float");

// <no functions exposed>

/* EMSCRIPTEN_GL_OES_texture_float */

// 2. https://www.khronos.org/registry/webgl/extensions/OES_texture_half_float/

// To enable: call emscripten_webgl_enable_extension(ctx, "OES_texture_half_float");

// <no functions exposed>

/* EMSCRIPTEN_GL_OES_texture_half_float */

// 3. https://www.khronos.org/registry/webgl/extensions/WEBGL_lose_context/

//#define EMSCRIPTEN_GL_WEBGL_lose_context 1

// TODO:

//WEBGL_APICALL EMSCRIPTEN_RESULT GL_APIENTRY emscripten_webgl_loseContext(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE contextHandle);

//WEBGL_APICALL EMSCRIPTEN_RESULT GL_APIENTRY emscripten_webgl_restoreContext(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE contextHandle);

/* EMSCRIPTEN_GL_WEBGL_lose_context */

// 4. https://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/

// To enable: call emscripten_webgl_enable_extension(ctx, "OES_standard_derivatives");

// <no functions exposed>

/* EMSCRIPTEN_GL_OES_standard_derivatives */

// 5. https://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/

// To enable: call

// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and

// call emscripten_webgl_enable_extension(ctx, "OES_vertex_array_object");

/* EMSCRIPTEN_GL_OES_vertex_array_object */

// 6. https://www.khronos.org/registry/webgl/extensions/WEBGL_debug_renderer_info/

// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_debug_renderer_info");

// <no functions exposed>

/* EMSCRIPTEN_GL_WEBGL_debug_renderer_info */

// 7. https://www.khronos.org/registry/webgl/extensions/WEBGL_debug_shaders/

// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_debug_shaders");

//TODO:

//WEBGL_APICALL void GL_APIENTRY emscripten_webgl_getTranslatedShaderSource(GLuint shader, GLsizei bufSize, GLsizei * _Nonnull length, GLchar * _Nonnull source);

/* EMSCRIPTEN_GL_WEBGL_debug_shaders */

// 8. https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/

// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_compressed_texture_s3tc");

// <no functions exposed>

/* EMSCRIPTEN_GL_WEBGL_compressed_texture_s3tc */

// 9. https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/

// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_depth_texture");

// <no functions exposed>

/* EMSCRIPTEN_GL_WEBGL_depth_texture */

// 10. https://www.khronos.org/registry/webgl/extensions/OES_element_index_uint/

// To enable: call emscripten_webgl_enable_extension(ctx, "OES_element_index_uint");

// <no functions exposed>

/* EMSCRIPTEN_GL_OES_element_index_uint */

// 11. https://www.khronos.org/registry/webgl/extensions/EXT_texture_filter_anisotropic/

// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_texture_filter_anisotropic");

// <no functions exposed>

/* EMSCRIPTEN_GL_EXT_texture_filter_anisotropic */

// 16. https://www.khronos.org/registry/webgl/extensions/EXT_frag_depth/

// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_frag_depth");

// <no functions exposed>

/* EMSCRIPTEN_GL_EXT_frag_depth */

// 18. https://www.khronos.org/registry/webgl/extensions/WEBGL_draw_buffers/

// To enable: call 

// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and

// call emscripten_webgl_enable_extension(ctx, "WEBGL_draw_buffers");

/* EMSCRIPTEN_GL_WEBGL_draw_buffers */

// 19. https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/

// To enable: call

// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and

// call emscripten_webgl_enable_extension(ctx, "ANGLE_instanced_arrays");

/* EMSCRIPTEN_GL_ANGLE_instanced_arrays */

// 20. https://www.khronos.org/registry/webgl/extensions/OES_texture_float_linear/

// To enable: call emscripten_webgl_enable_extension(ctx, "OES_texture_float_linear");

// <no functions exposed>

/* EMSCRIPTEN_GL_OES_texture_float_linear */

// 21. https://www.khronos.org/registry/webgl/extensions/OES_texture_half_float_linear/

// To enable: call emscripten_webgl_enable_extension(ctx, "OES_texture_half_float_linear");

// <no functions exposed>

/* EMSCRIPTEN_GL_OES_texture_half_float_linear */

// 25. https://www.khronos.org/registry/webgl/extensions/EXT_blend_minmax/

// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_blend_minmax");

// <no functions exposed>

/* EMSCRIPTEN_GL_EXT_blend_minmax */

// 27. https://www.khronos.org/registry/webgl/extensions/EXT_shader_texture_lod/

// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_shader_texture_lod");

// <no functions exposed>

/* EMSCRIPTEN_GL_EXT_shader_texture_lod */

// 13. https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/

// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_compressed_texture_pvrtc");

// <no functions exposed>

/* EMSCRIPTEN_GL_WEBGL_compressed_texture_pvrtc */

// 14. https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_half_float/

// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_color_buffer_half_float");

// <no functions exposed>

/* EMSCRIPTEN_GL_EXT_color_buffer_half_float */

// 15. https://www.khronos.org/registry/webgl/extensions/WEBGL_color_buffer_float/

// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_color_buffer_float");

// <no functions exposed>

/* EMSCRIPTEN_GL_WEBGL_color_buffer_float */

// 17. https://www.khronos.org/registry/webgl/extensions/EXT_sRGB/

// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_sRGB");

// <no functions exposed>

/* EMSCRIPTEN_GL_EXT_sRGB */

// 24. https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc1/

// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_compressed_texture_etc1");

// <no functions exposed>

/* EMSCRIPTEN_GL_WEBGL_compressed_texture_etc1 */

// 26. https://www.khronos.org/registry/webgl/extensions/EXT_disjoint_timer_query/

/* EMSCRIPTEN_GL_EXT_disjoint_timer_query */

// 29. https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc/

// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_compressed_texture_etc");

// <no functions exposed>

/* EMSCRIPTEN_GL_WEBGL_compressed_texture_etc */

// 30. https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/

// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_compressed_texture_astc");

//TODO:

//WEBGL_APICALL void GL_APIENTRY emscripten_webgl_getSupportedAstcProfiles(GLsizei bufSize, GLsizei * _Nonnull length, GLchar * _Nonnull buf);

/* EMSCRIPTEN_GL_WEBGL_compressed_texture_astc */

// 31. https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_float/

// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_color_buffer_float");

// <no functions exposed>

/* EMSCRIPTEN_GL_EXT_color_buffer_float */

// 32. https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc_srgb/

// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_compressed_texture_s3tc_srgb");

// <no functions exposed>

/* EMSCRIPTEN_GL_WEBGL_compressed_texture_s3tc_srgb */

// 37. https://www.khronos.org/registry/webgl/extensions/KHR_parallel_shader_compile/

// To enable: call emscripten_webgl_enable_extension(ctx, "KHR_parallel_shader_compile");

// <no functions exposed>

// 40. https://www.khronos.org/registry/webgl/extensions/WEBGL_multi_draw/

// To enable: call

// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and

// call emscripten_webgl_enable_extension(ctx, "WEBGL_multi_draw");

/* EMSCRIPTEN_GL_WEBGL_multi_draw */

// 44. https://www.khronos.org/registry/webgl/extensions/EXT_texture_norm16/

// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_texture_norm16");

// <no functions exposed>

/* EMSCRIPTEN_GL_EXT_texture_norm16 */

// EMSCRIPTEN_explicit_uniform_location

// https://github.com/emscripten-core/emscripten/blob/main/docs/EMSCRIPTEN_explicit_uniform_location.txt

// To enable: link with -sGL_EXPLICIT_UNIFORM_LOCATION=1

// <no functions exposed>

// EMSCRIPTEN_explicit_uniform_binding

// https://github.com/emscripten-core/emscripten/blob/main/docs/EMSCRIPTEN_explicit_uniform_binding.txt

// To enable: link with -sGL_EXPLICIT_UNIFORM_BINDING=1

// <no functions or defines exposed>

// 50. https://registry.khronos.org/webgl/extensions/EXT_polygon_offset_clamp/

// To enable: call

// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and

// call emscripten_webgl_enable_extension(ctx, "EXT_polygon_offset_clamp");

// 51. https://registry.khronos.org/webgl/extensions/EXT_clip_control/

// To enable: call

// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and

// call emscripten_webgl_enable_extension(ctx, "EXT_clip_control");

// 52. https://registry.khronos.org/webgl/extensions/EXT_depth_clamp/

// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_depth_clamp");

// <no functions exposed>

// 53. https://registry.khronos.org/webgl/extensions/WEBGL_polygon_mode/

// To enable: call

// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and

// call emscripten_webgl_enable_extension(ctx, "WEBGL_polygon_mode");

/* To add a new GL extension here, follow the template

// <num>. <online URL to extension documentation>
#ifndef EMSCRIPTEN_GL_<extension_name>
#ifndef EMSCRIPTEN_GL_<extension_name> 1
// To enable: <enable_instructions>
<exposed defines>
<exposed emscripten_gl* function declarations>
<exposed gl* function declarations>
#endif
*/


=== system/include/webgl/webgl2.h ===
SHA256: b748fd0dc0681317b8c12f50a8d2a9a1679e0914363869ea765ee8f5499be212
// WebGL 2 functions that do not exist in GLES3.0:

// Extensions:


=== system/include/webgl/webgl2_ext.h ===
SHA256: 24ad0a7ab1ddd3afacf18ede25f096988cc7c1945a1dc14c72bcb7047b61c0a1
// 33. https://www.khronos.org/registry/webgl/extensions/EXT_disjoint_timer_query_webgl2/

/* EMSCRIPTEN_GL_EXT_disjoint_timer_query_webgl2 */

// 46. https://www.khronos.org/registry/webgl/extensions/WEBGL_draw_instanced_base_vertex_base_instance/

/* EMSCRIPTEN_GL_WEBGL_draw_instanced_base_vertex_base_instance */

// 47. https://www.khronos.org/registry/webgl/extensions/WEBGL_multi_draw_instanced_base_vertex_base_instance/

/* EMSCRIPTEN_GL_WEBGL_multi_draw_instanced_base_vertex_base_instance */


=== system/lib/al.c ===
SHA256: fb69daa39ccd292d7e2cba5c4beff25027f7e90f5a673531e5cdb47474f37472
/*
 * Copyright 2017 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// AL proc address retrieval

// ALC extensions

// Validate the input.

/* ALC_INVALID_VALUE */

// Base API

// Extensions

// Validate the state and the input.

/* AL_INVALID_VALUE */

// Base API

// Extensions


=== system/lib/compiler-rt/__c_longjmp.S ===
SHA256: 2ed45a3b6248554a9d6824a1bdfc6dd245d400c45db1dd217e90734656cdbbd5
/*
 * Copyright 2025 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 *
 * Define the `__c_longjmp` Wasm EH tag which is used to implement setjmp/longjmp
 * in LLVM.
 */

#ifdef __wasm_exception_handling__

#ifdef __wasm64__
#define PTR i64
#else
#define PTR i32
#endif

.globl __c_longjmp
.tagtype __c_longjmp PTR
__c_longjmp:

#endif // !__wasm_exception_handling__



=== system/lib/compiler-rt/emscripten_exception_builtins.c ===
SHA256: 48e70458a6cc487f78b2406931cc6da9f12b81f72b2cd5098ff9216c6cd65f16
/*
 * Copyright 2018 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 *
 * Support functions for emscripten setjmp/longjmp and exception handling
 * support. References to the things below are generated in the LLVM backend.
 * See: https://llvm.org/doxygen/WebAssemblyLowerEmscriptenEHSjLj_8cpp.html
 */


=== system/lib/compiler-rt/emscripten_setjmp.c ===
SHA256: 9f085d529add34394f30fc2ffd3d53ba129ed23bfc32b87a5bd0ae43af05cabd
/*
* Copyright 2020 The Emscripten Authors.  All rights reserved.
* Emscripten is available under two separate licenses, the MIT license and the
* University of Illinois/NCSA Open Source License.  Both these licenses can be
* found in the LICENSE file.
*/

// jmp_buf should have large enough size and alignment to contain

// this structure.

// ABI contract

// sanity check

// ABI contract

// sanity check

// llvm uses `1` for the __c_longjmp tag.

// See https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/CodeGen/WasmEHFuncInfo.h

// Wasm EH allows us to throw and catch multiple values, but that requires

// multivalue support in the toolchain, which is not reliable at the time.

// TODO Consider switching to throwing two values at the same time later.

// C standard says:

// The longjmp function cannot cause the setjmp macro to return

// the value 0; if val is 0, the setjmp macro returns the value 1.

// C standard:

//   The longjmp function cannot cause the setjmp macro to return

//   the value 0; if val is 0, the setjmp macro returns the value 1.


=== system/lib/compiler-rt/emscripten_tempret.s ===
SHA256: 4e24aadf1832b97bbf0b3e31ec684ed5dee2abc7469bf4fa8334482fc35eeebf
.section .globals,"",@

.globaltype tempRet0, i32
tempRet0:

.section .text,"",@

.globl _emscripten_tempret_set
_emscripten_tempret_set:
  .functype _emscripten_tempret_set (i32) -> ()
  local.get 0
  global.set tempRet0
  end_function

.globl _emscripten_tempret_get
_emscripten_tempret_get:
  .functype _emscripten_tempret_get () -> (i32)
  global.get tempRet0
  end_function

# These aliases exist for LegalizeJSInterface pass in binaryen
# They get exported by emcc and the exports are then removed by the
# binaryen pass
.globl __get_temp_ret
.type __get_temp_ret, @function
__get_temp_ret = _emscripten_tempret_get

.globl __set_temp_ret
.type __set_temp_ret, @function
__set_temp_ret = _emscripten_tempret_set

# These aliases exist for the llvm passes that generate calls to these
# functions.  These aliases should no longer be exported by emscripten
# and hopefully can be removed if/when we transition llvm to the new names
# above.
.globl getTempRet0
.type getTempRet0, @function
getTempRet0 = _emscripten_tempret_get

.globl setTempRet0
.type setTempRet0, @function
setTempRet0 = _emscripten_tempret_set



=== system/lib/compiler-rt/include/profile/InstrProfData.inc ===
SHA256: 37a627d226dfb3067c9fd971788cdbb92800f74001d4964c44c4bd389bf2e17a
/*===-- InstrProfData.inc - instr profiling runtime structures -*- C++ -*-=== *\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

/*
 * This is the main file that defines all the data structure, signature,
 * constant literals that are shared across profiling runtime library,
 * compiler (instrumentation), and host tools (reader/writer). The entities
 * defined in this file affect the profile runtime ABI, the raw profile format,
 * or both.
 *
 * The file has two identical copies. The primary copy lives in LLVM and
 * the other one  sits in compiler-rt/lib/profile directory. To make changes
 * in this file, first modify the primary copy and copy it over to compiler-rt.
 * Testing of any change in this file can start only after the two copies are
 * synced up.
 *
 * The first part of the file includes macros that defines types, names, and
 * initializers for the member fields of the core data structures. The field
 * declarations for one structure is enabled by defining the field activation
 * macro associated with that structure. Only one field activation record
 * can be defined at one time and the rest definitions will be filtered out by
 * the preprocessor.
 *
 * Examples of how the template is used to instantiate structure definition:
 * 1. To declare a structure:
 *
 * struct ProfData {
 * #define INSTR_PROF_DATA(Type, LLVMType, Name, Initializer) \
 *    Type Name;
 * #include "llvm/ProfileData/InstrProfData.inc"
 * };
 *
 * 2. To construct LLVM type arrays for the struct type:
 *
 * Type *DataTypes[] = {
 * #define INSTR_PROF_DATA(Type, LLVMType, Name, Initializer) \
 *   LLVMType,
 * #include "llvm/ProfileData/InstrProfData.inc"
 * };
 *
 * 4. To construct constant array for the initializers:
 * #define INSTR_PROF_DATA(Type, LLVMType, Name, Initializer) \
 *   Initializer,
 * Constant *ConstantVals[] = {
 * #include "llvm/ProfileData/InstrProfData.inc"
 * };
 *
 *
 * The second part of the file includes definitions all other entities that
 * are related to runtime ABI and format. When no field activation macro is
 * defined, this file can be included to introduce the definitions.
 *
\*===----------------------------------------------------------------------===*/

/* Functions marked with INSTR_PROF_VISIBILITY must have hidden visibility in
 * the compiler runtime. */

// clang-format off:consider re-enabling clang-format if auto-formatted C macros

// are readable (e.g., after `issue #82426` is fixed)

/* INSTR_PROF_DATA start. */

/* Definition of member fields of the per-function control structure. */

/* This is used to map function pointers for the indirect call targets to
 * function name hashes during the conversion from raw to merged profile
 * data.
 */

/* INSTR_PROF_DATA end. */

/* For a virtual table object, record the name hash to associate profiled
 * addresses with global variables, and record {starting address, size in bytes}
 * to map the profiled virtual table (which usually have an offset from the
 * starting address) back to a virtual table object. */

/* INSTR_PROF_VTABLE_DATA end. */

/* This is an internal data structure used by value profiler. It
 * is defined here to allow serialization code sharing by LLVM
 * to be used in unit test.
 *
 * typedef struct ValueProfNode {
 *   // InstrProfValueData VData;
 *   uint64_t Value;
 *   uint64_t Count;
 *   struct ValueProfNode *Next;
 * } ValueProfNode;
 */

/* INSTR_PROF_VALUE_NODE start. */

/* INSTR_PROF_VALUE_NODE end. */

/* INSTR_PROF_RAW_HEADER  start */

/* Definition of member fields of the raw profile header data structure. */

/* Please update llvm/docs/InstrProfileFormat.rst as appropriate when updating
   raw profile format. */

/* INSTR_PROF_RAW_HEADER  end */

/* VALUE_PROF_FUNC_PARAM start */

/* Definition of parameter types of the runtime API used to do value profiling
 * for a given value site.
 */

/* VALUE_PROF_FUNC_PARAM end */

/* VALUE_PROF_KIND start */

/* For indirect function call value profiling, the addresses of the target
 * functions are profiled by the instrumented code. The target addresses are
 * written in the raw profile data and converted to target function name's MD5
 * hash by the profile reader during deserialization.  Typically, this happens
 * when the raw profile data is read during profile merging.
 *
 * For this remapping the ProfData is used.  ProfData contains both the function
 * name hash and the function address.
 */

/* For memory intrinsic functions size profiling. */

/* For virtual table address profiling, the address point of the virtual table
 * (i.e., the address contained in objects pointing to a virtual table) are
 * profiled. Note this may not be the address of the per C++ class virtual table
 *  object (e.g., there might be an offset).
 *
 * The profiled addresses are stored in raw profile, together with the following
 * two types of information.
 * 1. The (starting and ending) addresses of per C++ class virtual table objects.
 * 2. The (compressed) virtual table object names.
 * RawInstrProfReader converts profiled virtual table addresses to virtual table
 *  objects' MD5 hash.
 */

/* These two kinds must be the last to be
 * declared. This is to make sure the string
 * array created with the template can be
 * indexed with the kind value.
 */

/* VALUE_PROF_KIND end */

/* COVMAP_FUNC_RECORD start */

/* Definition of member fields of the function record structure in coverage
 * map.
 */

/* COVMAP_FUNC_RECORD end.  */

/* COVMAP_HEADER start */

/* Definition of member fields of coverage map header.
 */

/* COVMAP_HEADER end.  */

/* COVINIT_FUNC start */

/* COVINIT_FUNC end */

/*!
 * This is the header of the data structure that defines the on-disk
 * layout of the value profile data of a particular kind for one function.
 */

/* The kind of the value profile record. */

/*
   * The number of value profile sites. It is guaranteed to be non-zero;
   * otherwise the record for this kind won't be emitted.
   */

/*
   * The first element of the array that stores the number of profiled
   * values for each value site. The size of the array is NumValueSites.
   * Since NumValueSites is greater than zero, there is at least one
   * element in the array.
   */

/*
   * The fake declaration is for documentation purpose only.
   * Align the start of next field to be on 8 byte boundaries.
  uint8_t Padding[X];
   */

/* The array of value profile data. The size of the array is the sum
   * of all elements in SiteCountArray[].
  InstrProfValueData ValueData[];
   */

/*!
   * Return the number of value sites.
   */

/*!
   * Read data from this record and save it to Record.
   */

/*
   * In-place byte swap:
   * Do byte swap for this instance. \c Old is the original order before
   * the swap, and \c New is the New byte order.
   */

/*!
 * Per-function header/control data structure for value profiling
 * data in indexed format.
 */

/*
   * Total size in bytes including this field. It must be a multiple
   * of sizeof(uint64_t).
   */

/*
   *The number of value profile kinds that has value profile data.
   * In this implementation, a value profile kind is considered to
   * have profile data if the number of value profile sites for the
   * kind is not zero. More aggressively, the implementation can
   * choose to check the actual data value: if none of the value sites
   * has any profiled values, the kind can be skipped.
   */

/*
   * Following are a sequence of variable length records. The prefix/header
   * of each record is defined by ValueProfRecord type. The number of
   * records is NumValueKinds.
   * ValueProfRecord Record_1;
   * ValueProfRecord Record_N;
   */

/*!
   * Return the total size in bytes of the on-disk value profile data
   * given the data stored in Record.
   */

/*!
   * Return a pointer to \c ValueProfData instance ready to be streamed.
   */

/*!
   * Check the integrity of the record.
   */

/*!
   * Return a pointer to \c ValueProfileData instance ready to be read.
   * All data in the instance are properly byte swapped. The input
   * data is assumed to be in little endian order.
   */

/*!
   * Swap byte order from \c Endianness order to host byte order.
   */

/*!
   * Swap byte order from host byte order to \c Endianness order.
   */

/*!
   * Return the total size of \c ValueProfileData.
   */

/*!
   * Read data from this data and save it to \c Record.
   */

/*
 * The closure is designed to abstract away two types of value profile data:
 * - InstrProfRecord which is the primary data structure used to
 *   represent profile data in host tools (reader, writer, and profile-use)
 * - value profile runtime data structure suitable to be used by C
 *   runtime library.
 *
 * Both sources of data need to serialize to disk/memory-buffer in common
 * format: ValueProfData. The abstraction allows compiler-rt's raw profiler
 * writer to share the same format and code with indexed profile writer.
 *
 * For documentation of the member methods below, refer to corresponding methods
 * in class InstrProfRecord.
 */

/*
   * After extracting the value profile data from the value profile record,
   * this method is used to map the in-memory value to on-disk value. If
   * the method is null, value will be written out untranslated.
   */

/* INSTR_PROF_VALUE_PROF_DATA */

// clang-format on

/*!
 * Return the \c ValueProfRecord header size including the
 * padding bytes.
 */

/* Round the size to multiple of 8 bytes. */

/*!
 * Return the total size of the value profile record including the
 * header and the value data.
 */

/*!
 * Return the pointer to the start of value data array.
 */

/*!
 * Return the total number of value data for \c This record.
 */

/*!
 * Use this method to advance to the next \c This \c ValueProfRecord.
 */

/*!
 * Return the first \c ValueProfRecord instance.
 */

/* Closure based interfaces.  */

/*!
 * Return the total size in bytes of the on-disk value profile data
 * given the data stored in Record.
 */

/*!
 * Extract value profile data of a function for the profile kind \c ValueKind
 * from the \c Closure and serialize the data into \c This record instance.
 */

/*!
 * Extract value profile data of a function  from the \c Closure
 * and serialize the data into \c DstData if it is not NULL or heap
 * memory allocated by the \c Closure's allocator method. If \c
 * DstData is not null, the caller is expected to set the TotalSize
 * in DstData.
 */

/* INSTR_PROF_COMMON_API_IMPL */

/*============================================================================*/

// clang-format off:consider re-enabling clang-format if auto-formatted C macros

// are readable (e.g., after `issue #82426` is fixed)

/* Helper macros.  */

/* Magic number to detect file format and endianness.
 * Use 255 at one end, since no UTF-8 file can use that character.  Avoid 0,
 * so that utilities, like strings, don't grab it as a string.  129 is also
 * invalid UTF-8, and high enough to be interesting.
 * Use "lprofr" in the centre to stand for "LLVM Profile Raw", or "lprofR"
 * for 32-bit platforms.
 */

/* Raw profile format version (start from 1). */

/* Indexed profile format version (start from 1). */

/* Coverage mapping format version (start from 0). */

/* Profile version is always of type uint64_t. Reserve the upper 32 bits in the
 * version for other variants of profile. We set the 8th most significant bit
 * (i.e. bit 56) to 1 to indicate if this is an IR-level instrumentation
 * generated profile, and 0 if this is a Clang FE generated profile.
 * 1 in bit 57 indicates there are context-sensitive records in the profile.
 * The 54th bit indicates whether to always instrument loop entry blocks.
 * The 58th bit indicates whether to always instrument function entry blocks.
 * The 59th bit indicates whether to use debug info to correlate profiles.
 * The 60th bit indicates single byte coverage instrumentation.
 * The 61st bit indicates function entry instrumentation only.
 * The 62nd bit indicates whether memory profile information is present.
 * The 63rd bit indicates if this is a temporal profile.
 */

/* The variable that holds the name of the profile data
 * specified via command line. */

/* section name strings common to all targets other
   than WIN32 */

/* Windows section names. Because these section names contain dollar characters,
 * they must be quoted.
 */

/* Since cov data and cov names sections are not allocated, we don't need to
 * access them at runtime.
 */

// FIXME: Placeholder for Windows. Windows currently does not initialize

// the GCOV functions in the runtime.

/* Runtime section names and name strings.  */

/* Array of pointers. Each pointer points to a list
 * of value nodes associated with one value site.
 */

/* Value profile nodes section. */

/* Runtime section names and name strings.  */

/* Array of pointers. Each pointer points to a list
 * of value nodes associated with one value site.
 */

/* Value profile nodes section. */

/* Macros to define start/stop section symbol for a given
 * section on Linux. For instance
 * INSTR_PROF_SECT_START(INSTR_PROF_DATA_SECT_NAME) will
 * expand to __start___llvm_prof_data
 */

/* Value Profiling API linkage name.  */

/* InstrProfile per-function control data alignment.  */

/* The data structure that represents a tracked value by the
 * value profiler.
 */

/* Profiled value. */

/* Number of times the value appears in the training run. */

/* INSTR_PROF_DATA_INC */

/* The value range buckets (22 buckets) for the memop size value profiling looks
 * like:
 *
 *   [0, 0]
 *   [1, 1]
 *   [2, 2]
 *   [3, 3]
 *   [4, 4]
 *   [5, 5]
 *   [6, 6]
 *   [7, 7]
 *   [8, 8]
 *   [9, 15]
 *   [16, 16]
 *   [17, 31]
 *   [32, 32]
 *   [33, 63]
 *   [64, 64]
 *   [65, 127]
 *   [128, 128]
 *   [129, 255]
 *   [256, 256]
 *   [257, 511]
 *   [512, 512]
 *   [513, UINT64_MAX]
 *
 * Each range has a 'representative value' which is the lower end value of the
 * range and used to store in the runtime profile data records and the VP
 * metadata. For example, it's 2 for [2, 2] and 64 for [65, 127].
 */

/*
 * Clz and Popcount. This code was copied from
 * compiler-rt/lib/fuzzer/{FuzzerBuiltins.h,FuzzerBuiltinsMsvc.h} and
 * llvm/include/llvm/Support/MathExtras.h.
 */

// Scan the high 32 bits.

// Create a bit offset

// from the MSB.

// Scan the low 32 bits.

// This code originates from https://reviews.llvm.org/rG30626254510f.

/* defined(_MSC_VER) && !defined(__clang__) */

// clang-format on

/* Map an (observed) memop size value to the representative value of its range.
 * For example, 5 -> 5, 22 -> 17, 99 -> 65, 256 -> 256, 1001 -> 513. */

// The first ranges are individually tracked. Use the value as is.

// The last range is mapped to its lowest value.

// If it's a power of two, use it as is.

// Otherwise, take to the previous power of two + 1.

/* Return true if the range that an (observed) memop size value belongs to has
 * only a single value in the range.  For example, 0 -> true, 8 -> true, 10 ->
 * false, 64 -> true, 100 -> false, 513 -> false. */

// The first ranges are individually tracked.

// If it's a power of two, there's only one value.

// Otherwise, there's more than one value in the range.

/* INSTR_PROF_VALUE_PROF_MEMOP_API */


=== system/lib/compiler-rt/include/profile/MIBEntryDef.inc ===
SHA256: 258f2f52ee8edfb65fc5013fedb528cf98435bc602efa3ddfd9f5c26107d458a
/*===-- MemEntryDef.inc - MemProf profiling runtime macros -*- C++ -*-======== *\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

/*
 * This file defines the macros for memprof profiling data structures.
 * Eg. usage to define the memprof meminfoblock struct:
 *
 * struct MemInfoBlock {
 * #define MIBEntryDef(NameTag, Name, Type) Type Name;
 * #include MIBEntryDef.inc
 * #undef MIBEntryDef
 * };
 *
 * This file has two identical copies. The primary copy lives in LLVM and
 * the other one sits in compiler-rt/include/profile directory. To make changes
 * in this file, first modify the primary copy and copy it over to compiler-rt.
 * Testing of any change in this file can start only after the two copies are
 * synced up.
 *
\*===----------------------------------------------------------------------===*/


=== system/lib/compiler-rt/include/profile/MemProfData.inc ===
SHA256: a6634bac8cb5b688070343f1c875b4e062a6219f851bd9332f5d06220985180c
/*===-- MemProfData.inc - MemProf profiling runtime structures -*- C++ -*-=== *\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

/*
 * This is the main file that defines all the data structure, signature,
 * constant literals that are shared across profiling runtime library,
 * and host tools (reader/writer).
 *
 * This file has two identical copies. The primary copy lives in LLVM and
 * the other one sits in compiler-rt/include/profile directory. To make changes
 * in this file, first modify the primary copy and copy it over to compiler-rt.
 * Testing of any change in this file can start only after the two copies are
 * synced up.
 *
\*===----------------------------------------------------------------------===*/

// A 64-bit magic number to uniquely identify the raw binary memprof profile file.

// The version number of the raw binary format.

// Currently supported versions.

// A struct describing the header used for the raw binary memprof profile format.

// A struct describing the information necessary to describe a /proc/maps

// segment entry for a particular binary/library identified by its build id.

// This constructor is only used in tests so don't set the BuildId.

// Packed struct definition for MSVC. We can't use the PACKED macro defined in

// MemProfData.inc since it would mean we are embedding a directive (the

// #include for MIBEntryDef) into the macros which is undefined behaviour.

// A struct representing the heap allocation characteristics of a particular

// runtime context. This struct is shared between the compiler-rt runtime and

// the raw profile reader. The indexed format uses a separate, self-describing

// backwards compatible format.

// Access density is accesses per byte. Multiply by 100 to include the

// fractional part.

// Lifetime access density is the access density per second of lifetime.

// Multiply by 1000 to convert denominator lifetime to seconds (using a

// minimum lifetime of 1ms to avoid divide by 0. Do the multiplication first

// to reduce truncations to 0.

// We know newMIB was deallocated later, so just need to check if it was

// allocated before last one deallocated.

// For merging histograms, we always keep the longer histogram, and add

// values of shorter histogram to larger one.

// Swap histogram of current to larger histogram

// namespace memprof

// namespace llvm


=== system/lib/compiler-rt/include/profile/instr_prof_interface.h ===
SHA256: e799e4872db5104692980bd2a7349d383d1dfeee9fe02eb3e5ede302dc23c7e0
/*===---- instr_prof_interface.h - Instrumentation PGO User Program API ----===
 *
 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 * See https://llvm.org/LICENSE.txt for license information.
 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 *
 *===-----------------------------------------------------------------------===
 *
 * This header provides a public interface for fine-grained control of counter
 * reset and profile dumping. These interface functions can be directly called
 * in user programs.
 *
\*===---------------------------------------------------------------------===*/

// Profile file reset and dump interfaces.

// When `-fprofile[-instr]-generate`/`-fcs-profile-generate` is in effect,

// clang defines __LLVM_INSTR_PROFILE_GENERATE to pick up the API calls.

/*!
 * \brief Set the filename for writing instrumentation data.
 *
 * Sets the filename to be used for subsequent calls to
 * \a __llvm_profile_write_file().
 *
 * \c Name is not copied, so it must remain valid.  Passing NULL resets the
 * filename logic to the default behaviour.
 *
 * Note: There may be multiple copies of the profile runtime (one for each
 * instrumented image/DSO). This API only modifies the filename within the
 * copy of the runtime available to the calling image.
 *
 * Warning: This is a no-op if continuous mode (\ref
 * __llvm_profile_is_continuous_mode_enabled) is on. The reason for this is
 * that in continuous mode, profile counters are mmap()'d to the profile at
 * program initialization time. Support for transferring the mmap'd profile
 * counts to a new file has not been implemented.
 */

/*!
 * \brief Interface to set all PGO counters to zero for the current process.
 *
 */

/*!
 * \brief this is a wrapper interface to \c __llvm_profile_write_file.
 * After this interface is invoked, an already dumped flag will be set
 * so that profile won't be dumped again during program exit.
 * Invocation of interface __llvm_profile_reset_counters will clear
 * the flag. This interface is designed to be used to collect profile
 * data from user selected hot regions. The use model is
 *      __llvm_profile_reset_counters();
 *      ... hot region 1
 *      __llvm_profile_dump();
 *      .. some other code
 *      __llvm_profile_reset_counters();
 *      ... hot region 2
 *      __llvm_profile_dump();
 *
 *  It is expected that on-line profile merging is on with \c %m specifier
 *  used in profile filename . If merging is not turned on, user is expected
 *  to invoke __llvm_profile_set_filename to specify different profile names
 *  for different regions before dumping to avoid profile write clobbering.
 */

// extern "C"


=== system/lib/compiler-rt/include/sanitizer/allocator_interface.h ===
SHA256: 94be5aa9568359b0a1e331836221d05713d6810c28c6ed688d2aea6f3861348d
//===-- allocator_interface.h ---------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Public interface header for allocator used in sanitizers (ASan/TSan/MSan).

//===----------------------------------------------------------------------===//

/* Returns the estimated number of bytes that will be reserved by allocator
   for request of "size" bytes. If allocator can't allocate that much
   memory, returns the maximal possible allocation size, otherwise returns
   "size". */

/* Returns true if p was returned by the allocator and
   is not yet freed. */

/* If a pointer lies within an allocation, it will return the start address
   of the allocation. Otherwise, it returns nullptr. */

/* Returns the number of bytes reserved for the pointer p.
   Requires (get_ownership(p) == true) or (p == 0). */

/* Returns the number of bytes reserved for the pointer p.
   Requires __sanitizer_get_allocated_begin(p) == p. */

/* Number of bytes, allocated and not yet freed by the application. */

/* Number of bytes, mmaped by the allocator to fulfill allocation requests.
   Generally, for request of X bytes, allocator can reserve and add to free
   lists a large number of chunks of size X to use them for future requests.
   All these chunks count toward the heap size. Currently, allocator never
   releases memory to OS (instead, it just puts freed chunks to free
   lists). */

/* Number of bytes, mmaped by the allocator, which can be used to fulfill
   allocation requests. When a user program frees memory chunk, it can first
   fall into quarantine and will count toward __sanitizer_get_free_bytes()
   later. */

/* Number of bytes in unmapped pages, that are released to OS. Currently,
   always returns 0. */

/* Malloc hooks that may be optionally provided by user.
   - __sanitizer_malloc_hook(ptr, size) is called immediately after allocation
     of "size" bytes, which returned "ptr".
   - __sanitizer_free_hook(ptr) is called immediately before deallocation of
     "ptr".
   - __sanitizer_ignore_free_hook(ptr) is called immediately before deallocation
     of "ptr", and if it returns a non-zero value, the deallocation of "ptr"
     will not take place. This allows software to make free a no-op until it
     calls free() again in the same pointer at a later time. Hint: read this as
     "ignore the free" rather than "ignore the hook".
*/

/* Installs a pair of hooks for malloc/free.
   Several (currently, 5) hook pairs may be installed, they are executed
   in the order they were installed and after calling
   __sanitizer_malloc_hook/__sanitizer_free_hook.
   Unlike __sanitizer_malloc_hook/__sanitizer_free_hook these hooks can be
   chained and do not rely on weak symbols working on the platform, but
   require __sanitizer_install_malloc_and_free_hooks to be called at startup
   and thus will not be called on malloc/free very early in the process.
   Returns the number of hooks currently installed or 0 on failure.
   Not thread-safe, should be called in the main thread before starting
   other threads.
*/

/* Drains allocator quarantines (calling thread's and global ones), returns
   freed memory back to OS and releases other non-essential internal allocator
   resources in attempt to reduce process RSS.
   Currently available with ASan only.
*/

// extern "C"


=== system/lib/compiler-rt/include/sanitizer/asan_interface.h ===
SHA256: a0845c4541636053d42ad6f7aafcba588f0ce054eb172c16faa1b7888f8b5f69
//===-- sanitizer/asan_interface.h ------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer (ASan).

//

// Public interface header.

//===----------------------------------------------------------------------===//

/// Marks a memory region (<c>[addr, addr+size)</c>) as unaddressable.

///

/// This memory must be previously allocated by your program. Instrumented

/// code is forbidden from accessing addresses in this region until it is

/// unpoisoned. This function is not guaranteed to poison the entire region -

/// it could poison only a subregion of <c>[addr, addr+size)</c> due to ASan

/// alignment restrictions.

///

/// \note This function is not thread-safe because no two threads can poison or

/// unpoison memory in the same memory region simultaneously.

///

/// \param addr Start of memory region.

/// \param size Size of memory region.

/// Marks a memory region (<c>[addr, addr+size)</c>) as addressable.

///

/// This memory must be previously allocated by your program. Accessing

/// addresses in this region is allowed until this region is poisoned again.

/// This function could unpoison a super-region of <c>[addr, addr+size)</c> due

/// to ASan alignment restrictions.

///

/// \note This function is not thread-safe because no two threads can

/// poison or unpoison memory in the same memory region simultaneously.

///

/// \param addr Start of memory region.

/// \param size Size of memory region.

// Macros provided for convenience.

/// Marks a memory region as unaddressable.

///

/// \note Macro provided for convenience; defined as a no-op if ASan is not

/// enabled.

///

/// \param addr Start of memory region.

/// \param size Size of memory region.

/// Marks a memory region as addressable.

///

/// \note Macro provided for convenience; defined as a no-op if ASan is not

/// enabled.

///

/// \param addr Start of memory region.

/// \param size Size of memory region.

/// Checks if an address is poisoned.

///

/// Returns 1 if <c><i>addr</i></c> is poisoned (that is, 1-byte read/write

/// access to this address would result in an error report from ASan).

/// Otherwise returns 0.

///

/// \param addr Address to check.

///

/// \retval 1 Address is poisoned.

/// \retval 0 Address is not poisoned.

/// Checks if a region is poisoned.

///

/// If at least one byte in <c>[beg, beg+size)</c> is poisoned, returns the

/// address of the first such byte. Otherwise returns 0.

///

/// \param beg Start of memory region.

/// \param size Start of memory region.

/// \returns Address of first poisoned byte.

/// Describes an address (useful for calling from the debugger).

///

/// Prints the description of <c><i>addr</i></c>.

///

/// \param addr Address to describe.

/// Checks if an error has been or is being reported (useful for calling from

/// the debugger to get information about an ASan error).

///

/// Returns 1 if an error has been (or is being) reported. Otherwise returns 0.

///

/// \returns 1 if an error has been (or is being) reported. Otherwise returns

/// 0.

/// Gets the PC (program counter) register value of an ASan error (useful for

/// calling from the debugger).

///

/// Returns PC if an error has been (or is being) reported.

/// Otherwise returns 0.

///

/// \returns PC value.

/// Gets the BP (base pointer) register value of an ASan error (useful for

/// calling from the debugger).

///

/// Returns BP if an error has been (or is being) reported.

/// Otherwise returns 0.

///

/// \returns BP value.

/// Gets the SP (stack pointer) register value of an ASan error (useful for

/// calling from the debugger).

///

/// If an error has been (or is being) reported, returns SP.

/// Otherwise returns 0.

///

/// \returns SP value.

/// Gets the address of the report buffer of an ASan error (useful for calling

/// from the debugger).

///

/// Returns the address of the report buffer if an error has been (or is being)

/// reported. Otherwise returns 0.

///

/// \returns Address of report buffer.

/// Gets access type of an ASan error (useful for calling from the debugger).

///

/// Returns access type (read or write) if an error has been (or is being)

/// reported. Otherwise returns 0.

///

/// \returns Access type (0 = read, 1 = write).

/// Gets access size of an ASan error (useful for calling from the debugger).

///

/// Returns access size if an error has been (or is being) reported. Otherwise

/// returns 0.

///

/// \returns Access size in bytes.

/// Gets the bug description of an ASan error (useful for calling from a

/// debugger).

///

/// \returns Returns a bug description if an error has been (or is being)

/// reported - for example, "heap-use-after-free". Otherwise returns an empty

/// string.

/// Gets information about a pointer (useful for calling from the debugger).

///

/// Returns the category of the given pointer as a constant string.

/// Possible return values are <c>global</c>, <c>stack</c>, <c>stack-fake</c>,

/// <c>heap</c>, <c>heap-invalid</c>, <c>shadow-low</c>, <c>shadow-gap</c>,

/// <c>shadow-high</c>, and <c>unknown</c>.

///

/// If the return value is <c>global</c> or <c>stack</c>, tries to also return

/// the variable name, address, and size. If the return value is <c>heap</c>,

/// tries to return the chunk address and size. <c><i>name</i></c> should point

/// to an allocated buffer of size <c><i>name_size</i></c>.

///

/// \param addr Address to locate.

/// \param name Buffer to store the variable's name.

/// \param name_size Size in bytes of the variable's name buffer.

/// \param[out] region_address Address of the region.

/// \param[out] region_size Size of the region in bytes.

///

/// \returns Returns the category of the given pointer as a constant string.

/// Gets the allocation stack trace and thread ID for a heap address (useful

/// for calling from the debugger).

///

/// Stores up to <c><i>size</i></c> frames in <c><i>trace</i></c>. Returns

/// the number of stored frames or 0 on error.

///

/// \param addr A heap address.

/// \param trace A buffer to store the stack trace.

/// \param size Size in bytes of the trace buffer.

/// \param[out] thread_id The thread ID of the address.

///

/// \returns Returns the number of stored frames or 0 on error.

/// Gets the free stack trace and thread ID for a heap address (useful for

/// calling from the debugger).

///

/// Stores up to <c><i>size</i></c> frames in <c><i>trace</i></c>. Returns

/// the number of stored frames or 0 on error.

///

/// \param addr A heap address.

/// \param trace A buffer to store the stack trace.

/// \param size Size in bytes of the trace buffer.

/// \param[out] thread_id The thread ID of the address.

///

/// \returns Returns the number of stored frames or 0 on error.

/// Gets the current shadow memory mapping (useful for calling from the

/// debugger).

///

/// \param[out] shadow_scale Shadow scale value.

/// \param[out] shadow_offset Offset value.

/// This is an internal function that is called to report an error. However,

/// it is still a part of the interface because you might want to set a

/// breakpoint on this function in the debugger.

///

/// \param pc <c><i>pc</i></c> value of the ASan error.

/// \param bp <c><i>bp</i></c> value of the ASan error.

/// \param sp <c><i>sp</i></c> value of the ASan error.

/// \param addr Address of the ASan error.

/// \param is_write True if the error is a write error; false otherwise.

/// \param access_size Size of the memory access of the ASan error.

// Deprecated. Call __sanitizer_set_death_callback instead.

/// Sets the callback function to be called during ASan error reporting.

///

/// The callback provides a string pointer to the report.

///

/// \param callback User-provided function.

/// User-provided callback on ASan errors.

///

/// You can provide a function that would be called immediately when ASan

/// detects an error. This is useful in cases when ASan detects an error but

/// your program crashes before the ASan report is printed.

/// Prints accumulated statistics to <c>stderr</c> (useful for calling from the

/// debugger).

/// User-provided default option settings.

///

/// You can provide your own implementation of this function to return a string

/// containing ASan runtime options (for example,

/// <c>verbosity=1:halt_on_error=0</c>).

///

/// \returns Default options string.

// The following two functions facilitate garbage collection in presence of

// ASan's fake stack.

/// Gets an opaque handler to the current thread's fake stack.

///

/// Returns an opaque handler to be used by

/// <c>__asan_addr_is_in_fake_stack()</c>. Returns NULL if the current thread

/// does not have a fake stack.

///

/// \returns An opaque handler to the fake stack or NULL.

/// Checks if an address belongs to a given fake stack.

///

/// If <c><i>fake_stack</i></c> is non-NULL and <c><i>addr</i></c> belongs to a

/// fake frame in <c><i>fake_stack</i></c>, returns the address of the real

/// stack that corresponds to the fake frame and sets <c><i>beg</i></c> and

/// <c><i>end</i></c> to the boundaries of this fake frame. Otherwise returns

/// NULL and does not touch <c><i>beg</i></c> and <c><i>end</i></c>.

///

/// If <c><i>beg</i></c> or <c><i>end</i></c> are NULL, they are not touched.

///

/// \note This function can be called from a thread other than the owner of

/// <c><i>fake_stack</i></c>, but the owner thread needs to be alive.

///

/// \param fake_stack An opaque handler to a fake stack.

/// \param addr Address to test.

/// \param[out] beg Beginning of fake frame.

/// \param[out] end End of fake frame.

/// \returns Stack address or NULL.

/// Performs shadow memory cleanup of the current thread's stack before a

/// function marked with the <c>[[noreturn]]</c> attribute is called.

///

/// To avoid false positives on the stack, must be called before no-return

/// functions like <c>_exit()</c> and <c>execl()</c>.

/// Update allocation stack trace for the given allocation to the current stack

/// trace. Returns 1 if successful, 0 if not.

// extern "C"

// SANITIZER_ASAN_INTERFACE_H


=== system/lib/compiler-rt/include/sanitizer/common_interface_defs.h ===
SHA256: c9b7f630c91170a6f5557cbc8752ee724fcf905dbd4eaa0734a7b2e78d8fa037
//===-- sanitizer/common_interface_defs.h -----------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Common part of the public sanitizer interface.

//===----------------------------------------------------------------------===//

// Windows allows a user to set their default calling convention, but we always

// use __cdecl

// Arguments for __sanitizer_sandbox_on_notify() below.

// Enable sandbox support in sanitizer coverage.

// File descriptor to write coverage data to. If -1 is passed, a file will

// be pre-opened by __sanitizer_sandbox_on_notify(). This field has no

// effect if coverage_sandboxed == 0.

// If non-zero, split the coverage data into well-formed blocks. This is

// useful when coverage_fd is a socket descriptor. Each block will contain

// a header, allowing data from multiple processes to be sent over the same

// socket.

// Tell the tools to write their reports to "path.<pid>" instead of stderr.

// Tell the tools to write their reports to the provided file descriptor

// (casted to void *).

// Get the current full report file path, if a path was specified by

// an earlier call to __sanitizer_set_report_path. Returns null otherwise.

// Notify the tools that the sandbox is going to be turned on. The reserved

// parameter will be used in the future to hold a structure with functions

// that the tools may call to bypass the sandbox.

// This function is called by the tool when it has just finished reporting

// an error. 'error_summary' is a one-line string that summarizes

// the error message. This function can be overridden by the client.

// Some of the sanitizers (for example ASan/TSan) could miss bugs that happen

// in unaligned loads/stores. To find such bugs reliably, you need to replace

// plain unaligned loads/stores with these calls.

/// Loads a 16-bit unaligned value.

//

/// \param p Pointer to unaligned memory.

///

/// \returns Loaded value.

/// Loads a 32-bit unaligned value.

///

/// \param p Pointer to unaligned memory.

///

/// \returns Loaded value.

/// Loads a 64-bit unaligned value.

///

/// \param p Pointer to unaligned memory.

///

/// \returns Loaded value.

/// Stores a 16-bit unaligned value.

///

/// \param p Pointer to unaligned memory.

/// \param x 16-bit value to store.

/// Stores a 32-bit unaligned value.

///

/// \param p Pointer to unaligned memory.

/// \param x 32-bit value to store.

/// Stores a 64-bit unaligned value.

///

/// \param p Pointer to unaligned memory.

/// \param x 64-bit value to store.

// Returns 1 on the first call, then returns 0 thereafter.  Called by the tool

// to ensure only one report is printed when multiple errors occur

// simultaneously.

/// Annotates the current state of a contiguous container, such as

/// <c>std::vector</c>, <c>std::string</c>, or similar.

///

/// A contiguous container is a container that keeps all of its elements

/// in a contiguous region of memory. The container owns the region of memory

/// <c>[beg, end)</c>; the memory <c>[beg, mid)</c> is used to store the

/// current elements, and the memory <c>[mid, end)</c> is reserved for future

/// elements (<c>beg <= mid <= end</c>). For example, in

/// <c>std::vector<> v</c>:

///

/// \code

///   beg = &v[0];

///   end = beg + v.capacity() * sizeof(v[0]);

///   mid = beg + v.size()     * sizeof(v[0]);

/// \endcode

///

/// This annotation tells the Sanitizer tool about the current state of the

/// container so that the tool can report errors when memory from

/// <c>[mid, end)</c> is accessed. Insert this annotation into methods like

/// <c>push_back()</c> or <c>pop_back()</c>. Supply the old and new values of

/// <c>mid</c>(<c><i>old_mid</i></c> and <c><i>new_mid</i></c>). In the initial

/// state <c>mid == end</c>, so that should be the final state when the

/// container is destroyed or when the container reallocates the storage.

///

/// For ASan, <c><i>beg</i></c> no longer needs to be 8-aligned,

/// first and last granule may be shared with other objects

/// and therefore the function can be used for any allocator.

///

/// The following example shows how to use the function:

///

/// \code

///   int32_t x[3]; // 12 bytes

///   char *beg = (char*)&x[0];

///   char *end = beg + 12;

///   __sanitizer_annotate_contiguous_container(beg, end, beg, end);

/// \endcode

///

/// \note  Use this function with caution and do not use for anything other

/// than vector-like classes.

/// \note  Unaligned <c><i>beg</i></c> or <c><i>end</i></c> may miss bugs in

/// these granules.

///

/// \param beg Beginning of memory region.

/// \param end End of memory region.

/// \param old_mid Old middle of memory region.

/// \param new_mid New middle of memory region.

/// Similar to <c>__sanitizer_annotate_contiguous_container</c>.

///

/// Annotates the current state of a contiguous container memory,

/// such as <c>std::deque</c>'s single chunk, when the boundries are moved.

///

/// A contiguous chunk is a chunk that keeps all of its elements

/// in a contiguous region of memory. The container owns the region of memory

/// <c>[storage_beg, storage_end)</c>; the memory <c>[container_beg,

/// container_end)</c> is used to store the current elements, and the memory

/// <c>[storage_beg, container_beg), [container_end, storage_end)</c> is

/// reserved for future elements (<c>storage_beg <= container_beg <=

/// container_end <= storage_end</c>). For example, in <c> std::deque </c>:

/// - chunk with a frist deques element will have container_beg equal to address

///  of the first element.

/// - in every next chunk with elements, true is  <c> container_beg ==

/// storage_beg </c>.

///

/// Argument requirements:

/// During unpoisoning memory of empty container (before first element is

/// added):

/// - old_container_beg_p == old_container_end_p

/// During poisoning after last element was removed:

/// - new_container_beg_p == new_container_end_p

/// \param storage_beg Beginning of memory region.

/// \param storage_end End of memory region.

/// \param old_container_beg Old beginning of used region.

/// \param old_container_end End of used region.

/// \param new_container_beg New beginning of used region.

/// \param new_container_end New end of used region.

/// Copies memory annotations from a source storage region to a destination

/// storage region. After the operation, the destination region has the same

/// memory annotations as the source region, as long as sanitizer limitations

/// allow it (more bytes may be unpoisoned than in the source region, resulting

/// in more false negatives, but never false positives). If the source and

/// destination regions overlap, only the minimal required changes are made to

/// preserve the correct annotations. Old storage bytes that are not in the new

/// storage should have the same annotations, as long as sanitizer limitations

/// allow it.

///

/// This function is primarily designed to be used when moving trivially

/// relocatable objects that may have poisoned memory, making direct copying

/// problematic under sanitizer. However, this function does not move memory

/// content itself, only annotations.

///

/// A contiguous container is a container that keeps all of its elements in a

/// contiguous region of memory. The container owns the region of memory

/// <c>[src_begin, src_end)</c> and <c>[dst_begin, dst_end)</c>. The memory

/// within these regions may be alternately poisoned and non-poisoned, with

/// possibly smaller poisoned and unpoisoned regions.

///

/// If this function fully poisons a granule, it is marked as "container

/// overflow".

///

/// Argument requirements: The destination container must have the same size as

/// the source container, which is inferred from the beginning and end of the

/// source region. Addresses may be granule-unaligned, but this may affect

/// performance.

///

/// \param src_begin Begin of the source container region.

/// \param src_end End of the source container region.

/// \param dst_begin Begin of the destination container region.

/// \param dst_end End of the destination container region.

/// Returns true if the contiguous container <c>[beg, end)</c> is properly

/// poisoned.

///

/// Proper poisoning could occur, for example, with

/// <c>__sanitizer_annotate_contiguous_container</c>), that is, if

/// <c>[beg, mid)</c> is addressable and <c>[mid, end)</c> is unaddressable.

/// Full verification requires O (<c>end - beg</c>) time; this function tries

/// to avoid such complexity by touching only parts of the container around

/// <c><i>beg</i></c>, <c><i>mid</i></c>, and <c><i>end</i></c>.

///

/// \param beg Beginning of memory region.

/// \param mid Middle of memory region.

/// \param end Old end of memory region.

///

/// \returns True if the contiguous container <c>[beg, end)</c> is properly

///  poisoned.

/// Returns true if the double ended contiguous

/// container <c>[storage_beg, storage_end)</c> is properly poisoned.

///

/// Proper poisoning could occur, for example, with

/// <c>__sanitizer_annotate_double_ended_contiguous_container</c>), that is, if

/// <c>[storage_beg, container_beg)</c> is not addressable, <c>[container_beg,

/// container_end)</c> is addressable and <c>[container_end, end)</c> is

/// unaddressable. Full verification requires O (<c>storage_end -

/// storage_beg</c>) time; this function tries to avoid such complexity by

/// touching only parts of the container around <c><i>storage_beg</i></c>,

/// <c><i>container_beg</i></c>, <c><i>container_end</i></c>, and

/// <c><i>storage_end</i></c>.

///

/// \param storage_beg Beginning of memory region.

/// \param container_beg Beginning of used region.

/// \param container_end End of used region.

/// \param storage_end End of memory region.

///

/// \returns True if the double-ended contiguous container <c>[storage_beg,

/// container_beg, container_end, end)</c> is properly poisoned - only

/// [container_beg; container_end) is addressable.

/// Similar to <c>__sanitizer_verify_contiguous_container()</c> but also

/// returns the address of the first improperly poisoned byte.

///

/// Returns NULL if the area is poisoned properly.

///

/// \param beg Beginning of memory region.

/// \param mid Middle of memory region.

/// \param end Old end of memory region.

///

/// \returns The bad address or NULL.

/// returns the address of the first improperly poisoned byte.

///

/// Returns NULL if the area is poisoned properly.

///

/// \param storage_beg Beginning of memory region.

/// \param container_beg Beginning of used region.

/// \param container_end End of used region.

/// \param storage_end End of memory region.

///

/// \returns The bad address or NULL.

/// Prints the stack trace leading to this call (useful for calling from the

/// debugger).

// Symbolizes the supplied 'pc' using the format string 'fmt'.

// Outputs at most 'out_buf_size' bytes into 'out_buf'.

// If 'out_buf' is not empty then output is zero or more non empty C strings

// followed by single empty C string. Multiple strings can be returned if PC

// corresponds to inlined function. Inlined frames are printed in the order

// from "most-inlined" to the "least-inlined", so the last frame should be the

// not inlined function.

// Inlined frames can be removed with 'symbolize_inline_frames=0'.

// The format syntax is described in

// lib/sanitizer_common/sanitizer_stacktrace_printer.h.

// Same as __sanitizer_symbolize_pc, but for data section (i.e. globals).

// Determine the return address.

/// Sets the callback to be called immediately before death on error.

///

/// Passing 0 will unset the callback.

///

/// \param callback User-provided callback.

// Interceptor hooks.

// Whenever a libc function interceptor is called, it checks if the

// corresponding weak hook is defined, and calls it if it is indeed defined.

// The primary use-case is data-flow-guided fuzzing, where the fuzzer needs

// to know what is being passed to libc functions (for example memcmp).

// FIXME: implement more hooks.

/// Interceptor hook for <c>memcmp()</c>.

///

/// \param called_pc PC (program counter) address of the original call.

/// \param s1 Pointer to block of memory.

/// \param s2 Pointer to block of memory.

/// \param n Number of bytes to compare.

/// \param result Value returned by the intercepted function.

/// Interceptor hook for <c>strncmp()</c>.

///

/// \param called_pc PC (program counter) address of the original call.

/// \param s1 Pointer to block of memory.

/// \param s2 Pointer to block of memory.

/// \param n Number of bytes to compare.

/// \param result Value returned by the intercepted function.

/// Interceptor hook for <c>strncasecmp()</c>.

///

/// \param called_pc PC (program counter) address of the original call.

/// \param s1 Pointer to block of memory.

/// \param s2 Pointer to block of memory.

/// \param n Number of bytes to compare.

/// \param result Value returned by the intercepted function.

/// Interceptor hook for <c>strcmp()</c>.

///

/// \param called_pc PC (program counter) address of the original call.

/// \param s1 Pointer to block of memory.

/// \param s2 Pointer to block of memory.

/// \param result Value returned by the intercepted function.

/// Interceptor hook for <c>strcasecmp()</c>.

///

/// \param called_pc PC (program counter) address of the original call.

/// \param s1 Pointer to block of memory.

/// \param s2 Pointer to block of memory.

/// \param result Value returned by the intercepted function.

/// Interceptor hook for <c>strstr()</c>.

///

/// \param called_pc PC (program counter) address of the original call.

/// \param s1 Pointer to block of memory.

/// \param s2 Pointer to block of memory.

/// \param result Value returned by the intercepted function.

// Prints stack traces for all live heap allocations ordered by total

// allocation size until top_percent of total live heap is shown. top_percent

// should be between 1 and 100. At most max_number_of_contexts contexts

// (stack traces) are printed.

// Experimental feature currently available only with ASan on Linux/x86_64.

/// Notify ASan that a fiber switch has started (required only if implementing

/// your own fiber library).

///

/// Before switching to a different stack, you must call

/// <c>__sanitizer_start_switch_fiber()</c> with a pointer to the bottom of the

/// destination stack and with its size. When code starts running on the new

/// stack, it must call <c>__sanitizer_finish_switch_fiber()</c> to finalize

/// the switch. The <c>__sanitizer_start_switch_fiber()</c> function takes a

/// <c>void**</c> pointer argument to store the current fake stack if there is

/// one (it is necessary when the runtime option

/// <c>detect_stack_use_after_return</c> is enabled).

///

/// When restoring a stack, this <c>void**</c> pointer must be given to the

/// <c>__sanitizer_finish_switch_fiber()</c> function. In most cases, this

/// pointer can be stored on the stack immediately before switching. When

/// leaving a fiber definitely, NULL must be passed as the first argument to

/// the <c>__sanitizer_start_switch_fiber()</c> function so that the fake stack

/// is destroyed. If your program does not need stack use-after-return

/// detection, you can always pass NULL to these two functions.

///

/// \note The fake stack mechanism is disabled during fiber switch, so if a

/// signal callback runs during the switch, it will not benefit from stack

/// use-after-return detection.

///

/// \param[out] fake_stack_save Fake stack save location.

/// \param bottom Bottom address of stack.

/// \param size Size of stack in bytes.

/// Notify ASan that a fiber switch has completed (required only if

/// implementing your own fiber library).

///

/// When code starts running on the new stack, it must call

/// <c>__sanitizer_finish_switch_fiber()</c> to finalize

/// the switch. For usage details, see the description of

/// <c>__sanitizer_start_switch_fiber()</c>.

///

/// \param fake_stack_save Fake stack save location.

/// \param[out] bottom_old Bottom address of old stack.

/// \param[out] size_old Size of old stack in bytes.

// Get full module name and calculate pc offset within it.

// Returns 1 if pc belongs to some module, 0 if module was not found.

// extern "C"

// SANITIZER_COMMON_INTERFACE_DEFS_H


=== system/lib/compiler-rt/include/sanitizer/coverage_interface.h ===
SHA256: 6313ecc71c8958568bb0bbf35a78933e55f3e2404f7090fad13834e9a79cccc7
//===-- sanitizer/coverage_interface.h --------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Public interface for sanitizer coverage.

//===----------------------------------------------------------------------===//

// Record and dump coverage info.

// Clear collected coverage info.

// Dump collected coverage info. Sorts pcs by module into individual .sancov

// files.

// extern "C"

// SANITIZER_COVERAG_INTERFACE_H


=== system/lib/compiler-rt/include/sanitizer/dfsan_interface.h ===
SHA256: 213c5f6712e5a44c1d7472769fcef9c4c60d78d910ecea0257560424f5b86e7d
//===-- dfsan_interface.h -------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of DataFlowSanitizer.

//

// Public interface header.

//===----------------------------------------------------------------------===//

/// Signature of the callback argument to dfsan_set_write_callback().

/// Signature of the callback argument to dfsan_set_conditional_callback().

/// Signature of the callback argument to dfsan_set_reaches_function_callback().

/// The description is intended to hold the name of the variable.

/// Computes the union of \c l1 and \c l2, resulting in a union label.

/// Sets the label for each address in [addr,addr+size) to \c label.

/// Sets the label for each address in [addr,addr+size) to the union of the

/// current label for that address and \c label.

/// Retrieves the label associated with the given data.

///

/// The type of 'data' is arbitrary.  The function accepts a value of any type,

/// which can be truncated or extended (implicitly or explicitly) as necessary.

/// The truncation/extension operations will preserve the label of the original

/// value.

/// Retrieves the immediate origin associated with the given data. The returned

/// origin may point to another origin.

///

/// The type of 'data' is arbitrary.

/// Retrieves the label associated with the data at the given address.

/// Return the origin associated with the first taint byte in the size bytes

/// from the address addr.

/// Returns whether the given label contains the label elem.

/// Flushes the DFSan shadow, i.e. forgets about all labels currently associated

/// with the application memory.  Use this call to start over the taint tracking

/// within the same process.

///

/// Note: If another thread is working with tainted data during the flush, that

/// taint could still be written to shadow after the flush.

/// Sets a callback to be invoked on calls to write().  The callback is invoked

/// before the write is done.  The write is not guaranteed to succeed when the

/// callback executes.  Pass in NULL to remove any callback.

/// Sets a callback to be invoked on any conditional expressions which have a

/// taint label set. This can be used to find where tainted data influences

/// the behavior of the program.

/// These callbacks will only be added when -dfsan-conditional-callbacks=true.

/// Conditional expressions occur during signal handlers.

/// Making callbacks that handle signals well is tricky, so when

/// -dfsan-conditional-callbacks=true, conditional expressions used in signal

/// handlers will add the labels they see into a global (bitwise-or together).

/// This function returns all label bits seen in signal handler conditions.

/// Sets a callback to be invoked when tainted data reaches a function.

/// This could occur at function entry, or at a load instruction.

/// These callbacks will only be added if -dfsan-reaches-function-callbacks=1.

/// Making callbacks that handle signals well is tricky, so when

/// -dfsan-reaches-function-callbacks=true, functions reached in signal

/// handlers will add the labels they see into a global (bitwise-or together).

/// This function returns all label bits seen during signal handlers.

/// Interceptor hooks.

/// Whenever a dfsan's custom function is called the corresponding

/// hook is called it non-zero. The hooks should be defined by the user.

/// The primary use case is taint-guided fuzzing, where the fuzzer

/// needs to see the parameters of the function and the labels.

/// FIXME: implement more hooks.

/// Prints the origin trace of the label at the address addr to stderr. It also

/// prints description at the beginning of the trace. If origin tracking is not

/// on, or the address is not labeled, it prints nothing.

/// As above, but use an origin id from dfsan_get_origin() instead of address.

/// Does not include header line with taint label and address information.

/// Prints the origin trace of the label at the address \p addr to a

/// pre-allocated output buffer. If origin tracking is not on, or the address is

/// not labeled, it prints nothing.

///

/// Typical usage:

/// \code

///   char kDescription[] = "...";

///   char buf[1024];

///   dfsan_sprint_origin_trace(&tainted_var, kDescription, buf, sizeof(buf));

/// \endcode

///

/// Typical usage that handles truncation:

/// \code

///   char buf[1024];

///   int len = dfsan_sprint_origin_trace(&var, nullptr, buf, sizeof(buf));

///

///   if (len < sizeof(buf)) {

///     ProcessOriginTrace(buf);

///   } else {

///     char *tmpbuf = new char[len + 1];

///     dfsan_sprint_origin_trace(&var, nullptr, tmpbuf, len + 1);

///     ProcessOriginTrace(tmpbuf);

///     delete[] tmpbuf;

///   }

/// \endcode

///

/// \param addr The tainted memory address whose origin we are printing.

/// \param description A description printed at the beginning of the trace.

/// \param [out] out_buf The output buffer to write the results to.

/// \param out_buf_size The size of \p out_buf.

///

/// \returns The number of symbols that should have been written to \p out_buf

/// (not including trailing null byte '\0'). Thus, the string is truncated iff

/// return value is not less than \p out_buf_size.

/// As above, but use an origin id from dfsan_get_origin() instead of address.

/// Does not include header line with taint label and address information.

/// Prints the stack trace leading to this call to a pre-allocated output

/// buffer.

///

/// For usage examples, see dfsan_sprint_origin_trace.

///

/// \param [out] out_buf The output buffer to write the results to.

/// \param out_buf_size The size of \p out_buf.

///

/// \returns The number of symbols that should have been written to \p out_buf

/// (not including trailing null byte '\0'). Thus, the string is truncated iff

/// return value is not less than \p out_buf_size.

/// Retrieves the very first origin associated with the data at the given

/// address.

/// Returns the value of -dfsan-track-origins.

/// * 0: do not track origins.

/// * 1: track origins at memory store operations.

/// * 2: track origins at memory load and store operations.

// extern "C"

// DFSAN_INTERFACE_H


=== system/lib/compiler-rt/include/sanitizer/hwasan_interface.h ===
SHA256: 04fa77448fb0ac24b70332c7eca1f0d6dcd1e2b21d64ae3ad65a2f3153d23a6e
//===-- sanitizer/hwasan_interface.h ----------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of HWAddressSanitizer.

//

// Public interface header.

//===----------------------------------------------------------------------===//

// Libc hook for program startup in statically linked executables.

// Initializes enough of the runtime to run instrumented code. This function

// should only be called in statically linked executables because it modifies

// the GOT, which won't work in regular binaries because RELRO will already

// have been applied by the time the function is called. This also means that

// the function should be called before libc applies RELRO.

// Does not call libc unless there is an error.

// Can be called multiple times.

// This function may be optionally provided by user and should return

// a string containing HWASan runtime options. See asan_flags.h for details.

// Mark region of memory with the given tag. Both address and size need to be

// 16-byte aligned.

/// Set pointer tag. Previous tag is lost.

/// Get tag from the pointer.

// Set memory tag from the current SP address to the given address to zero.

// This is meant to annotate longjmp and other non-local jumps.

// This function needs to know the (almost) exact destination frame address;

// clearing shadow for the entire thread stack like __asan_handle_no_return

// does would cause false reports.

// Set memory tag for the part of the current thread stack below sp_dst to

// zero. Call this in vfork() before returning in the parent process.

// Libc hook for thread creation. Should be called in the child thread before

// any instrumented code.

// Libc hook for thread destruction. No instrumented code should run after

// this call.

// Print shadow and origin for the memory range to stderr in a human-readable

// format.

// Print one-line report about the memory usage of the current process.

/* Returns the offset of the first byte in the memory range that can not be
 * accessed through the pointer in x, or -1 if the whole range is good. */

/* Sets the callback function to be called during HWASan error reporting. */

// extern "C"

// SANITIZER_HWASAN_INTERFACE_H


=== system/lib/compiler-rt/include/sanitizer/linux_syscall_hooks.h ===
SHA256: e5907ab5bfec70c2343f957db38b609b297a7663a16bb4727ea5d86dfb65bd5b
//===-- linux_syscall_hooks.h ---------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of public sanitizer interface.

//

// System call handlers.

//

// Interface methods declared in this header implement pre- and post- syscall

// actions for the active sanitizer.

// Usage:

//   __sanitizer_syscall_pre_getfoo(...args...);

//   long res = syscall(__NR_getfoo, ...args...);

//   __sanitizer_syscall_post_getfoo(res, ...args...);

//===----------------------------------------------------------------------===//

// And now a few syscalls we don't handle yet.

// Private declarations. Do not call directly from user code. Use macros above.

// extern "C"

// SANITIZER_LINUX_SYSCALL_HOOKS_H


=== system/lib/compiler-rt/include/sanitizer/lsan_interface.h ===
SHA256: d61859dd521fd4953fb2786e04ce29f1301f5a0194a01528410912ad841a381d
//===-- sanitizer/lsan_interface.h ------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer.

//

// Public interface header.

//===----------------------------------------------------------------------===//

// Allocations made between calls to __lsan_disable() and __lsan_enable() will

// be treated as non-leaks. Disable/enable pairs may be nested.

// The heap object into which p points will be treated as a non-leak.

// Memory regions registered through this interface will be treated as sources

// of live pointers during leak checking. Useful if you store pointers in

// mapped memory.

// Points of note:

// - __lsan_unregister_root_region() must be called with the same pointer and

// size that have earlier been passed to __lsan_register_root_region()

// - LSan will skip any inaccessible memory when scanning a root region. E.g.,

// if you map memory within a larger region that you have mprotect'ed, you can

// register the entire large region.

// - the implementation is not optimized for performance. This interface is

// intended to be used for a small number of relatively static regions.

// Check for leaks now. This function behaves identically to the default

// end-of-process leak check. In particular, it will terminate the process if

// leaks are found and the exitcode runtime flag is non-zero.

// Subsequent calls to this function will have no effect and end-of-process

// leak check will not run. Effectively, end-of-process leak check is moved to

// the time of first invocation of this function.

// By calling this function early during process shutdown, you can instruct

// LSan to ignore shutdown-only leaks which happen later on.

// Check for leaks now. Returns zero if no leaks have been found or if leak

// detection is disabled, non-zero otherwise.

// This function may be called repeatedly, e.g. to periodically check a

// long-running process. It prints a leak report if appropriate, but does not

// terminate the process. It does not affect the behavior of

// __lsan_do_leak_check() or the end-of-process leak check, and is not

// affected by them.

// The user may optionally provide this function to disallow leak checking

// for the program it is linked into (if the return value is non-zero). This

// function must be defined as returning a constant value; any behavior beyond

// that is unsupported.

// To avoid dead stripping, you may need to define this function with

// __attribute__((used))

// This function may be optionally provided by user and should return

// a string containing LSan runtime options. See lsan_flags.inc for details.

// This function may be optionally provided by the user and should return

// a string containing LSan suppressions.

// extern "C"

// namespace __lsan

// SANITIZER_LSAN_INTERFACE_H


=== system/lib/compiler-rt/include/sanitizer/memprof_interface.h ===
SHA256: 039336c2477485861e990d4feca67c9b0b35f17e14a870bb5160e77f80238d3f
//===-- sanitizer/memprof_interface.h --------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of MemProfiler (MemProf).

//

// Public interface header.

//===----------------------------------------------------------------------===//

/// Records access to a memory region (<c>[addr, addr+size)</c>).

///

/// This memory must be previously allocated by your program.

///

/// \param addr Start of memory region.

/// \param size Size of memory region.

/// Records access to a memory address <c><i>addr</i></c>.

///

/// This memory must be previously allocated by your program.

///

/// \param addr Accessed memory address

/// User-provided callback on MemProf errors.

///

/// You can provide a function that would be called immediately when MemProf

/// detects an error. This is useful in cases when MemProf detects an error but

/// your program crashes before the MemProf report is printed.

/// Prints accumulated statistics to <c>stderr</c> (useful for calling from the

/// debugger).

/// User-provided default option settings.

///

/// You can set these options via the -memprof-runtime-default-options LLVM flag

/// or you can provide your own implementation of this function. See

/// memprof_flags.h for more info.

///

/// \returns Default options string.

/// Prints the memory profile to the current profile file.

///

/// \returns 0 on success.

/// Closes the existing file descriptor, if it is valid and not stdout or

/// stderr, and resets the internal state such that the profile filename is

/// reopened on the next profile dump attempt. This can be used to enable

/// multiple rounds of profiling on the same binary.

// extern "C"

// SANITIZER_MEMPROF_INTERFACE_H


=== system/lib/compiler-rt/include/sanitizer/msan_interface.h ===
SHA256: a89c18345406364c6bcd7cebf8ce26e57e0f1307bf55b8e6244a53690a8ce1ca
//===-- msan_interface.h --------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of MemorySanitizer.

//

// Public interface header.

//===----------------------------------------------------------------------===//

/* Set raw origin for the memory range. */

/* Get raw origin for an address. */

/* Test that this_id is a descendant of prev_id (or they are simply equal).
 * "descendant" here means they are part of the same chain, created with
 * __msan_chain_origin. */

/* Returns non-zero if tracking origins. */

/* Returns the origin id of the latest UMR in the calling thread. */

/* Make memory region fully initialized (without changing its contents). */

/* Make a null-terminated string fully initialized (without changing its
   contents). */

/* Make first n parameters of the next function call fully initialized. */

/* Make memory region fully uninitialized (without changing its contents).
   This is a legacy interface that does not update origin information. Use
   __msan_allocated_memory() instead. */

/* Make memory region partially uninitialized (without changing its contents).
 */

/* Returns the offset of the first (at least partially) poisoned byte in the
   memory range, or -1 if the whole range is good. */

/* Checks that memory range is fully initialized, and reports an error if it
 * is not. */

/* For testing:
   __msan_set_expect_umr(1);
   ... some buggy code ...
   __msan_set_expect_umr(0);
   The last line will verify that a UMR happened. */

/* Change the value of keep_going flag. Non-zero value means don't terminate
   program execution when an error is detected. This will not affect error in
   modules that were compiled without the corresponding compiler flag. */

/* Print shadow and origin for the memory range to stderr in a human-readable
   format. */

/* Print shadow for the memory range to stderr in a minimalistic
   human-readable format. */

/* Returns true if running under a dynamic tool (DynamoRio-based). */

/* Tell MSan about newly allocated memory (ex.: custom allocator).
   Memory will be marked uninitialized, with origin at the call site. */

/* Tell MSan about newly destroyed memory. Mark memory as uninitialized. */

/* This function may be optionally provided by user and should return
   a string containing Msan runtime options. See msan_flags.h for details. */

/* Deprecated. Call __sanitizer_set_death_callback instead. */

/* Update shadow for the application copy of size bytes from src to dst.
   Src and dst are application addresses. This function does not copy the
   actual application memory, it only updates shadow and origin for such
   copy. Source and destination regions can overlap. */

/* Disables uninitialized memory checks in interceptors. */

/* Re-enables uninitialized memory checks in interceptors after a previous
   call to __msan_scoped_disable_interceptor_checks. */

// extern "C"


=== system/lib/compiler-rt/include/sanitizer/netbsd_syscall_hooks.h ===
SHA256: 6b85d7ebed660f83ff11a8e50137fd0a6810085d54c2ff0f80f7afb5ef557a40
//===-- netbsd_syscall_hooks.h --------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of public sanitizer interface.

//

// System call handlers.

//

// Interface methods declared in this header implement pre- and post- syscall

// actions for the active sanitizer.

// Usage:

//   __sanitizer_syscall_pre_getfoo(...args...);

//   long long res = syscall(SYS_getfoo, ...args...);

//   __sanitizer_syscall_post_getfoo(res, ...args...);

//

// DO NOT EDIT! THIS FILE HAS BEEN GENERATED!

//

// Generated with: generate_netbsd_syscalls.awk

// Generated date: 2020-09-10

// Generated from: syscalls.master,v 1.306 2020/08/14 00:53:16 riastradh Exp

//

//===----------------------------------------------------------------------===//

/* syscall 11 has been skipped */

/* syscall 67 has been skipped */

/* syscall 68 has been skipped */

/* syscall 69 has been skipped */

/* syscall 70 has been skipped */

/* syscall 76 has been skipped */

/* syscall 77 has been skipped */

/* syscall 94 has been skipped */

/* syscall 107 has been skipped */

/* syscall 115 has been skipped */

/* syscall 119 has been skipped */

/* syscall 139 has been skipped */

/* syscall 151 has been skipped */

/* syscall 152 has been skipped */

/* syscall 153 has been skipped */

/* syscall 154 has been skipped */

/* syscall 159 has been skipped */

/* syscall 160 has been skipped */

/* syscall 169 has been skipped */

/* syscall 170 has been skipped */

/* syscall 171 has been skipped */

/* syscall 172 has been skipped */

/* syscall 176 has been skipped */

/* syscall 177 has been skipped */

/* syscall 178 has been skipped */

/* syscall 179 has been skipped */

/* syscall 180 has been skipped */

/* syscall 211 has been skipped */

/* syscall 212 has been skipped */

/* syscall 213 has been skipped */

/* syscall 214 has been skipped */

/* syscall 215 has been skipped */

/* syscall 216 has been skipped */

/* syscall 217 has been skipped */

/* syscall 218 has been skipped */

/* syscall 219 has been skipped */

/* syscall 267 has been skipped */

/* syscall 268 has been skipped */

/* syscall 269 has been skipped */

/* syscall 326 has been skipped */

/* syscall 327 has been skipped */

/* syscall 328 has been skipped */

/* syscall 329 has been skipped */

/* syscall 336 has been skipped */

/* syscall 337 has been skipped */

/* syscall 338 has been skipped */

/* syscall 339 has been skipped */

/* syscall 341 has been skipped */

/* syscall 342 has been skipped */

/* syscall 352 has been skipped */

/* syscall 353 has been skipped */

/* syscall 407 has been skipped */

/* syscall 408 has been skipped */

/* syscall 409 has been skipped */

/* syscall 448 has been skipped */

/* syscall 452 has been skipped */

/* Compat with older releases */

// Private declarations. Do not call directly from user code. Use macros above.

// DO NOT EDIT! THIS FILE HAS BEEN GENERATED!

/* syscall 11 has been skipped */

/* syscall 67 has been skipped */

/* syscall 68 has been skipped */

/* syscall 69 has been skipped */

/* syscall 70 has been skipped */

/* syscall 76 has been skipped */

/* syscall 77 has been skipped */

/* syscall 94 has been skipped */

/* syscall 107 has been skipped */

/* syscall 115 has been skipped */

/* syscall 119 has been skipped */

/* syscall 139 has been skipped */

/* syscall 151 has been skipped */

/* syscall 152 has been skipped */

/* syscall 153 has been skipped */

/* syscall 154 has been skipped */

/* syscall 159 has been skipped */

/* syscall 160 has been skipped */

/* syscall 169 has been skipped */

/* syscall 170 has been skipped */

/* syscall 171 has been skipped */

/* syscall 172 has been skipped */

/* syscall 176 has been skipped */

/* syscall 177 has been skipped */

/* syscall 178 has been skipped */

/* syscall 179 has been skipped */

/* syscall 180 has been skipped */

/* syscall 211 has been skipped */

/* syscall 212 has been skipped */

/* syscall 213 has been skipped */

/* syscall 214 has been skipped */

/* syscall 215 has been skipped */

/* syscall 216 has been skipped */

/* syscall 217 has been skipped */

/* syscall 218 has been skipped */

/* syscall 219 has been skipped */

/* syscall 267 has been skipped */

/* syscall 268 has been skipped */

/* syscall 269 has been skipped */

/* syscall 326 has been skipped */

/* syscall 327 has been skipped */

/* syscall 328 has been skipped */

/* syscall 329 has been skipped */

/* syscall 336 has been skipped */

/* syscall 337 has been skipped */

/* syscall 338 has been skipped */

/* syscall 339 has been skipped */

/* syscall 341 has been skipped */

/* syscall 342 has been skipped */

/* syscall 352 has been skipped */

/* syscall 353 has been skipped */

/* syscall 407 has been skipped */

/* syscall 408 has been skipped */

/* syscall 409 has been skipped */

/* syscall 448 has been skipped */

/* syscall 452 has been skipped */

// extern "C"

// DO NOT EDIT! THIS FILE HAS BEEN GENERATED!

// SANITIZER_NETBSD_SYSCALL_HOOKS_H


=== system/lib/compiler-rt/include/sanitizer/nsan_interface.h ===
SHA256: 1f4347427a3123e9128b762d60da50aab91b557c89de7d6c468c25321ebda5be
//===-- sanitizer/nsan_interface.h ------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Public interface for nsan.

//

//===----------------------------------------------------------------------===//

/// User-provided default option settings.

///

/// You can provide your own implementation of this function to return a string

/// containing NSan runtime options (for example,

/// <c>verbosity=1:halt_on_error=0</c>).

///

/// \returns Default options string.

// Dumps nsan shadow data for a block of `size_bytes` bytes of application

// memory at location `addr`.

//

// Each line contains application address, shadow types, then values.

// Unknown types are shown as `__`, while known values are shown as

// `f`, `d`, `l` for float, double, and long double respectively. Position is

// shown as a single hex digit. The shadow value itself appears on the line that

// contains the first byte of the value.

// FIXME: Show both shadow and application value.

//

// Example: `__nsan_dump_shadow_mem(addr, 32, 8, 0)` might print:

//

//  0x0add7359:  __ f0 f1 f2 f3 __ __ __   (42.000)

//  0x0add7361:  __ d1 d2 d3 d4 d5 d6 d7

//  0x0add7369:  d8 f0 f1 f2 f3 __ __ f2   (-1.000) (12.5)

//  0x0add7371:  f3 __ __ __ __ __ __ __

//

// This means that there is:

//   - a shadow double for the float at address 0x0add7360, with value 42;

//   - a shadow float128 for the double at address 0x0add7362, with value -1;

//   - a shadow double for the float at address 0x0add736a, with value 12.5;

// There was also a shadow double for the float at address 0x0add736e, but bytes

// f0 and f1 were overwritten by one or several stores, so that the shadow value

// is no longer valid.

// The argument `reserved` can be any value. Its true value is provided by the

// instrumentation.

// Explicitly dumps a value.

// FIXME: vector versions ?

// Explicitly checks a value.

// FIXME: vector versions ?

// extern "C"

// SANITIZER_NSAN_INTERFACE_H


=== system/lib/compiler-rt/include/sanitizer/rtsan_interface.h ===
SHA256: d86bcd545bb0e6c33cd17cd2b2c937620166143b61f93b40adaf3812621ce39f
//===-- sanitizer/rtsan_interface.h -----------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of RealtimeSanitizer.

//

// Public interface header.

//===----------------------------------------------------------------------===//

// __cplusplus

// Disable all RTSan error reporting.

// Must be paired with a call to `__rtsan_enable`

// Re-enable all RTSan error reporting.

// Must follow a call to `__rtsan_disable`.

// extern "C"

// __cplusplus >= 201103L

// __cplusplus >= 201103L

// defined(__has_feature) && __has_feature(realtime_sanitizer)

// namespace __rtsan

// __cplusplus

// SANITIZER_RTSAN_INTERFACE_H


=== system/lib/compiler-rt/include/sanitizer/scudo_interface.h ===
SHA256: 2bed39576da4d1afb98e8f75f54151c665d1014a153a51b82ecc03fd1389cf1f
//===-- sanitizer/scudo_interface.h -----------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

/// Public Scudo interface header.

//

//===----------------------------------------------------------------------===//

// This function may be optionally provided by a user and should return

// a string containing Scudo runtime options. See scudo_flags.h for details.

// This function allows to set the RSS limit at runtime. This can be either

// the hard limit (HardLimit=1) or the soft limit (HardLimit=0). The limit

// can be removed by setting LimitMb to 0. This function's parameters should

// be fully trusted to avoid security mishaps.

// This function outputs various allocator statistics for both the Primary

// and Secondary allocators, including memory usage, number of allocations

// and deallocations.

// extern "C"

// SANITIZER_SCUDO_INTERFACE_H_


=== system/lib/compiler-rt/include/sanitizer/tsan_interface.h ===
SHA256: f91dbdf74ce69e8b8ae227c5e169a35025b24e0db6dfa31cff33b643bf7d9968
//===-- tsan_interface.h ----------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of ThreadSanitizer (TSan), a race detector.

//

// Public interface header for TSan.

//===----------------------------------------------------------------------===//

// __tsan_release establishes a happens-before relation with a preceding

// __tsan_acquire on the same address.

// Annotations for custom mutexes.

// The annotations allow to get better reports (with sets of locked mutexes),

// detect more types of bugs (e.g. mutex misuses, races between lock/unlock and

// destruction and potential deadlocks) and improve precision and performance

// (by ignoring individual atomic operations in mutex code). However, the

// downside is that annotated mutex code itself is not checked for correctness.

// Mutex creation flags are passed to __tsan_mutex_create annotation.

// If mutex has no constructor and __tsan_mutex_create is not called,

// the flags may be passed to __tsan_mutex_pre_lock/__tsan_mutex_post_lock

// annotations.

// Mutex has static storage duration and no-op constructor and destructor.

// This effectively makes tsan ignore destroy annotation.

// Mutex is write reentrant.

// Mutex is read reentrant.

// Mutex does not have static storage duration, and must not be used after

// its destructor runs.  The opposite of __tsan_mutex_linker_init.

// If this flag is passed to __tsan_mutex_destroy, then the destruction

// is ignored unless this flag was previously set on the mutex.

// Mutex operation flags:

// Denotes read lock operation.

// Denotes try lock operation.

// Denotes that a try lock operation has failed to acquire the mutex.

// Denotes that the lock operation acquires multiple recursion levels.

// Number of levels is passed in recursion parameter.

// This is useful for annotation of e.g. Java builtin monitors,

// for which wait operation releases all recursive acquisitions of the mutex.

// Denotes that the unlock operation releases all recursion levels.

// Number of released levels is returned and later must be passed to

// the corresponding __tsan_mutex_post_lock annotation.

// Convenient composed constants.

// Annotate creation of a mutex.

// Supported flags: mutex creation flags.

// Annotate destruction of a mutex.

// Supported flags:

//   - __tsan_mutex_linker_init

//   - __tsan_mutex_not_static

// Annotate start of lock operation.

// Supported flags:

//   - __tsan_mutex_read_lock

//   - __tsan_mutex_try_lock

//   - all mutex creation flags

// Annotate end of lock operation.

// Supported flags:

//   - __tsan_mutex_read_lock (must match __tsan_mutex_pre_lock)

//   - __tsan_mutex_try_lock (must match __tsan_mutex_pre_lock)

//   - __tsan_mutex_try_lock_failed

//   - __tsan_mutex_recursive_lock

//   - all mutex creation flags

// Annotate start of unlock operation.

// Supported flags:

//   - __tsan_mutex_read_lock

//   - __tsan_mutex_recursive_unlock

// Annotate end of unlock operation.

// Supported flags:

//   - __tsan_mutex_read_lock (must match __tsan_mutex_pre_unlock)

// Annotate start/end of notify/signal/broadcast operation.

// Supported flags: none.

// Annotate start/end of a region of code where lock/unlock/signal operation

// diverts to do something else unrelated to the mutex. This can be used to

// annotate, for example, calls into cooperative scheduler or contention

// profiling code.

// These annotations must be called only from within

// __tsan_mutex_pre/post_lock, __tsan_mutex_pre/post_unlock,

// __tsan_mutex_pre/post_signal regions.

// Supported flags: none.

// Check that the current thread does not hold any mutexes,

// report a bug report otherwise.

// External race detection API.

// Can be used by non-instrumented libraries to detect when their objects are

// being used in an unsafe manner.

//   - __tsan_external_read/__tsan_external_write annotates the logical reads

//       and writes of the object at the specified address. 'caller_pc' should

//       be the PC of the library user, which the library can obtain with e.g.

//       `__builtin_return_address(0)`.

//   - __tsan_external_register_tag registers a 'tag' with the specified name,

//       which is later used in read/write annotations to denote the object type

//   - __tsan_external_assign_tag can optionally mark a heap object with a tag

// Fiber switching API.

//   - TSAN context for fiber can be created by __tsan_create_fiber

//     and freed by __tsan_destroy_fiber.

//   - TSAN context of current fiber or thread can be obtained

//     by calling __tsan_get_current_fiber.

//   - __tsan_switch_to_fiber should be called immediately before switch

//     to fiber, such as call of swapcontext.

//   - Fiber name can be set by __tsan_set_fiber_name.

// Flags for __tsan_switch_to_fiber:

// Do not establish a happens-before relation between fibers

// User-provided callback invoked on TSan initialization.

// User-provided callback invoked on TSan shutdown.

// `failed` - Nonzero if TSan did detect issues, zero otherwise.

// Return `0` if TSan should exit as if no issues were detected.  Return nonzero

// if TSan should exit as if issues were detected.

// Release TSan internal memory in a best-effort manner.

// User-provided default TSAN options.

// User-provided default TSAN suppressions.

/// Returns a report's description.

///

/// Returns a report's description (issue type), number of duplicate issues

/// found, counts of array data (stack traces, memory operations, locations,

/// mutexes, threads, unique thread IDs) and a stack trace of a <c>sleep()</c>

/// call (if one was involved in the issue).

///

/// \param report Opaque pointer to the current report.

/// \param[out] description Report type description.

/// \param[out] count Count of duplicate issues.

/// \param[out] stack_count Count of stack traces.

/// \param[out] mop_count Count of memory operations.

/// \param[out] loc_count Count of locations.

/// \param[out] mutex_count Count of mutexes.

/// \param[out] thread_count Count of threads.

/// \param[out] unique_tid_count Count of unique thread IDs.

/// \param sleep_trace A buffer to store the stack trace of a <c>sleep()</c>

/// call.

/// \param trace_size Size in bytes of the trace buffer.

/// \returns Returns 1 if successful, 0 if not.

/// Returns information about stack traces included in the report.

///

/// \param report Opaque pointer to the current report.

/// \param idx Index to the report's stacks.

/// \param trace A buffer to store the stack trace.

/// \param trace_size Size in bytes of the trace buffer.

/// \returns Returns 1 if successful, 0 if not.

/// Returns information about memory operations included in the report.

///

/// \param report Opaque pointer to the current report.

/// \param idx Index to the report's memory operations.

/// \param[out] tid Thread ID of the memory operation.

/// \param[out] addr Address of the memory operation.

/// \param[out] size Size of the memory operation.

/// \param[out] write Write flag of the memory operation.

/// \param[out] atomic Atomicity flag of the memory operation.

/// \param trace A buffer to store the stack trace.

/// \param trace_size Size in bytes of the trace buffer.

/// \returns Returns 1 if successful, 0 if not.

/// Returns information about locations included in the report.

///

/// \param report Opaque pointer to the current report.

/// \param idx Index to the report's locations.

/// \param[out] type Type of the location.

/// \param[out] addr Address of the location.

/// \param[out] start Start of the location.

/// \param[out] size Size of the location.

/// \param[out] tid Thread ID of the location.

/// \param[out] fd File descriptor of the location.

/// \param[out] suppressable Suppressable flag.

/// \param trace A buffer to store the stack trace.

/// \param trace_size Size in bytes of the trace buffer.

/// \returns Returns 1 if successful, 0 if not.

/// Returns information about mutexes included in the report.

///

/// \param report Opaque pointer to the current report.

/// \param idx Index to the report's mutexes.

/// \param[out] mutex_id Id of the mutex.

/// \param[out] addr Address of the mutex.

/// \param[out] destroyed Destroyed mutex flag.

/// \param trace A buffer to store the stack trace.

/// \param trace_size Size in bytes of the trace buffer.

/// \returns Returns 1 if successful, 0 if not.

/// Returns information about threads included in the report.

///

/// \param report Opaque pointer to the current report.

/// \param idx Index to the report's threads.

/// \param[out] tid Thread ID of the thread.

/// \param[out] os_id Operating system's ID of the thread.

/// \param[out] running Running flag of the thread.

/// \param[out] name Name of the thread.

/// \param[out] parent_tid ID of the parent thread.

/// \param trace A buffer to store the stack trace.

/// \param trace_size Size in bytes of the trace buffer.

/// \returns Returns 1 if successful, 0 if not.

/// Returns information about unique thread IDs included in the report.

///

/// \param report Opaque pointer to the current report.

/// \param idx Index to the report's unique thread IDs.

/// \param[out] tid Unique thread ID of the report.

/// \returns Returns 1 if successful, 0 if not.

/// Returns the current report.

///

/// If TSan is currently reporting a detected issue on the current thread,

/// returns an opaque pointer to the current report. Otherwise returns NULL.

/// \returns An opaque pointer to the current report. Otherwise returns NULL.

// extern "C"

// SANITIZER_TSAN_INTERFACE_H


=== system/lib/compiler-rt/include/sanitizer/tsan_interface_atomic.h ===
SHA256: 1d9069134ddb89a573221b9d80cbf3fdeedfd3b9949ba8457f7189d22ae99483
//===-- tsan_interface_atomic.h ---------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of ThreadSanitizer (TSan), a race detector.

//

// Public interface header for TSan atomics.

//===----------------------------------------------------------------------===//

// Part of ABI, do not change.

// https://github.com/llvm/llvm-project/blob/main/libcxx/include/atomic

// extern "C"

// TSAN_INTERFACE_ATOMIC_H


=== system/lib/compiler-rt/include/sanitizer/ubsan_interface.h ===
SHA256: 669b7c494061ea50c20e5e9e51ab5710eb8052c8c0e27911141b1fb72dd0561f
//===-- sanitizer/ubsan_interface.h -----------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of UBSanitizer (UBSan).

//

// Public interface header.

//===----------------------------------------------------------------------===//

/// User-provided default option settings.

///

/// You can provide your own implementation of this function to return a string

/// containing UBSan runtime options (for example,

/// <c>verbosity=1:halt_on_error=0</c>).

///

/// \returns Default options string.

// extern "C"

// SANITIZER_UBSAN_INTERFACE_H


=== system/lib/compiler-rt/lib/asan/asan_activation.cpp ===
SHA256: cd5ad127540fc568a5808df0e460ac67747fe9ebb37d302df5f6288f4567da61
//===-- asan_activation.cpp -------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// ASan activation/deactivation logic.

//===----------------------------------------------------------------------===//

// Copy the current activation flags.

// this is activation-specific help

// Check if activation flags need to be overridden.

// Stash runtime state.

// Deactivate the runtime.

// Redzone must be at least Max(16, granularity) bytes long.

// namespace __asan


=== system/lib/compiler-rt/lib/asan/asan_activation.h ===
SHA256: b53749e5a4313961470af0b86f894077d9ffdf81bdb6ab185f1c60953e4ef750
//===-- asan_activation.h ---------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// ASan activation/deactivation logic.

//===----------------------------------------------------------------------===//

// namespace __asan

// ASAN_ACTIVATION_H


=== system/lib/compiler-rt/lib/asan/asan_activation_flags.inc ===
SHA256: f7fbde7ea244f91e160f40a6998578057a258c00949c3f577a98d775975402d0
//===-- asan_activation_flags.inc -------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// A subset of ASan (and common) runtime flags supported at activation time.

//

//===----------------------------------------------------------------------===//

// ASAN_ACTIVATION_FLAG(Type, Name)

// See COMMON_FLAG in sanitizer_flags.inc for more details.


=== system/lib/compiler-rt/lib/asan/asan_allocator.cpp ===
SHA256: 037dd3732608a5d3ac58dd342cfc4a5abf524bf6d348051053c559a373772b6e
//===-- asan_allocator.cpp ------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Implementation of ASan's memory allocator, 2-nd version.

// This variant uses the allocator from sanitizer_common, i.e. the one shared

// with ThreadSanitizer and MemorySanitizer.

//

//===----------------------------------------------------------------------===//

// Valid redzone sizes are 16, 32, 64, ... 2048, so we encode them in 3 bits.

// We use adaptive redzones: for larger allocation larger redzones are used.

// The memory chunk allocated from the underlying allocator looks like this:

// L L L L L L H H U U U U U U R R

//   L -- left redzone words (0 or more bytes)

//   H -- ChunkHeader (16 bytes), which is also a part of the left redzone.

//   U -- user memory.

//   R -- right redzone (0 or more bytes)

// ChunkBase consists of ChunkHeader and other bytes that overlap with user

// memory.

// If the left redzone is greater than the ChunkHeader size we store a magic

// value in the first uptr word of the memory block and store the address of

// ChunkBase in the next uptr.

// M B L L L L L L L L L  H H U U U U U U

//   |                    ^

//   ---------------------|

//   M -- magic value kAllocBegMagic

//   B -- address of ChunkHeader pointing to the first 'H'

// align < 8 -> 0

// else      -> log2(min(align, 512)) - 2

// Either just allocated by underlying allocator, but AsanChunk is not yet

// ready, or almost returned to undelying allocator and AsanChunk is already

// meaningless.

// The chunk is allocated and not yet freed.

// The chunk was freed and put into quarantine zone.

// FIXME: Use ReleaseMemoryPagesToOS.

// We have to skip the chunk header, it contains free_context_id.

// Skip Header2 in user area.

// Poison the region.

// The secondary will immediately unpoison and unmap the memory, so this

// branch is unnecessary.

// Clear the magic value, as allocator internals may overwrite the

// contents of deallocated chunk, confusing GetAsanChunk lookup.

// Statistics.

// Recycle for the secondary will immediately unpoison and unmap the

// memory, so quarantine preparation is unnecessary.

// The primary allocation may need pattern fill if enabled.

// TODO(alekseys): Consider making quarantine OOM-friendly.

// Statistics.

// The secondary mapping will be immediately returned to user, no value

// poisoning that with non-zero just before unpoisoning by Allocate(). So just

// poison head/tail invisible to Allocate().

// Statistics.

// We are about to unmap a chunk of user memory.

// Mark the corresponding shadow memory as not needed.

// Statistics.

// We can not use THREADLOCAL because it is not supported on some of the

// platforms we care about (OSX 10.6, Android).

// static THREADLOCAL AllocatorCache cache;

// ------------------- Options --------------------------

// ------------------- Initialization ------------------------

// This could be a user-facing chunk (with redzones), or some internal

// housekeeping chunk, like TransferBatch. Start by assuming the former.

// Looks like a valid AsanChunk in use, poison redzones only.

// This is either not an AsanChunk or freed or quarantined AsanChunk.

// In either case, poison everything.

// Apply provided AllocatorOptions to an Allocator

// Poison all existing allocation's redzones.

// -------------------- Helper methods. -------------------------

// We have an address between two chunks, and we want to report just one.

// Prefer an allocated chunk over freed chunk and freed chunk

// over available chunk.

// Same chunk_state: choose based on offset.

// -------------------- Allocation/Deallocation routines ---------------

// We'd be happy to avoid allocating memory for zero-size requests, but

// some programs/tests depend on this behavior and assume that malloc

// would not return NULL even for zero-size allocations. Moreover, it

// looks like operator new should never return NULL, and results of

// consecutive "new" calls must be different even if the allocated size

// is zero.

// If we are allocating from the secondary allocator, there will be no

// automatic right redzone, so add the right redzone manually.

// The allocator provides an unpoisoned chunk. This is possible for the

// secondary allocator, or if CanPoisonMemory() was false for some time,

// for example, due to flags()->start_disabled. Anyway, poison left and

// right of the block before using it for anything else.

// Unpoison the bulk of the memory region.

// Deal with the end of the region if size is not aligned to granularity.

// Must be the last mutation of metadata in this function.

// Set quarantine flag if chunk is allocated, issue ASan error report on

// available and quarantined chunks. Return true on success, false otherwise.

// Flip the chunk_state atomically to avoid race on double-free.

// It's not safe to push a chunk in quarantine on invalid free.

// It was a user data.

// Expects the chunk to already be marked as quarantined by using

// AtomicallySetQuarantineFlagIfAllocated.

// Push into quarantine.

// On Windows, uninstrumented DLLs may allocate memory before ASan hooks

// malloc. Don't report an invalid free in this case.

// Someone used __sanitizer_ignore_free_hook() and decided that they

// didn't want the memory to __sanitizer_ignore_free_hook freed right now.

// When they call free() on this pointer again at a later time, we should

// ignore the alloc-type mismatch and allow them to deallocate the pointer

// through free(), rather than the initial alloc type.

// Must mark the chunk as quarantined before any changes to its metadata.

// Do not quarantine given chunk if we failed to set CHUNK_QUARANTINE flag.

// If realloc() races with free(), we may start copying freed memory.

// However, we will report racy double-free later anyway.

// If the memory comes from the secondary allocator no need to clear it

// as it comes directly from mmap.

// -------------------------- Chunk lookup ----------------------

// Assumes alloc_beg == allocator.GetBlockBegin(alloc_beg).

// Returns nullptr if AsanChunk is not yet initialized just after

// get_allocator().Allocate(), or is being destroyed just before

// get_allocator().Deallocate().

// It does not guaranty that Chunk is initialized, but it's

// definitely not for any other value.

// Allocator must be locked when this function is called.

// The address is in the chunk's left redzone, so maybe it is actually

// a right buffer overflow from the other chunk before.

// Search a bit before to see if there is another chunk.

// Still the same chunk.

// Apply provided AllocatorOptions to an Allocator

// Allocate a size of 1 if we shouldn't free() on Realloc to 0

// pvalloc(0) should allocate one page.

// OOM error is already taken care of by Allocate.

// namespace __asan

// --- Implementation of LSan-specific functions --- {{{1

// FIXME: All usecases provide chunk address, GetAsanChunkByAddrFastLocked is

// not needed.

// namespace __lsan

// ---------------------- Interface ---------------- {{{1

// ASan allocator doesn't reserve extra bytes, so normally we would

// just return "size". We don't want to expose our redzone sizes, etc here.

// Die if p is not malloced or if it is already freed.


=== system/lib/compiler-rt/lib/asan/asan_allocator.h ===
SHA256: a9f757d22229fa462fce9aa3d210616a8206e6928ba2384ddadb12487109a16e
//===-- asan_allocator.h ----------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// ASan-private header for asan_allocator.cpp.

//===----------------------------------------------------------------------===//

// Memory block came from malloc, calloc, realloc, etc.

// Memory block came from operator new.

// Memory block came from operator new [ ]

// Checks if AsanChunkView points to a valid

// allocated or quarantined chunk.

// Checks if the memory is currently allocated.

// Checks if the memory is currently quarantined.

// First byte of user memory.

// Last byte of user memory.

// Size requested by the user.

// Originally requested alignment.

// List of AsanChunks with total size.

// This is a sentinel indicating we do not want the primary allocator arena to

// be placed at a fixed address. It will be anonymously mmap'd.

// These are sanitizer tunings that allow all bringup tests for RISCV-64 Sv39 +

// Fuchsia to run with asan-instrumented. That is, we can run bringup, e2e,

// libc, and scudo tests with this configuration.

//

// TODO: This is specifically tuned for Sv39. 48/57 will likely require other

// tunings, or possibly use the same tunings Fuchsia uses for other archs. The

// VMA size isn't technically tied to the Fuchsia System ABI, so once 48/57 is

// supported, we'd need a way of dynamically checking what the VMA size is and

// determining optimal configuration.

// This indicates the total amount of space dedicated for the primary allocator

// during initialization. This is roughly proportional to the size set by the

// FuchsiaConfig for scudo (~11.25GB == ~2^33.49). Requesting any more could

// lead to some failures in sanitized bringup tests where we can't allocate new

// vmars because there wouldn't be enough contiguous space. We could try 2^34 if

// we re-evaluate the SizeClassMap settings.

// 8GB

// This is roughly equivalent to the configuration for the VeryDenseSizeClassMap

// but has fewer size classes (ideally at most 32). Fewer class sizes means the

// region size for each class is larger, thus less chances of running out of

// space for each region. The main differences are the MidSizeLog (which is

// smaller) and the MaxSizeLog (which is larger).

//

// - The MaxSizeLog is higher to allow some of the largest allocations I've

//   observed to be placed in the primary allocator's arena as opposed to being

//   mmap'd by the secondary allocator. This helps reduce fragmentation from

//   large classes. A huge example of this the scudo allocator tests (and its

//   testing infrastructure) which malloc's/new's objects on the order of

//   hundreds of kilobytes which normally would not be in the primary allocator

//   arena with the default VeryDenseSizeClassMap.

// - The MidSizeLog is reduced to help shrink the number of size classes and

//   increase region size. Without this, we'd see ASan complain many times about

//   a region running out of available space.

//

// This differs a bit from the fuchsia config in scudo, mainly from the NumBits,

// MaxSizeLog, and NumCachedHintT. This should place the number of size classes

// for scudo at 45 and some large objects allocated by this config would be

// placed in the arena whereas scudo would mmap them. The asan allocator needs

// to have a number of classes that are a power of 2 for various internal things

// to work, so we can't match the scudo settings to a tee. The sanitizer

// allocator is slightly slower than scudo's but this is enough to get

// memory-intensive scudo tests to run with asan instrumentation.

/*kNumBits=*/

/*kMinSizeLog=*/

/*kMidSizeLog=*/

/*kMaxSizeLog=*/

/*kNumCachedHintT=*/

/*kMaxBytesCachedLog=*/

// SANITIZER_RISCV64

// These are the default allocator tunings for non-RISCV environments where the

// VMA is usually 48 bits and we have lots of space.

// 4T.

// SANITIZER_RISCV64

// SANITIZER_FUCHSIA

// SANITIZER_APPLE

// SANITIZER_APPLE

// 2T.

// Android needs to support 39, 42 and 48 bit VMA.

// 128G.

// 128G.

// 2T.

// 500G

// 4T.

// 4T.

// defined(__powerpc64__) etc.

// SANITIZER_FUCHSIA

// Allocator64 parameters. Deliberately using a short name.

// SANITIZER_CAN_USE_ALLOCATOR64. Fallback to SizeClassAllocator32.

// SANITIZER_CAN_USE_ALLOCATOR64

// These objects are allocated via mmap() and are zero-initialized.

// namespace __asan

// ASAN_ALLOCATOR_H


=== system/lib/compiler-rt/lib/asan/asan_debugging.cpp ===
SHA256: e087934e29b9abf43ab25836b05719f0b32b8d872f574797d8f4f63f8c30c5b6
//===-- asan_debugging.cpp ------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// This file contains various functions that are generally useful to call when

// using a debugger (LLDB, GDB).

//===----------------------------------------------------------------------===//

// We use name_len + 1 because strlcpy will guarantee a \0 at the end, so

// if we're limiting the copy due to name_len, we add 1 to ensure we copy

// the whole name and then terminate with '\0'.

// namespace

// region_{address,size} are already 0

// region_{address,size} are already 0

// region_{address,size} are already 0

/* alloc_stack */

/* alloc_stack */


=== system/lib/compiler-rt/lib/asan/asan_descriptions.cpp ===
SHA256: 67f04a640c52e29fad86e72d675571f7094a78a73f4fb6e8fbe4ed60ed1f94bb
//===-- asan_descriptions.cpp -----------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// ASan functions for getting information about an address and/or printing it.

//===----------------------------------------------------------------------===//

// No need to announce the main thread.

// `context->parent_tid` may point to reused slot. Check `unique_id` which

// is always smaller for the parent, always greater for a new user.

// Recursively described parent thread if needed.

// Shadow descriptions

// Heap descriptions

// Stack descriptions

// Try to fetch precise stack frame for this access.

// On PowerPC64 ELFv1 or AIX, the address of a function actually points to a

// three-doubleword (or three-word for 32-bit AIX) data structure with

// the first field containing the address of the function's code.

// If the variable [var.beg, var_end) is the nearest variable to the

// current memory access, indicate it in the log.

// May happen if this is a use-after-return.

// Render variable name.

// FIXME: we may want to also print the size of the access here,

// but in case of accesses generated by memset it may be confusing.

// Global descriptions

// Can it happen?

/*print_module_name=*/

// Now we print the frame where the alloca has happened.

// We print this frame as a stack trace with one element.

// The symbolizer may print more than one frame if inlining was involved.

// The frame numbers may be different than those in the stack trace printed

// previously. That's unfortunate, but I have no better solution,

// especially given that the alloca may be from entirely different place

// (e.g. use-after-scope, or different thread's stack).

// 'addr' is a stack address, so return true even if we can't parse frame

// Report the number of stack objects.

// Report all objects in this frame.

// Check global first. On AIX, some global data defined in shared libraries

// are put to the STACK region for unknown reasons. Check global first can

// workaround this issue.

// TODO: Look into whether there's a different solution to this problem.

// We exhausted our possibilities. Bail out.

// namespace __asan


=== system/lib/compiler-rt/lib/asan/asan_descriptions.h ===
SHA256: 8167878acdb8ae5a08159490cff7d98e9cb042a0d8d5ba49f6b6162c07e2bd1d
//===-- asan_descriptions.h -------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// ASan-private header for asan_descriptions.cpp.

// TODO(filcab): Most struct definitions should move to the interface headers.

//===----------------------------------------------------------------------===//

// Contains "T%tid (%name)" or "T%tid" if the name is empty.

// This means we have an AddressSanitizer bug!

// Assume address is close to at most four globals.

// Returns true when this descriptions points inside the same global variable

// as other. Descriptions can have different address within the variable

// General function to describe an address. Will try to describe the address as

// a shadow, global (variable), stack, or heap address.

// bug_type is optional and is used for checking if we're reporting an

// initialization-order-fiasco

// The proper access_size should be passed for stack, global, and heap

// addresses. Defaults to 1.

// Each of the *AddressDescription functions has its own Print() member, which

// may take access_size and bug_type parameters if needed.

// shouldLockThreadRegistry allows us to skip locking if we're sure we already

// have done it.

// initialization-order-fiasco has a special Print()

// namespace __asan

// ASAN_DESCRIPTIONS_H


=== system/lib/compiler-rt/lib/asan/asan_emscripten.cpp ===
SHA256: c2c5357012e75c5c359fe336fbaa482ef932cf74d8b588573a37123a95d7b92c
// for CAN_SANITIZE_LEAKS

// Poison the shadow memory of the shadow area at the start of the address

// space. This helps catching null pointer dereference.

// Assert that the shadow region is large enough.  We don't want to start

// running into the static data region which starts right after the shadow

// region.

// TODO(sbc): In the growable memory case we should really be checking this

// every time we grow.

// On Linux, this is some magic that fails linking with -static.

// On Emscripten, we have to do static linking, so we stub this out.

// Strict init-order checking is thread-hostile.

// Ignore all allocations made by pthread_create: thread stack/TLS may be

// stored by pthread for future reuse even after thread destruction, and

// the linked list it's stored in doesn't even hold valid pointers to the

// objects, the latter are calculated by obscure pointer arithmetic.

// If the thread didn't start delete the AsanThread to avoid leaking it.

// Note AsanThreadContexts never get destroyed so the AsanThreadContext

// that was just created for the AsanThread is wasted.

// namespace __asan

// XXX HACK: Emscripten treats thread_local variables the same as globals in

// non-threaded builds, so a hack was introduced where we skip the allocator

// cache in the common module. Now we have to define this symbol to keep that

// hack working when using LSan as part of ASan without threads.

// namespace __lsan

// SANITIZER_EMSCRIPTEN


=== system/lib/compiler-rt/lib/asan/asan_errors.cpp ===
SHA256: 38a4395c0b38fbd6271a9b0c63550e4509069a8817be52ed6474e77f9bd6cc75
//===-- asan_errors.cpp -----------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// ASan implementation for error structures.

//===----------------------------------------------------------------------===//

// On FreeBSD the slow unwinding that leverages _Unwind_Backtrace()

// yields the call stack of the signal's handler and not of the code

// that raised the signal (as it does on Linux).

// Tests and maybe some users expect that scariness is going to be printed

// just before the stack. As only asan has scariness score we have no

// corresponding code in the sanitizer_common and we use this callback to

// print it.

/*print_module_name=*/

/*print_module_name=*/

/*shouldLockThreadRegistry=*/

// Determine the error type.

// If we are accessing 16 bytes, look at the second shadow byte.

// If we are in the partial right redzone, look at the next shadow byte.

// For use-after-frees reads are almost as bad as writes.

// If address is in the first page (64 KB), then it is likely that the

// access is a result of a null pointer dereference.

/*in_shadow*/

// Skip rows that would be outside the shadow range. This can happen when

// the user address is near the bottom, top, or shadow gap of the address

// space.

// If we are in the partial right redzone, look at the next shadow byte.

// Pass bug_descr because we have a special case for

// initialization-order-fiasco

// This is an experimental flag, hence we don't make a special handler.

// namespace __asan


=== system/lib/compiler-rt/lib/asan/asan_errors.h ===
SHA256: 9f02eb3785cb1cac0d659336581dac9248a8ab87681f9e734e5ac9f66785d600
//===-- asan_errors.h -------------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// ASan-private header for error structures.

//===----------------------------------------------------------------------===//

// (*) VS2013 does not implement unrestricted unions, so we need a trivial

// default constructor explicitly defined for each particular error.

// None of the error classes own the stack traces mentioned in them.

// (*)

// (*)

// (*)

// (*)

// (*)

/*shouldLockThreadRegistry=*/

// (*)

// (*)

/*shouldLockThreadRegistry=*/

// (*)

/*shouldLockThreadRegistry=*/

// (*)

// (*)

// (*)

// (*)

// (*)

// (*)

// (*)

// (*)

// (*)

// (*)

/*shouldLockThreadRegistry=*/

/*shouldLockThreadRegistry=*/

// (*)

/*shouldLockThreadRegistry=*/

// (*)

// PS4: Do we want an AddressDescription for beg?

// (*)

// (*)

// (*)

// (*)

/*shouldLockThreadRegistry=*/

/*shouldLockThreadRegistry=*/

// (*)

// clang-format off

// clang-format on

// We're using a tagged union because it allows us to have a trivially

// copiable type and use the same structures as the public interface.

//

// We can add a wrapper around it to make it "more c++-like", but that would

// add a lot of code and the benefit wouldn't be that big.

// namespace __asan

// ASAN_ERRORS_H


=== system/lib/compiler-rt/lib/asan/asan_fake_stack.cpp ===
SHA256: f48ff4f05bb4619626ed0e90fd7bdf4b253af020922822df801915932131b4cd
//===-- asan_fake_stack.cpp -----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// FakeStack is used to detect use-after-return bugs.

//===----------------------------------------------------------------------===//

// For small size classes inline PoisonShadow for better performance.

// This code expects ASAN_SHADOW_SCALE=3.

// Make sure this does not become memset.

// The size class is too big, it's cheaper to poison only size bytes.

// This part is tricky. On one hand, checking and setting flags[pos]

// should be atomic to ensure async-signal safety. But on the other hand,

// if the signal arrives between checking and setting flags[pos], the

// signal handler's fake stack will start from a different hint_position

// and so will not touch this particular byte. So, it is safe to do this

// with regular non-atomic load and store (at least I was not able to make

// this code crash).

// We are out of fake stack.

// Hack: The statement below is not true if we take into account sigaltstack or

// makecontext. It should be possible to make GC to discard wrong stack frame if

// we use these tools. For now, let's support the simplest case and allow GC to

// discard only frames from the default stack, assuming there is no buffer on

// the stack which is used for makecontext or sigaltstack.

//

// When throw, longjmp or some such happens we don't call OnFree() and

// as the result may leak one or more fake frames, but the good news is that

// we are notified about all such events by HandleNoReturn().

// If we recently had such no-return event we need to collect garbage frames.

// We do it based on their 'real_stack' values -- everything that is lower

// than the current real_stack is garbage.

// Try again when we have a thread.

// Not the default stack.

// not allocated.

// GC only on the default stack.

// Poison the frame, so the any access will be reported as UAR.

// not allocated.

// (SANITIZER_LINUX && !SANITIZER_ANDROID) || SANITIZER_FUCHSIA

// Out of fake stack.

// Out of fake stack.

// namespace __asan

// ---------------------- Interface ---------------- {{{1

// TODO: remove this method and fix tests that use it by setting

// -asan-use-after-return=never, after modal UAR flag lands

// (https://github.com/google/sanitizers/issues/1394)

// extern "C"


=== system/lib/compiler-rt/lib/asan/asan_fake_stack.h ===
SHA256: 403f67afabf24a3d73aac23f7383a0dece3a39410d62e59a208c3442e8708696
//===-- asan_fake_stack.h ---------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// ASan-private header for asan_fake_stack.cpp, implements FakeStack.

//===----------------------------------------------------------------------===//

// Fake stack frame contains local variables of one function.

// Modified by the instrumented code.

// Modified by the instrumented code.

// Modified by the instrumented code.

// For each thread we create a fake stack and place stack objects on this fake

// stack instead of the real stack. The fake stack is not really a stack but

// a fast malloc-like allocator so that when a function exits the fake stack

// is not popped but remains there for quite some time until gets used again.

// So, we poison the objects on the fake stack when function returns.

// It helps us find use-after-return bugs.

//

// The FakeStack objects is allocated by a single mmap call and has no other

// pointers. The size of the fake stack depends on the actual thread stack size

// and thus can not be a constant.

// stack_size is a power of two greater or equal to the thread's stack size;

// we store it as its logarithm (stack_size_log).

// FakeStack has kNumberOfSizeClasses (11) size classes, each size class

// is a power of two, starting from 64 bytes. Each size class occupies

// stack_size bytes and thus can allocate

// NumberOfFrames=(stack_size/BytesInSizeClass) fake frames (also a power of 2).

// For each size class we have NumberOfFrames allocation flags,

// each flag indicates whether the given frame is currently allocated.

// All flags for size classes 0 .. 10 are stored in a single contiguous region

// followed by another contiguous region which contains the actual memory for

// size classes. The addresses are computed by GetFlags and GetFrame without

// any memory accesses solely based on 'this' and stack_size_log.

// Allocate() flips the appropriate allocation flag atomically, thus achieving

// async-signal safety.

// This allocator does not have quarantine per se, but it tries to allocate the

// frames in round robin fashion to maximize the delay between a deallocation

// and the next allocation.

// Min frame is 64B.

// Max stack frame is 64K.

// CTOR: create the FakeStack as a single mmap-ed object.

// stack_size_log is at least 15 (stack_size >= 32K).

// Each size class occupies stack_size bytes.

// Number of bytes requires for the whole object.

// Offset of the given flag from the first flag.

// The flags for class 0 begin at offset  000000000

// The flags for class 1 begin at offset  100000000

// ....................2................  110000000

// ....................3................  111000000

// and so on.

// Divide n by the number of frames in size class.

// The pointer to the flags of the given class_id.

// Get frame by class_id and pos.

// Allocate the fake frame.

// Deallocate the fake frame: read the saved flag address and write 0 there.

// Poison the entire FakeStack's shadow with the magic value.

// Return the beginning of the FakeFrame or 0 if the address is not ours.

// Number of bytes in a fake frame of this size class.

// The fake frame is guaranteed to have a right redzone.

// We use the last word of that redzone to store the address of the flag

// that corresponds to the current frame to make faster deallocation.

// This is were the flags begin.

// Must match the number of uses of DEFINE_STACK_MALLOC_FREE_WITH_CLASS_ID

// a bit is set if something was allocated from the corresponding size class.

// namespace __asan

// ASAN_FAKE_STACK_H


=== system/lib/compiler-rt/lib/asan/asan_flags.cpp ===
SHA256: 2707bba4346bd032ef8b8de380ddb8efbfe9138f3c8547f2333028b2de261c5d
//===-- asan_flags.cpp ------------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// ASan flag parsing logic.

//===----------------------------------------------------------------------===//

// use via flags().

// TODO(eugenis): dump all flags at verbosity>=2?

// Set the default values and prepare for parsing ASan and common flags.

// getenv on emscripten uses malloc, which we can't when using LSan.

// You can't run external symbolizer executables anyway.

// Set the default values and prepare for parsing LSan and UBSan flags

// (which can also overwrite common flags).

// Support macOS MallocScribble and MallocPreScribble:

// <https://developer.apple.com/library/content/documentation/Performance/

// Conceptual/ManagingMemory/Articles/MallocDebug.html>

// Override from ASan compile definition.

// Override from user-specified string.

// Override from Emscripten Module.

// TODO: add EM_ASM_I64 and avoid using a double for a 64-bit pointer.

// Override from command line.

// SANITIZER_EMSCRIPTEN

// SANITIZER_EMSCRIPTEN

//

// TODO(samsonov): print all of the flags (ASan, LSan, common).

// Validate flags and report incompatible configurations

// Flag validation:

// Ensure that redzone is at least ASAN_SHADOW_GRANULARITY.

// Make "strict_init_order" imply "check_initialization_order".

// TODO(samsonov): Use a single runtime flag for an init-order checker.

// quarantine_size is deprecated but we still honor it.

// quarantine_size can not be used together with quarantine_size_mb.

// It is not advised to go lower than 64Kb, otherwise quarantine batches

// pushed from thread local quarantine to global one will create too

// much overhead. One quarantine batch size is 8Kb and it  holds up to

// 1021 chunk, which amounts to 1/8 memory overhead per batch when

// thread local quarantine is set to 64Kb.

// On Windows, weak symbols (such as the `__asan_default_options` function)

// are emulated by having the user program register which weak functions are

// defined. The ASAN DLL will initialize flags prior to user module

// initialization, so __asan_default_options will not point to the user

// definition yet. We still want to ensure we capture when options are passed

// via

// __asan_default_options, so we add a callback to be run

// when it is registered with the runtime.

// There is theoretically time between the initial ProcessFlags and

// registering the weak callback where a weak function could be added and we

// would miss it, but in practice, InitializeFlags will always happen under

// the loader lock (if built as a DLL) and so will any calls to

// __sanitizer_register_weak_function.

// We call `InitializeDefaultFlags` again, instead of just parsing

// `__asan_default_options` directly, to ensure that flags set through

// `ASAN_OPTS` take precedence over those set through

// `__asan_default_options`.

// To match normal behavior, do not print UBSan help.

// To match normal behavior, do not print LSan help.

// namespace __asan


=== system/lib/compiler-rt/lib/asan/asan_flags.h ===
SHA256: 662071b3d621620e2d9fd8e0088dba5df65b3ae6d9f65691d26d547aad3d73a9
//===-- asan_flags.h -------------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// ASan runtime flags.

//===----------------------------------------------------------------------===//

// ASan flag values can be defined in four ways:

// 1) initialized with default values at startup.

// 2) overridden during compilation of ASan runtime by providing

//    compile definition ASAN_DEFAULT_OPTIONS.

// 3) overridden from string returned by user-specified function

//    __asan_default_options().

// 4) overridden from env variable ASAN_OPTIONS.

// 5) overridden during ASan activation (for now used on Android only).

// namespace __asan

// ASAN_FLAGS_H


=== system/lib/compiler-rt/lib/asan/asan_flags.inc ===
SHA256: 11c8548913e152398fd92719bcae23e57d2c521242516a81ba4c61099e992202
//===-- asan_flags.inc ------------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// ASan runtime flags.

//

//===----------------------------------------------------------------------===//

// ASAN_FLAG(Type, Name, DefaultValue, Description)

// See COMMON_FLAG in sanitizer_flags.inc for more details.

// We can't do smaller anyway.

// 1Mb per size class, i.e. ~11Mb per thread

// By default, fill only the first 4K.

// Turn off alloc/dealloc mismatch checker on Mac and Windows for now.

// https://github.com/google/sanitizers/issues/131

// https://github.com/google/sanitizers/issues/309

// TODO(glider,timurrrr): Fix known issues and enable this back.


=== system/lib/compiler-rt/lib/asan/asan_fuchsia.cpp ===
SHA256: 176ad240d8b01c7090a92339a632f6a36900448e234c91a775c1cbc2216abf8f
//===-- asan_fuchsia.cpp -------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Fuchsia-specific details.

//===---------------------------------------------------------------------===//

// ASan doesn't need to do anything else special in the startup hook.

// namespace __sanitizer

// The system already set up the shadow memory for us.

// __sanitizer::GetMaxUserVirtualAddress has already been called by

// AsanInitInternal->InitializeHighMemEnd (asan_rtl.cpp).

// Just do some additional sanity checks here.

// Make sure SHADOW_OFFSET doesn't use __asan_shadow_memory_dynamic_address.

// The current sp might not point to the default stack. This

// could be because we are in a crash stack from fuzzing for example.

// Unpoison the default stack and the current stack page.

// The default stack grows from top to bottom. (bottom < top).

// The current stack is the default stack.

// We only need to unpoison from where we are using until the end.

// The current stack is not the default stack.

// Unpoison the entire default stack and the current stack page.

// We can use a plain thread_local variable for TSD.

// There's no initialization needed, and the passed-in destructor

// will never be called.  Instead, our own thread destruction hook

// (below) will call AsanThread::TSDDtor directly.

// Shared setup between thread creation and startup for the initial thread.

// In lieu of AsanThread::Create.

// This gets the same arguments passed to Init by CreateAsanThread, above.

// We're in the creator thread before the new thread is actually started,

// but its stack address range is already known.  We don't bother tracking

// the static TLS address range because the system itself already uses an

// ASan-aware allocator for that.

// Called by __asan::AsanInitInternal (asan_rtl.c).

// We need to set the current thread before calling AsanThread::Init() below,

// since it reads the thread ID.

// This is called before each thread creation is attempted.  So, in

// its first call, the calling thread is the initial and sole thread.

// Strict init-order checking is thread-hostile.

// On other systems, AsanThread::Init() is called from the new

// thread itself.  But on Fuchsia we already know the stack address

// range beforehand, so we can do most of the setup right now.

// This is called after creating a new thread (in the creating thread),

// with the pointer returned by BeforeThreadCreateHook (above).

// The thread was created successfully.

// ThreadStartHook is already running in the new thread.

// The thread wasn't created after all.

// Clean up everything we set up in BeforeThreadCreateHook.

// This is called in the newly-created thread before it runs anything else,

// with the pointer returned by BeforeThreadCreateHook (above).

// cf. asan_interceptors.cpp:asan_thread_start

// In lieu of AsanThread::ThreadStart.

// Each thread runs this just before it exits,

// with the pointer returned by BeforeThreadCreateHook (above).

// All per-thread destructors have already been called.

// Not supported on this platform.

// On Fuchsia, leak detection is done by a special hook after atexit hooks.

// So this doesn't install any atexit hook like on other platforms.

// namespace __asan

// namespace __lsan

// These are declared (in extern "C") by <zircon/sanitizer.h>.

// The system runtime will call our definitions directly.

// SANITIZER_FUCHSIA


=== system/lib/compiler-rt/lib/asan/asan_globals.cpp ===
SHA256: d23057e5b14efd980c3439f0e8cc17d0c064f2f78eff65c3ef845adf7cb1ed40
//===-- asan_globals.cpp --------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Handle globals.

//===----------------------------------------------------------------------===//

// We want to remember where a certain range of globals was registered.

// TODO: Add a NoDestroy helper, this patter is very common in sanitizers.

// Unpoison the whole global.

// Poison redzones back.

// Fallback to Global::gcc_location

// Check ODR violation for given global G via special ODR indicator. We use

// this method in case compiler instruments global variables through their

// local aliases.

// Instrumentation requests to skip ODR check.

// If *odr_indicator is REGISTERED, some module have already registered

// externally visible symbol with the same name. This is an ODR violation.

// UNREGISTERED

// Check ODR violation for given global G by checking if it's already poisoned.

// We use this method in case compiler doesn't use private aliases for global

// variables.

// This check may not be enough: if the first global is much larger

// the entire redzone of the second global may be within the first global.

// Clang provides two different ways for global variables protection:

// it can poison the global itself or its private alias. In former

// case we may poison same symbol multiple times, that can help us to

// cheaply detect ODR violation: if we try to poison an already poisoned

// global, we have ODR violation error.

// In latter case, we poison each symbol exactly once, so we use special

// indicator symbol to perform similar check.

// In either case, compiler provides a special odr_indicator field to Global

// structure, that can contain two kinds of values:

//   1) Non-zero value. In this case, odr_indicator is an address of

//      corresponding indicator variable for given global.

//   2) Zero. This means that we don't use private aliases for global variables

//      and can freely check ODR violation with the first method.

//

// This routine chooses between two different methods of ODR violation

// detection.

// Register a global variable.

// This function may be called more than once for every global

// so we store the globals in a map.

// Try detecting ODR (One Definition Rule) violation, i.e. the situation

// where two globals with the same name are defined in different modules.

// We unpoison the shadow memory for the global but we do not remove it from

// the list because that would require O(n^2) time with the current list

// implementation. It might not be worth doing anyway.

// Release ODR indicator.

/*mark_initialized=*/

/*0x00 <= c &&*/

// We can spoil names of globals with C linkage, so use an heuristic

// approach to check if the name should be demangled.

// Check if the global is a zero-terminated ASCII string. If so, print it.

// Fallback to Global::gcc_location

// namespace __asan

// ---------------------- Interface ---------------- {{{1

// Apply __asan_register_globals to all globals found in the same loaded

// executable or shared library as `flag'. The flag tracks whether globals have

// already been registered or not for this image.

// This mirrors __asan_register_image_globals.

// Register an array of globals.

// The MSVC incremental linker may pad globals out to 256 bytes. As long

// as __asan_global is less than 256 bytes large and its size is a power

// of two, we can skip over the padding.

// If these are padding bytes, the rest of the global should be zero.

// Poison the metadata. It should not be accessible to user code.

// Unregister an array of globals.

// We must do this when a shared objects gets dlclosed.

// Skip globals that look like padding from the MSVC incremental linker.

// See comment in __asan_register_globals.

// Unpoison the metadata.

// This method runs immediately prior to dynamic initialization in each TU,

// when all dynamically initialized globals are unpoisoned.  This method

// poisons all global variables not defined in this TU, so that a dynamic

// initializer can only touch global variables in the same TU.

// First call, poison all globals from other modules.

/*mark_initialized=*/

// Module changed.

/*mark_initialized=*/

// Maybe SANITIZER_CAN_USE_PREINIT_ARRAY is to conservative for `.init_array`,

// however we should not make mistake here. If `UnpoisonBeforeMain` was not

// executed at all we will have false reports on globals.

// This optimization aims to reduce the overhead of `__asan_after_dynamic_init`

// calls by leveraging incremental unpoisoning/poisoning in

// `__asan_before_dynamic_init`. We expect most `__asan_after_dynamic_init

// calls` to be no-ops. However, to ensure all globals are unpoisoned before the

// `main`, we force `UnpoisonBeforeMain` to fully execute

// `__asan_after_dynamic_init`.

// With lld, `UnpoisonBeforeMain` runs after standard `.init_array`, making it

// the final `__asan_after_dynamic_init` call for the static runtime. In

// contrast, GNU ld executes it earlier, causing subsequent

// `__asan_after_dynamic_init` calls to perform full unpoisoning, losing the

// optimization.

// Incremental poisoning is disabled, unpoison globals immediately.

// SANITIZER_CAN_USE_PREINIT_ARRAY

// This method runs immediately after dynamic initialization in each TU, when

// all dynamically initialized globals except for those defined in the current

// TU are poisoned.  It simply unpoisons all dynamically initialized globals.

/*mark_initialized=*/


=== system/lib/compiler-rt/lib/asan/asan_globals_win.cpp ===
SHA256: cce259588d123404e5567c3ca0568509fcf585caf5c914a177768fe91356e3b2
//===-- asan_globals_win.cpp ----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Global registration code that is linked into every Windows DLL and EXE.

//

//===----------------------------------------------------------------------===//

// We know end >= start because the linker sorts the portion after the dollar

// sign alphabetically.

// Register globals

// namespace __asan

// SANITIZER_WINDOWS


=== system/lib/compiler-rt/lib/asan/asan_init_version.h ===
SHA256: c8e9c318269853f69429860e81dc045dbe279e0d91f8d71f6f4421c7bf8e889e
//===-- asan_init_version.h -------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// This header defines a versioned __asan_init function to be called at the

// startup of the instrumented program.

//===----------------------------------------------------------------------===//

// Every time the ASan ABI changes we also change the version number in the

// __asan_init function name.  Objects built with incompatible ASan ABI

// versions will not link with run-time.

//

// Changes between ABI versions:

// v1=>v2: added 'module_name' to __asan_global

// v2=>v3: stack frame description (created by the compiler)

//         contains the function PC as the 3rd field (see

//         DescribeAddressIfStack)

// v3=>v4: added '__asan_global_source_location' to __asan_global

// v4=>v5: changed the semantics and format of __asan_stack_malloc_ and

//         __asan_stack_free_ functions

// v5=>v6: changed the name of the version check symbol

// v6=>v7: added 'odr_indicator' to __asan_global

// v7=>v8: added '__asan_(un)register_image_globals' functions for dead

//         stripping support on Mach-O platforms

// v8=>v9: 32-bit Android switched to dynamic shadow

// ASAN_INIT_VERSION_H


=== system/lib/compiler-rt/lib/asan/asan_interceptors.cpp ===
SHA256: 7b15e2de282c1d7b6789d32c5c567faf470ca6619a884619c9e10629ce29c340
//===-- asan_interceptors.cpp ---------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Intercept various libc functions.

//===----------------------------------------------------------------------===//

// There is no general interception at all on Fuchsia or Emscripten.

// Only the functions in asan_interceptors_memintrinsics.cpp are

// really defined to replace libc functions.

// FIXME: ask frontend whether we need to return failure.

// namespace __asan

// ---------------------- Wrappers ---------------- {{{1

// Should be asanThreadRegistry().SetThreadNameByUserId(thread, name)

// But asan does not remember UserId's for threads (pthread_t);

// and remembers all ever existed threads, so the linear search by UserId

// can be slow.

// Strict init-order checking is dlopen-hostile:

// https://github.com/google/sanitizers/issues/178

// Only unpoison shadow if it's an ASAN managed address.

// We should not tag if munmap fail, but it's to late to tag after

// real_munmap, as the pages could be mmaped by another thread.

// Protect from unmapping the shadow.

// Syscall interceptors don't have contexts, we don't support suppressions

// for them.

// Strict init-order checking is thread-hostile.

// Ignore all allocations made by pthread_create: thread stack/TLS may be

// stored by pthread for future reuse even after thread destruction, and

// the linked list it's stored in doesn't even hold valid pointers to the

// objects, the latter are calculated by obscure pointer arithmetic.

// If the thread didn't start delete the AsanThread to avoid leaking it.

// Note AsanThreadContexts never get destroyed so the AsanThreadContext

// that was just created for the AsanThread is wasted.

// ASAN_INTERCEPT_PTHREAD_CREATE

// Only clear if we know the stack. This should be true only for contexts

// created with makecontext().

// Align to page size.

// Since Solaris 10/SPARC, ucp->uc_stack.ss_sp refers to the stack base address

// as on other targets.  For binary compatibility, the new version uses a

// different external name, so we intercept that.

// We don't know a better way to forward ... into REAL function. We can

// increase args size if necessary.

// Sign the stack so we can identify it for unpoisoning.

// Clear shadow memory for new context (it may share stack

// with current context).

// swapcontext technically does not return, but program may swap context to

// "oucp" later, that would look as if swapcontext() returned 0.

// We need to clear shadow for ucp once again, as it may be in arbitrary

// state.

// ASAN_INTERCEPT_SWAPCONTEXT

// ASAN_INTERCEPT_INDEX

// For both strcat() and strncat() we need to check the validity of |to|

// argument irrespective of the |from| length.

// If the copying actually happens, the |from| string should not overlap

// with the resulting string starting at |to|, which has a length of

// to_length + from_length + 1.

// strcpy is called from malloc_default_purgeable_zone()

// in __asan::ReplaceSystemAlloc() on Mac.

// Windows doesn't always define the strdup identifier,

// and when it does it's a macro defined to either _strdup

// or _strdup_dbg, _strdup_dbg ends up calling _strdup, so

// we want to intercept that. push/pop_macro are used to avoid problems

// if this file ends up including <string.h> in the future.

// Allowing null input is Windows-specific

// ASAN_INTERCEPT___STRDUP

// REAL(strtol) may be ntdll!strtol, which doesn't set errno. Instead,

// call REAL(strtoll) and do the range check ourselves.

// "man atoi" tells that behavior of atoi(nptr) is the same as

// strtol(nptr, 0, 10), i.e. it sets errno to ERANGE if the

// parsed integer can't be stored in *long* type (even if it's

// different from int). So, we just imitate this behavior.

// ASAN_INTERCEPT___CXA_ATEXIT

// Avoid calling real atexit as it is unreachable on at least on Linux.

// REAL(pthread_atfork) cannot be called due to symbol indirections at least

// on NetBSD

// ---------------------- InitializeAsanInterceptors ---------------- {{{1

// Intercept str* functions.

// Intercept jump-related functions.

// See the makecontext interceptor above for an explanation.

// Intercept exception handling functions.

// Indirectly intercept std::rethrow_exception.

// Indirectly intercept std::rethrow_exception.

// Intercept threading-related functions

// TODO: this should probably have an unversioned fallback for newer arches?

// Intercept atexit function.

// namespace __asan

// !SANITIZER_FUCHSIA && !SANITIZER_EMSCRIPTEN


=== system/lib/compiler-rt/lib/asan/asan_interceptors.h ===
SHA256: 1412af91fe21dd5565aaa9a2229072542777a02848d740f1c978bbc6c44b9795
//===-- asan_interceptors.h -------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// ASan-private header for asan_interceptors.cpp

//===----------------------------------------------------------------------===//

// namespace __asan

// There is no general interception at all on Fuchsia.

// Only the functions in asan_interceptors_memintrinsics.h are

// really defined to replace libc functions.

// Use macro to describe if specific function should be

// intercepted on a given platform.

// OS X interceptors don't need to be initialized with INTERCEPT_FUNCTION.

// SANITIZER_APPLE

// !SANITIZER_FUCHSIA

// ASAN_INTERCEPTORS_H


=== system/lib/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp ===
SHA256: f899deb551b39a3199091ee79c086c1fa7265c55e1d0c71c6616f76023c7cb96
//===-- asan_interceptors_memintrinsics.cpp -------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// ASan versions of memcpy, memmove, and memset.

//===---------------------------------------------------------------------===//

// memcpy is called during __asan_init() from the internals of printf(...).

// We do not treat memcpy with to==from as a bug.

// See http://llvm.org/bugs/show_bug.cgi?id=11763.

// memset is called inside Printf.

// Fuchsia doesn't use sanitizer_common_interceptors.inc, but

// the only things there it wants are these three.  Just define them

// as aliases here rather than repeating the contents.

// SANITIZER_FUCHSIA || SANITIZER_EMSCRIPTEN

// SANITIZER_FUCHSIA || SANITIZER_EMSCRIPTEN


=== system/lib/compiler-rt/lib/asan/asan_interceptors_memintrinsics.h ===
SHA256: a8a7eab6e060ddb2f15a377e15727cc378f4a3215cdc70f8e281e74628d58435
//===-- asan_interceptors_memintrinsics.h -----------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// ASan-private header for asan_interceptors_memintrinsics.cpp

//===---------------------------------------------------------------------===//

// Return true if we can quickly decide that the region is unpoisoned.

// We assume that a redzone is at least 16 bytes.

// We implement ACCESS_MEMORY_RANGE, ASAN_READ_RANGE,

// and ASAN_WRITE_RANGE as macro instead of function so

// that no extra frames are created, and stack trace contains

// relevant information only.

// We check all shadow bytes.

// Behavior of functions like "memcpy" or "strcpy" is undefined

// if memory intervals overlap. We report error in this case.

// Macro is used to avoid creation of new frames.

// namespace __asan

// ASAN_MEMINTRIN_H


=== system/lib/compiler-rt/lib/asan/asan_interface.inc ===
SHA256: 0ced95bd2443805e88c08141d01fc06cef7be81b01bae2e4f0a171461a408640
//===-- asan_interface.inc ------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Asan interface list.

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/asan/asan_interface_internal.h ===
SHA256: 07faeedfd478d7ffaad041fd00b69b9afe2311da061eca9437ca090da8f17bd4
//===-- asan_interface_internal.h -------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// This header declares the AddressSanitizer runtime interface functions.

// The runtime library has to define these functions so the instrumented program

// could call them.

//

// See also include/sanitizer/asan_interface.h

//===----------------------------------------------------------------------===//

// This function should be called at the very beginning of the process,

// before any instrumented code is executed and before any call to malloc.

// This function exists purely to get a linker/loader error when using

// incompatible versions of instrumentation and runtime library. Please note

// that __asan_version_mismatch_check is a macro that is replaced with

// __asan_version_mismatch_check_vXXX at compile-time.

// This structure is used to describe the source location of a place where

// global was defined.

// This structure describes an instrumented global variable.

// The address of the global.

// The original size of the global.

// The size with the redzone.

// Name as a C string.

// Module name as a C string. This pointer is a

// unique identifier of a module.

// Non-zero if the global has dynamic initializer.

// Source location of a global,

// used by GCC compiler. LLVM uses

// llvm-symbolizer that relies

// on DWARF debugging info.

// The address of the ODR indicator symbol.

// These functions can be called on some platforms to find globals in the same

// loaded image as `flag' and apply __asan_(un)register_globals to them,

// filtering out redundant calls.

// These two functions should be called by the instrumented code.

// 'globals' is an array of structures describing 'n' globals.

// These two functions should be called before and after dynamic initializers

// of a single module run, respectively.

// Sets bytes of the given range of the shadow memory into specific value.

// These two functions are used by instrumented code in the

// use-after-scope mode. They mark memory for local variables as

// unaddressable when they leave scope and addressable before the

// function exits.

// Performs cleanup before a NoReturn function. Must be called before things

// like _exit and execl to avoid false positives on stack.

// Global flag, copy of ASAN_OPTIONS=detect_stack_use_after_return

// extern "C"

// ASAN_INTERFACE_INTERNAL_H


=== system/lib/compiler-rt/lib/asan/asan_internal.h ===
SHA256: 5fc78ef0f772e7b2bb8c3648828ab514b0760f242626fadfcfc3890427a3ce7c
//===-- asan_internal.h -----------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// ASan-private header which defines various general utilities.

//===----------------------------------------------------------------------===//

// Build-time configuration options.

// If set, asan will intercept C++ exception api call(s).

// If set, values like allocator chunk size, as well as defaults for some flags

// will be changed towards less memory overhead.

// All internal functions in asan reside inside the __asan namespace

// to avoid namespace collisions with the user programs.

// Separate namespace also makes it simpler to distinguish the asan run-time

// functions from the instrumented user code in a profile.

// asan_win.cpp

// Returns whether an address is a valid allocated system heap block.

// 'addr' must point to the beginning of the block.

// asan_rtl.cpp

// asan_shadow_setup.cpp

// asan_malloc_linux.cpp / asan_malloc_mac.cpp

// asan_linux.cpp / asan_mac.cpp / asan_win.cpp

// Unpoisons platform-specific stacks.

// Returns true if all stacks have been unpoisoned.

// asan_rtl.cpp

// Unpoison a region containing a stack.

// Performs a sanity check and warns if the bounds don't look right.

// The warning contains the type string to identify the stack type.

// asan_thread.cpp

// Support function for __asan_(un)register_image_globals. Searches for the

// loaded image containing `needle' and then enumerates all global metadata

// structures declared in that image, applying `op' (e.g.,

// __asan_(un)register_globals) to them.

// Wrapper for TLS/TSD.

// Returns `true` iff most of ASan init process should be skipped due to the

// ASan library being loaded via `dlopen()`. Platforms may perform any

// `dlopen()` specific initialization inside this function.

// These magic values are written to shadow for better error

// reporting.

// namespace __asan

// ASAN_INTERNAL_H


=== system/lib/compiler-rt/lib/asan/asan_linux.cpp ===
SHA256: 311c6ffdedf16bb5f4283a02e3c3bd7d7e71c72c9cb25311c35d9ad423b435ff
//===-- asan_linux.cpp ----------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Linux-specific details.

//===----------------------------------------------------------------------===//

// FIXME: perhaps also store abi version here?

// We may have mapped too much. Release extra memory.

/*min_shadow_base_alignment*/

// Since asan's mapping is compacting, the shadow chunk may be

// not page-aligned, so we only flush the page-aligned portion.

// ASLR personality check.

// Caution: 'personality' is sometimes forbidden by sandboxes, so only call

// this function as a last resort (when the memory mapping is incompatible

// and ASan would fail anyway).

// Disable ASLR if the memory layout was incompatible.

// Alternatively, we could just keep re-execing until we get lucky

// with a compatible randomized layout, but the risk is that if it's

// not an ASLR-related issue, we will be stuck in an infinite loop of

// re-execing (unless we change ReExec to pass a parameter of the

// number of retries allowed.)

// FIXME: should we do anything for Android?

// Ignore first entry (the main program)

// Ignore vDSO. glibc versions earlier than 2.15 (and some patched

// by distributors) return an empty name for the vDSO entry, so

// detect this as well.

// Ignore vDSO.

// Ensure that dynamic RT is the first DSO in the list

// Ensure that dynamic runtime is not present. We should detect it

// as early as possible, otherwise ASan interceptors could bind to

// the functions in dynamic ASan runtime instead of the functions in

// system libraries, causing crashes later in ASan initialization.

/*cache_enabled*/

// SANITIZER_ANDROID

// ASAN_INTERCEPT_SWAPCONTEXT

// Not supported on this platform.

// namespace __asan

// SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD ||

// SANITIZER_SOLARIS || SANITIZER_HAIKU


=== system/lib/compiler-rt/lib/asan/asan_mac.cpp ===
SHA256: f94e0c64409bb46bd3283f8079ea5e6d932b0152bc6250d59feeaee03f7b2331
//===-- asan_mac.cpp ------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Mac-specific details.

//===----------------------------------------------------------------------===//

// for free()

// from <crt_externs.h>, but we don't have that file on iOS

/*min_shadow_base_alignment*/

// Not used.

// No-op. Mac does not support static linkage anyway.

// No-op. Mac does not support static linkage anyway.

// Find the Mach-O header for the image containing the needle

// Look up the __asan_globals section in that image and register its globals

// Since asan's mapping is compacting, the shadow chunk may be

// not page-aligned, so we only flush the page-aligned portion.

// Support for the following functions from libdispatch on Mac OS:

//   dispatch_async_f()

//   dispatch_async()

//   dispatch_sync_f()

//   dispatch_sync()

//   dispatch_after_f()

//   dispatch_after()

//   dispatch_group_async_f()

//   dispatch_group_async()

// TODO(glider): libdispatch API contains other functions that we don't support

// yet.

//

// dispatch_sync() and dispatch_sync_f() are synchronous, although chances are

// they can cause jobs to run on a thread different from the current one.

// TODO(glider): if so, we need a test for this (otherwise we should remove

// them).

//

// The following functions use dispatch_barrier_async_f() (which isn't a library

// function but is exported) and are thus supported:

//   dispatch_source_set_cancel_handler_f()

//   dispatch_source_set_cancel_handler()

//   dispatch_source_set_event_handler_f()

//   dispatch_source_set_event_handler()

//

// The reference manual for Grand Central Dispatch is available at

//   http://developer.apple.com/library/mac/#documentation/Performance/Reference/GCD_libdispatch_Ref/Reference/reference.html

// The implementation details are at

//   http://libdispatch.macosforge.org/trac/browser/trunk/src/queue.c

// A wrapper for the ObjC blocks used to support libdispatch.

/* detached */

// For use by only those functions that allocated the context via

// alloc_asan_context().

// Call the original dispatcher for the block.

// namespace __asan

// Wrap |ctxt| and |func| into an asan_block_context_t.

// The caller retains control of the allocated context.

// Define interceptor for dispatch_*_f function with the three most common

// parameters: dispatch_queue_t, context, dispatch_function_t.

// SANITIZER_APPLE


=== system/lib/compiler-rt/lib/asan/asan_malloc_linux.cpp ===
SHA256: 6c207b0e1f639ee5eaeea02b653d093fbaf088a86f2885d3c586fb369941aa98
//===-- asan_malloc_linux.cpp ---------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Linux-specific malloc interception.

// We simply define functions like malloc, free, realloc, etc.

// They will replace the corresponding libc functions automagically.

//===----------------------------------------------------------------------===//

// ---------------------- Replacement functions ---------------- {{{1

// Suppress leaks from dlerror(). Previously dlsym hack on global array was

// used by leak sanitizer as a root region.

// SANITIZER_INTERCEPT_CFREE

// SANITIZER_INTERCEPT_REALLOCARRAY

// SANITIZER_INTERCEPT_MEMALIGN

// SANITIZER_INTERCEPT_ALIGNED_ALLOC

// We avoid including malloc.h for portability reasons.

// man mallinfo says the fields are "long", but the implementation uses int.

// It doesn't matter much -- we just need to make sure that the libc's mallinfo

// is not called.

// SANITIZER_INTERCEPT_MALLOPT_AND_MALLINFO

// SANITIZER_INTERCEPT_PVALLOC

// Format of __libc_malloc_dispatch has changed in Android L.

// While we are moving towards a solution that does not depend on bionic

// internals, here is something to support both K* and L releases.

// Decide on K vs L dispatch format by the presence of

// __libc_malloc_default_dispatch export in libc.

// namespace __asan

// SANITIZER_ANDROID

// namespace __asan

// SANITIZER_ANDROID

// SANITIZER_FREEBSD || SANITIZER_FUCHSIA || SANITIZER_LINUX ||

// SANITIZER_NETBSD || SANITIZER_SOLARIS || SANITIZER_HAIKU ||

// SANITIZER_EMSCRIPTEN


=== system/lib/compiler-rt/lib/asan/asan_malloc_mac.cpp ===
SHA256: 30ebe5f60ee0636dca85bf75b9eeeaa18424c13071c28e131d8dcb5070d349e5
//===-- asan_malloc_mac.cpp -----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Mac-specific malloc interception.

//===----------------------------------------------------------------------===//

// We have no reliable way of knowing how we are being loaded

// so make it a requirement on Apple platforms to set this environment

// variable to indicate that we want to perform initialization via

// dlopen().

// When we are loaded via `dlopen()` path we still initialize the malloc zone

// so Symbolication clients (e.g. `leaks`) that load the ASan allocator can

// find an initialized malloc zone.

// namespace COMMON_MALLOC_NAMESPACE

// Range is [begin_ptr, end_ptr)

// namespace


=== system/lib/compiler-rt/lib/asan/asan_malloc_win.cpp ===
SHA256: e9ec597d77cc2d0c17319d24dcfb366e2dff65198fcd416f72221b217759fc8b
//===-- asan_malloc_win.cpp -----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Windows-specific malloc interception.

//===----------------------------------------------------------------------===//

// Intentionally not including windows.h here, to avoid the risk of

// pulling in conflicting declarations of these functions. (With mingw-w64,

// there's a risk of windows.h pulling in stdint.h.)

// MT: Simply defining functions with the same signature in *.obj

// files overrides the standard functions in the CRT.

// MD: Memory allocation functions are defined in the CRT .dll,

// so we have to intercept them before they are called for the first time.

// _expand is used in realloc-like functions to resize the buffer if possible.

// We don't want memory to stand still while resizing buffers, so return 0.

// TODO(timurrrr): Might want to add support for _aligned_* allocation

// functions to detect a bit more bugs.  Those functions seem to wrap malloc().

// extern "C"

// If the RTL allocators are hooked we need to check whether the ASAN

// allocator owns the pointer we're about to use. Allocations occur before

// interception takes place, so if it is not owned by the RTL heap we can

// pass it to the ASAN heap for inspection.

// If the ASAN runtime is not initialized, or we encounter an unsupported

// flag, fall back to the original allocator.

// In the case that we don't hook the rtl allocators,

// this becomes an assert since there is no failover to the original

// allocator.

// Reading MSDN suggests that the *entire* usable allocation is zeroed out.

// Otherwise it is difficult to HeapReAlloc with HEAP_ZERO_MEMORY.

// https://blogs.msdn.microsoft.com/oldnewthing/20120316-00/?p=8083

// Heap allocations happen before this function is hooked, so we must fall

// back to the original function if the pointer is not from the ASAN heap,

// or unsupported flags are provided.

// If this heap block which was allocated before the ASAN

// runtime came up, use the real HeapFree function.

// if this is a conversion to ASAN upported flags, transfer this

// allocation to the ASAN allocator

// owned by rtl or neither with unsupported ASAN flags,

// just pass back to original allocator

// Conversion to unsupported flags allocation,

// transfer this allocation back to the original allocator.

// At this point we should either be ASAN owned with ASAN supported flags

// or we owned by neither and have supported flags.

// Pass through even when it's neither since this could be a null realloc or

// UAF that ASAN needs to catch.

// asan_realloc will never reallocate in place, so for now this flag is

// unsupported until we figure out a way to fake this.

// HeapReAlloc and HeapAlloc both happily accept 0 sized allocations.

// passing a 0 size into asan_realloc will free the allocation.

// To avoid this and keep behavior consistent, fudge the size if 0.

// (asan_malloc already does this)

// namespace __asan

// The following functions are undocumented and subject to change.

// However, hooking them is necessary to hook Windows heap

// allocations with detours and their definitions are unlikely to change.

// Comments in /minkernel/ntos/rtl/heappublic.c indicate that these functions

// are part of the heap's public interface.

// This function is documented as part of the Driver Development Kit but *not*

// the Windows Development Kit.

// This function is documented as part of the Driver Development Kit but *not*

// the Windows Development Kit.

// This function is completely undocumented.

// This function is completely undocumented.

// Heap allocations happen before this function is hooked, so we must fall

// back to the original function if the pointer is not from the ASAN heap, or

// unsupported flags are provided.

// If the ASAN runtime is not initialized, or we encounter an unsupported

// flag, fall back to the original allocator.

// Reading MSDN suggests that the *entire* usable allocation is zeroed out.

// Otherwise it is difficult to HeapReAlloc with HEAP_ZERO_MEMORY.

// https://blogs.msdn.microsoft.com/oldnewthing/20120316-00/?p=8083

// If it's actually a heap block which was allocated before the ASAN runtime

// came up, use the real RtlFreeHeap function.

// Failure here is not fatal. The CRT may not be present, and different CRT

// versions use different symbols.

// Undocumented functions must be intercepted by name, not by symbol.

// Recent versions of ucrtbase.dll appear to be built with PGO and LTCG, which

// enable cross-module inlining. This means our _malloc_base hook won't catch

// all CRT allocations. This code here patches the import table of

// ucrtbase.dll so that all attempts to use the lower-level win32 heap

// allocation API will be directed to ASan's heap. We don't currently

// intercept all calls to HeapAlloc. If we did, we would have to check on

// HeapFree whether the pointer came from ASan of from the system.

// namespace __asan

// _WIN32


=== system/lib/compiler-rt/lib/asan/asan_malloc_win_thunk.cpp ===
SHA256: 0f49dc168e9f4ab685e3607bb29e4642e45539c16f061e151f06eb5ff22a9556
//===-- asan_malloc_win_thunk.cpp

//-----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Windows-specific malloc interception.

// This is included statically for projects statically linking

// with the C Runtime (/MT, /MTd) in order to provide ASAN-aware

// versions of the C allocation functions.

//===----------------------------------------------------------------------===//

// #include "asan_win_thunk_common.h"

// Preserve stack traces with noinline.

// Avoid tailcall optimization to preserve stack frames.

// _msize

// free

// malloc

// calloc

// Provided by legacy msvcrt.

// realloc

// recalloc

// expand

// _expand is used in realloc-like functions to resize the buffer if possible.

// We don't want memory to stand still while resizing buffers, so return 0.

// We need to provide symbols for all the debug CRT functions if we decide to

// provide any. Most of these functions make no sense under ASan and so we

// make them no-ops.

// TODO: These were added upstream but conflict with definitions in ucrtbased.

// int _CrtDbgReport(int, const char *, int, const char *, const char *, ...) {

//   ShowStatsAndAbort();

// }

//

// int _CrtDbgReportW(int reportType, const wchar_t *, int, const wchar_t *,

//                    const wchar_t *, ...) {

//   ShowStatsAndAbort();

// }

//

// int _CrtSetReportMode(int, int) { return 0; }

// extern "C"

// SANITIZER_STATIC_RUNTIME_THUNK


=== system/lib/compiler-rt/lib/asan/asan_mapping.h ===
SHA256: 238b10ca080cc814ad73c347ca52ad943c07dfde1a994508fa59fe92f82cccf5
//===-- asan_mapping.h ------------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Defines ASan memory mapping.

//===----------------------------------------------------------------------===//

// The full explanation of the memory mapping could be found here:

// https://github.com/google/sanitizers/wiki/AddressSanitizerAlgorithm

//

// Typical shadow mapping on Linux/x86_64 with SHADOW_OFFSET == 0x00007fff8000:

// || `[0x10007fff8000, 0x7fffffffffff]` || HighMem    ||

// || `[0x02008fff7000, 0x10007fff7fff]` || HighShadow ||

// || `[0x00008fff7000, 0x02008fff6fff]` || ShadowGap  ||

// || `[0x00007fff8000, 0x00008fff6fff]` || LowShadow  ||

// || `[0x000000000000, 0x00007fff7fff]` || LowMem     ||

//

// When SHADOW_OFFSET is zero (-pie):

// || `[0x100000000000, 0x7fffffffffff]` || HighMem    ||

// || `[0x020000000000, 0x0fffffffffff]` || HighShadow ||

// || `[0x000000040000, 0x01ffffffffff]` || ShadowGap  ||

//

// Special case when something is already mapped between

// 0x003000000000 and 0x005000000000 (e.g. when prelink is installed):

// || `[0x10007fff8000, 0x7fffffffffff]` || HighMem    ||

// || `[0x02008fff7000, 0x10007fff7fff]` || HighShadow ||

// || `[0x005000000000, 0x02008fff6fff]` || ShadowGap3 ||

// || `[0x003000000000, 0x004fffffffff]` || MidMem     ||

// || `[0x000a7fff8000, 0x002fffffffff]` || ShadowGap2 ||

// || `[0x00067fff8000, 0x000a7fff7fff]` || MidShadow  ||

// || `[0x00008fff7000, 0x00067fff7fff]` || ShadowGap  ||

// || `[0x00007fff8000, 0x00008fff6fff]` || LowShadow  ||

// || `[0x000000000000, 0x00007fff7fff]` || LowMem     ||

//

// Default Linux/i386 mapping on x86_64 machine:

// || `[0x40000000, 0xffffffff]` || HighMem    ||

// || `[0x28000000, 0x3fffffff]` || HighShadow ||

// || `[0x24000000, 0x27ffffff]` || ShadowGap  ||

// || `[0x20000000, 0x23ffffff]` || LowShadow  ||

// || `[0x00000000, 0x1fffffff]` || LowMem     ||

//

// Default Linux/i386 mapping on i386 machine

// (addresses starting with 0xc0000000 are reserved

// for kernel and thus not sanitized):

// || `[0x38000000, 0xbfffffff]` || HighMem    ||

// || `[0x27000000, 0x37ffffff]` || HighShadow ||

// || `[0x24000000, 0x26ffffff]` || ShadowGap  ||

// || `[0x20000000, 0x23ffffff]` || LowShadow  ||

// || `[0x00000000, 0x1fffffff]` || LowMem     ||

//

// Default Linux/MIPS32 mapping:

// || `[0x2aaa0000, 0xffffffff]` || HighMem    ||

// || `[0x0fff4000, 0x2aa9ffff]` || HighShadow ||

// || `[0x0bff4000, 0x0fff3fff]` || ShadowGap  ||

// || `[0x0aaa0000, 0x0bff3fff]` || LowShadow  ||

// || `[0x00000000, 0x0aa9ffff]` || LowMem     ||

//

// Default Linux/MIPS64 mapping:

// || `[0x4000000000, 0xffffffffff]` || HighMem    ||

// || `[0x2800000000, 0x3fffffffff]` || HighShadow ||

// || `[0x2400000000, 0x27ffffffff]` || ShadowGap  ||

// || `[0x2000000000, 0x23ffffffff]` || LowShadow  ||

// || `[0x0000000000, 0x1fffffffff]` || LowMem     ||

//

// Default Linux/RISCV64 Sv39 mapping with SHADOW_OFFSET == 0xd55550000;

// (the exact location of SHADOW_OFFSET may vary depending the dynamic probing

//  by FindDynamicShadowStart).

//

// || `[0x1555550000, 0x3fffffffff]` || HighMem    ||

// || `[0x0fffffa000, 0x1555555fff]` || HighShadow ||

// || `[0x0effffa000, 0x0fffff9fff]` || ShadowGap  ||

// || `[0x0d55550000, 0x0effff9fff]` || LowShadow  ||

// || `[0x0000000000, 0x0d5554ffff]` || LowMem     ||

//

// Default Linux/AArch64 (39-bit VMA) mapping:

// || `[0x2000000000, 0x7fffffffff]` || highmem    ||

// || `[0x1400000000, 0x1fffffffff]` || highshadow ||

// || `[0x1200000000, 0x13ffffffff]` || shadowgap  ||

// || `[0x1000000000, 0x11ffffffff]` || lowshadow  ||

// || `[0x0000000000, 0x0fffffffff]` || lowmem     ||

//

// Default Linux/AArch64 (42-bit VMA) mapping:

// || `[0x10000000000, 0x3ffffffffff]` || highmem    ||

// || `[0x0a000000000, 0x0ffffffffff]` || highshadow ||

// || `[0x09000000000, 0x09fffffffff]` || shadowgap  ||

// || `[0x08000000000, 0x08fffffffff]` || lowshadow  ||

// || `[0x00000000000, 0x07fffffffff]` || lowmem     ||

//

// Default Linux/S390 mapping:

// || `[0x30000000, 0x7fffffff]` || HighMem    ||

// || `[0x26000000, 0x2fffffff]` || HighShadow ||

// || `[0x24000000, 0x25ffffff]` || ShadowGap  ||

// || `[0x20000000, 0x23ffffff]` || LowShadow  ||

// || `[0x00000000, 0x1fffffff]` || LowMem     ||

//

// Default Linux/SystemZ mapping:

// || `[0x14000000000000, 0x1fffffffffffff]` || HighMem    ||

// || `[0x12800000000000, 0x13ffffffffffff]` || HighShadow ||

// || `[0x12000000000000, 0x127fffffffffff]` || ShadowGap  ||

// || `[0x10000000000000, 0x11ffffffffffff]` || LowShadow  ||

// || `[0x00000000000000, 0x0fffffffffffff]` || LowMem     ||

//

// Default Linux/SPARC64 (52-bit VMA) mapping:

// || `[0x8000000000000, 0xfffffffffffff]` || HighMem    ||

// || `[0x1080000000000, 0x207ffffffffff]` || HighShadow ||

// || `[0x0090000000000, 0x107ffffffffff]` || ShadowGap  ||

// || `[0x0080000000000, 0x008ffffffffff]` || LowShadow  ||

// || `[0x0000000000000, 0x007ffffffffff]` || LowMem     ||

//

// Default Linux/LoongArch64 (47-bit VMA) mapping:

// || `[0x500000000000, 0x7fffffffffff]` || HighMem    ||

// || `[0x4a0000000000, 0x4fffffffffff]` || HighShadow ||

// || `[0x480000000000, 0x49ffffffffff]` || ShadowGap  ||

// || `[0x400000000000, 0x47ffffffffff]` || LowShadow  ||

// || `[0x000000000000, 0x3fffffffffff]` || LowMem     ||

//

// Shadow mapping on FreeBSD/x86-64 with SHADOW_OFFSET == 0x400000000000:

// || `[0x500000000000, 0x7fffffffffff]` || HighMem    ||

// || `[0x4a0000000000, 0x4fffffffffff]` || HighShadow ||

// || `[0x480000000000, 0x49ffffffffff]` || ShadowGap  ||

// || `[0x400000000000, 0x47ffffffffff]` || LowShadow  ||

// || `[0x000000000000, 0x3fffffffffff]` || LowMem     ||

//

// Shadow mapping on FreeBSD/i386 with SHADOW_OFFSET == 0x40000000:

// || `[0x60000000, 0xffffffff]` || HighMem    ||

// || `[0x4c000000, 0x5fffffff]` || HighShadow ||

// || `[0x48000000, 0x4bffffff]` || ShadowGap  ||

// || `[0x40000000, 0x47ffffff]` || LowShadow  ||

// || `[0x00000000, 0x3fffffff]` || LowMem     ||

//

// Shadow mapping on NetBSD/x86-64 with SHADOW_OFFSET == 0x400000000000:

// || `[0x4feffffffe01, 0x7f7ffffff000]` || HighMem    ||

// || `[0x49fdffffffc0, 0x4feffffffe00]` || HighShadow ||

// || `[0x480000000000, 0x49fdffffffbf]` || ShadowGap  ||

// || `[0x400000000000, 0x47ffffffffff]` || LowShadow  ||

// || `[0x000000000000, 0x3fffffffffff]` || LowMem     ||

//

// Shadow mapping on NetBSD/i386 with SHADOW_OFFSET == 0x40000000:

// || `[0x60000000, 0xfffff000]` || HighMem    ||

// || `[0x4c000000, 0x5fffffff]` || HighShadow ||

// || `[0x48000000, 0x4bffffff]` || ShadowGap  ||

// || `[0x40000000, 0x47ffffff]` || LowShadow  ||

// || `[0x00000000, 0x3fffffff]` || LowMem     ||

//

// Default Windows/i386 mapping:

// (the exact location of HighShadow/HighMem may vary depending

//  on WoW64, /LARGEADDRESSAWARE, etc).

// || `[0x50000000, 0xffffffff]` || HighMem    ||

// || `[0x3a000000, 0x4fffffff]` || HighShadow ||

// || `[0x36000000, 0x39ffffff]` || ShadowGap  ||

// || `[0x30000000, 0x35ffffff]` || LowShadow  ||

// || `[0x00000000, 0x2fffffff]` || LowMem     ||

// Set to 1 to profile the functions below.

// If 1, all shadow boundaries are constants.

// Don't set to 1 other than for testing.

// Fixed mapping for 64-bit Linux. Mostly used for performance comparison

// with non-fixed mapping. As of r175253 (Feb 2013) the performance

// difference between fixed and non-fixed mapping is below the noise level.

// Initialized in __asan_init.

// namespace __asan

// With the zero shadow base we can not actually map pages starting from 0.

// This constant is somewhat arbitrary.

// In zero-based shadow mode we treat addresses near zero as addresses

// in shadow gap as well.

// namespace __asan

// Must be after all calls to PROFILE_ASAN_MAPPING().

// namespace __asan

// __cplusplus

// ASAN_MAPPING_H


=== system/lib/compiler-rt/lib/asan/asan_mapping_emscripten.h ===
SHA256: 53d931dc3e70a69caf4842a79e8cd1eb2ea13f4d4fde9a2127b68b2b1f7024ec
//===-- asan_mapping_emscripten.h -------------------------------*- C++ -*-===//

//

//                     The LLVM Compiler Infrastructure

//

// This file is distributed under the University of Illinois Open Source

// License. See LICENSE.TXT for details.

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Emscripten-specific definitions for ASan memory mapping.

//===----------------------------------------------------------------------===//

// The first 1/8 of the shadow memory space is shadowing itself.

// This allows attempted accesses into the shadow memory, as well as null

// pointer dereferences, to be detected properly.

// The shadow memory of the shadow memory is poisoned.

// namespace __asan

// ASAN_MAPPING_EMSCRIPTEN_H


=== system/lib/compiler-rt/lib/asan/asan_mapping_sparc64.h ===
SHA256: b2fe362d743934ba2bea06bf24f293981a41f20097783a6d437ddecaac0e3b87
//===-- asan_mapping_sparc64.h ----------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// SPARC64-specific definitions for ASan memory mapping.

//===----------------------------------------------------------------------===//

// This is tailored to the 52-bit VM layout on SPARC-T4 and later.

// The VM space is split into two 51-bit halves at both ends: the low part

// has all the bits above the 51st cleared, while the high part has them set.

//   0xfff8000000000000 - 0xffffffffffffffff

//   0x0000000000000000 - 0x0007ffffffffffff

// The idea is to chop the high bits before doing the scaling, so the two

// parts become contiguous again and the usual scheme can be applied.

// But of course there is the huge hole between the high shadow memory,

// which is in the low part, and the beginning of the high part.

// With the zero shadow base we can not actually map pages starting from 0.

// This constant is somewhat arbitrary.

// Gets aligned down.

// namespace __asan

// ASAN_MAPPING_SPARC64_H


=== system/lib/compiler-rt/lib/asan/asan_memory_profile.cpp ===
SHA256: a4846aa10f81de6a9a7dd3ed6b4810f77013c055b5e0df36dc7928355b8fc6aa
//===-- asan_memory_profile.cpp ----------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// This file implements __sanitizer_print_memory_profile.

//===----------------------------------------------------------------------===//

// Linear lookup will be good enough for most cases (although not all).

// namespace __asan

// CAN_SANITIZE_LEAKS

// CAN_SANITIZE_LEAKS

// extern "C"


=== system/lib/compiler-rt/lib/asan/asan_new_delete.cpp ===
SHA256: c683782bfc9346625b34aa5e32fd8eb826573b90f57e3684cb4f1ce19fc51bc7
//===-- asan_interceptors.cpp ---------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Interceptors for operators new and delete.

//===----------------------------------------------------------------------===//

// C++ operators can't have dllexport attributes on Windows. We export them

// anyway by passing extra -export flags to the linker, which is exactly that

// dllexport would normally do. We need to export them in order to make the

// VS2015 dynamic CRT (MD) work.

// operator new

// operator new nothrow

// operator delete

// sized operator delete

// operator new[]

// operator delete[]

// operator new

// operator new nothrow

// operator delete

// sized operator delete

// operator new[]

// operator delete[]

// This code has issues on OSX.

// See https://github.com/google/sanitizers/issues/131.

// Fake std::nothrow_t and std::align_val_t to avoid including <new>.

// namespace std

// TODO(alekseyshl): throw std::bad_alloc instead of dying on OOM.

// For local pool allocation, align to SHADOW_GRANULARITY to match asan

// allocator behavior.

// On OS X it's not enough to just provide our own 'operator new' and

// 'operator delete' implementations, because they're going to be in the

// runtime dylib, and the main executable will depend on both the runtime

// dylib and libstdc++, each of those'll have its implementation of new and

// delete.

// To make sure that C++ allocation/deallocation operators are overridden on

// OS X we need to intercept them using their mangled names.

// SANITIZER_APPLE

// !SANITIZER_APPLE

// SANITIZER_APPLE

// !SANITIZER_APPLE


=== system/lib/compiler-rt/lib/asan/asan_poisoning.cpp ===
SHA256: f486b42857b07060cb8af352d97c473a1cb10921119e83666403dd9f2179d5d1
//===-- asan_poisoning.cpp ------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Shadow memory poisoning by ASan RTL and by user application.

//===----------------------------------------------------------------------===//

// in [0, ASAN_SHADOW_GRANULARITY)

// = *chunk;

// namespace __asan

// ---------------------- Interface ---------------- {{{1

// Current implementation of __asan_(un)poison_memory_region doesn't check

// that user program (un)poisons the memory it owns. It poisons memory

// conservatively, and unpoisons progressively to make sure asan shadow

// mapping invariant is preserved (see detailed mapping description here:

// https://github.com/google/sanitizers/wiki/AddressSanitizerAlgorithm).

//

// * if user asks to poison region [left, right), the program poisons

// at least [left, AlignDown(right)).

// * if user asks to unpoison region [left, right), the program unpoisons

// at most [AlignDown(left), right).

/*max_size=*/

/*fast=*/

// We can only poison memory if the byte in end.offset is unaddressable.

// No need to re-poison memory if it is poisoned already.

// Mark bytes from beg.offset as unaddressable.

// Poison if byte in end.offset is unaddressable.

// Note: we don't need to update the poison tracking here. Since the shadow

// memory will be unpoisoned, the poison tracking ring buffer entries will be

// ignored.

// We unpoison memory bytes up to enbytes up to end.offset if it is not

// unpoisoned already.

// XXX Emscripten hack XXX

// Null pointer handling, since Emscripten does not crash on null pointer,

// ASan must catch null pointer dereference by itself.

// Unfortunately, this function returns 0 to mean the region is not

// poisoned, so we must return 1 instead if we receive a region

// starting at 0.

// First check the first and the last application bytes,

// then check the ASAN_SHADOW_GRANULARITY-aligned region by calling

// mem_is_zero on the corresponding shadow.

// The fast check failed, so we have a poisoned byte somewhere.

// Find it slowly.

// If sval is not kAsanArrayCookieMagic it can only be freed memory,

// which means that we are going to get double-free. So, return 0 to avoid

// infinite loop of destructors. We don't want to report a double-free here

// though, so print a warning just in case.

// CHECK_EQ(sval, kAsanHeapFreeMagic);

// The cookie may remain unpoisoned if e.g. it comes from a custom

// operator new defined inside a class.

// This is a simplified version of __asan_(un)poison_memory_region, which

// assumes that left border of region to be poisoned is properly aligned.

// If possible, mark all the bytes mapping to last shadow byte as

// unaddressable.

// If necessary, mark few first bytes mapping to last shadow byte

// as addressable

// Ignore the last unaligned granule if the storage is followed by

// unpoisoned byte, because we can't poison the prefix anyway. Don't call

// AddressIsPoisoned at all if container changes does not affect the last

// granule at all.

// Handle misaligned begin and cut it off.

// The first unaligned granule needs special handling only if we had bytes

// there before and will have none after.

// Keep granule prefix outside of the storage unpoisoned.

// Sanity check.

// Nothing to do here.

// uptr d2 = RoundUpTo(old_mid, granularity);

// Currently we should be in this state:

// [a, d1) is good, [d2, c) is bad, [d1, d2) is partially good.

// Make a quick sanity check that we are indeed in this state.

//

// FIXME: Two of these three checks are disabled until we fix

// https://github.com/google/sanitizers/issues/258.

// if (d1 != d2)

//  DCHECK_EQ(*(u8*)MemToShadow(d1), old_mid - d1);

//

// NOTE: curly brackets for the "if" below to silence a MSVC warning.

// if (d2 + granularity <= c && c <= end)

//   DCHECK_EQ(*(u8 *)MemToShadow(c - granularity),

//            kAsanContiguousContainerOOBMagic);

// New state:

// [a, b1) is good, [b2, c) is bad, [b1, b2) is partially good.

// Annotates a double ended contiguous memory area like std::deque's chunk.

// It allows detecting buggy accesses to allocated but not used begining

// or end items of such a container.

// Sanity check.

// Nothing to do here.

// Handle non-intersecting new/old containers separately have simpler

// intersecting case.

// Poisoning the old container.

// Unpoisoning the new container.

// Intersection of old and new containers is not empty.

// Round down because we can't poison prefixes.

// Round down and ignore the [c, old_beg) as its state defined by unchanged

// [old_beg, old_end).

// Round down and poison [a, old_beg) because it was unpoisoned only as a

// prefix.

// Round down and ignore the [c, new_beg) as its state defined by unchanged

// [new_beg, old_end).

// Round down to poison the prefix.

// Round down and handle remainder below.

// Round up and handle remained below.

// Round up to poison entire granule as we had nothing in [old_end, c2).

// Marks the specified number of bytes in a granule as accessible or

// poisones the whole granule with kAsanContiguousContainerOOBMagic value.

// Performs a byte-by-byte copy of ASan annotations (shadow memory values).

// Result may be different due to ASan limitations, but result cannot lead

// to false positives (more memory than requested may get unpoisoned).

// Performs a byte-by-byte copy of ASan annotations (shadow memory values),

// going through bytes in reversed order, but not reversing annotations.

// Result may be different due to ASan limitations, but result cannot lead

// to false positives (more memory than requested may get unpoisoned).

// A helper function for __sanitizer_copy_contiguous_container_annotations,

// has assumption about begin and end of the container.

// Should not be used stand alone.

// First granule

// A helper function for __sanitizer_copy_contiguous_container_annotations,

// has assumption about begin and end of the container.

// Should not be used stand alone.

// Last granule

// This function copies ASan memory annotations (poisoned/unpoisoned states)

// from one buffer to another.

// It's main purpose is to help with relocating trivially relocatable objects,

// which memory may be poisoned, without calling copy constructor.

// However, it does not move memory content itself, only annotations.

// If the buffers aren't aligned (the distance between buffers isn't

// granule-aligned)

//     // src_beg % granularity != dst_beg % granularity

// the function handles this by going byte by byte, slowing down performance.

// The old buffer annotations are not removed. If necessary,

// user can unpoison old buffer with __asan_unpoison_memory_region.

// Due to support for overlapping buffers, we may have to copy elements

// in reversed order, when destination buffer starts in the middle of

// the source buffer (or shares first granule with it).

//

// When buffers are not granule-aligned (or distance between them,

// to be specific), annotatios have to be copied byte by byte.

//

// The only remaining edge cases involve edge granules,

// when the container starts or ends within a granule.

// As buffers are granule-aligned, we can just copy annotations of granules

// from the middle.

// If the byte after the storage is unpoisoned, everything in the granule

// before must stay unpoisoned.

// The prefix of the firs granule of the container is unpoisoned.

// If the byte after the storage is unpoisoned, the prefix of the last granule

// is unpoisoned.

// --- Implementation of LSan-specific functions --- {{{1


=== system/lib/compiler-rt/lib/asan/asan_poisoning.h ===
SHA256: 14657d010a63dd69a2f5fd164b828dc8a7d9d66362c41732dbd7155716dd70bf
//===-- asan_poisoning.h ----------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Shadow memory poisoning by ASan RTL and by user application.

//===----------------------------------------------------------------------===//

// Enable/disable memory poisoning.

// Poisons the shadow memory for "size" bytes starting from "addr".

// Poisons the shadow memory for "redzone_size" bytes starting from

// "addr + size".

// Fast versions of PoisonShadow and PoisonShadowPartialRightRedzone that

// assume that memory addresses are properly aligned. Use in

// performance-critical code with care.

// FIXME: Page states are different on Windows, so using the same interface

// for mapping shadow and zeroing out pages doesn't "just work", so we should

// probably provide higher-level interface for these operations.

// For now, just memset on Windows.

// Emscripten doesn't have a nice way to zero whole pages.

// The bulk memory proposal will allow memset to be optimized, but

// even then, we still must use memset.

// SANITIZER_FUCHSIA

// fully addressable

// unaddressable

// first size-i bytes are addressable

// Calls __sanitizer::ReleaseMemoryPagesToOS() on

// [MemToShadow(p), MemToShadow(p+size)].

// namespace __asan

// ASAN_POISONING_H


=== system/lib/compiler-rt/lib/asan/asan_posix.cpp ===
SHA256: 20238200469af7a97e3b71f95ed9ac348001d0bb18d41096165e45489e5286ba
//===-- asan_posix.cpp ----------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Posix-specific details.

//===----------------------------------------------------------------------===//

// If we're executing on the signal alternate stack AND the Linux flag

// SS_AUTODISARM was used, then we cannot get the signal alternate stack

// bounds from sigaltstack -- sigaltstack's output looks just as if no

// alternate stack has ever been set up.

// We're always unpoisoning the signal alternate stack to support jumping

// between the default stack and signal alternate stack.

// Since we're on the signal alternate stack, we cannot find the DEFAULT

// stack bottom using a local variable.

/*main=*/

// ---------------------- TSD ---------------- {{{1

// Thread Static Data cannot be used in early static ASan init on NetBSD.

// Reuse the Asan TSD API for compatibility with existing code

// with an alternative implementation.

// Make sure that signal handler can not see a stale current thread pointer.

// After this point it's unsafe to execute signal handlers which may be

// instrumented. It's probably not just a Linux issue.

// `_lsan` functions defined regardless of `CAN_SANITIZE_LEAKS` and lock the

// stuff we need.

// `_lsan` functions defined regardless of `CAN_SANITIZE_LEAKS` and unlock

// the stuff we need.

// While other Linux targets use clone in internal_fork which doesn't

// trigger pthread_atfork handlers, Linux/sparc64 uses __fork, causing a

// hang.

// FIXME: Implement FutexWait.

/* fork_child= */

/* fork_child= */

// namespace __asan

// SANITIZER_POSIX


=== system/lib/compiler-rt/lib/asan/asan_preinit.cpp ===
SHA256: f3b605bf90d3c680317c943eefbe98fbf38f248924835ff1747a21cce6efa1b6
//===-- asan_preinit.cpp --------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Call __asan_init at the very early stage of process startup.

//===----------------------------------------------------------------------===//

// This section is linked into the main executable when -fsanitize=address is

// specified to perform initialization at a very early stage.


=== system/lib/compiler-rt/lib/asan/asan_premap_shadow.cpp ===
SHA256: 217fc483e90ca46480fb0ccacf0d76de0c444634d922fd7bdd20167dcd557086
//===-- asan_premap_shadow.cpp --------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Reserve shadow memory with an ifunc resolver.

//===----------------------------------------------------------------------===//

// The code in this file needs to run in an unrelocated binary. It may not

// access any external symbol, including its own non-hidden globals.

// Conservative upper limit.

// Returns an address aligned to 8 pages, such that one page on the left and

// PremapShadowSize() bytes on the right of it are mapped r/o.

/*mmap_alignment_scale*/

/*min_shadow_base_alignment*/

// shadow == resolver is how Android KitKat and older handles ifunc.

// shadow == 0 just in case.

// namespace __asan

// The resolver may be called multiple times. Map the shadow just once.

// __asan_shadow is a "function" that has the same address as the first byte of

// the shadow mapping.

// ASAN_PREMAP_SHADOW


=== system/lib/compiler-rt/lib/asan/asan_premap_shadow.h ===
SHA256: 968d12c24639aa459bc780b60e27f9b9c093299436cd6002ad4f033d17b47053
//===-- asan_mapping.h ------------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Premap shadow range with an ifunc resolver.

//===----------------------------------------------------------------------===//

// Conservative upper limit.

// ASAN_PREMAP_SHADOW_H


=== system/lib/compiler-rt/lib/asan/asan_report.cpp ===
SHA256: 817d0ce95b3a29d3ad818fb736f5f193091f7f4ff7e392e5d0769256b48709d9
//===-- asan_report.cpp ---------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// This file contains error reporting code.

//===----------------------------------------------------------------------===//

// -------------------- User-specified callbacks ----------------- {{{1

// ---------------------- Helper functions ----------------------- {{{1

// ---------------------- Address Descriptions ------------------- {{{1

// This string is created by the compiler and has the following form:

// "n alloc_1 alloc_2 ... alloc_n"

// where alloc_i looks like "offset size len ObjectName"

// or                       "offset size len ObjectName:line".

// -------------------- Different kinds of reports ----------------- {{{1

// Use ScopedInErrorReport to run common actions just before and

// immediately after printing error report.

// Deadlock Prevention Between ASan and LSan

//

// Background:

// - The `dl_iterate_phdr` function requires holding libdl's internal lock

//   (Lock A).

// - LSan acquires the ASan thread registry lock (Lock B) *after* calling

//   `dl_iterate_phdr`.

//

// Problem Scenario:

// When ASan attempts to call `dl_iterate_phdr` while holding Lock B (e.g.,

// during error reporting via `ErrorDescription::Print`), a circular lock

// dependency may occur:

//   1. Thread 1: Holds Lock B → Requests Lock A (via dl_iterate_phdr)

//   2. Thread 2: Holds Lock A → Requests Lock B (via LSan operations)

//

// Solution:

// Proactively load all required modules before acquiring Lock B.

// This ensures:

// 1. Any `dl_iterate_phdr` calls during module loading complete before

//    locking.

// 2. Subsequent error reporting avoids nested lock acquisition patterns.

// 3. Eliminates the lock order inversion risk between libdl and ASan's

//    thread registry.

// Make sure the registry and sanitizer report mutexes are locked while

// we're printing an error report.

// We can lock them only here to avoid self-deadlock in case of

// recursive reports.

// Make sure the current thread is announced.

// We may want to grab this lock again when printing stats.

// Print memory stats.

// Copy the message buffer so that we could start logging without holding a

// lock that gets acquired during printing.

// Clear error_message_buffer so that if we find other errors

// we don't re-log this error.

// On Android the message is truncated to 512 characters.

// FIXME: implement "compact" error format, possibly without, or with

// highly compressed stack traces?

// FIXME: or just use the summary line as abort message?

// In halt_on_error = false mode, reset the current error object (before

// unlocking).

// Can only report one error per ScopedInErrorReport.

// Error currently being reported. This enables the destructor to interact

// with the debugger and point it to an error description.

/*fatal*/

/*fatal*/

/*fatal*/

/*fatal*/

/*fatal*/

/*fatal*/

/*fatal*/

/*fatal*/

/*fatal*/

/*fatal*/

// ----------------------- CheckForInvalidPointerPair ----------- {{{1

// 256B in shadow memory can be iterated quite fast

// check whether left is a stack memory pointer

// check whether left is a heap memory address

// check whether left is an address of a global variable

// At this point we know nothing about both a1 and a2 addresses.

// ----------------------- Mac-specific reports ----------------- {{{1

// -------------- SuppressErrorReport -------------- {{{1

// Avoid error reports duplicating for ASan recover mode.

// Optimization experiments.

// The experiments can be used to evaluate potential optimizations that remove

// instrumentation (assess false negatives). Instead of completely removing

// some instrumentation, compiler can emit special calls into runtime

// (e.g. __asan_report_exp_load1 instead of __asan_report_load1) and pass

// mask of experiments (exp).

// The reaction to a non-zero value of exp is to be defined.

// namespace __asan

// --------------------------- Interface --------------------- {{{1

// Thread registry must be locked while we're describing an address.

// extern "C"

// Provide default implementation of __asan_on_error that does nothing

// and may be overridden by user.


=== system/lib/compiler-rt/lib/asan/asan_report.h ===
SHA256: e070c2bd3d11e411fd42bff861a61a2c4f2a4d70ec7b0f35bb99c3e28eed8f4a
//===-- asan_report.h -------------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// ASan-private header for error reporting functions.

//===----------------------------------------------------------------------===//

// Returns the number of globals close to the provided address and copies

// them to "globals" array.

// The following functions prints address description depending

// on the memory type (shadow/heap/stack/global).

// Different kinds of error reports.

// Mac-specific errors and warnings.

// namespace __asan

// ASAN_REPORT_H


=== system/lib/compiler-rt/lib/asan/asan_rtl.cpp ===
SHA256: fa9360b4c368767c543f60b6f24def01acda317ecb5098780821e3d759124458
//===-- asan_rtl.cpp ------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Main file of the ASan run-time library.

//===----------------------------------------------------------------------===//

// Global interface symbol.

// Global interface symbol.

// Used only for testing asan.

// Don't die twice - run a busy loop.

// -------------------------- Globals --------------------- {{{1

// -------------------------- Misc ---------------- {{{1

// --------------- LowLevelAllocateCallbac ---------- {{{1

// -------------------------- Run-time entry ------------------- {{{1

// exported functions

// Force the linker to keep the symbols for various ASan interface functions.

// We want to keep those in the executable in order to let the instrumented

// dynamic libraries access the symbol even if it is not used by the executable

// itself. This should help if the build system is removing dead code at link

// time.

// prevent dead condition elimination.

// __asan_report_* functions are noreturn, so we need a switch to prevent

// the compiler from removing any of them.

// clang-format off

// clang-format on

// Print AsanMappingProfile.

// Increase kHighMemEnd to make sure it's properly

// aligned together with kHighMemBeg:

// !ASAN_FIXED_MAPPING

// !SANITIZER_EMSCRIPTEN

// Apply most options specified either through the ASAN_OPTIONS

// environment variable, or through the `__asan_default_options` user function.

//

// This function may be called multiple times, once per weak reference callback

// on Windows, so it needs to be idempotent.

//

// Context:

// For maximum compatibility on Windows, it is necessary for ASan options to be

// configured/registered/applied inside this method (instead of in

// ASanInitInternal, for example). That's because, on Windows, the user-provided

// definition for `__asan_default_opts` may not be bound when `ASanInitInternal`

// is invoked (it is bound later).

//

// To work around the late binding on windows, `ApplyOptions` will be called,

// again, after binding to the user-provided `__asan_default_opts` function.

// Therefore, any flags not configured here are not guaranteed to be

// configurable through `__asan_default_opts` on Windows.

//

//

// For more details on this issue, see:

// https://github.com/llvm/llvm-project/issues/117925

// Initialize flags. On Windows it also also register weak function callbacks.

// This must be done early, because most of the initialization steps look at

// flags().

// Stop performing init at this point if we are being loaded via

// dlopen() and the platform supports it.

// Make sure we are not statically linked.

// Install tool-specific callbacks in sanitizer_common.

// Setup internal allocator callback.

// Enable system log ("adb logcat") on Android.

// Doing this before interceptors are initialized crashes in:

// AsanInitInternal -> android_log_write -> __interceptor_strcmp

// MSan and TSan re-exec with a fixed size stack. We don't do that because

// it may break the program. InitializeShadowMemory() will, if needed,

// re-exec without ASLR, which solves most shadow mapping compatibility

// issues.

// SANITIZER_POSIX

// !SANITIZER_EMSCRIPTEN

// Apply ASan flags.

// NOTE: In order for options specified through `__asan_default_options` to be

// honored on Windows, it is necessary for those options to be configured

// inside the `ApplyOptions` method. See the function-level comment for

// `ApplyFlags` for more details.

// On Linux AsanThread::ThreadStart() calls malloc() that's why asan_inited

// should be set to 1 prior to initializing the threads.

// Now that ASan runtime is (mostly) initialized, deactivate it if

// necessary, so that it can be re-activated when requested.

// Create main thread.

// no-op.

// LateInitialize() calls dlsym, which can allocate an error string buffer

// in the TLS.  Let's ignore the allocation to avoid reporting a leak.

// Initialize as requested from some part of ASan runtime library (interceptors,

// allocator, etc).

// Initialize runtime in case it's LD_PRELOAD-ed into unsanitized executable

// (and thus normal initializers from .preinit_array or modules haven't run).

// ASAN_DYNAMIC

// 64M

// If we haven't seen this thread, try asking the OS for stack bounds.

/*main=*/

// namespace __asan

// ---------------------- Interface ---------------- {{{1

// Initialize as requested from instrumented application code.

// We use this call as a trigger to wake up ASan from deactivated state.

// Do nothing.


=== system/lib/compiler-rt/lib/asan/asan_rtl_static.cpp ===
SHA256: 8b0d88cecb2f698018d138befae4438f55c6e8d1ca3fc9d429166a7e98505571
//===-- asan_static_rtl.cpp -----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Main file of the ASan run-time library.

//===----------------------------------------------------------------------===//

// This file is empty for now. Main reason to have it is workaround for Windows

// build, which complains because no files are part of the asan_static lib.

// namespace __asan


=== system/lib/compiler-rt/lib/asan/asan_scariness_score.h ===
SHA256: a765bfa5e84ed567161997628c66e5148b6ab20d3d4d52f385ed771b428391f6
//===-- asan_scariness_score.h ----------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Compute the level of scariness of the error message.

// Don't expect any deep science here, just a set of heuristics that suggest

// that e.g. 1-byte-read-global-buffer-overflow is less scary than

// 8-byte-write-stack-use-after-return.

//

// Every error report has one or more features, such as memory access size,

// type (read or write), type of accessed memory (e.g. free-d heap, or a global

// redzone), etc. Every such feature has an int score and a string description.

// The overall score is the sum of all feature scores and the description

// is a concatenation of feature descriptions.

// Examples:

//  17 (4-byte-read-heap-buffer-overflow)

//  65 (multi-byte-write-stack-use-after-return)

//  10 (null-deref)

//

//===----------------------------------------------------------------------===//

// namespace __asan

// ASAN_SCARINESS_SCORE_H


=== system/lib/compiler-rt/lib/asan/asan_shadow_setup.cpp ===
SHA256: d0d4a01b72b6f7c24f4c6f4675f5f9358273e7553dbc2a108806ca2820100be6
//===-- asan_shadow_setup.cpp ---------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Set up the shadow memory.

//===----------------------------------------------------------------------===//

// asan_fuchsia.cpp and asan_emscripten.cc have have their own

// InitializeShadowMemory implementation.

// The shadow gap is unprotected, so there is a chance that someone

// is actually using this memory. Which means it needs a shadow...

// Set the shadow memory address to uninitialized.

// Detect if a dynamic shadow address must used and find a available location

// when necessary. When dynamic address is used, the macro |kLowShadowBeg|

// expands to |__asan_shadow_memory_dynamic_address| which is

// |kDefaultShadowSentinel|.

// Update the shadow memory address (potentially) used by instrumentation.

// mmap the low shadow plus at least one page at the left.

// mmap the high shadow.

// protect the gap.

// mmap the low shadow plus at least one page at the left.

// mmap the mid shadow.

// mmap the high shadow.

// protect the gaps.

// ASan's mappings can usually shadow the entire address space, even with

// maximum ASLR entropy. However:

// - On 32-bit systems, the maximum ASLR entropy (currently up to 16-bits

//   == 256MB) is a significant chunk of the address space; reclaiming it

//   by disabling ASLR might allow chonky binaries to run.

// - On 64-bit systems, some settings (e.g., for Linux, unlimited stack

//   size plus 31+ bits of entropy) can lead to an incompatible layout.

// namespace __asan

// !SANITIZER_FUCHSIA


=== system/lib/compiler-rt/lib/asan/asan_stack.cpp ===
SHA256: 04be25fe4fb5873bf587549303c47bcbcd7b3398d865168ab2949e211910fcc9
//===-- asan_stack.cpp ----------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Code for ASan stack trace.

//===----------------------------------------------------------------------===//

// ScopedUnwinding is a scope for stacktracing member of a context

// namespace

// namespace __asan

// ------------------ Interface -------------- {{{1

// extern "C"


=== system/lib/compiler-rt/lib/asan/asan_stack.h ===
SHA256: ea42994a10b57dbf26c7c3ad890b149e586d3f95702c9842deac176d7d5f67c0
//===-- asan_stack.h --------------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// ASan-private header for asan_stack.cpp.

//===----------------------------------------------------------------------===//

// namespace __asan

// NOTE: A Rule of thumb is to retrieve stack trace in the interceptors

// as early as possible (in functions exposed to the user), as we generally

// don't want stack trace to contain functions from ASan internals.

// ASAN_STACK_H


=== system/lib/compiler-rt/lib/asan/asan_stats.cpp ===
SHA256: d7e248a40cbac4bdc31bc7165eb6d213b437a122b53a78fbf030b824b9d62863
//===-- asan_stats.cpp ----------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Code related to statistics collected by AddressSanitizer.

//===----------------------------------------------------------------------===//

// Required for malloc_zone_statistics() on OS X. This can't be stored in

// per-thread AsanStats.

// This is not very accurate: we may miss allocation peaks that happen

// between two updates of accumulated_stats_. For more accurate bookkeeping

// the maximum should be updated on every malloc(), which is unacceptable.

// Use lock to keep reports from mixing up.

// namespace __asan

// ---------------------- Interface ---------------- {{{1

// Return sane value if malloced < freed due to racy

// way we update accumulated stats.

// Return sane value if total_free < total_used due to racy

// way we update accumulated stats.


=== system/lib/compiler-rt/lib/asan/asan_stats.h ===
SHA256: bc0fd33c1625c6b8bd0a55df700dcbd9056a347349b0e94fdbd138218e5d456e
//===-- asan_stats.h --------------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// ASan-private header for statistics.

//===----------------------------------------------------------------------===//

// AsanStats struct is NOT thread-safe.

// Each AsanThread has its own AsanStats, which are sometimes flushed

// to the accumulated AsanStats.

// AsanStats must be a struct consisting of uptr fields only.

// When merging two AsanStats structs, we treat them as arrays of uptr.

// Ctor for global AsanStats (accumulated stats for dead threads).

// Creates empty stats.

// Prints formatted stats to stderr.

// Returns stats for GetCurrentThread(), or stats for fake "unknown thread"

// if GetCurrentThread() returns 0.

// Flushes a given stats into accumulated stats of dead threads.

// A cross-platform equivalent of malloc_statistics_t on Mac OS.

// namespace __asan

// ASAN_STATS_H


=== system/lib/compiler-rt/lib/asan/asan_suppressions.cpp ===
SHA256: 6d4d8d508383e43329a97f0c6636e990c0753cd122ced609d50e4d28041f9141
//===-- asan_suppressions.cpp ---------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Issue suppression and suppression-related functions.

//===----------------------------------------------------------------------===//

// Match "interceptor_name" suppressions.

// Match "odr_violation" suppressions.

// Match suppressions.

// Match "alloc_dealloc_mismatch" suppressions.

// Match "interceptor_via_lib" suppressions.

// Match "interceptor_via_func" suppressions.

// namespace __asan


=== system/lib/compiler-rt/lib/asan/asan_suppressions.h ===
SHA256: 161680239cb0083b2956cf4051d250abc36b89e761590d6ebedf84da635060ae
//===-- asan_suppressions.h -------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// ASan-private header for asan_suppressions.cpp.

//===----------------------------------------------------------------------===//

// namespace __asan

// ASAN_SUPPRESSIONS_H


=== system/lib/compiler-rt/lib/asan/asan_thread.cpp ===
SHA256: ff6cc18a1e07e637f959d334ca94cfc472f94b78df16870700198f1048621005
//===-- asan_thread.cpp ---------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Thread-related code.

//===----------------------------------------------------------------------===//

// AsanThreadContext implementation.

// Drop the link to the AsanThread object.

// TODO(leonardchan@): It should be possible to make LowLevelAllocator

// threadsafe and consolidate this one into the GlobalLoweLevelAllocator.

// We should be able to do something similar to what's in

// sanitizer_stack_store.cpp.

// Don't worry about thread_safety - this should be called when there is

// a single thread.

// Never reuse ASan threads: we store pointer to AsanThreadContext

// in TSD and can't reliably tell when no more TSD destructors will

// be called. It would be wrong to reuse AsanThreadContext for another

// thread before all TSD destructors will be called for it.

// MIPS requires aligned address

// AsanThread implementation.

// We also clear the shadow on thread destruction because

// some code may still be executing in later TSD destructors

// and we don't want it to have any poisoned stack.

// if fake_stack_save is null, the fiber will die, delete the fakestack

// Make sure the stack bounds are fully initialized.

// Note: need to check next stack first, because FinishSwitchFiber

// may be in process of overwriting stack_top_/bottom_. But in such case

// we are already on the next stack.

// We want to create the FakeStack lazily on the first use, but not earlier

// than the stack size is known and the procedure has to be async-signal safe.

// stack_size is not yet available, don't use FakeStack.

// fake_stack_ has 3 states:

// 0   -- not initialized

// 1   -- being initialized

// ptr -- initialized

// This CAS checks if the state was 0 and if so changes it to state 1,

// if that was successful, it initializes the pointer.

// AsyncSignalSafeLazyInitFakeStack makes use of threadlocals and must be

// called from the context of the thread it is initializing, not its parent.

// Most platforms call AsanThread::Init on the newly-spawned thread, but

// Fuchsia calls this function from the parent thread.  To support that

// approach, we avoid calling AsyncSignalSafeLazyInitFakeStack here; it will

// be called by the new thread when it first attempts to access the fake

// stack.

// Fuchsia doesn't use ThreadStart.

// asan_fuchsia.c definies CreateMainThread and SetThreadStackAndTls.

/* parent_tid */

/* stack */

/* detached */

// This implementation doesn't use the argument, which is just passed down

// from the caller of Init (which see, above).  It's only there to support

// OS-specific implementations that need more information passed through.

// !SANITIZER_FUCHSIA

// align addr.

// align addr.

// On Android, libc constructor is called _after_ asan_init, and cleans up

// TSD. Try to figure out if this is still the main thread by the stack

// address. We are not entirely sure that we have correct main thread

// limits, so only do this magic on Android, and only if the found thread

// is the main thread.

// Make sure we do not reset the current AsanThread.

// namespace __asan

// --- Implementation of LSan-specific functions --- {{{1

// ASan doesn't keep allocator caches in TLS, so these are unused.

// namespace __lsan

// namespace __sanitizer

// ---------------------- Interface ---------------- {{{1


=== system/lib/compiler-rt/lib/asan/asan_thread.h ===
SHA256: 70f3fa50f629441607b5e2f62e568800c5034f9f9f572574ea3b39dd71a2c1c7
//===-- asan_thread.h -------------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// ASan-private header for asan_thread.cpp.

//===----------------------------------------------------------------------===//

// namespace __sanitizer

// These objects are created for every thread and are never deleted,

// so we can find them by tid even if the thread is long dead.

// AsanThreadContext objects are never freed, so we need many of them.

// MSVC raises a warning about a nonstandard extension being used for the 0

// sized element in this array. Disable this for warn-as-error builds.

// AsanThread are stored in TSD and destroyed when the thread dies.

// Returns a pointer to the start of the stack variable's shadow memory.

// True is this thread is currently unwinding stack (i.e. collecting a stack

// trace). Used to prevent deadlocks on platforms where libc unwinder calls

// malloc internally. See PR17116 for more details.

// NOTE: There is no AsanThread constructor. It is allocated

// via mmap() and *must* be valid in zero-initialized state.

// these variables are used when the thread is about to switch stack

// true if switching is in progress

// Returns a single instance of registry.

// Must be called under ThreadRegistryLock.

// Get the current thread. May return 0.

// Used to handle fork().

// namespace __asan

// ASAN_THREAD_H


=== system/lib/compiler-rt/lib/asan/asan_win.cpp ===
SHA256: 4350427b4e3287ef7e5c12cfc9944a9e9f279771dd55af2c8bafefc08371e8bd
//===-- asan_win.cpp

//------------------------------------------------------===//>

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Windows-specific details.

//===----------------------------------------------------------------------===//

// extern "C"

// ---------------------- Windows-specific interceptors ---------------- {{{

// FIXME: Handle EXCEPTION_STACK_OVERFLOW here.

// Wrapper SEH Handler. If the exception should be handled by asan, we call

// __asan_unhandled_exception_filter, otherwise, we execute the user provided

// exception handler or the default.

// Bubble out to the default exception filter.

// We record the user provided exception handler to be called for all the

// exceptions unhandled by asan.

// This is a noreturn function, unless it's one of the exceptions raised to

// communicate with the debugger, such as the one from OutputDebugString.

// This handler is named differently in -MT and -MD CRTs.

// Strict init-order checking is thread-hostile.

// FIXME: The CreateThread interceptor is not the same as a pthread_create

// one.  This is a bandaid fix for PR22025.

// FIXME: how can we determine it on Windows?

// }}}

// The interceptors were not designed to be removable, so we have to keep this

// module alive for the life of the process.

// Try to intercept kernel32!RaiseException, and if that fails, intercept

// ntdll!RtlRaiseException instead.

// Only asan on 64-bit Windows supports committing shadow memory on demand.

// Since asan's mapping is compacting, the shadow chunk may be

// not page-aligned, so we only flush the page-aligned portion.

// ---------------------- TSD ---------------- {{{

// https://docs.microsoft.com/en-us/windows/desktop/api/winternl/ns-winternl-_teb

// "[This structure may be altered in future versions of Windows. Applications

// should use the alternate functions listed in this topic.]"

// PVOID ThreadLocalStoragePointer; is here, at the last field in Reserved1.

// FIXME: we're ignoring the destructor for now.

// }}}

// ---------------------- Various stuff ---------------- {{{

/*min_shadow_base_alignment*/

// Not used

// Exception handler for dealing with shadow memory.

// Only handle access violations.

// Only handle access violations that land within the shadow memory.

// Check valid shadow range.

// This is an access violation while trying to read from the shadow. Commit

// the relevant page and let execution continue.

// Determine the address of the page that is being accessed.

// Commit the page.

// The page mapping succeeded, so continue execution as usual.

// On Win64, we map memory on demand with access violation handler.

// Install our exception handler.

// We want to install our own exception handler (EH) to print helpful reports

// on access violations and whatnot.  Unfortunately, the CRT initializers assume

// they are run before any user code and drop any previously-installed EHs on

// the floor, so we can't install our handler inside __asan_init.

// (See crt0dat.c in the CRT sources for the details)

//

// Things get even more complicated with the dynamic runtime, as it finishes its

// initialization before the .exe module CRT begins to initialize.

//

// For the static runtime (-MT), it's enough to put a callback to

// __asan_set_seh_filter in the last section for C initializers.

//

// For the dynamic runtime (-MD), we want link the same

// asan_dynamic_runtime_thunk.lib to all the modules, thus __asan_set_seh_filter

// will be called for each instrumented module.  This ensures that at least one

// __asan_set_seh_filter call happens after the .exe module CRT is initialized.

// We should only store the previous handler if it's not our own handler in

// order to avoid loops in the EH chain.

// Not supported on this platform.

// The CRT runs initializers in this order:

// - C initializers, from XIA to XIZ

// - C++ initializers, from XCA to XCZ

// Prior to 2015, the CRT set the unhandled exception filter at priority XIY,

// near the end of C initialization. Starting in 2015, it was moved to the

// beginning of C++ initialization. We set our priority to XCAB to run

// immediately after the CRT runs. This way, our exception filter is called

// first and we can delegate to their filter if appropriate.

// Piggyback on the TLS initialization callback directory to initialize asan as

// early as possible. Initializers in .CRT$XL* are called directly by ntdll,

// which run before the CRT. Users also add code to .CRT$XLC, so it's important

// to run our initializers first.

// Unpoison the thread's stack because the memory may be re-used.

// }}}

// namespace __asan

// SANITIZER_WINDOWS


=== system/lib/compiler-rt/lib/asan/asan_win_common_runtime_thunk.cpp ===
SHA256: f0f092325d6283252b45292793d7d18dec50fc06934b6b706d7e17e844e9d5fa
//===-- asan_win_common_runtime_thunk.cpp --------------------------- -----===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// This file defines things that need to be present in the application modules

// to interact with the ASan DLL runtime correctly and can't be implemented

// using the default "import library" generated when linking the DLL.

//

// This includes:

//  - Cloning shadow memory dynamic address from ASAN DLL

//  - Creating weak aliases to default implementation imported from asan dll

//  - Forwarding the detect_stack_use_after_return runtime option

//  - installing a custom SEH handler

//

//===----------------------------------------------------------------------===//

// Define weak alias for all weak functions imported from asan dll.

////////////////////////////////////////////////////////////////////////////////

// Define a copy of __asan_option_detect_stack_use_after_return that should be

// used when linking an MD runtime with a set of object files on Windows.

//

// The ASan MD runtime dllexports '__asan_option_detect_stack_use_after_return',

// so normally we would just dllimport it.  Unfortunately, the dllimport

// attribute adds __imp_ prefix to the symbol name of a variable.

// Since in general we don't know if a given TU is going to be used

// with a MT or MD runtime and we don't want to use ugly __imp_ names on Windows

// just to work around this issue, let's clone the variable that is constant

// after initialization anyways.

// Our cloned variables must be initialized before C/C++ constructors.  If TLS

// is used, our .CRT$XLAB initializer will run first. If not, our .CRT$XIB

// initializer is needed as a backup.

////////////////////////////////////////////////////////////////////////////////

// ASan SEH handling.

// We need to set the ASan-specific SEH handler at the end of CRT initialization

// of each module (see also asan_win.cpp).

// Unfortunately, putting a pointer to __asan_set_seh_filter into

// __asan_intercept_seh gets optimized out, so we have to use an extra function.

// defined(SANITIZER_DYNAMIC_RUNTIME_THUNK) ||

// defined(SANITIZER_STATIC_RUNTIME_THUNK)


=== system/lib/compiler-rt/lib/asan/asan_win_common_runtime_thunk.h ===
SHA256: 960969953c97d47bfff84c7835db24a024850588e5e1031f84f2a81038ffffa4
//===-- asan_win_common_runtime_thunk.h -------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// This file defines things that need to be present in the application modules

// to interact with the ASan DLL runtime correctly and can't be implemented

// using the default "import library" generated when linking the DLL.

//

//===----------------------------------------------------------------------===//

// C initializer (during C init before dyninit)

// First C initializer after CRT initializers

// First C++ initializer after startup initializers

// First ASAN globals terminator

// Last ASAN globals terminator

// First TLS initializer

// defined(SANITIZER_STATIC_RUNTIME_THUNK) ||

// defined(SANITIZER_DYNAMIC_RUNTIME_THUNK)


=== system/lib/compiler-rt/lib/asan/asan_win_dynamic_runtime_thunk.cpp ===
SHA256: c921ccbde7d02168bf49ed18c06af13feb67ede0d522fcd7ea0470083504fbf8
//===-- asan_win_dynamic_runtime_thunk.cpp --------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// This file defines things that need to be present for application modules

// that are dynamic linked with the C Runtime.

//

//===----------------------------------------------------------------------===//

////////////////////////////////////////////////////////////////////////////////

// For some reason, the MD CRT doesn't call the C/C++ terminators during on DLL

// unload or on exit.  ASan relies on LLVM global_dtors to call

// __asan_unregister_globals on these events, which unfortunately doesn't work

// with the MD runtime, see PR22545 for the details.

// To work around this, for each DLL we schedule a call to UnregisterGlobals

// using atexit() that calls a small subset of C terminators

// where LLVM global_dtors is placed.  Fingers crossed, no other C terminators

// are there.

// namespace

// We need to call 'atexit(UnregisterGlobals);' as early as possible, but after

// atexit() is initialized (.CRT$XIC).  As this is executed before C++

// initializers (think ctors for globals), UnregisterGlobals gets executed after

// dtors for C++ globals.

// SANITIZER_DYNAMIC_RUNTIME_THUNK


=== system/lib/compiler-rt/lib/asan/asan_win_static_runtime_thunk.cpp ===
SHA256: 0f638ea43ba59f4fbe3611cd7de97e4393cf27616dec0cdff5d6825e02c936b7
//===-- asan_win_static_runtime_thunk.cpp ---------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// This file defines a family of thunks that should be statically linked into

// modules that are statically linked with the C Runtime in order to delegate

// the calls to the ASAN runtime DLL.

// See https://github.com/google/sanitizers/issues/209 for the details.

//===----------------------------------------------------------------------===//

// Disable warnings such as: 'void memchr(void)': incorrect number of arguments

// for intrinsic function, expected '3' arguments.

// memmove and memcpy share an implementation on amd64

// INTERCEPT_LIBRARY_FUNCTION_ASAN(strrchr);

// Note: Don't intercept strtol(l). They are supposed to set errno for out-of-

// range values, but since the ASan runtime is linked against the dynamic CRT,

// its errno is different from the one in the current module.

// _except_handler4 checks -GS cookie which is different for each module, so we

// can't use INTERCEPT_LIBRARY_FUNCTION_ASAN(_except_handler4), need to apply

// manually

// Windows specific functions not included in asan_interface.inc.

// INTERCEPT_WRAP_W_V(__asan_should_detect_stack_use_after_return)

// INTERCEPT_WRAP_W_V(__asan_get_shadow_memory_dynamic_address)

// INTERCEPT_WRAP_W_W(__asan_unhandled_exception_filter)

// Single threaded, no need for synchronization.

// SANITIZER_DLL_THUNK


=== system/lib/compiler-rt/lib/builtins/absvdi2.c ===
SHA256: 92d89adc501e3f8aba30f49f68e99df1ecfb5941569d7f213331700836f5b467
//===-- absvdi2.c - Implement __absvdi2 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __absvdi2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: absolute value

// Effects: aborts if abs(x) < 0


=== system/lib/compiler-rt/lib/builtins/absvsi2.c ===
SHA256: d84648b8427d3dd5d56c29b722af46e7ffa80e59ac1bc040633d29214e317d89
//===-- absvsi2.c - Implement __absvsi2 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __absvsi2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: absolute value

// Effects: aborts if abs(x) < 0


=== system/lib/compiler-rt/lib/builtins/absvti2.c ===
SHA256: d7b75e01b9450ddb6cfeb2fa0aa85ca32ffc1018ea2e7edfbac6ac7e265aa776
//===-- absvti2.c - Implement __absvdi2 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __absvti2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: absolute value

// Effects: aborts if abs(x) < 0

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/adddf3.c ===
SHA256: c948665a4272f7155fd0cd51c3f2bb218bfd0d1dc0ab556565ee1a4eb315eb26
//===-- lib/adddf3.c - Double-precision addition ------------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements double-precision soft-float addition.

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/addsf3.c ===
SHA256: c462bb5e45cf6181b2803633328e2e33c1bd5e4bff7a766f057361ef88ba2c45
//===-- lib/addsf3.c - Single-precision addition ------------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements single-precision soft-float addition.

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/addtf3.c ===
SHA256: b23037fd20a30845a5c19414659ac2820de33a5ea4abf65c2aceaa8ba94fd102
//===-- lib/addtf3.c - Quad-precision addition --------------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements quad-precision soft-float addition.

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/addvdi3.c ===
SHA256: 60c8121c6ca71ff698704b9ee1e5124a86197de4480674d781edd2e4a076d262
//===-- addvdi3.c - Implement __addvdi3 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __addvdi3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a + b

// Effects: aborts if a + b overflows


=== system/lib/compiler-rt/lib/builtins/addvsi3.c ===
SHA256: 36ad0fa5e9a6c26ea0e5fd9cfece1699bc8904cc7af8e6034138f2193cd88ae0
//===-- addvsi3.c - Implement __addvsi3 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __addvsi3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a + b

// Effects: aborts if a + b overflows


=== system/lib/compiler-rt/lib/builtins/addvti3.c ===
SHA256: 8bb4138eaa9a5580fc27e7f9e8512f08091be3ba469e64382b853e2a7ce01c3c
//===-- addvti3.c - Implement __addvti3 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __addvti3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a + b

// Effects: aborts if a + b overflows

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/apple_versioning.c ===
SHA256: c51e0fcbec808e1cc122a03192c3acb057830896ea6707006e46bdd5e19d5309
//===-- apple_versioning.c - Adds versioning symbols for ld ---------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Symbols in libSystem.dylib in 10.6 and later,

//  but are in libgcc_s.dylib in earlier versions

// __powerpc__

// __arm__ && __DYNAMIC__

// !__APPLE__

// !__APPLE__


=== system/lib/compiler-rt/lib/builtins/ashldi3.c ===
SHA256: 7982c05b8a139ab662ac1a88be061669d7ee838d2153b42e4b0f4ec410bdf5a5
// ====-- ashldi3.c - Implement __ashldi3 ---------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __ashldi3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a << b

// Precondition:  0 <= b < bits_in_dword

/* bits_in_word <= b < bits_in_dword */

/* 0 <= b < bits_in_word */


=== system/lib/compiler-rt/lib/builtins/ashlti3.c ===
SHA256: 39afba4710d9b24c9c27cccdc8e18a18db10ce3616dc60cdcfa494f0a49a3a60
//===-- ashlti3.c - Implement __ashlti3 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __ashlti3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a << b

// Precondition:  0 <= b < bits_in_tword

/* bits_in_dword <= b < bits_in_tword */

/* 0 <= b < bits_in_dword */

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/ashrdi3.c ===
SHA256: 7aea539b6160c9439733fafc631d553ba2969aa15ebeba9fac12cd7027eedb4a
//===-- ashrdi3.c - Implement __ashrdi3 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __ashrdi3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: arithmetic a >> b

// Precondition:  0 <= b < bits_in_dword

/* bits_in_word <= b < bits_in_dword */

// result.s.high = input.s.high < 0 ? -1 : 0

/* 0 <= b < bits_in_word */


=== system/lib/compiler-rt/lib/builtins/ashrti3.c ===
SHA256: a6da2dc32167fbf369bbb0d185daeaf1b23aa13fda72f832e2097926c9fb2d74
//===-- ashrti3.c - Implement __ashrti3 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __ashrti3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: arithmetic a >> b

// Precondition:  0 <= b < bits_in_tword

/* bits_in_dword <= b < bits_in_tword */

// result.s.high = input.s.high < 0 ? -1 : 0

/* 0 <= b < bits_in_dword */

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/assembly.h ===
SHA256: 48a5c8e13dbae5694bbc9ab051392d58d08471ecac5e5f8cddf75f154a58cc64
//===-- assembly.h - compiler-rt assembler support macros -----------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file defines macros for use in compiler-rt assembler source.

// This file is not part of the interface of this library.

//

//===----------------------------------------------------------------------===//

// tell linker it can break up file at label boundaries

// !__APPLE__ && !__ELF__

// BTI, PAC, and GCS gnu property note

// Determine actual [ARM][THUMB[1][2]] ISA using compiler predefined macros:

// - for '-mthumb -march=armv6' compiler defines '__thumb__'

// - for '-mthumb -march=armv7' compiler defines '__thumb__' and '__thumb2__'

// defined(__thumb__2)

// !defined(__thumb2__) && !defined(__thumb__)

// pop {pc} can't switch Thumb mode on ARMv4T

// !defined(__arm)

// On ARM64EC, function names and calls (but not address-taking or data symbol

// references) use symbols prefixed with "#".

// COMPILERRT_ASSEMBLY_H


=== system/lib/compiler-rt/lib/builtins/atomic.c ===
SHA256: 9fcf5fc6f0cb1da23f004fa9bc3af1cfcb5589f0c8d20e7b6de863591b60eb98
//===-- atomic.c - Implement support functions for atomic operations.------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

//  atomic.c defines a set of functions for performing atomic accesses on

//  arbitrary-sized memory locations.  This design uses locks that should

//  be fast in the uncontended case, for two reasons:

//

//  1) This code must work with C programs that do not link to anything

//     (including pthreads) and so it should not depend on any pthread

//     functions. If the user wishes to opt into using pthreads, they may do so.

//  2) Atomic operations, rather than explicit mutexes, are most commonly used

//     on code where contended operations are rate.

//

//  To avoid needing a per-object lock, this code allocates an array of

//  locks and hashes the object pointers to find the one that it should use.

//  For operations that must be atomic on two locations, the lower lock is

//  always acquired first, to avoid deadlock.

//

//===----------------------------------------------------------------------===//

// We use __builtin_mem* here to avoid dependencies on libc-provided headers.

// Clang objects if you redefine a builtin.  This little hack allows us to

// define a function with the same name as an intrinsic.

/// Number of locks.  This allocates one page on 32-bit platforms, two on

/// 64-bit.  This can be specified externally if a different trade between

/// memory usage and contention probability is required for a given platform.

////////////////////////////////////////////////////////////////////////////////

// Platform-specific lock implementation.  Falls back to spinlocks if none is

// defined.  Each platform should define the Lock type, and corresponding

// lock() and unlock() functions.

////////////////////////////////////////////////////////////////////////////////

/// Unlock a lock.  This is a release operation.

/// Locks a lock.

/// locks for atomic operations

// clang-format off

// clang-format on

/// locks for atomic operations

/// Locks a lock.  In the current implementation, this is potentially

/// unbounded in the contended case.

// initialized to OS_SPINLOCK_INIT which is 0

/// Unlock a lock.  This is a release operation.

/// Locks a lock.  In the current implementation, this is potentially

/// unbounded in the contended case.

/// locks for atomic operations

/// Returns a lock to use for a given pointer.

// Disregard the lowest 4 bits.  We want all values that may be part of the

// same memory operation to hash to the same value and therefore use the same

// lock.

// Use the next bits as the basis for the hash

// Now use the high(er) set of bits to perturb the hash, so that we don't

// get collisions from atomic fields in a single object

// Return a pointer to the word to use

/// Macros for determining whether a size is lock free.

/// Macro that calls the compiler-generated lock-free versions of functions

/// when they exist.

/* __uint128_t not available */

/* __uint128_t may not be supported */

/// Whether atomic operations for the given size (and alignment) are lock-free.

/// An atomic load operation.  This is atomic with respect to the source

/// pointer only.

/// An atomic store operation.  This is atomic with respect to the destination

/// pointer only.

/// Atomic compare and exchange operation.  If the value at *ptr is identical

/// to the value at *expected, then this copies value at *desired to *ptr.  If

/// they  are not, then this stores the current value from *ptr in *expected.

///

/// This function returns 1 if the exchange takes place or 0 if it fails.

/// Performs an atomic exchange operation between two pointers.  This is atomic

/// with respect to the target address.

////////////////////////////////////////////////////////////////////////////////

// Where the size is known at compile time, the compiler may emit calls to

// specialised versions of the above functions.

////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////

// Atomic read-modify-write operations for integers of various sizes.

////////////////////////////////////////////////////////////////////////////////

// Allow build with clang without __c11_atomic_fetch_nand builtin (pre-14)


=== system/lib/compiler-rt/lib/builtins/atomic_flag_clear.c ===
SHA256: 43e769b5a1bd3b197ab131c068860ac323fd82e4c04652104a28a0e957a23153
//===-- atomic_flag_clear.c -----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements atomic_flag_clear from C11's stdatomic.h.

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/atomic_flag_clear_explicit.c ===
SHA256: 27ac4a0f0a4972a8a6c6d4a5fcdb1f78d9ff2074705561323fdb1d61845a69ba
//===-- atomic_flag_clear_explicit.c --------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements atomic_flag_clear_explicit from C11's stdatomic.h.

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/atomic_flag_test_and_set.c ===
SHA256: bdab7d2ff70c6eb1181d10895def633374a49ebc0660d0bda90c2a01d1db7d8a
//===-- atomic_flag_test_and_set.c ----------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements atomic_flag_test_and_set from C11's stdatomic.h.

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/atomic_flag_test_and_set_explicit.c ===
SHA256: d7fc0891505ecc5b302f036a45ccc283b5f3b90062b97787aaacababa335aac5
//===-- atomic_flag_test_and_set_explicit.c -------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements atomic_flag_test_and_set_explicit from C11's stdatomic.h

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/atomic_signal_fence.c ===
SHA256: d2a2d1bbfd27b18ce3860774cf91c7032d5ff9fb6345708bd2961e322579fdfc
//===-- atomic_signal_fence.c ---------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements atomic_signal_fence from C11's stdatomic.h.

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/atomic_thread_fence.c ===
SHA256: a9112df75c6c3f66ffc417efb9c22e101eef2461480668017a6ef9be63472d38
//===-- atomic_thread_fence.c ---------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements atomic_thread_fence from C11's stdatomic.h.

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/bswapdi2.c ===
SHA256: a330569afdc24b4b03983ea196e99f22b1e9e25a58149e1a969b9757eb18b71a
//===-- bswapdi2.c - Implement __bswapdi2 ---------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __bswapdi2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/bswapsi2.c ===
SHA256: f921d32911960a0700e22191fef4756b672653a7a0ab351d77f2fb4dc1d891f1
//===-- bswapsi2.c - Implement __bswapsi2 ---------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __bswapsi2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/clear_cache.c ===
SHA256: f802e4263d5c1c4d52281d739c032eb7081a7a34c12084b960769b62a7e1fafc
//===-- clear_cache.c - Implement __clear_cache ---------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Forward declare Win32 APIs since the GCC mode driver does not handle the

// newer SDKs as well as needed.

// clang-format off

// clang-format on

// clang-format off

// clang-format on

// to get platform-specific syscall definitions

// The compiler generates calls to __clear_cache() when creating

// trampoline functions on the stack for use with nested functions.

// It is expected to invalidate the instruction cache for the

// specified range.

// Intel processors have a unified instruction and data cache

// so there is nothing to do

// no-op

// We used to include asm/unistd.h for the __ARM_NR_cacheflush define, but

// it also brought many other unused defines, as well as a dependency on

// kernel headers to be installed.

//

// This value is stable at least since Linux 3.13 and should remain so for

// compatibility reasons, warranting it's re-definition here.

// The last "move $at, $0" is the target of jr.hb instead of delay slot.

// Pre-R6 may not be globalized. And some implementations may give strange

// synci_step. So, let's use libc call for it.

// Get Cache Type Info.

// The DC and IC instructions must use 64-bit registers so we don't use

// uintptr_t in case this runs in an IPL32 environment.

// If CTR_EL0.IDC is set, data cache cleaning to the point of unification

// is not required for instruction to data coherence.

// If CTR_EL0.DIC is set, instruction cache invalidation to the point of

// unification is not required for instruction to data coherence.

// Newer CPUs have a bigger line size made of multiple blocks, so the

// following value is a minimal common denominator for what used to be

// a single block cache line and is therefore inneficient.

// See: arch/riscv/include/asm/cacheflush.h, arch/riscv/kernel/sys_riscv.c

// "0" means that we clear cache for all threads (SYS_RISCV_FLUSH_ICACHE_ALL)

// On Darwin, sys_icache_invalidate() provides this functionality


=== system/lib/compiler-rt/lib/builtins/clzdi2.c ===
SHA256: 1d8970c43523c1347332ef247dad97fb98946daa3e27d51322a33a547a454967
//===-- clzdi2.c - Implement __clzdi2 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __clzdi2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: the number of leading 0-bits

// On 64-bit architectures with neither a native clz instruction nor a native

// ctz instruction, `__builtin_clz` resolves to `__clzdi2` rather than

// __clzsi2 as libgcc does not ship with `__clzsi2`, leading to infinite

// recursion.

// Precondition: a != 0


=== system/lib/compiler-rt/lib/builtins/clzsi2.c ===
SHA256: 3524233af4d8de1efe7e486ee84d24924f3f6154157b544791b1a8b927b8846f
//===-- clzsi2.c - Implement __clzsi2 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __clzsi2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: the number of leading 0-bits

// Precondition: a != 0

// if (x is small) t = 16 else 0

// x = [0 - 0xFFFF]

// r = [0, 16]

// return r + clz(x)

// x = [0 - 0xFF]

// r = [0, 8, 16, 24]

// return r + clz(x)

// x = [0 - 0xF]

// r = [0, 4, 8, 12, 16, 20, 24, 28]

// return r + clz(x)

// x = [0 - 3]

// r = [0 - 30] and is even

// return r + clz(x)

//     switch (x)

//     {

//     case 0:

//         return r + 2;

//     case 1:

//         return r + 1;

//     case 2:

//     case 3:

//         return r;

//     }


=== system/lib/compiler-rt/lib/builtins/clzti2.c ===
SHA256: 70c9c2896ae9282850e9b6425dab8bc53c3ef68bef5f0ff2f8fd7bef4434fd79
//===-- clzti2.c - Implement __clzti2 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __clzti2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: the number of leading 0-bits

// Precondition: a != 0

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/cmpdi2.c ===
SHA256: 18cb3b389cd9735b62db41476334e9a8f4cc84960e46c828a30c2e0a3dd7240c
//===-- cmpdi2.c - Implement __cmpdi2 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __cmpdi2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: if (a <  b) returns 0

//           if (a == b) returns 1

//           if (a >  b) returns 2

// Returns: if (a <  b) returns -1

//           if (a == b) returns  0

//           if (a >  b) returns  1


=== system/lib/compiler-rt/lib/builtins/cmpti2.c ===
SHA256: b6950bc60c69bd1b3839754e6661afaff86b60870e56ad03c3778b104b484948
//===-- cmpti2.c - Implement __cmpti2 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __cmpti2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns:  if (a <  b) returns 0

//           if (a == b) returns 1

//           if (a >  b) returns 2

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/comparedf2.c ===
SHA256: c2af3f6a5ae89c08e5ee25b3ec03170b7e98d5dc699646c14820e359cd54fde5
//===-- lib/comparedf2.c - Double-precision comparisons -----------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// // This file implements the following soft-float comparison routines:

//

//   __eqdf2   __gedf2   __unorddf2

//   __ledf2   __gtdf2

//   __ltdf2

//   __nedf2

//

// The semantics of the routines grouped in each column are identical, so there

// is a single implementation for each, and wrappers to provide the other names.

//

// The main routines behave as follows:

//

//   __ledf2(a,b) returns -1 if a < b

//                         0 if a == b

//                         1 if a > b

//                         1 if either a or b is NaN

//

//   __gedf2(a,b) returns -1 if a < b

//                         0 if a == b

//                         1 if a > b

//                        -1 if either a or b is NaN

//

//   __unorddf2(a,b) returns 0 if both a and b are numbers

//                           1 if either a or b is NaN

//

// Note that __ledf2( ) and __gedf2( ) are identical except in their handling of

// NaN values.

//

//===----------------------------------------------------------------------===//

// Alias for libgcc compatibility

// The alias mechanism doesn't work on Windows except for MinGW, so emit

// wrapper functions.


=== system/lib/compiler-rt/lib/builtins/comparesf2.c ===
SHA256: c24e84f8b8800e994b457dce12089ce14b693c839be5bbe74d53080aaa9597f0
//===-- lib/comparesf2.c - Single-precision comparisons -----------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements the following soft-fp_t comparison routines:

//

//   __eqsf2   __gesf2   __unordsf2

//   __lesf2   __gtsf2

//   __ltsf2

//   __nesf2

//

// The semantics of the routines grouped in each column are identical, so there

// is a single implementation for each, and wrappers to provide the other names.

//

// The main routines behave as follows:

//

//   __lesf2(a,b) returns -1 if a < b

//                         0 if a == b

//                         1 if a > b

//                         1 if either a or b is NaN

//

//   __gesf2(a,b) returns -1 if a < b

//                         0 if a == b

//                         1 if a > b

//                        -1 if either a or b is NaN

//

//   __unordsf2(a,b) returns 0 if both a and b are numbers

//                           1 if either a or b is NaN

//

// Note that __lesf2( ) and __gesf2( ) are identical except in their handling of

// NaN values.

//

//===----------------------------------------------------------------------===//

// Alias for libgcc compatibility

// The alias mechanism doesn't work on Windows except for MinGW, so emit

// wrapper functions.


=== system/lib/compiler-rt/lib/builtins/comparetf2.c ===
SHA256: 4656413b5b87c11855a053a55f1c1fb8c483c1b6c5183b5e70ba1ca6e939819d
//===-- lib/comparetf2.c - Quad-precision comparisons -------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// // This file implements the following soft-float comparison routines:

//

//   __eqtf2   __getf2   __unordtf2

//   __letf2   __gttf2

//   __lttf2

//   __netf2

//

// The semantics of the routines grouped in each column are identical, so there

// is a single implementation for each, and wrappers to provide the other names.

//

// The main routines behave as follows:

//

//   __letf2(a,b) returns -1 if a < b

//                         0 if a == b

//                         1 if a > b

//                         1 if either a or b is NaN

//

//   __getf2(a,b) returns -1 if a < b

//                         0 if a == b

//                         1 if a > b

//                        -1 if either a or b is NaN

//

//   __unordtf2(a,b) returns 0 if both a and b are numbers

//                           1 if either a or b is NaN

//

// Note that __letf2( ) and __getf2( ) are identical except in their handling of

// NaN values.

//

//===----------------------------------------------------------------------===//

// Alias for libgcc compatibility


=== system/lib/compiler-rt/lib/builtins/crtbegin.c ===
SHA256: 3c6e3dc6145c336c0c042674665f11342104ec23142f8e28a71ad8617c8b4044
//===-- crtbegin.c - Start of constructors and destructors ----------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// TODO: use __ptrauth-qualified pointers when they are supported on clang side

// If ptrauth_init_fini feature is not present, compiler emits raw unsigned

// pointers in .init_array. Use inline assembly to avoid implicit signing of

// __do_init function pointer with ptrauth_calls enabled.

// CRT_HAS_INITFINI_ARRAY

// TODO: use __ptrauth-qualified pointers when they are supported on clang side

// If ptrauth_init_fini feature is not present, compiler emits raw unsigned

// pointers in .fini_array. Use inline assembly to avoid implicit signing of

// __do_fini function pointer with ptrauth_calls enabled.

// CRT_HAS_INIT_FINI_ARRAY


=== system/lib/compiler-rt/lib/builtins/crtend.c ===
SHA256: 6d5a61b8f2f6fa541a12ec52aea40b5085e40fcf8626984d318523cb30335d06
//===-- crtend.c - End of constructors and destructors --------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Put 4-byte zero which is the length field in FDE at the end as a terminator.


=== system/lib/compiler-rt/lib/builtins/ctzdi2.c ===
SHA256: 945cd8765de0c267f5ff93d53817687d53365edbfea21529f390318e46597d69
//===-- ctzdi2.c - Implement __ctzdi2 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __ctzdi2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: the number of trailing 0-bits

// On 64-bit architectures with neither a native clz instruction nor a native

// ctz instruction, gcc resolves __builtin_ctz to __ctzdi2 rather than

// __ctzsi2, leading to infinite recursion.

// Precondition: a != 0


=== system/lib/compiler-rt/lib/builtins/ctzsi2.c ===
SHA256: f1f912dc5f9f40e4cefadc0aefc7fea5f6848657c7cf970e64d9a0220b2952c5
//===-- ctzsi2.c - Implement __ctzsi2 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __ctzsi2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: the number of trailing 0-bits

// Precondition: a != 0

// if (x has no small bits) t = 16 else 0

// x = [0 - 0xFFFF] + higher garbage bits

// r = [0, 16]

// return r + ctz(x)

// x = [0 - 0xFF] + higher garbage bits

// r = [0, 8, 16, 24]

// return r + ctz(x)

// x = [0 - 0xF] + higher garbage bits

// r = [0, 4, 8, 12, 16, 20, 24, 28]

// return r + ctz(x)

// x = [0 - 3]

// r = [0 - 30] and is even

// return r + ctz(x)

//  The branch-less return statement below is equivalent

//  to the following switch statement:

//     switch (x)

//    {

//     case 0:

//         return r + 2;

//     case 2:

//         return r + 1;

//     case 1:

//     case 3:

//         return r;

//     }


=== system/lib/compiler-rt/lib/builtins/ctzti2.c ===
SHA256: 967dde517d93a8ff50384b8f938bb480121b0bc188f2aad25241282fd052e5aa
//===-- ctzti2.c - Implement __ctzti2 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __ctzti2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: the number of trailing 0-bits

// Precondition: a != 0

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/divdc3.c ===
SHA256: f6ebfa99e5a208078e998cf87e539f25a92d86e4e316fe983f4031f1745d938a
//===-- divdc3.c - Implement __divdc3 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __divdc3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: the quotient of (a + ib) / (c + id)


=== system/lib/compiler-rt/lib/builtins/divdf3.c ===
SHA256: 2c8850a107c4ab79d518d1c3246ff936dd28446c82e17c1f347717a36b7a88a8
//===-- lib/divdf3.c - Double-precision division ------------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements double-precision soft-float division

// with the IEEE-754 default rounding (to nearest, ties to even).

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/divdi3.c ===
SHA256: 668b6a3f19fd40fbdb079d0e88073364f88ec1b5e4b1cb38a2c721051c66efbd
//===-- divdi3.c - Implement __divdi3 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __divdi3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a / b


=== system/lib/compiler-rt/lib/builtins/divmoddi4.c ===
SHA256: f85b721b92892ba571c85b15ad4ed4f59ac51d5a52d551a5a28e7f09a5ba3bfc
//===-- divmoddi4.c - Implement __divmoddi4 -------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __divmoddi4 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a / b, *rem = a % b

// s_a = a < 0 ? -1 : 0

// s_b = b < 0 ? -1 : 0

// negate if s_a == -1

// negate if s_b == -1

// sign of quotient

// negate if s_b == -1

// negate if s_a == -1


=== system/lib/compiler-rt/lib/builtins/divmodsi4.c ===
SHA256: 600350324bb5f69053dfa93550ecb54c0110ec95a394cc307d5da0405a8860fa
//===-- divmodsi4.c - Implement __divmodsi4

//--------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __divmodsi4 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a / b, *rem = a % b

// s_a = a < 0 ? -1 : 0

// s_b = b < 0 ? -1 : 0

// negate if s_a == -1

// negate if s_b == -1

// sign of quotient

// negate if s_b == -1

// negate if s_a == -1


=== system/lib/compiler-rt/lib/builtins/divmodti4.c ===
SHA256: bcf5210b5534ab118d836fc8dd015519f5622c3238e0d526706a7848c5a4a144
//===-- divmodti4.c - Implement __divmodti4 -------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __divmodti4 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a / b, *rem = a % b

// s_a = a < 0 ? -1 : 0

// s_b = b < 0 ? -1 : 0

// negate if s_a == -1

// negate if s_b == -1

// sign of quotient

// negate if s_b == -1

// negate if s_a == -1

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/divsc3.c ===
SHA256: 0c2532543221eee987579bd63d93687a4cb5ab83e2f403231be2f40014d8d7a3
//===-- divsc3.c - Implement __divsc3 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __divsc3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: the quotient of (a + ib) / (c + id)


=== system/lib/compiler-rt/lib/builtins/divsf3.c ===
SHA256: 07fa9c2ac2fa467c8bcd8678ea5dae4ddafade06e6c2429eea9513b775fac2f1
//===-- lib/divsf3.c - Single-precision division ------------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements single-precision soft-float division

// with the IEEE-754 default rounding (to nearest, ties to even).

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/divsi3.c ===
SHA256: d6fc80648fefadc1997eda1e7570587e9f5287ccf7e57a8b75797a21938b123e
//===-- divsi3.c - Implement __divsi3 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __divsi3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a / b

// On CPUs without unsigned hardware division support,

//  this calls __udivsi3 (notice the cast to su_int).

// On CPUs with unsigned hardware division support,

//  this uses the unsigned division instruction.


=== system/lib/compiler-rt/lib/builtins/divtc3.c ===
SHA256: 9e679671cccd06fad99c8888f2147ea4bf0883eeea5de03d75688c1d40089e10
//===-- divtc3.c - Implement __divtc3 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __divtc3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: the quotient of (a + ib) / (c + id)


=== system/lib/compiler-rt/lib/builtins/divtf3.c ===
SHA256: c792ed3e30ca8f451bcbca0f655859090c87aac4ee94e174423891cf0b8ff223
//===-- lib/divtf3.c - Quad-precision division --------------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements quad-precision soft-float division

// with the IEEE-754 default rounding (to nearest, ties to even).

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/divti3.c ===
SHA256: b8392be2b070cda2a01bc33c7912e06ab83ce9a1ec7995fe0acbe44540cf92ae
//===-- divti3.c - Implement __divti3 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __divti3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a / b

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/divxc3.c ===
SHA256: 2f7814e11d2866c7c2504ef6cc9c223f9f56183f1b2d510269a2c728be5f91c5
//===-- divxc3.c - Implement __divxc3 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __divxc3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: the quotient of (a + ib) / (c + id)


=== system/lib/compiler-rt/lib/builtins/emutls.c ===
SHA256: a4437f3e329a0835adbc7df38e36df12f358d05c073b11813c409f849c2345d2
//===---------- emutls.c - Implements __emutls_get_address ---------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// There are 4 pthread key cleanup rounds on Bionic. Delay emutls deallocation

// to round 2. We need to delay deallocation because:

//  - Android versions older than M lack __cxa_thread_atexit_impl, so apps

//    use a pthread key destructor to call C++ destructors.

//  - Apps might use __thread/thread_local variables in pthread destructors.

// We can't wait until the final two rounds, because jemalloc needs two rounds

// after the final malloc/free call to free its thread-specific data (see

// https://reviews.llvm.org/D46978#1107507).

// MSVC raises a warning about a nonstandard extension being used for the 0

// sized element in this array. Disable this for warn-as-error builds.

// number of elements in the 'data' array

// Default is not to use posix_memalign, so systems like Android

// can use thread local data without heavier POSIX memory allocators.

// The mallocated address is in ((void**)base)[-1]

// emutls is deallocated using a pthread key destructor. These

// destructors are called in several rounds to accommodate destructor

// functions that (re)initialize key values with pthread_setspecific.

// Delay the emutls deallocation to accommodate other end-of-thread

// cleanup tasks like calling thread_local destructors (e.g. the

// __cxa_thread_atexit fallback in libc++abi).

// _WIN32

// Provide atomic load/store functions for emutls_get_index if built with MSVC.

// These return the previous value - but since we do an OR with 0,

// it's equivalent to a plain load.

// __ATOMIC_RELEASE

// _WIN32

// number of allocated TLS objects

// Free the allocated TLS data

// For every TLS variable xyz,

// there is one __emutls_control variable named __emutls_v.xyz.

// If xyz has non-zero initial value, __emutls_v.xyz's "value"

// will point to __emutls_t.xyz, which has the initial value.

// Must use gcc_word here, instead of size_t, to match GCC.  When

// gcc_word is larger than size_t, the upper extra bits are all

// zeros.  We can use variables of size_t to operate on size and

// align.

// size of the object in bytes

// alignment of the object in bytes

// data[index-1] is the object address

// object address, when in single thread env

// null or non-zero initial value for the object

// Emulated TLS objects are always allocated at run-time.

// Use standard C types, check with gcc's emutls.o.

// Make sure that align is power of 2.

// Returns control->object.index; set index if not allocated yet.

// Updates newly allocated thread local emutls_address_array.

// Returns the new 'data' array size, number of elements,

// which must be no smaller than the given index.

// Need to allocate emutls_address_array with extra slots

// to store the header.

// Round up the emutls_address_array size to multiple of 16.

// Returns the size in bytes required for an emutls_address_array with

// N number of elements for data field.

// Returns the thread local emutls_address_array.

// Extends its size if necessary to hold address at index.

// Our emulated TLS implementation relies on local state (e.g. for the pthread

// key), and if we duplicate this state across different shared libraries,

// accesses to the same TLS variable from different shared libraries will yield

// different results (see https://github.com/android/ndk/issues/1551 for an

// example). __emutls_get_address is the only external entry point for emulated

// TLS, and by making it default visibility and weak, we can rely on the dynamic

// linker to coalesce multiple copies at runtime and ensure a single unique copy

// of TLS state. This is a best effort; it won't work if the user is linking

// with -Bsymbolic or -Bsymbolic-functions, and it also won't work on Windows,

// where the dynamic linker has no notion of coalescing weak symbols at runtime.

// A more robust solution would be to create a separate shared library for

// emulated TLS, to ensure a single copy of its state.

// Called by Bionic on dlclose to delete the emutls pthread key.


=== system/lib/compiler-rt/lib/builtins/enable_execute_stack.c ===
SHA256: e056478fbe46e1affaa6b0bbae6643fdbbb144172c9d5b51094896d6b517ffb2
//===-- enable_execute_stack.c - Implement __enable_execute_stack ---------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// #include "config.h"

// FIXME: CMake - include when cmake system is ready.

// Remove #define HAVE_SYSCONF 1 line.

// __APPLE__

// _WIN32

// The compiler generates calls to __enable_execute_stack() when creating

// trampoline functions on the stack for use with nested functions.

// It is expected to mark the page(s) containing the address

// and the next 48 bytes as executable.  Since the stack is normally rw-

// that means changing the protection on those page(s) to rwx.

// We should probably assert here because there is no return value

// On Darwin, pagesize is always 4096 bytes

// __APPLE__


=== system/lib/compiler-rt/lib/builtins/eprintf.c ===
SHA256: 0b9f56df0d3dc0e23ff6be83d67bfcb9f858dcdac0a48f0f8861eaeb06f45de1
//===---------- eprintf.c - Implements __eprintf --------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __eprintf() was used in an old version of <assert.h>.

// It can eventually go away, but it is needed when linking

// .o files built with the old <assert.h>.

//

// It should never be exported from a dylib, so it is marked

// visibility hidden.


=== system/lib/compiler-rt/lib/builtins/extendbfsf2.c ===
SHA256: d04574b6326b0818a3effd8890a217721d9e1f8b5184a2748822b39f55ce8466
//===-- lib/extendbfsf2.c - bfloat -> single conversion -----------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/extenddftf2.c ===
SHA256: d5d52fd1e14e5db84c99319cd3aa363de68cbfbd5fe290c73b39a3acc541cf20
//===-- lib/extenddftf2.c - double -> quad conversion -------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/extendhfdf2.c ===
SHA256: 1f2f5efe15e05ce5b38756564762121a24662dd3db00a2f13d3d60f9756d4278
//===-- lib/extendhfdf2.c - half -> single conversion -------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/extendhfsf2.c ===
SHA256: 79779f7d20f3b90a90d791926a1e7cc9cac3a8bfdc10e715d9ea8b65d2b4a470
//===-- lib/extendhfsf2.c - half -> single conversion -------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Use a forwarding definition and noinline to implement a poor man's alias,

// as there isn't a good cross-platform way of defining one.


=== system/lib/compiler-rt/lib/builtins/extendhftf2.c ===
SHA256: 67eaa321be3aa7557df12e2b346a4fa933281afbb9ce86fc9cba018c5f3ef58a
//===-- lib/extendhftf2.c - half -> quad conversion ---------------*- C -*-===//

//

//                     The LLVM Compiler Infrastructure

//

// This file is dual licensed under the MIT and the University of Illinois Open

// Source Licenses. See LICENSE.TXT for details.

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/extendhfxf2.c ===
SHA256: 09404679be2916ae53de82e07775ce531d42897b8921751edc231f2a7a46772f
//===-- lib/extendhfxf2.c - half -> long double conversion --------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Long double are expected to be as precise as double.


=== system/lib/compiler-rt/lib/builtins/extendsfdf2.c ===
SHA256: 0da160f7dcf46bf7d54a688a21477db5dfcb7147ad62e74895e00ea9778d78bf
//===-- lib/extendsfdf2.c - single -> double conversion -----------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/extendsftf2.c ===
SHA256: 48fb287875d8831c08b6a820f2a152705b1ad00d7615a8150e11475ce2c202c2
//===-- lib/extendsftf2.c - single -> quad conversion -------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/extendxftf2.c ===
SHA256: b6f5f739c78a55ae90145833ff2c2624e210a9ac33f17ccad9603285a976a272
//===-- lib/extendxftf2.c - long double -> quad conversion --------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Assumption: long double is a IEEE 80 bit floating point type padded to 128

// bits.


=== system/lib/compiler-rt/lib/builtins/ffsdi2.c ===
SHA256: c4c554b314a20641164d4bb084d9f7bb99513fce93ff310742bce02ab11e2b9d
//===-- ffsdi2.c - Implement __ffsdi2 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __ffsdi2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: the index of the least significant 1-bit in a, or

// the value zero if a is zero. The least significant bit is index one.


=== system/lib/compiler-rt/lib/builtins/ffssi2.c ===
SHA256: b1328621e08cad6486189652073f94589759e738c00cbfe3a922d4f3ede792f2
//===-- ffssi2.c - Implement __ffssi2 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __ffssi2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: the index of the least significant 1-bit in a, or

// the value zero if a is zero. The least significant bit is index one.


=== system/lib/compiler-rt/lib/builtins/ffsti2.c ===
SHA256: 80e3b51c072773cf848559eb66b15b74424dad26bcd077d43987766eb992ebe5
//===-- ffsti2.c - Implement __ffsti2 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __ffsti2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: the index of the least significant 1-bit in a, or

// the value zero if a is zero. The least significant bit is index one.

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/fixdfdi.c ===
SHA256: 5542e35a576e96c17e5c9731ffa24f72cedc7369d18079d8c29c5df6702feb94
//===-- fixdfdi.c - Implement __fixdfdi -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Support for systems that have hardware floating-point; can set the invalid

// flag as a side-effect of computation.

// Support for systems that don't have hardware floating-point; there are no

// flags to set, and we don't want to code-gen to an unknown soft-float

// implementation.


=== system/lib/compiler-rt/lib/builtins/fixdfsi.c ===
SHA256: 7a17622bf348e1854ff5c47a3290acf7f7d85ddfd97f35e2af7d51d05964ebb2
//===-- fixdfsi.c - Implement __fixdfsi -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/fixdfti.c ===
SHA256: d8f1610e93d8117dfd20d87333215b4be5a0b0a79b127183dca07ac6160cc35c
//===-- fixdfti.c - Implement __fixdfti -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/fixsfdi.c ===
SHA256: 78cc6b65fb3b77fb167c6eacca3d0fa150822af1f5fd1545c8d45acf98465a87
//===-- fixsfdi.c - Implement __fixsfdi -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Support for systems that have hardware floating-point; can set the invalid

// flag as a side-effect of computation.

// Support for systems that don't have hardware floating-point; there are no

// flags to set, and we don't want to code-gen to an unknown soft-float

// implementation.


=== system/lib/compiler-rt/lib/builtins/fixsfsi.c ===
SHA256: 34206d84741996a14a3d710de2318ea15646d497daf867b0144826ae09f0ce3b
//===-- fixsfsi.c - Implement __fixsfsi -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/fixsfti.c ===
SHA256: 5ab5d030f95fe6c7309916f61606c19d26e755ba1605bb83044aedfdc6b1db43
//===-- fixsfti.c - Implement __fixsfti -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/fixtfdi.c ===
SHA256: f3beb07a867f62ae6867eded8ef8f36a70251da2c40049390fa3cea88ad3a062
//===-- fixtfdi.c - Implement __fixtfdi -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/fixtfsi.c ===
SHA256: f095391826740e76b2bc6e119c90b90d3c0e8f39df5d2774a24b1b07ba528124
//===-- fixtfsi.c - Implement __fixtfsi -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/fixtfti.c ===
SHA256: 8574081aded6a57c0be7c6266ddfeb759d8ebc5252aaa8cb4c4d8b9995b77e50
//===-- fixtfti.c - Implement __fixtfti -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/fixunsdfdi.c ===
SHA256: edfc5d1bc551a6acb8d3cb4e6e5073125e8a3ef93ff539002db381fce4c6236a
//===-- fixunsdfdi.c - Implement __fixunsdfdi -----------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Support for systems that have hardware floating-point; can set the invalid

// flag as a side-effect of computation.

// a / 0x1p32f;

// high * 0x1p32f;

// Support for systems that don't have hardware floating-point; there are no

// flags to set, and we don't want to code-gen to an unknown soft-float

// implementation.


=== system/lib/compiler-rt/lib/builtins/fixunsdfsi.c ===
SHA256: 57b6312618aedf3f0f1c13bd1de12b5ea4b7c3070d2bb549d4fc93aca33abb28
//===-- fixunsdfsi.c - Implement __fixunsdfsi -----------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/fixunsdfti.c ===
SHA256: 5aab5881fc92335bd17b19409352bcd55f6dc7890f464aa3521cdc6a34625afb
//===-- fixunsdfti.c - Implement __fixunsdfti -----------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/fixunssfdi.c ===
SHA256: 19ca6247d9d5238809d07d74fe6645e585479b4c0229655afc0782e35da3a1cd
//===-- fixunssfdi.c - Implement __fixunssfdi -----------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Support for systems that have hardware floating-point; can set the invalid

// flag as a side-effect of computation.

// da / 0x1p32f;

// high * 0x1p32f;

// Support for systems that don't have hardware floating-point; there are no

// flags to set, and we don't want to code-gen to an unknown soft-float

// implementation.


=== system/lib/compiler-rt/lib/builtins/fixunssfsi.c ===
SHA256: 8940cb20e403a9cabd868bfefe83ba80110d7d415d7abc6b64ea6141752f9405
//===-- fixunssfsi.c - Implement __fixunssfsi -----------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __fixunssfsi for the compiler_rt library.

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/fixunssfti.c ===
SHA256: 977edad73ca94331d68486155fd54ab310ae3f3f9ef95d793682fa28d9bb353b
//===-- fixunssfti.c - Implement __fixunssfti -----------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __fixunssfti for the compiler_rt library.

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/fixunstfdi.c ===
SHA256: ff89c13b098b55aed90473cde432df5b3009e867558c9fa9a6fd3789fc5b0e6d
//===-- fixunstfdi.c - Implement __fixunstfdi -----------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/fixunstfsi.c ===
SHA256: 425fc324122745b1c33e67f5d333645b54584a58e2f689dd1dadb2fb0564257f
//===-- fixunstfsi.c - Implement __fixunstfsi -----------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/fixunstfti.c ===
SHA256: 9755a102200199ba8ef4a6b9d2f6472c83ab9a31966dbcd571386b006595310a
//===-- fixunstfsi.c - Implement __fixunstfsi -----------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/fixunsxfdi.c ===
SHA256: 39f773c27e98d45ecff795707f15db7a20a26b397842f1e16e3471138c39ff72
//===-- fixunsxfdi.c - Implement __fixunsxfdi -----------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __fixunsxfdi for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: convert a to a unsigned long long, rounding toward zero.

//          Negative values all become zero.

// Assumption: long double is an intel 80 bit floating point type padded with 6

// bytes du_int is a 64 bit integral type value in long double is representable

// in du_int or is negative (no range checking performed)

// gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee

// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm

// mmmm mmmm mmmm

// MSVC throws a warning about 'uninitialized variable use' here,

// disable it for builds that warn-as-error

//!_ARCH_PPC


=== system/lib/compiler-rt/lib/builtins/fixunsxfsi.c ===
SHA256: 330ef390f3c6a9b2ae22308e8a1a0a4635802988e814045a8df16d40f237ccba
//===-- fixunsxfsi.c - Implement __fixunsxfsi -----------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __fixunsxfsi for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: convert a to a unsigned int, rounding toward zero.

//          Negative values all become zero.

// Assumption: long double is an intel 80 bit floating point type padded with 6

// bytes su_int is a 32 bit integral type value in long double is representable

// in su_int or is negative

// gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee

// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm

// mmmm mmmm mmmm

// MSVC throws a warning about 'uninitialized variable use' here,

// disable it for builds that warn-as-error

// !_ARCH_PPC


=== system/lib/compiler-rt/lib/builtins/fixunsxfti.c ===
SHA256: feccbd5082677a6111234c877e7148e5e61bf0d101358490ba136e8767338c7f
//===-- fixunsxfti.c - Implement __fixunsxfti -----------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __fixunsxfti for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: convert a to a unsigned long long, rounding toward zero.

//          Negative values all become zero.

// Assumption: long double is an intel 80 bit floating point type padded with 6

// bytes tu_int is a 128 bit integral type value in long double is representable

// in tu_int or is negative

// gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee

// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm

// mmmm mmmm mmmm

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/fixxfdi.c ===
SHA256: 990a7c894cd342f7c8023248a368f41a73c511edfada2b5d2f41246a2f8ef168
//===-- fixxfdi.c - Implement __fixxfdi -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __fixxfdi for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: convert a to a signed long long, rounding toward zero.

// Assumption: long double is an intel 80 bit floating point type padded with 6

// bytes di_int is a 64 bit integral type value in long double is representable

// in di_int (no range checking performed)

// gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee

// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm

// mmmm mmmm mmmm

// MSVC throws a warning about 'uninitialized variable use' here,

// disable it for builds that warn-as-error

// !_ARCH_PPC


=== system/lib/compiler-rt/lib/builtins/fixxfti.c ===
SHA256: 2f5476be8a52df4efd6ad42c529a1aaacf706817db2bb09b80a6a18da1e85c41
//===-- fixxfti.c - Implement __fixxfti -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __fixxfti for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: convert a to a signed long long, rounding toward zero.

// Assumption: long double is an intel 80 bit floating point type padded with 6

// bytes ti_int is a 128 bit integral type value in long double is representable

// in ti_int

// gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee

// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm

// mmmm mmmm mmmm

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/floatdidf.c ===
SHA256: aa8abfb4f802a359b220b4a5edcd494aa484e7ece129c9e8036143f5913e8783
//===-- floatdidf.c - Implement __floatdidf -------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __floatdidf for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: convert a to a double, rounding toward even.

// Assumption: double is a IEEE 64 bit floating point type

//             di_int is a 64 bit integral type

// seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm

// mmmm

// Support for systems that have hardware floating-point; we'll set the inexact

// flag as a side-effect of this computation.

// 0x1.0p52

// 0x1.0p32

// Support for systems that don't have hardware floating-point; there are no

// flags to set, and we don't want to code-gen to an unknown soft-float

// implementation.


=== system/lib/compiler-rt/lib/builtins/floatdisf.c ===
SHA256: df7893f22d36a4585d521c2af023921253d61a41c3edbabf2429fe50e1251daf
//===-- floatdisf.c - Implement __floatdisf -------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __floatdisf for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: convert a to a float, rounding toward even.

// Assumption: float is a IEEE 32 bit floating point type

//             di_int is a 64 bit integral type

// seee eeee emmm mmmm mmmm mmmm mmmm mmmm


=== system/lib/compiler-rt/lib/builtins/floatditf.c ===
SHA256: 7c879c64362b2c233c647550b31e14b9684daede36adbdc63a58f6c672c74d04
//===-- lib/floatditf.c - integer -> quad-precision conversion ----*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements di_int to quad-precision conversion for the

// compiler-rt library in the IEEE-754 default round-to-nearest, ties-to-even

// mode.

//

//===----------------------------------------------------------------------===//

// Handle zero as a special case to protect clz

// All other cases begin by extracting the sign and absolute value of a

// Exponent of (fp_t)a is the width of abs(a).

// Shift a into the significand field, rounding if it is a right-shift

// Insert the exponent

// Insert the sign bit and return


=== system/lib/compiler-rt/lib/builtins/floatdixf.c ===
SHA256: 2661895607bec21409bd7ca16bb7fd406b6b359913ef7f6acf9952824e8ef9ee
//===-- floatdixf.c - Implement __floatdixf -------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __floatdixf for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: convert a to a long double, rounding toward even.

// Assumption: long double is a IEEE 80 bit floating point type padded to 128

// bits di_int is a 64 bit integral type

// gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee

// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm

// mmmm mmmm mmmm

// exponent

// sign

// exponent

// mantissa

// !_ARCH_PPC


=== system/lib/compiler-rt/lib/builtins/floatsidf.c ===
SHA256: d5141b5b7e860113c75f2d03d0cf39ca41aeea3e75390c40f73979c4ac172b51
//===-- lib/floatsidf.c - integer -> double-precision conversion --*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements integer to double-precision conversion for the

// compiler-rt library in the IEEE-754 default round-to-nearest, ties-to-even

// mode.

//

//===----------------------------------------------------------------------===//

// Handle zero as a special case to protect clz

// All other cases begin by extracting the sign and absolute value of a

// Exponent of (fp_t)a is the width of abs(a).

// Shift a into the significand field and clear the implicit bit.  Extra

// cast to unsigned int is necessary to get the correct behavior for

// the input INT_MIN.

// Insert the exponent

// Insert the sign bit and return


=== system/lib/compiler-rt/lib/builtins/floatsisf.c ===
SHA256: 9026c891c3df01ce7cc9d751cb6011e1324ba5ce0545d7aca73c6a50cb432676
//===-- lib/floatsisf.c - integer -> single-precision conversion --*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements integer to single-precision conversion for the

// compiler-rt library in the IEEE-754 default round-to-nearest, ties-to-even

// mode.

//

//===----------------------------------------------------------------------===//

// Handle zero as a special case to protect clz

// All other cases begin by extracting the sign and absolute value of a

// Exponent of (fp_t)a is the width of abs(a).

// Shift a into the significand field, rounding if it is a right-shift

// Insert the exponent

// Insert the sign bit and return


=== system/lib/compiler-rt/lib/builtins/floatsitf.c ===
SHA256: b0227a97e438ae8b0f2d61b979379446dd9bfbcb252a1e8073938b4ac89e2649
//===-- lib/floatsitf.c - integer -> quad-precision conversion ----*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements integer to quad-precision conversion for the

// compiler-rt library in the IEEE-754 default round-to-nearest, ties-to-even

// mode.

//

//===----------------------------------------------------------------------===//

// Handle zero as a special case to protect clz

// All other cases begin by extracting the sign and absolute value of a

// Exponent of (fp_t)a is the width of abs(a).

// Shift a into the significand field and clear the implicit bit.

// Insert the exponent

// Insert the sign bit and return


=== system/lib/compiler-rt/lib/builtins/floattidf.c ===
SHA256: 6e676a5f03ae29781b3978ab6b7510317d896b929fcda5084d2fe4b650999491
//===-- floattidf.c - Implement __floattidf -------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __floattidf for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: convert a to a double, rounding toward even.

// Assumption: double is a IEEE 64 bit floating point type

//            ti_int is a 128 bit integral type

// seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm

// mmmm

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/floattisf.c ===
SHA256: 47ecd2d414ddf7bac1a065f7aade5b06a1dd9eb4b99045fc6b481920f718ebc7
//===-- floattisf.c - Implement __floattisf -------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __floattisf for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: convert a to a float, rounding toward even.

// Assumption: float is a IEEE 32 bit floating point type

//             ti_int is a 128 bit integral type

// seee eeee emmm mmmm mmmm mmmm mmmm mmmm

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/floattitf.c ===
SHA256: 9a220868e01d45bab5aefbe80592bd7a71ad2d3c94a286a7be4c9db39e151672
//===-- lib/floattitf.c - int128 -> quad-precision conversion -----*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements ti_int to quad-precision conversion for the

// compiler-rt library in the IEEE-754 default round-to-nearest, ties-to-even

// mode.

//

//===----------------------------------------------------------------------===//

// Returns: convert a ti_int to a fp_t, rounding toward even.

// Assumption: fp_t is a IEEE 128 bit floating point type

//             ti_int is a 128 bit integral type

// seee eeee eeee eeee mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm

// mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm

// mmmm mmmm mmmm


=== system/lib/compiler-rt/lib/builtins/floattixf.c ===
SHA256: 3deae4f6e889dc864f720b78f1d1a48450935b25703781384e034d7c419e3d4a
//===-- floattixf.c - Implement __floattixf -------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __floattixf for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: convert a to a long double, rounding toward even.

// Assumption: long double is a IEEE 80 bit floating point type padded to 128

// bits ti_int is a 128 bit integral type

// gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee

// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm

// mmmm mmmm mmmm

// number of significant digits

// exponent

//  start:  0000000000000000000001xxxxxxxxxxxxxxxxxxxxxxPQxxxxxxxxxxxxxxxxxx

//  finish: 000000000000000000000000000000000000001xxxxxxxxxxxxxxxxxxxxxxPQR

//                                                12345678901234567890123456

//  1 = msb 1 bit

//  P = bit LDBL_MANT_DIG-1 bits to the right of 1

//  Q = bit LDBL_MANT_DIG bits to the right of 1

//  R = "or" of all bits to the right of Q

// finish:

// Or P into R

// round - this step may add a significant bit

// dump Q and R

// a is now rounded to LDBL_MANT_DIG or LDBL_MANT_DIG+1 bits

// a is now rounded to LDBL_MANT_DIG bits

// a is now rounded to LDBL_MANT_DIG bits

// sign

// exponent

// mantissa

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/floatundidf.c ===
SHA256: 052bbd24835e69cfa03dc9c820f5022893dd69c2f8b9d9e6fe4187bb8773d28b
//===-- floatundidf.c - Implement __floatundidf ---------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __floatundidf for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: convert a to a double, rounding toward even.

// Assumption: double is a IEEE 64 bit floating point type

//             du_int is a 64 bit integral type

// seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm

// mmmm

// Support for systems that have hardware floating-point; we'll set the inexact

// flag as a side-effect of this computation.

// 0x1.0p52

// 0x1.0p84

// 0x1.00000001p84

// Support for systems that don't have hardware floating-point; there are no

// flags to set, and we don't want to code-gen to an unknown soft-float

// implementation.


=== system/lib/compiler-rt/lib/builtins/floatundisf.c ===
SHA256: 3e737977c6c5fb7e84f44495997ff242a708b1e0a13aff27d4e9e30d418cc58d
//===-- floatundisf.c - Implement __floatundisf ---------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __floatundisf for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: convert a to a float, rounding toward even.

// Assumption: float is a IEEE 32 bit floating point type

//            du_int is a 64 bit integral type

// seee eeee emmm mmmm mmmm mmmm mmmm mmmm


=== system/lib/compiler-rt/lib/builtins/floatunditf.c ===
SHA256: 24a32bf0ac8589d0c0c2fb68c01d94cb24d3e580648da7374013d82a08c6ceaa
//===-- lib/floatunditf.c - uint -> quad-precision conversion -----*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements du_int to quad-precision conversion for the

// compiler-rt library in the IEEE-754 default round-to-nearest, ties-to-even

// mode.

//

//===----------------------------------------------------------------------===//

// Handle zero as a special case to protect clz

// Exponent of (fp_t)a is the width of abs(a).

// Shift a into the significand field and clear the implicit bit.

// Insert the exponent


=== system/lib/compiler-rt/lib/builtins/floatundixf.c ===
SHA256: 3c6dab077791fc118556c99875a053922be95ca11d88a8670651bf8a324b8217
//===-- floatundixf.c - Implement __floatundixf ---------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __floatundixf for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: convert a to a long double, rounding toward even.

// Assumption: long double is a IEEE 80 bit floating point type padded to 128

// bits du_int is a 64 bit integral type

// gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee

// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm

// mmmm mmmm mmmm

// exponent

// exponent

// mantissa

// _ARCH_PPC


=== system/lib/compiler-rt/lib/builtins/floatunsidf.c ===
SHA256: 9f3593197c2584c14c86a4760051be18c788d0835cf8ffdb9f11834c2ce9bf5b
//===-- lib/floatunsidf.c - uint -> double-precision conversion ---*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements unsigned integer to double-precision conversion for the

// compiler-rt library in the IEEE-754 default round-to-nearest, ties-to-even

// mode.

//

//===----------------------------------------------------------------------===//

// Handle zero as a special case to protect clz

// Exponent of (fp_t)a is the width of abs(a).

// Shift a into the significand field and clear the implicit bit.

// Insert the exponent


=== system/lib/compiler-rt/lib/builtins/floatunsisf.c ===
SHA256: a002e5243cabecefc49858dc505b1a3f89fdd75362adb00e4bbe3eb707fff9a4
//===-- lib/floatunsisf.c - uint -> single-precision conversion ---*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements unsigned integer to single-precision conversion for the

// compiler-rt library in the IEEE-754 default round-to-nearest, ties-to-even

// mode.

//

//===----------------------------------------------------------------------===//

// Handle zero as a special case to protect clz

// Exponent of (fp_t)a is the width of abs(a).

// Shift a into the significand field, rounding if it is a right-shift

// Insert the exponent


=== system/lib/compiler-rt/lib/builtins/floatunsitf.c ===
SHA256: 9418e6093a593268f15220553fd35bdfd25a1fd94ecaf23b0ceba54c36445efb
//===-- lib/floatunsitf.c - uint -> quad-precision conversion -----*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements unsigned integer to quad-precision conversion for the

// compiler-rt library in the IEEE-754 default round-to-nearest, ties-to-even

// mode.

//

//===----------------------------------------------------------------------===//

// Handle zero as a special case to protect clz

// Exponent of (fp_t)a is the width of abs(a).

// Shift a into the significand field and clear the implicit bit.

// Insert the exponent


=== system/lib/compiler-rt/lib/builtins/floatuntidf.c ===
SHA256: a0d1db27d8b19db400a765fe6401e5027187441394cda8ddc939f130397e643b
//===-- floatuntidf.c - Implement __floatuntidf ---------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __floatuntidf for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: convert a to a double, rounding toward even.

// Assumption: double is a IEEE 64 bit floating point type

//             tu_int is a 128 bit integral type

// seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm

// mmmm

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/floatuntisf.c ===
SHA256: 08e0e906c19113ed07aa5895a9ebc03342fdadbf26483a71c85962839eca5bd3
//===-- floatuntisf.c - Implement __floatuntisf ---------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __floatuntisf for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: convert a to a float, rounding toward even.

// Assumption: float is a IEEE 32 bit floating point type

//             tu_int is a 128 bit integral type

// seee eeee emmm mmmm mmmm mmmm mmmm mmmm

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/floatuntitf.c ===
SHA256: 9372575d4f406767739b7499815f1ec3aaeba89ea71e081542d79c3a94a5e731
//===-- lib/floatuntitf.c - uint128 -> quad-precision conversion --*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements tu_int to quad-precision conversion for the

// compiler-rt library in the IEEE-754 default round-to-nearest, ties-to-even

// mode.

//

//===----------------------------------------------------------------------===//

// Returns: convert a tu_int to a fp_t, rounding toward even.

// Assumption: fp_t is a IEEE 128 bit floating point type

//             tu_int is a 128 bit integral type

// seee eeee eeee eeee mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm

// mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm

// mmmm mmmm mmmm


=== system/lib/compiler-rt/lib/builtins/floatuntixf.c ===
SHA256: 24d72e4f7b6328702b7ffe031127a738d046275e4c85fc01eb62fc742afdafff
//===-- floatuntixf.c - Implement __floatuntixf ---------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __floatuntixf for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: convert a to a long double, rounding toward even.

// Assumption: long double is a IEEE 80 bit floating point type padded to 128

// bits tu_int is a 128 bit integral type

// gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee

// eeee | 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm

// mmmm mmmm mmmm

// number of significant digits

// exponent

//  start:  0000000000000000000001xxxxxxxxxxxxxxxxxxxxxxPQxxxxxxxxxxxxxxxxxx

//  finish: 000000000000000000000000000000000000001xxxxxxxxxxxxxxxxxxxxxxPQR

//                                                12345678901234567890123456

//  1 = msb 1 bit

//  P = bit LDBL_MANT_DIG-1 bits to the right of 1

//  Q = bit LDBL_MANT_DIG bits to the right of 1

//  R = "or" of all bits to the right of Q

// finish:

// Or P into R

// round - this step may add a significant bit

// dump Q and R

// a is now rounded to LDBL_MANT_DIG or LDBL_MANT_DIG+1 bits

// a is now rounded to LDBL_MANT_DIG bits

// a is now rounded to LDBL_MANT_DIG bits

// exponent

// mantissa


=== system/lib/compiler-rt/lib/builtins/fp_add_impl.inc ===
SHA256: 327276adbb45d7e2cb2da1cf98b508da00b43b0cb84d4883d07878a0a9a1cd07
//===----- lib/fp_add_impl.inc - floaing point addition -----------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements soft-float addition with the IEEE-754 default rounding

// (to nearest, ties to even).

//

//===----------------------------------------------------------------------===//

// Detect if a or b is zero, infinity, or NaN.

// NaN + anything = qNaN

// anything + NaN = qNaN

// +/-infinity + -/+infinity = qNaN

// +/-infinity + anything remaining = +/- infinity

// anything remaining + +/-infinity = +/-infinity

// zero + anything = anything

// We need to get the sign right for zero + zero.

// anything + zero = anything

// Swap a and b if necessary so that a has the larger absolute value.

// Extract the exponent and significand from the (possibly swapped) a and b.

// Normalize any denormals, and adjust the exponent accordingly.

// The sign of the result is the sign of the larger operand, a.  If they

// have opposite signs, we are performing a subtraction.  Otherwise, we

// perform addition.

// Shift the significands to give us round, guard and sticky, and set the

// implicit significand bit.  If we fell through from the denormal path it

// was already set by normalize( ), but setting it twice won't hurt

// anything.

// Shift the significand of b by the difference in exponents, with a sticky

// bottom bit to get rounding correct.

// Set the sticky bit.  b is known to be non-zero.

// If a == -b, return +zero.

// If partial cancellation occured, we need to left-shift the result

// and adjust the exponent.

/* addition */

// If the addition carried up, we need to right-shift the result and

// adjust the exponent.

// If we have overflowed the type, return +/- infinity.

// The result is denormal before rounding.  The exponent is zero and we

// need to shift the significand.

// Low three bits are round, guard, and sticky.

// Shift the significand into place, and mask off the implicit bit.

// Insert the exponent and sign.

// Perform the final rounding.  The result may overflow to infinity, but

// that is the correct result in that case.


=== system/lib/compiler-rt/lib/builtins/fp_compare_impl.inc ===
SHA256: 626c1a736ed5a52af9e127e3520c50b5d82c0919e296d99e26436fdb59c5aab3
//===-- lib/fp_compare_impl.inc - Floating-point comparison -------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// GCC uses long (at least for x86_64) as the return type of the comparison

// functions. We need to ensure that the return value is sign-extended in the

// same way as GCC expects (since otherwise GCC-generated __builtin_isinf

// returns true for finite 128-bit floating-point numbers).

// AArch64 GCC overrides libgcc_cmp_return to use int instead of long.

// LLP64 ABIs use long long instead of long.

// AVR uses a single byte for the return value.

// Otherwise the comparison functions return long.

// GCC uses a special __libgcc_cmp_return__ mode to define the return type, so

// check that we are ABI-compatible when compiling the builtins with GCC.

// If either a or b is NaN, they are unordered.

// If a and b are both zeros, they are equal.

// If at least one of a and b is positive, we get the same result comparing

// a and b as signed integers as we would with a floating-point compare.

// Otherwise, both are negative, so we need to flip the sense of the

// comparison to get the correct result.  (This assumes a twos- or ones-

// complement integer representation; if integers are represented in a

// sign-magnitude representation, then this flip is incorrect).

// Note: different from LE_UNORDERED


=== system/lib/compiler-rt/lib/builtins/fp_div_impl.inc ===
SHA256: 2d1d901e87805e0bb2f3a3ab951b29224a59a761d6f292c3bd86f35368186fdd
//===-- fp_div_impl.inc - Floating point division -----------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements soft-float division with the IEEE-754 default

// rounding (to nearest, ties to even).

//

//===----------------------------------------------------------------------===//

// The __divXf3__ function implements Newton-Raphson floating point division.

// It uses 3 iterations for float32, 4 for float64 and 5 for float128,

// respectively. Due to number of significant bits being roughly doubled

// every iteration, the two modes are supported: N full-width iterations (as

// it is done for float32 by default) and (N-1) half-width iteration plus one

// final full-width iteration. It is expected that half-width integer

// operations (w.r.t rep_t size) can be performed faster for some hardware but

// they require error estimations to be computed separately due to larger

// computational errors caused by truncating intermediate results.

// Half the bit-size of rep_t

// rep_t-sized bitmask with lower half of bits set to ones

// Detect if a or b is zero, denormal, infinity, or NaN.

// NaN / anything = qNaN

// anything / NaN = qNaN

// infinity / infinity = NaN

// infinity / anything else = +/- infinity

// anything else / infinity = +/- 0

// zero / zero = NaN

// zero / anything else = +/- zero

// anything else / zero = +/- infinity

// One or both of a or b is denormal.  The other (if applicable) is a

// normal number.  Renormalize one or both of a and b, and set scale to

// include the necessary exponent adjustment.

// Set the implicit significand bit.  If we fell through from the

// denormal path it was already set by normalize( ), but setting it twice

// won't hurt anything.

// Align the significand of b as a UQ1.(n-1) fixed-point number in the range

// [1.0, 2.0) and get a UQ0.n approximate reciprocal using a small minimax

// polynomial approximation: x0 = 3/4 + 1/sqrt(2) - b/2.

// The max error for this approximation is achieved at endpoints, so

//   abs(x0(b) - 1/b) <= abs(x0(1) - 1/1) = 3/4 - 1/sqrt(2) = 0.04289...,

// which is about 4.5 bits.

// The initial approximation is between x0(1.0) = 0.9571... and x0(2.0) = 0.4571...

// Then, refine the reciprocal estimate using a quadratically converging

// Newton-Raphson iteration:

//     x_{n+1} = x_n * (2 - x_n * b)

//

// Let b be the original divisor considered "in infinite precision" and

// obtained from IEEE754 representation of function argument (with the

// implicit bit set). Corresponds to rep_t-sized b_UQ1 represented in

// UQ1.(W-1).

//

// Let b_hw be an infinitely precise number obtained from the highest (HW-1)

// bits of divisor significand (with the implicit bit set). Corresponds to

// half_rep_t-sized b_UQ1_hw represented in UQ1.(HW-1) that is a **truncated**

// version of b_UQ1.

//

// Let e_n := x_n - 1/b_hw

//     E_n := x_n - 1/b

// abs(E_n) <= abs(e_n) + (1/b_hw - 1/b)

//           = abs(e_n) + (b - b_hw) / (b*b_hw)

//          <= abs(e_n) + 2 * 2^-HW

// rep_t-sized iterations may be slower than the corresponding half-width

// variant depending on the handware and whether single/double/quad precision

// is selected.

// NB: Using half-width iterations increases computation errors due to

// rounding, so error estimations have to be computed taking the selected

// mode into account!

// Starting with (n-1) half-width iterations

// C is (3/4 + 1/sqrt(2)) - 1 truncated to W0 fractional bits as UQ0.HW

// with W0 being either 16 or 32 and W0 <= HW.

// That is, C is the aforementioned 3/4 + 1/sqrt(2) constant (from which

// b/2 is subtracted to obtain x0) wrapped to [0, 1) range.

// Use 16-bit initial estimation in case we are using half-width iterations

// for float32 division. This is expected to be useful for some 16-bit

// targets. Not used by default as it requires performing more work during

// rounding and would hardly help on regular 32- or 64-bit targets.

// HW is at least 32. Shifting into the highest bits if needed.

// b >= 1, thus an upper bound for 3/4 + 1/sqrt(2) - b/2 is about 0.9572,

// so x0 fits to UQ0.HW without wrapping.

/* exact b_hw/2 as UQ0.HW */

// An e_0 error is comprised of errors due to

// * x0 being an inherently imprecise first approximation of 1/b_hw

// * C_hw being some (irrational) number **truncated** to W0 bits

// Please note that e_0 is calculated against the infinitely precise

// reciprocal of b_hw (that is, **truncated** version of b).

//

// e_0 <= 3/4 - 1/sqrt(2) + 2^-W0

// By construction, 1 <= b < 2

// f(x)  = x * (2 - b*x) = 2*x - b*x^2

// f'(x) = 2 * (1 - b*x)

//

// On the [0, 1] interval, f(0)   = 0,

// then it increses until  f(1/b) = 1 / b, maximum on (0, 1),

// then it decreses to     f(1)   = 2 - b

//

// Let g(x) = x - f(x) = b*x^2 - x.

// On (0, 1/b), g(x) < 0 <=> f(x) > x

// On (1/b, 1], g(x) > 0 <=> f(x) < x

//

// For half-width iterations, b_hw is used instead of b.

// corr_UQ1_hw can be **larger** than 2 - b_hw*x by at most 1*Ulp

// of corr_UQ1_hw.

// "0.0 - (...)" is equivalent to "2.0 - (...)" in UQ1.(HW-1).

// On the other hand, corr_UQ1_hw should not overflow from 2.0 to 0.0 provided

// no overflow occurred earlier: ((rep_t)x_UQ0_hw * b_UQ1_hw >> HW) is

// expected to be strictly positive because b_UQ1_hw has its highest bit set

// and x_UQ0_hw should be rather large (it converges to 1/2 < 1/b_hw <= 1).

// Now, we should multiply UQ0.HW and UQ1.(HW-1) numbers, naturally

// obtaining an UQ1.(HW-1) number and proving its highest bit could be

// considered to be 0 to be able to represent it in UQ0.HW.

// From the above analysis of f(x), if corr_UQ1_hw would be represented

// without any intermediate loss of precision (that is, in twice_rep_t)

// x_UQ0_hw could be at most [1.]000... if b_hw is exactly 1.0 and strictly

// less otherwise. On the other hand, to obtain [1.]000..., one have to pass

// 1/b_hw == 1.0 to f(x), so this cannot occur at all without overflow (due

// to 1.0 being not representable as UQ0.HW).

// The fact corr_UQ1_hw was virtually round up (due to result of

// multiplication being **first** truncated, then negated - to improve

// error estimations) can increase x_UQ0_hw by up to 2*Ulp of x_UQ0_hw.

// Now, either no overflow occurred or x_UQ0_hw is 0 or 1 in its half_rep_t

// representation. In the latter case, x_UQ0_hw will be either 0 or 1 after

// any number of iterations, so just subtract 2 from the reciprocal

// approximation after last iteration.

// In infinite precision, with 0 <= eps1, eps2 <= U = 2^-HW:

// corr_UQ1_hw = 2 - (1/b_hw + e_n) * b_hw + 2*eps1

//             = 1 - e_n * b_hw + 2*eps1

// x_UQ0_hw = (1/b_hw + e_n) * (1 - e_n*b_hw + 2*eps1) - eps2

//          = 1/b_hw - e_n + 2*eps1/b_hw + e_n - e_n^2*b_hw + 2*e_n*eps1 - eps2

//          = 1/b_hw + 2*eps1/b_hw - e_n^2*b_hw + 2*e_n*eps1 - eps2

// e_{n+1} = -e_n^2*b_hw + 2*eps1/b_hw + 2*e_n*eps1 - eps2

//         = 2*e_n*eps1 - (e_n^2*b_hw + eps2) + 2*eps1/b_hw

//                        \------ >0 -------/   \-- >0 ---/

// abs(e_{n+1}) <= 2*abs(e_n)*U + max(2*e_n^2 + U, 2 * U)

// For initial half-width iterations, U = 2^-HW

// Let  abs(e_n)     <= u_n * U,

// then abs(e_{n+1}) <= 2 * u_n * U^2 + max(2 * u_n^2 * U^2 + U, 2 * U)

// u_{n+1} <= 2 * u_n * U + max(2 * u_n^2 * U + 1, 2)

// Account for possible overflow (see above). For an overflow to occur for the

// first time, for "ideal" corr_UQ1_hw (that is, without intermediate

// truncation), the result of x_UQ0_hw * corr_UQ1_hw should be either maximum

// value representable in UQ0.HW or less by 1. This means that 1/b_hw have to

// be not below that value (see g(x) above), so it is safe to decrement just

// once after the final iteration. On the other hand, an effective value of

// divisor changes after this point (from b_hw to b), so adjust here.

// C is (3/4 + 1/sqrt(2)) - 1 truncated to 32 fractional bits as UQ0.n

// E_0 <= 3/4 - 1/sqrt(2) + 2 * 2^-32

// Error estimations for full-precision iterations are calculated just

// as above, but with U := 2^-W and taking extra decrementing into account.

// We need at least one such iteration.

// Cannot normally reach here: only one full-width iteration is requested and

// the total number of iterations should be at least 3 even for float32.

// Simulating operations on a twice_rep_t to perform a single final full-width

// iteration. Using ad-hoc multiplication implementations to take advantage

// of particular structure of operands.

// x_UQ0 = x_UQ0_hw * 2^HW - 1

// x_UQ0 * b_UQ1 = (x_UQ0_hw * 2^HW) * (b_UQ1_hw * 2^HW + blo) - b_UQ1

//

//   <--- higher half ---><--- lower half --->

//   [x_UQ0_hw * b_UQ1_hw]

// +            [  x_UQ0_hw *  blo  ]

// -                      [      b_UQ1       ]

// = [      result       ][.... discarded ...]

// account for *possible* carry

// x_UQ0 * corr_UQ1 = (x_UQ0_hw * 2^HW) * (hi_corr * 2^HW + lo_corr) - corr_UQ1

// 1 to account for the highest bit of corr_UQ1 can be 1

// 1 to account for possible carry

// Just like the case of half-width iterations but with possibility

// of overflowing by one extra Ulp of x_UQ0.

// ... and then traditional fixup by 2 should work

// On error estimation:

// abs(E_{N-1}) <=   (u_{N-1} + 2 /* due to conversion e_n -> E_n */) * 2^-HW

//                 + (2^-HW + 2^-W))

// abs(E_{N-1}) <= (u_{N-1} + 3.01) * 2^-HW

// Then like for the half-width iterations:

// With 0 <= eps1, eps2 < 2^-W

// E_N  = 4 * E_{N-1} * eps1 - (E_{N-1}^2 * b + 4 * eps2) + 4 * eps1 / b

// abs(E_N) <= 2^-W * [ 4 * abs(E_{N-1}) + max(2 * abs(E_{N-1})^2 * 2^W + 4, 8)) ]

// abs(E_N) <= 2^-W * [ 4 * (u_{N-1} + 3.01) * 2^-HW + max(4 + 2 * (u_{N-1} + 3.01)^2, 8) ]

// Finally, account for possible overflow, as explained above.

// u_n for different precisions (with N-1 half-width iterations):

// W0 is the precision of C

//   u_0 = (3/4 - 1/sqrt(2) + 2^-W0) * 2^HW

// Estimated with bc:

//   define half1(un) { return 2.0 * (un + un^2) / 2.0^hw + 1.0; }

//   define half2(un) { return 2.0 * un / 2.0^hw + 2.0; }

//   define full1(un) { return 4.0 * (un + 3.01) / 2.0^hw + 2.0 * (un + 3.01)^2 + 4.0; }

//   define full2(un) { return 4.0 * (un + 3.01) / 2.0^hw + 8.0; }

//             | f32 (0 + 3) | f32 (2 + 1)  | f64 (3 + 1)  | f128 (4 + 1)

// u_0         | < 184224974 | < 2812.1     | < 184224974  | < 791240234244348797

// u_1         | < 15804007  | < 242.7      | < 15804007   | < 67877681371350440

// u_2         | < 116308    | < 2.81       | < 116308     | < 499533100252317

// u_3         | < 7.31      |              | < 7.31       | < 27054456580

// u_4         |             |              |              | < 80.4

// Final (U_N) | same as u_3 | < 72         | < 218        | < 13920

// Add 2 to U_N due to final decrement.

// Suppose 1/b - P * 2^-W < x < 1/b + P * 2^-W

// Now 1/b - (2*P) * 2^-W < x < 1/b

// Now, a/b - 4*P * 2^-W < q < a/b for q=<quotient_UQ1:dummy> in UQ1.(SB+1+W).

// quotient_UQ1 is in [0.5, 2.0) as UQ1.(SB+1),

// adjust it to be in [1.0, 2.0) as UQ1.SB.

// In a rare case where quotient is < 0.5, we can adjust the quotient and

// the written exponent, and then treat them the same way as in [0.5, 1.0)

// Highest bit is 0, so just reinterpret quotient_UQ1 as UQ1.SB,

// effectively doubling its value as well as its error estimation.

// Highest bit is 1 (the UQ1.(SB+1) value is in [1, 2)), convert it

// to UQ1.SB by right shifting by 1. Least significant bit is omitted.

// NB: residualLo is calculated above for the normal result case.

//     It is re-computed on denormal path that is expected to be not so

//     performance-sensitive.

// Now, q cannot be greater than a/b and can differ by at most 8*P * 2^-W + 2^-SB

// Each NextAfter() increments the floating point value by at least 2^-SB

// (more, if exponent was incremented).

// Different cases (<---> is of 2^-SB length, * = a/b that is shown as a midpoint):

//   q

//   |   | * |   |   |       |       |

//       <--->      2^t

//   |   |   |   |   |   *   |       |

//               q

// To require at most one NextAfter(), an error should be less than 1.5 * 2^-SB.

//   (8*P) * 2^-W + 2^-SB < 1.5 * 2^-SB

//   (8*P) * 2^-W         < 0.5 * 2^-SB

//   P < 2^(W-4-SB)

// Generally, for at most R NextAfter() to be enough,

//   P < (2*R - 1) * 2^(W-4-SB)

// For f32 (0+3): 10 < 32 (OK)

// For f32 (2+1): 32 < 74 < 32 * 3, so two NextAfter() are required

// For f64: 220 < 256 (OK)

// For f128: 4096 * 3 < 13922 < 4096 * 5 (three NextAfter() are required)

// If we have overflowed the exponent, return infinity

// Now, quotient_UQ1_SB <= the correctly-rounded result

// and may need taking NextAfter() up to 3 times (see error estimates above)

// r = a - b * q

// Clear the implicit bit

// Insert the exponent

// Prevent shift amount from being negative

// multiplied by two to prevent shift amount to be negative

// Round

// tie to even

// The above line conditionally turns the below LT comparison into LTE

// Do not round Infinity to NaN


=== system/lib/compiler-rt/lib/builtins/fp_extend.h ===
SHA256: b3da60a65ab5aca4b93ddd36df8af90051912d1c455c4cea2de0e50ce37c526d
//===-lib/fp_extend.h - low precision -> high precision conversion -*- C

//-*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Set source and destination setting

//

//===----------------------------------------------------------------------===//

// -1 accounts for the sign bit.

// srcBits - srcSigFracBits - 1

// -1 accounts for the sign bit.

// srcBits - srcSigFracBits - 1

// sign bit, exponent and significand occupy the lower 80 bits.

// -1 accounts for the sign bit.

// -1 accounts for the explicitly stored integer bit.

// srcBits - srcSigFracBits - 1 - 1

// -1 accounts for the sign bit.

// srcBits - srcSigFracBits - 1

// -1 accounts for the sign bit.

// srcBits - srcSigFracBits - 1

// end source precision

// -1 accounts for the sign bit.

// dstBits - dstSigFracBits - 1

// -1 accounts for the sign bit.

// dstBits - dstSigFracBits - 1

// -1 accounts for the sign bit.

// dstBits - dstSigFracBits - 1

// end destination precision

// End of specialization parameters.

// TODO: These helper routines should be placed into fp_lib.h

// Currently they depend on macros/constants defined above.

// Two helper routines for conversion to and from the representation of

// floating-point data as integer values follow.

// End helper routines.  Conversion implementation follows.

// FP_EXTEND_HEADER


=== system/lib/compiler-rt/lib/builtins/fp_extend_impl.inc ===
SHA256: 63f9cd801c0c2a04e8becbd22f189eaaa47b5466bc098acc214fe69fd525f92a
//=-lib/fp_extend_impl.inc - low precision -> high precision conversion -*-- -//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements a fairly generic conversion from a narrower to a wider

// IEEE-754 floating-point type.  The constants and types defined following the

// includes below parameterize the conversion.

//

// It does not support types that don't use the usual IEEE-754 interchange

// formats; specifically, some work would be needed to adapt it to

// (for example) the Intel 80-bit format or PowerPC double-double format.

//

// Note please, however, that this implementation is only intended to support

// *widening* operations; if you need to convert to a *narrower* floating-point

// type (e.g. double -> float), then this routine will not do what you want it

// to.

//

// It also requires that integer types at least as large as both formats

// are available on the target platform; this may pose a problem when trying

// to add support for quad on some 32-bit systems, for example.  You also may

// run into trouble finding an appropriate CLZ function for wide source types;

// you will likely need to roll your own on some platforms.

//

// Finally, the following assumptions are made:

//

// 1. Floating-point types and integer types have the same endianness on the

//    target platform.

//

// 2. Quiet NaNs, if supported, are indicated by the leading bit of the

//    significand field being set.

//

//===----------------------------------------------------------------------===//

// The source type may use a usual IEEE-754 interchange format or Intel 80-bit

// format. In particular, for the source type srcSigFracBits may be not equal to

// srcSigBits. The destination type is assumed to be one of IEEE-754 standard

// types.

// Various constants whose values follow from the type parameters.

// Any reasonable optimizer will fold and propagate all of these.

// Break a into a sign and representation of the absolute value.

// a is a normal number.

// a is NaN or infinity.

// a is denormal.

// The exponent fields are identical and this is a denormal number, so all

// the non-significand bits are zero. In particular, this branch is always

// taken when we extend a denormal F80 to F128.

// If src_rep_t_clz is not defined this branch must be unreachable.

// Renormalize the significand and clear the leading bit.

// For F80 -> F128 this codepath is unused.

// a is zero.


=== system/lib/compiler-rt/lib/builtins/fp_fixint_impl.inc ===
SHA256: 9f783582b31c028721a14561f2c5741b5bb19befa557a4575e1436381f966f4e
//===-- lib/fixdfsi.c - Double-precision -> integer conversion ----*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements float to integer conversion for the

// compiler-rt library.

//

//===----------------------------------------------------------------------===//

// Break a into sign, exponent, significand parts.

// If exponent is negative, the result is zero.

// If the value is too large for the integer type, saturate.

// If 0 <= exponent < significandBits, right shift to get the result.

// Otherwise, shift left.


=== system/lib/compiler-rt/lib/builtins/fp_fixuint_impl.inc ===
SHA256: fc0d0b1b6fd1b3ec61ed3cd96e634de9f380eb76b7161fea91ddbddece71ac09
//===-- lib/fixdfsi.c - Double-precision -> integer conversion ----*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements float to unsigned integer conversion for the

// compiler-rt library.

//

//===----------------------------------------------------------------------===//

// Break a into sign, exponent, significand parts.

// If either the value or the exponent is negative, the result is zero.

// If the value is too large for the integer type, saturate.

// If 0 <= exponent < significandBits, right shift to get the result.

// Otherwise, shift left.


=== system/lib/compiler-rt/lib/builtins/fp_lib.h ===
SHA256: cf3a5301c95986a9b392edba32dfe7ac27d3352d266e284e528a09413f84f6cc
//===-- lib/fp_lib.h - Floating-point utilities -------------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a configuration header for soft-float routines in compiler-rt.

// This file does not provide any part of the compiler-rt interface, but defines

// many useful constants and utility routines that are used in the

// implementation of the soft-float routines in compiler-rt.

//

// Assumes that float, double and long double correspond to the IEEE-754

// binary32, binary64 and binary 128 types, respectively, and that integer

// endianness matches floating point endianness on the target platform.

//

//===----------------------------------------------------------------------===//

// 32x32 --> 64 bit multiply

// 64x64 -> 128 wide multiply for platforms that don't have such an operation;

// many 64-bit platforms have this operation, but they tend to have hardware

// floating-point, so we don't bother with a special case for them here.

// Each of the component 32x32 -> 64 products

// Sum terms that contribute to lo in a way that allows us to get the carry

// Sum terms contributing to hi with the carry from lo

// Note: Since there is no explicit way to tell compiler the constant is a

// 128-bit integer, we let the constant be casted to 128-bit integer

// 128x128 -> 256 wide multiply for platforms that don't have such an operation;

// many 64-bit platforms have this operation, but they tend to have hardware

// floating-point, so we don't bother with a special case for them here.

// The addition above can overflow, in which case `*lo` will be less than

// `r0`. Carry any overflow into `hi`.

// defined(CRT_HAS_IEEE_TF)

// defined(CRT_HAS_F128) && defined(CRT_HAS_128BIT)

// Implements logb methods (logb, logbf, logbl) for IEEE-754. This avoids

// pulling in a libm dependency from compiler-rt, but is not meant to replace

// it (i.e. code calling logb() should get the one from libm, not this), hence

// the __compiler_rt prefix.

// Abnormal cases:

// 1) +/- inf returns +inf; NaN returns NaN

// 2) 0.0 returns -inf

// NaN or +inf: return x

// -inf: return -x

// 0.0: return -inf

// Normal number

// Unbias exponent

// Subnormal number; normalize and repeat

// Unbias exponent

// Avoid using scalbn from libm. Unlike libc/libm scalbn, this function never

// sets errno on underflow/overflow.

// +/- 0.0, NaN, or inf: return x

// Normalize subnormal input.

// clear the implicit bit again

// Saturate the exponent, which will guarantee an underflow/overflow below.

// Return this value: [+/-] 1.sig * 2 ** (exp - exponentBias).

// Overflow, which could produce infinity or the largest-magnitude value,

// depending on the rounding mode.

// Subnormal or underflow. Use floating-point multiply to handle truncation

// correctly.

// !defined(QUAD_PRECISION) || defined(CRT_HAS_IEEE_TF)

// Avoid using fmax from libm.

// If either argument is NaN, return the other argument. If both are NaN,

// arbitrarily return the second one. Otherwise, if both arguments are +/-0,

// arbitrarily return the first one.

// Use __builtin_fmax which turns into an fmaxnm instruction on AArch64.

// __builtin_fmax frequently turns into a libm call, so inline the function.

// The generic implementation only works for ieee754 floating point. For other

// floating point types, continue to rely on the libm implementation for now.

// *_PRECISION

// FP_LIB_HEADER


=== system/lib/compiler-rt/lib/builtins/fp_mode.c ===
SHA256: 0f626fefe2e19854549dfe598bd168a770bae7e1cab34b459871fabec4632f25
//===----- lib/fp_mode.c - Floaing-point environment mode utilities --C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file provides a default implementation of fp_mode.h for architectures

// that does not support or does not have an implementation of floating point

// environment mode.

//

//===----------------------------------------------------------------------===//

// IEEE-754 default rounding (to nearest, ties to even).


=== system/lib/compiler-rt/lib/builtins/fp_mode.h ===
SHA256: 874aa9eee8990ae2a6f48127ddb48c3198a8fa741f634f93053ebac3f89e1e83
//===----- lib/fp_mode.h - Floaing-point environment mode utilities --C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is not part of the interface of this library.

//

// This file defines an interface for accessing hardware floating point

// environment mode.

//

//===----------------------------------------------------------------------===//

// FP_MODE_H


=== system/lib/compiler-rt/lib/builtins/fp_mul_impl.inc ===
SHA256: 5fd5ec9eaf57c983ed521f3501346660221d6f2d49d48d186b2046702b54d8c3
//===---- lib/fp_mul_impl.inc - floating point multiplication -----*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements soft-float multiplication with the IEEE-754 default

// rounding (to nearest, ties to even).

//

//===----------------------------------------------------------------------===//

// Detect if a or b is zero, denormal, infinity, or NaN.

// NaN * anything = qNaN

// anything * NaN = qNaN

// infinity * non-zero = +/- infinity

// infinity * zero = NaN

// non-zero * infinity = +/- infinity

// zero * infinity = NaN

// zero * anything = +/- zero

// anything * zero = +/- zero

// One or both of a or b is denormal.  The other (if applicable) is a

// normal number.  Renormalize one or both of a and b, and set scale to

// include the necessary exponent adjustment.

// Set the implicit significand bit.  If we fell through from the

// denormal path it was already set by normalize( ), but setting it twice

// won't hurt anything.

// Perform a basic multiplication on the significands.  One of them must be

// shifted beforehand to be aligned with the exponent.

// Normalize the significand and adjust the exponent if needed.

// If we have overflowed the type, return +/- infinity.

// The result is denormal before rounding.

//

// If the result is so small that it just underflows to zero, return

// zero with the appropriate sign.  Mathematically, there is no need to

// handle this case separately, but we make it a special case to

// simplify the shift logic.

// Otherwise, shift the significand of the result so that the round

// bit is the high bit of productLo.

// The result is normal before rounding.  Insert the exponent.

// Insert the sign of the result.

// Perform the final rounding.  The final result may overflow to infinity,

// or underflow to zero, but those are the correct results in those cases.

// We use the default IEEE-754 round-to-nearest, ties-to-even rounding mode.


=== system/lib/compiler-rt/lib/builtins/fp_trunc.h ===
SHA256: 90626a0811dcf96be507daa5d7fe872d1efae2c388af4c48eaba45101856be23
//=== lib/fp_trunc.h - high precision -> low precision conversion *- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Set source and destination precision setting

//

//===----------------------------------------------------------------------===//

// -1 accounts for the sign bit.

// srcBits - srcSigFracBits - 1

// -1 accounts for the sign bit.

// srcBits - srcSigFracBits - 1

// sign bit, exponent and significand occupy the lower 80 bits.

// -1 accounts for the sign bit.

// -1 accounts for the explicitly stored integer bit.

// srcBits - srcSigFracBits - 1 - 1

// -1 accounts for the sign bit.

// srcBits - srcSigFracBits - 1

// end source precision

// -1 accounts for the sign bit.

// dstBits - dstSigFracBits - 1

// -1 accounts for the sign bit.

// -1 accounts for the explicitly stored integer bit.

// dstBits - dstSigFracBits - 1 - 1

// -1 accounts for the sign bit.

// dstBits - dstSigFracBits - 1

// -1 accounts for the sign bit.

// dstBits - dstSigFracBits - 1

// -1 accounts for the sign bit.

// dstBits - dstSigFracBits - 1

// end destination precision

// TODO: These helper routines should be placed into fp_lib.h

// Currently they depend on macros/constants defined above.

// Set the explicit integer bit in F80 if present.

// End of specialization parameters.  Two helper routines for conversion to and

// from the representation of floating-point data as integer values follow.

// FP_TRUNC_HEADER


=== system/lib/compiler-rt/lib/builtins/fp_trunc_impl.inc ===
SHA256: 17098ba776ada9f2cc568a02cf34317bb0b59b8a603ff8a92ea909b7bc8c214b
//= lib/fp_trunc_impl.inc - high precision -> low precision conversion *-*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements a fairly generic conversion from a wider to a narrower

// IEEE-754 floating-point type in the default (round to nearest, ties to even)

// rounding mode.  The constants and types defined following the includes below

// parameterize the conversion.

//

// This routine can be trivially adapted to support conversions to

// half-precision or from quad-precision. It does not support types that don't

// use the usual IEEE-754 interchange formats; specifically, some work would be

// needed to adapt it to (for example) the Intel 80-bit format or PowerPC

// double-double format.

//

// Note please, however, that this implementation is only intended to support

// *narrowing* operations; if you need to convert to a *wider* floating-point

// type (e.g. float -> double), then this routine will not do what you want it

// to.

//

// It also requires that integer types at least as large as both formats

// are available on the target platform; this may pose a problem when trying

// to add support for quad on some 32-bit systems, for example.

//

// Finally, the following assumptions are made:

//

// 1. Floating-point types and integer types have the same endianness on the

//    target platform.

//

// 2. Quiet NaNs, if supported, are indicated by the leading bit of the

//    significand field being set.

//

//===----------------------------------------------------------------------===//

// The destination type may use a usual IEEE-754 interchange format or Intel

// 80-bit format. In particular, for the destination type dstSigFracBits may be

// not equal to dstSigBits. The source type is assumed to be one of IEEE-754

// standard types.

// Various constants whose values follow from the type parameters.

// Any reasonable optimizer will fold and propagate all of these.

// Same size exponents and a's significand tail is 0.

// The significand can be truncated and the exponent can be copied over.

// The exponent of a is within the range of normal numbers in the

// destination format. We can convert by simply right-shifting with

// rounding and adjusting the exponent.

// Round to nearest.

// Tie to even.

// Rounding has changed the exponent.

// a is NaN.

// Conjure the result by beginning with infinity, setting the qNaN

// bit and inserting the (truncated) trailing NaN field.

// a underflows on conversion to the destination type or is an exact

// zero.  The result may be a denormal or zero.  Extract the exponent

// to get the shift amount for the denormalization.

// Set the implicit integer bit if the source is a normal number.

// Right shift by the denormalization amount with sticky.

// Round to nearest

// Ties to even

// Rounding has changed the exponent.


=== system/lib/compiler-rt/lib/builtins/gcc_personality_v0.c ===
SHA256: 006d2c0c5404d58f08e5fcb2cd50ff341d94ec86eb2f0c87223481e90ed1cf5b
//===-- gcc_personality_v0.c - Implement __gcc_personality_v0 -------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// When building with older compilers (e.g. clang <3.9), it is possible that we

// have a version of unwind.h which does not provide the EHABI declarations

// which are quired for the C personality to conform to the specification.  In

// order to provide forward compatibility for such compilers, we re-declare the

// necessary interfaces in the helper to permit a standalone compilation of the

// builtins (which contains the C unwinding personality for historical reasons).

// Pointer encodings documented at:

//   http://refspecs.freestandards.org/LSB_1.3.0/gLSB/gLSB/ehframehdr.html

// no data follows

// gcc extension

// read a uleb128 encoded value and advance pointer

// read a pointer encoded value and advance pointer

// first get value

// not supported

// then add relative offset

// do nothing

// not supported

// then apply indirection

// On ARM EHABI the personality routine is responsible for actually

// unwinding a single stack frame before returning (ARM EHABI Sec. 6.1).

// The C compiler makes references to __gcc_personality_v0 in

// the dwarf unwind information for translation units that use

// __attribute__((cleanup(xx))) on local variables.

// This personality routine is called by the system unwinder

// on each frame as the stack is unwound during a C++ exception

// throw through a C function compiled with -fexceptions.

// the setjump-longjump based exceptions personality routine has a

// different name

// The ARM EHABI personality routine has a different signature.

// Since C does not have catch clauses, there is nothing to do during

// phase 1 (the search phase).

// After resuming from a cleanup we should also continue on to the next

// frame straight away.

// There is nothing to do if there is no LSDA for this frame.

// Parse LSDA header.

// Walk call-site table looking for range that includes current PC.

// action value not used for C code

// no landing pad for this entry

// Found landing pad for the PC.

// Set Instruction Pointer to so we re-enter function

// at landing pad. The landing pad is created by the compiler

// to take two parameters in registers.

// No landing pad found, continue unwinding.


=== system/lib/compiler-rt/lib/builtins/int_div_impl.inc ===
SHA256: 833906405d418f0f421d6155acc5abf79d9902ed37a44903d01c95ff55d3a010
//===-- int_div_impl.inc - Integer division ---------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Helpers used by __udivsi3, __umodsi3, __udivdi3, and __umodsi3.

//

//===----------------------------------------------------------------------===//

// Adapted from Figure 3-40 of The PowerPC Compiler Writer's Guide

// d == 0 cases are unspecified.

// 0 <= sr <= N - 1 or sr is very large.

// n < d

// d == 1

// 1 <= sr <= N - 1. Shifts do not trigger UB.

// Branch-less version of:

// carry = 0;

// if (r >= d) r -= d, carry = 1;

// Mostly identical to __udivXi3 but the return values are different.

// d == 0 cases are unspecified.

// 0 <= sr <= N - 1 or sr is very large.

// n < d

// d == 1

// 1 <= sr <= N - 1. Shifts do not trigger UB.

// Branch-less version of:

// carry = 0;

// if (r >= d) r -= d, carry = 1;

// s_a = a < 0 ? -1 : 0

// s_b = b < 0 ? -1 : 0

// negate if s_a == -1

// negate if s_b == -1

// sign of quotient

// negate if s_a == -1

// COMPUTE_UDIV

// s = b < 0 ? -1 : 0

// negate if s == -1

// s = a < 0 ? -1 : 0

// negate if s == -1

// negate if s == -1

// ASSIGN_UMOD


=== system/lib/compiler-rt/lib/builtins/int_endianness.h ===
SHA256: ec5175561075845b7b16a92ad5ecdfd42a284de2736dd07e4ca7011b75c37709
//===-- int_endianness.h - configuration header for compiler-rt -----------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a configuration header for compiler-rt.

// This file is not part of the interface of this library.

//

//===----------------------------------------------------------------------===//

// Clang and GCC provide built-in endianness definitions.

// __BYTE_ORDER__

// Compilers other than Clang or GCC.

// !_LITTLE_ENDIAN

// !_LITTLE_ENDIAN

// Solaris

// ..

// _BYTE_ORDER

// *BSD

// _BYTE_ORDER

// OpenBSD

// ..

// Mac OSX has __BIG_ENDIAN__ or __LITTLE_ENDIAN__ automatically set by the

// compiler (at least with GCC)

// __BIG_ENDIAN__

// __LITTLE_ENDIAN__

// Mac OSX

// ..

// Windows

// Clang or GCC.

// .

// Check we found an endianness correctly.

// INT_ENDIANNESS_H


=== system/lib/compiler-rt/lib/builtins/int_lib.h ===
SHA256: d79f2a9f4756e89fdd7a786fea5361720f40563a6d7c34d078505a236892d28f
//===-- int_lib.h - configuration header for compiler-rt  -----------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a configuration header for compiler-rt.

// This file is not part of the interface of this library.

//

//===----------------------------------------------------------------------===//

// Assumption: Signed integral is 2's complement.

// Assumption: Right shift of signed negative is arithmetic shift.

// Assumption: Endianness is little or big (not mixed).

// ABI macro definitions

//

// Kernel and boot environment can't use normal headers,

// so use the equivalent system headers.

// NB: FreeBSD (and OpenBSD) deprecate machine/limits.h in

// favour of sys/limits.h, so prefer the former, but fall

// back on the latter if not available since NetBSD only has

// the latter.

//

// Include the standard compiler builtin headers we use functionality from.

// Include the commonly used internal type definitions.

// Include internal utility function declarations.

// Definitions for builtins unavailable on MSVC

// defined(_MSC_VER) && !defined(__clang__)

// INT_LIB_H


=== system/lib/compiler-rt/lib/builtins/int_math.h ===
SHA256: 42d83ee41543909de016379a8251e211a6890cbc7945c433bb30f4ba29d7b10c
//===-- int_math.h - internal math inlines --------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is not part of the interface of this library.

//

// This file defines substitutes for the libm functions used in some of the

// compiler-rt implementations, defined in such a way that there is not a direct

// dependency on libm or math.h. Instead, we use the compiler builtin versions

// where available. This reduces our dependencies on the system SDK by foisting

// the responsibility onto the compiler.

//

//===----------------------------------------------------------------------===//

// Define crt_isfinite in terms of the builtin if available, otherwise provide

// an alternate version in terms of our other functions. This supports some

// versions of GCC which didn't have __builtin_isfinite.

// __has_builtin(__builtin_isfinite)

// _MSC_VER

// We define __has_builtin to always return 0 for GCC versions below 10,

// but __builtin_copysignf128 is available since version 7.

// We define __has_builtin to always return 0 for GCC versions below 10,

// but __builtin_fabsf128 is available since version 7.

// INT_MATH_H


=== system/lib/compiler-rt/lib/builtins/int_mulo_impl.inc ===
SHA256: 59f40cf894c0bc39915698f449322343a22f752ced0f72f5900664b89a2e745c
//===-- int_mulo_impl.inc - Implement __mulo[sdt]i4 ---------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Helper used by __mulosi4, __mulodi4 and __muloti4.

//

//===----------------------------------------------------------------------===//

// Returns: a * b

// Effects: sets *overflow to 1  if a * b overflows


=== system/lib/compiler-rt/lib/builtins/int_mulv_impl.inc ===
SHA256: 32ea5403907d722e371e3255efc230a6cc8df7a9cd5522af0c1354959c1f89b2
//===-- int_mulv_impl.inc - Implement __mulv[sdt]i3 ---------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Helper used by __mulvsi3, __mulvdi3 and __mulvti3.

//

//===----------------------------------------------------------------------===//

// Returns: a * b

// Effects: aborts if a * b overflows


=== system/lib/compiler-rt/lib/builtins/int_to_fp.h ===
SHA256: 9ac8fd0650f1560e6c910979e0004c5956ae7da6e3bded7eab0b0270c51bf400
//===-- int_to_fp.h - integer to floating point conversion ----------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Set source and destination defines in order to use a correctly

// parameterised floatXiYf implementation.

//

//===----------------------------------------------------------------------===//

// INT_TO_FP_H


=== system/lib/compiler-rt/lib/builtins/int_to_fp_impl.inc ===
SHA256: 5bb2fa67db4fc0c35038240189c23ef94f005d14676f2a5e4deab4085ad05a55
//===-- int_to_fp_impl.inc - integer to floating point conversion ---------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Thsi file implements a generic conversion from an integer type to an

// IEEE-754 floating point type, allowing a common implementation to be hsared

// without copy and paste.

//

//===----------------------------------------------------------------------===//

// number of significant digits

// exponent

//  start:  0000000000000000000001xxxxxxxxxxxxxxxxxxxxxxPQxxxxxxxxxxxxxxxxxx

//  finish: 000000000000000000000000000000000000001xxxxxxxxxxxxxxxxxxxxxxPQR

//                                                12345678901234567890123456

//  1 = msb 1 bit

//  P = bit dstMantDig-1 bits to the right of 1

//  Q = bit dstMantDig bits to the right of 1

//  R = "or" of all bits to the right of Q

// Do nothing.

// finish:

// Or P into R

// round - this step may add a significant bit

// dump Q and R

// a is now rounded to dstMantDig or dstMantDig+1 bits

// a is now rounded to dstMantDig bits

// a is now rounded to dstMantDig bits

// Combine sign, exponent, and mantissa.


=== system/lib/compiler-rt/lib/builtins/int_types.h ===
SHA256: bc956eca1626fee5b6242053bafd92bf0b1def230140ee36a9725034aeb02fa8
//===-- int_lib.h - configuration header for compiler-rt  -----------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is not part of the interface of this library.

//

// This file defines various standard types, most importantly a number of unions

// used to access parts of larger types.

//

//===----------------------------------------------------------------------===//

// si_int is defined in Linux sysroot's asm-generic/siginfo.h

// _YUGA_LITTLE_ENDIAN

// _YUGA_LITTLE_ENDIAN

// MSVC doesn't have a working 128bit integer type. Users should really compile

// compiler-rt with clang, but if they happen to be doing a standalone build for

// asan or something else, disable the 128 bit parts so things sort of work.

// _YUGA_LITTLE_ENDIAN

// _YUGA_LITTLE_ENDIAN

// CRT_HAS_128BIT

// FreeBSD's boot environment does not support using floating-point and poisons

// the float and double keywords.

// _YUGA_LITTLE_ENDIAN

// Check if the target supports 80 bit extended precision long doubles.

// Notably, on x86 Windows, MSVC only provides a 64-bit long double, but GCC

// still makes it 80 bits. Clang will match whatever compiler it is trying to

// be compatible with. On 32-bit x86 Android, long double is 64 bits, while on

// x86_64 Android, long double is 128 bits.

// From https://gcc.gnu.org/wiki/Ieee128PowerPC:

// PowerPC64 uses the following suffixes:

// IFmode: IBM extended double

// KFmode: IEEE 128-bit floating point

// TFmode: Matches the default for long double. With -mabi=ieeelongdouble,

//         it is IEEE 128-bit, with -mabi=ibmlongdouble IBM extended double

// Since compiler-rt only implements the tf set of libcalls, we use long double

// for the tf_float typedef.

// Use long double instead of __float128 if it matches the IEEE 128-bit format

// or the IBM hexadecimal format.

// NB: we assume the __float128 type uses IEEE representation.

// __(u)int128_t is currently needed to compile the *tf builtins as we would

// otherwise need to manually expand the bit manipulation on two 64-bit value.

// Clang prior to 11 did not support __float128 _Complex.

// GCC does not allow __float128 _Complex, but accepts _Float128 _Complex.

// CRT_HAS_FLOATING_POINT

// INT_TYPES_H


=== system/lib/compiler-rt/lib/builtins/int_util.c ===
SHA256: c2efa4a829b46383f5abe662e1a0545c4ab5f30f8b169e122152eef47c6f029a
//===-- int_util.c - Implement internal utilities -------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// NOTE: The definitions in this file are declared weak because we clients to be

// able to arbitrarily package individual functions into separate .a files. If

// we did not declare these weak, some link situations might end up seeing

// duplicate strong definitions of the same symbol.

//

// We can't use this solution for kernel use (which may not support weak), but

// currently expect that when built for kernel use all the functionality is

// packaged into a single library.

// from libSystem.dylib

// Avoid depending on libc when compiling with -ffreestanding.


=== system/lib/compiler-rt/lib/builtins/int_util.h ===
SHA256: 63d06198ab720a75c20bfd84be895c2746581b129168bae6201e7384bbb0473b
//===-- int_util.h - internal utility functions ---------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is not part of the interface of this library.

//

// This file defines non-inline utilities which are available for use in the

// library. The function definitions themselves are all contained in int_util.c

// which will always be compiled into any compiler-rt library.

//

//===----------------------------------------------------------------------===//

/// \brief Trigger a program abort (or panic for kernel code).

// Force unrolling the code specified to be repeated N times.

/* do nothing */

// INT_UTIL_H


=== system/lib/compiler-rt/lib/builtins/lshrdi3.c ===
SHA256: b8c43f0df0c6136f017ffc18123e74677a52c893dbb166e216804756578a1eab
//===-- lshrdi3.c - Implement __lshrdi3 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __lshrdi3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: logical a >> b

// Precondition:  0 <= b < bits_in_dword

/* bits_in_word <= b < bits_in_dword */

/* 0 <= b < bits_in_word */


=== system/lib/compiler-rt/lib/builtins/lshrti3.c ===
SHA256: 89da91e31e33c3c62128c32ed1c740856a413c17ac1e7cd75702da37d1cf9fa4
//===-- lshrti3.c - Implement __lshrti3 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __lshrti3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: logical a >> b

// Precondition:  0 <= b < bits_in_tword

/* bits_in_dword <= b < bits_in_tword */

/* 0 <= b < bits_in_dword */

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/moddi3.c ===
SHA256: ec2261d7e4bf7b04583c17933a7fd370be4de10418c1d75929e0dc382694f820
//===-- moddi3.c - Implement __moddi3 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __moddi3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a % b


=== system/lib/compiler-rt/lib/builtins/modsi3.c ===
SHA256: 120fb67478b98cd78ac8c5f3e8aa6e760d184ece60fa96e9f0672379e3c57aa5
//===-- modsi3.c - Implement __modsi3 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __modsi3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a % b


=== system/lib/compiler-rt/lib/builtins/modti3.c ===
SHA256: 23b5f5af57a8a3ccdab785eec6e486bffef932cee87ff1152b3beedaa6296414
//===-- modti3.c - Implement __modti3 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __modti3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a % b

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/muldc3.c ===
SHA256: 6b5c3fba3f59901c717168ba3a51dab26674541ac16a7b870ce7af0f3e339644
//===-- muldc3.c - Implement __muldc3 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __muldc3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: the product of a + ib and c + id


=== system/lib/compiler-rt/lib/builtins/muldf3.c ===
SHA256: e35d748cefd466cb17e4d0fd4ef9d92e0911fea97bb7a59ad138479ba9c0d553
//===-- lib/muldf3.c - Double-precision multiplication ------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements double-precision soft-float multiplication

// with the IEEE-754 default rounding (to nearest, ties to even).

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/muldi3.c ===
SHA256: 76a80699855619040b053078ab246adacb060fcc15b4e3431b76ee053032a8b9
//===-- muldi3.c - Implement __muldi3 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __muldi3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a * b

// Returns: a * b


=== system/lib/compiler-rt/lib/builtins/mulodi4.c ===
SHA256: 55b3b4195f026a96f809823f3b5de6a66e0a0a9469e69f6e5494b987cf8dd579
//===-- mulodi4.c - Implement __mulodi4 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __mulodi4 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a * b

// Effects: sets *overflow to 1  if a * b overflows


=== system/lib/compiler-rt/lib/builtins/mulosi4.c ===
SHA256: 770bf722616411be0aea4b72f9d49fc7e4a6bb383fcc1007bf2df84f48315abf
//===-- mulosi4.c - Implement __mulosi4 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __mulosi4 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a * b

// Effects: sets *overflow to 1  if a * b overflows


=== system/lib/compiler-rt/lib/builtins/muloti4.c ===
SHA256: a116475e0f4e98e16054e3e0492d55cc911691a0fac6dfedbe024eae9b0e02bc
//===-- muloti4.c - Implement __muloti4 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __muloti4 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a * b

// Effects: sets *overflow to 1  if a * b overflows

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/mulsc3.c ===
SHA256: ced55a7c473dbde086ca3649c431dc198348cf66d612eec2316862837a84b14a
//===-- mulsc3.c - Implement __mulsc3 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __mulsc3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: the product of a + ib and c + id


=== system/lib/compiler-rt/lib/builtins/mulsf3.c ===
SHA256: 9d93ec3313c62db3244c09827a4b27949caf94d2bcaf9ea616d8f5521eee799d
//===-- lib/mulsf3.c - Single-precision multiplication ------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements single-precision soft-float multiplication

// with the IEEE-754 default rounding (to nearest, ties to even).

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/multc3.c ===
SHA256: 826cabd0ba1ac5a249b1ff5661b26a98aba7ebcbc251fdaebed64c20216e968c
//===-- multc3.c - Implement __multc3 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __multc3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: the product of a + ib and c + id


=== system/lib/compiler-rt/lib/builtins/multf3.c ===
SHA256: 29ae4d98ff8bfb7226abfe9fe6a90c4b818196bc0ef736f981343aee2648864a
//===-- lib/multf3.c - Quad-precision multiplication --------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements quad-precision soft-float multiplication

// with the IEEE-754 default rounding (to nearest, ties to even).

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/multi3.c ===
SHA256: b2e133764668e78119f7c76facbb11f0b4b7c0c6b279fb0b97a589da11d1d060
//===-- multi3.c - Implement __multi3 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __multi3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a * b

// Returns: a * b

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/mulvdi3.c ===
SHA256: f9200755b7c4b1c396a91bc473f641ee985a8651e55009108be2d624fd744402
//===-- mulvdi3.c - Implement __mulvdi3 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __mulvdi3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a * b

// Effects: aborts if a * b overflows


=== system/lib/compiler-rt/lib/builtins/mulvsi3.c ===
SHA256: 8dd946a05cbd7b1fc0cbd009cc1e2988339eefd7303e302f12dcdd8e1408b5c9
//===-- mulvsi3.c - Implement __mulvsi3 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __mulvsi3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a * b

// Effects: aborts if a * b overflows


=== system/lib/compiler-rt/lib/builtins/mulvti3.c ===
SHA256: 3372782348a85ae38441419f5a570c45cc26ea79c32d807fb7c76d4f60cd3b1b
//===-- mulvti3.c - Implement __mulvti3 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __mulvti3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a * b

// Effects: aborts if a * b overflows

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/mulxc3.c ===
SHA256: 9de668cf8933db694755bbe4c68d0908c304c0dbbb25aee99e688cdd57d1f09c
//===-- mulxc3.c - Implement __mulxc3 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __mulxc3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: the product of a + ib and c + id


=== system/lib/compiler-rt/lib/builtins/negdf2.c ===
SHA256: 7abbbda67bfbb193e3d524f656c8bc4e40c2a678bac7a21a6bad656eb696f0cb
//===-- lib/negdf2.c - double-precision negation ------------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements double-precision soft-float negation.

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/negdi2.c ===
SHA256: 6f163c11ac47518ee82f136e2664c6e11a76e40da21eb511ddf09ab099d84efa
//===-- negdi2.c - Implement __negdi2 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __negdi2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: -a

// Note: this routine is here for API compatibility; any sane compiler

// should expand it inline.


=== system/lib/compiler-rt/lib/builtins/negsf2.c ===
SHA256: 3a28122868b63306bc2fa7f04cca7c083f4a7f5cf19b78b496f15c0661413238
//===-- lib/negsf2.c - single-precision negation ------------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements single-precision soft-float negation.

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/negti2.c ===
SHA256: 5ed863c89848453e48be85ca4c91be7a1fbbe1b80f12a6fdf17402c010b1cc3f
//===-- negti2.c - Implement __negti2 -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __negti2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: -a

// Note: this routine is here for API compatibility; any sane compiler

// should expand it inline.

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/negvdi2.c ===
SHA256: cef1901164610459f0d22bd10717412bf492b758652466ca2479bec40f5f6b32
//===-- negvdi2.c - Implement __negvdi2 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __negvdi2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: -a

// Effects: aborts if -a overflows


=== system/lib/compiler-rt/lib/builtins/negvsi2.c ===
SHA256: 89cb0f85dc13ea577aaa0a9d7124ae22350cd3eda51e7b61eb26d33481444b2d
//===-- negvsi2.c - Implement __negvsi2 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __negvsi2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: -a

// Effects: aborts if -a overflows


=== system/lib/compiler-rt/lib/builtins/negvti2.c ===
SHA256: fa30f03177dfd64510531742c17bb9d5bbc1c23ca2d264a2c2a104bb143e2227
//===-- negvti2.c - Implement __negvti2 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __negvti2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: -a

// Effects: aborts if -a overflows

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/os_version_check.c ===
SHA256: 37accdfb259f9228c1e5049e8bc3dcc2c996fa17c7fda542eed977237af71a9e
//===-- os_version_check.c - OS version checking  -------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements the function __isOSVersionAtLeast, used by

// Objective-C's @available

//

//===----------------------------------------------------------------------===//

// These three variables hold the host's OS version.

// _availability_version_check darwin API support.

// We can't include <CoreFoundation/CoreFoundation.h> directly from here, so

// just forward declare everything that we need from it.

// kCFStringEncodingASCII analog.

// kCFStringEncodingUTF8 analog.

// New API is supported and we're not being asked to load the plist,

// exit early!

// Use the new API if it's is available.

// New API is supported and we're not being asked to load the plist,

// exit early!

// Still load the PLIST to ensure that the existing calls to

// __isOSVersionAtLeast still work even with new compiler-rt and old OSes.

// Load CoreFoundation dynamically

// CFPropertyListCreateWithData was introduced only in macOS 10.6+, so it

// will be NULL on earlier OS versions.

// CFPropertyListCreateFromXMLDataFunc is deprecated in macOS 10.10, so it

// might be NULL in future OS versions.

// Dynamically allocated stuff.

// Get the file buffer into CF's format. We pass in a null allocator here *

// because we free PListBuf ourselves

// Find and parse the SystemVersion.plist file.

/*LoadPlist=*/

/*LoadPlist=*/

// This old API entry point is no longer used by Clang for Darwin. We still need

// to keep it around to ensure that object files that reference it are still

// usable when linked with new compiler-rt.

// Populate the global version variables, if they haven't already.

// Handle case of back-deployment for older macOS.

// When the system property doesn't exist, defaults to future API level.

// Allow all on pre-release. Note that we still rely on compile-time checks.

// Silence an empty translation unit warning.


=== system/lib/compiler-rt/lib/builtins/paritydi2.c ===
SHA256: 7dac1a60368bbf47abf5247cb558d1545098434b17026fadf486d0c74e91acbe
//===-- paritydi2.c - Implement __paritydi2 -------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __paritydi2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: 1 if number of bits is odd else returns 0


=== system/lib/compiler-rt/lib/builtins/paritysi2.c ===
SHA256: a41f4394c711c949d64c408de6b9e8d34836faf9f1fc624a861df3194e256be5
//===-- paritysi2.c - Implement __paritysi2 -------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __paritysi2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: 1 if number of bits is odd else returns 0


=== system/lib/compiler-rt/lib/builtins/parityti2.c ===
SHA256: 19127d1c904bfa9f1752bf02b003deb4935c279839fd04464aac4d00a04f1105
//===-- parityti2.c - Implement __parityti2 -------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __parityti2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: 1 if number of bits is odd else returns 0

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/popcountdi2.c ===
SHA256: 9c4e3828d94046d00aa66835dca4158ae097abfca27515de07b732b8fc1c887c
//===-- popcountdi2.c - Implement __popcountdi2 ---------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __popcountdi2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: count of 1 bits

// Every 2 bits holds the sum of every pair of bits (32)

// Every 4 bits holds the sum of every 4-set of bits (3 significant bits) (16)

// Every 8 bits holds the sum of every 8-set of bits (4 significant bits) (8)

// The lower 32 bits hold four 16 bit sums (5 significant bits).

//   Upper 32 bits are garbage

// The lower 16 bits hold two 32 bit sums (6 significant bits).

//   Upper 16 bits are garbage

// (7 significant bits)


=== system/lib/compiler-rt/lib/builtins/popcountsi2.c ===
SHA256: 5ad8cb98cfb67fa4ffb25dc0592962fac006781dcf72039fed5174a0cb51a1cd
//===-- popcountsi2.c - Implement __popcountsi2 ---------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __popcountsi2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: count of 1 bits

// Every 2 bits holds the sum of every pair of bits

// Every 4 bits holds the sum of every 4-set of bits (3 significant bits)

// Every 8 bits holds the sum of every 8-set of bits (4 significant bits)

// The lower 16 bits hold two 8 bit sums (5 significant bits).

//    Upper 16 bits are garbage

// (6 significant bits)


=== system/lib/compiler-rt/lib/builtins/popcountti2.c ===
SHA256: 1cfc511d395a8af1ca45bace24f8fe1e40324bd6b23a58bc16539e8472de2d1c
//===-- popcountti2.c - Implement __popcountti2

//----------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __popcountti2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: count of 1 bits

// Every 2 bits holds the sum of every pair of bits (64)

// Every 4 bits holds the sum of every 4-set of bits (3 significant bits) (32)

// Every 8 bits holds the sum of every 8-set of bits (4 significant bits) (16)

// Every 8 bits holds the sum of every 8-set of bits (5 significant bits) (8)

// Every 8 bits holds the sum of every 8-set of bits (6 significant bits) (4)

// Every 8 bits holds the sum of every 8-set of bits (7 significant bits) (2)

//

// Upper 16 bits are garbage

// (8 significant bits)

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/powidf2.c ===
SHA256: b1643f46d86e6230a30a1720454a2707f0cd5d1c1ff29b0e2c9d6d2ed082713f
//===-- powidf2.cpp - Implement __powidf2 ---------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __powidf2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a ^ b


=== system/lib/compiler-rt/lib/builtins/powisf2.c ===
SHA256: 19f74a6c065040b9ab8c4f1cfed03db551e2c83bf02cf7044f3730a3a67331f9
//===-- powisf2.cpp - Implement __powisf2 ---------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __powisf2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a ^ b


=== system/lib/compiler-rt/lib/builtins/powitf2.c ===
SHA256: 74aaf6303046d3532cc32bf4366f527af0bb4ff49ed516fecc650aca1cb50033
//===-- powitf2.cpp - Implement __powitf2 ---------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __powitf2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a ^ b


=== system/lib/compiler-rt/lib/builtins/powixf2.c ===
SHA256: 450cb525971aa264dd28db3eb1b8a518b99edc40be92077cd43fab06c0221bdb
//===-- powixf2.cpp - Implement __powixf2 ---------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __powixf2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a ^ b


=== system/lib/compiler-rt/lib/builtins/subdf3.c ===
SHA256: 201404b61436f1f617221ac20aeee67e41349baaf13ef838f0f5969e3b8b86ab
//===-- lib/adddf3.c - Double-precision subtraction ---------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements double-precision soft-float subtraction.

//

//===----------------------------------------------------------------------===//

// Subtraction; flip the sign bit of b and add.


=== system/lib/compiler-rt/lib/builtins/subsf3.c ===
SHA256: 5a908db14744b02835c6ccc254772d88ac229951830007cfed0a18d1e1d94db5
//===-- lib/subsf3.c - Single-precision subtraction ---------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements single-precision soft-float subtraction.

//

//===----------------------------------------------------------------------===//

// Subtraction; flip the sign bit of b and add.


=== system/lib/compiler-rt/lib/builtins/subtf3.c ===
SHA256: e68ff5c165411378b63779937f24ac7b7b9e15d76387187e3fd5e1673e946600
//===-- lib/subtf3.c - Quad-precision subtraction -----------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements quad-precision soft-float subtraction.

//

//===----------------------------------------------------------------------===//

// Subtraction; flip the sign bit of b and add.


=== system/lib/compiler-rt/lib/builtins/subvdi3.c ===
SHA256: 87c709b9eae4cfa4c81ffad2967964ee55452d6bac32ea074e4706b839f2e863
//===-- subvdi3.c - Implement __subvdi3 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __subvdi3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a - b

// Effects: aborts if a - b overflows


=== system/lib/compiler-rt/lib/builtins/subvsi3.c ===
SHA256: c40d701faa479e0b947abb669fcb87625d98f9e4fbe54474e4c08b4e048ef56b
//===-- subvsi3.c - Implement __subvsi3 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __subvsi3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a - b

// Effects: aborts if a - b overflows


=== system/lib/compiler-rt/lib/builtins/subvti3.c ===
SHA256: 781bce9495ca7f1d2bc703a76b15700809ebac7b5ad1ae7adb86cfba9d1aece2
//===-- subvti3.c - Implement __subvti3 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __subvti3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a - b

// Effects: aborts if a - b overflows

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/trampoline_setup.c ===
SHA256: 8df97a87d8582231d1dd1d2ab64015c247c4d17363071ebc34a5d44ba9990f31
//===----- trampoline_setup.c - Implement __trampoline_setup -------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// The ppc compiler generates calls to __trampoline_setup() when creating

// trampoline functions on the stack for use with nested functions.

// This function creates a custom 40-byte trampoline function on the stack

// which loads r11 with a pointer to the outer function's locals

// and then jumps to the target nested function.

// should never happen, but if compiler did not allocate

// enough space on stack for the trampoline, abort

// create trampoline

// mflr r0

// bl Lbase

// Lbase: mflr r11

// lwz    r12,0(r11)

// mtlr r0

// mtctr r12

// lwz    r11,4(r11)

// bctr

// clear instruction cache

// __powerpc__ && !defined(__powerpc64__)


=== system/lib/compiler-rt/lib/builtins/truncdfbf2.c ===
SHA256: e0d1b2078f6334dc9dd8186d2ebae2e1792ec00122e8f179219c16fefd2d34cf
//===-- lib/truncdfbf2.c - double -> bfloat conversion ------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/truncdfhf2.c ===
SHA256: 3533c0dba3709a1f0ebfc7217ed32afd734372a2b414d93c1544942e8e092de8
//===-- lib/truncdfhf2.c - double -> half conversion --------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/truncdfsf2.c ===
SHA256: 2842933c7721ae3e6c9d4f8d131f77f9c8228c1d5f77b1b05102c7e8b1f9b515
//===-- lib/truncdfsf2.c - double -> single conversion ------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/truncsfbf2.c ===
SHA256: 02f9717dbfb083c05d578196aa01e6dfd8e24535384bb8b7802c08b3e69c7e5c
//===-- lib/truncsfbf2.c - single -> bfloat conversion ------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/truncsfhf2.c ===
SHA256: 399a7f72c7a93511396a35a96aace9dec6c347508dd58cc19f07a5757753c634
//===-- lib/truncsfhf2.c - single -> half conversion --------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Use a forwarding definition and noinline to implement a poor man's alias,

// as there isn't a good cross-platform way of defining one.


=== system/lib/compiler-rt/lib/builtins/trunctfbf2.c ===
SHA256: a56927d7aeb3463974de1d929e184c64aaf4b448d5c6cc1e7cd93a838fa26d98
//===--------- lib/trunctfbf2.c - quad -> bfloat conversion -------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/trunctfdf2.c ===
SHA256: 46a8ca78c3d3c44a0eb8eff7a86739349cbd26cb7f61e3b5784fb096a5420871
//===-- lib/truncdfsf2.c - quad -> double conversion --------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/trunctfhf2.c ===
SHA256: cfe0aa603194b87225e561bc499375356c64f58055779a52e9044b554dcff924
//===-- lib/trunctfhf2.c - quad -> half conversion ----------------*- C -*-===//

//

//                     The LLVM Compiler Infrastructure

//

// This file is dual licensed under the MIT and the University of Illinois Open

// Source Licenses. See LICENSE.TXT for details.

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/trunctfsf2.c ===
SHA256: 6d1cf89c99ca23deb573fda82b729105cc8d8a44643a47d3377a8636f5bb2998
//===-- lib/trunctfsf2.c - quad -> single conversion --------------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/trunctfxf2.c ===
SHA256: ab5f53ed4bd15529f58be300ab9cf0d8ea0bfd03dfd6f1140cfc2bb806829096
//===-- lib/trunctfsf2.c - long double -> quad conversion ---------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Assumption: long double is a IEEE 80 bit floating point type padded to 128

// bits.


=== system/lib/compiler-rt/lib/builtins/truncxfbf2.c ===
SHA256: c750e79e127ce78ad654fecb183179568ffec5e6271963eb1de1a9eb2552b6af
//===-- lib/truncxfbf2.c - long double -> bfloat conversion -------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Have at least one declaration to suppress warnings.


=== system/lib/compiler-rt/lib/builtins/truncxfhf2.c ===
SHA256: 4b1b0aab39c7b0cada38d68b3e8127514780020ee5d8eb011b901c33bba100e0
//===-- lib/truncsfhf2.c - long double -> half conversion ---------*- C -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/builtins/ucmpdi2.c ===
SHA256: 7ff381dcbdb4d10a93093e39a915c50206c73583d37b9cd2906f58f33982a856
//===-- ucmpdi2.c - Implement __ucmpdi2 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __ucmpdi2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns:  if (a <  b) returns 0

//           if (a == b) returns 1

//           if (a >  b) returns 2

// Returns: if (a <  b) returns -1

//           if (a == b) returns  0

//           if (a >  b) returns  1


=== system/lib/compiler-rt/lib/builtins/ucmpti2.c ===
SHA256: c74d7be5038666f1e845e9c3e327295065de5779b8619b0c754e97a161d62618
//===-- ucmpti2.c - Implement __ucmpti2 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __ucmpti2 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns:  if (a <  b) returns 0

//           if (a == b) returns 1

//           if (a >  b) returns 2

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/udivdi3.c ===
SHA256: e250263dcb27261e969db4228a479b2f3bde2b06e59baa2f2c595ac752b17643
//===-- udivdi3.c - Implement __udivdi3 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __udivdi3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a / b


=== system/lib/compiler-rt/lib/builtins/udivmoddi4.c ===
SHA256: e963fd1418909bb0f43603a7846edf568d4c8bae0670bd3b13a3e754a104e2fe
//===-- udivmoddi4.c - Implement __udivmoddi4 -----------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __udivmoddi4 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Effects: if rem != 0, *rem = a % b

// Returns: a / b

// Translated from Figure 3-40 of The PowerPC Compiler Writer's Guide

// MSVC throws a warning about mod 0 here, disable it for builds that

// warn-as-error

// special cases, X is unknown, K != 0

// 0 X

// ---

// 0 X

// 0 X

// ---

// K X

// n.s.high != 0

// K X

// ---

// 0 0

// d.s.high != 0

// K 0

// ---

// K 0

// K K

// ---

// K 0

/* if d is a power of 2 */

// K K

// ---

// K 0

// 0 <= sr <= n_uword_bits - 2 or sr large

// 1 <= sr <= n_uword_bits - 1

// q.all = n.all << (n_udword_bits - sr);

// r.all = n.all >> sr;

/* d.s.low != 0 */

// K X

// ---

// 0 K

/* if d is a power of 2 */

// K X

// ---

// 0 K

// 2 <= sr <= n_udword_bits - 1

// q.all = n.all << (n_udword_bits - sr);

// r.all = n.all >> sr;

/* 2 <= sr <= n_uword_bits - 1 */

/* n_uword_bits + 1 <= sr <= n_udword_bits - 1 */

// K X

// ---

// K K

// 0 <= sr <= n_uword_bits - 1 or sr large

// 1 <= sr <= n_uword_bits

// q.all = n.all << (n_udword_bits - sr);

// Not a special case

// q and r are initialized with:

// q.all = n.all << (n_udword_bits - sr);

// r.all = n.all >> sr;

// 1 <= sr <= n_udword_bits - 1

// r:q = ((r:q)  << 1) | carry

// carry = 0;

// if (r.all >= d.all)

// {

//      r.all -= d.all;

//      carry = 1;

// }


=== system/lib/compiler-rt/lib/builtins/udivmodsi4.c ===
SHA256: 7076fde23185eb4f60a7ff19402d6864bc3e5d105a56bab8bd1af27feb40f36f
//===-- udivmodsi4.c - Implement __udivmodsi4 -----------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __udivmodsi4 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a / b, *rem = a % b


=== system/lib/compiler-rt/lib/builtins/udivmodti4.c ===
SHA256: 2fb3eb297e006000935452cb34622b389c5ce39af6e1416b4a11398b78142251
//===-- udivmodti4.c - Implement __udivmodti4 -----------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __udivmodti4 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns the 128 bit division result by 64 bit. Result must fit in 64 bits.

// Remainder stored in r.

// Taken and adjusted from libdivide libdivide_128_div_64_to_64 division

// fallback. For a correctness proof see the reference for this algorithm

// in Knuth, Volume 2, section 4.3.1, Algorithm D.

// Number base (32 bits)

// Norm. dividend LSD's

// Norm. divisor digits

// Quotient digits

// Dividend digit pairs

// A remainder

// Shift amount for normalization

// Normalize the divisor.

// Shift dividend left

// Avoid undefined behavior of (u0 >> 64).

// Break divisor up into two 32-bit digits.

// Break right half of dividend into two digits.

// Compute the first quotient digit, q1.

// q1 has at most error 2. No more than 2 iterations.

// Compute the second quotient digit.

// q0 has at most error 2. No more than 2 iterations.

// Effects: if rem != 0, *rem = a % b

// Returns: a / b

// When the divisor fits in 64 bits, we can use an optimized path.

// The result fits in 64 bits.

// First, divide with the high part to get the remainder in dividend.s.high.

// After that dividend.s.high < divisor.s.low.

// 0 <= shift <= 63.

// Branch free version of.

// if (dividend.all >= divisor.all)

// {

//    dividend.all -= divisor.all;

//    carry = 1;

// }

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/udivsi3.c ===
SHA256: c41c76d2e44362a662f26411b0f1b5bfdabe40d1d624fe335b601663a7a313ef
//===-- udivsi3.c - Implement __udivsi3 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __udivsi3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a / b


=== system/lib/compiler-rt/lib/builtins/udivti3.c ===
SHA256: c0b20f06f6e0e8a6b5423ca6674cf0c57219d07554f6f35c9ecc36bf28915355
//===-- udivti3.c - Implement __udivti3 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __udivti3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a / b

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/umoddi3.c ===
SHA256: d812aa1e62d6179f9013e38bc040ba69d905be128fa25e104645a9da0841d209
//===-- umoddi3.c - Implement __umoddi3 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __umoddi3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a % b


=== system/lib/compiler-rt/lib/builtins/umodsi3.c ===
SHA256: 1404beb2eb5904b8b68cf46de4f08d232d4813dad319c167b4a3a8ed5afdb7bb
//===-- umodsi3.c - Implement __umodsi3 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __umodsi3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a % b


=== system/lib/compiler-rt/lib/builtins/umodti3.c ===
SHA256: 3d88088419d87b486858a4bf54ff08209944ae526c77b8dc5e0c0b6b8001c1e9
//===-- umodti3.c - Implement __umodti3 -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements __umodti3 for the compiler_rt library.

//

//===----------------------------------------------------------------------===//

// Returns: a % b

// CRT_HAS_128BIT


=== system/lib/compiler-rt/lib/builtins/unwind-ehabi-helpers.h ===
SHA256: 3687a1f01739347bed7df0de8cfed8e0bb1c5d54e1286f4899f36dec2ed4650b
//===-- arm-ehabi-helpers.h - Supplementary ARM EHABI declarations --------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===--------------------------------------------------------------------===//

// NOTE: see reasoning for this inclusion below

// NOTE: _URC_OK, _URC_FAILURE must be present as preprocessor tokens.  This

// allows for a substitution of a constant which can be cast into the

// appropriate enumerated type.  This header is expected to always be included

// AFTER unwind.h (which is why it is forcefully included above).  This ensures

// that we do not overwrite the token for the enumeration.  Subsequent uses of

// the token would be clean to rewrite with constant values.

//

// The typedef redeclaration should be safe.  Due to the protection granted to

// us by the `__ARM_EABI_UNWINDER__` above, we are guaranteed that we are in a

// header not vended by gcc.  The HP unwinder (being an itanium unwinder) does

// not support EHABI, and the GNU unwinder, derived from the HP unwinder, also

// does not support EHABI as of the introduction of this header.  As such, we

// are fairly certain that we are in the LLVM case.  Here, _Unwind_State is a

// typedef, and so we can get away with a redeclaration.

//

// Guarded redefinitions of the needed unwind state prevent the redefinition of

// those states.


=== system/lib/compiler-rt/lib/interception/interception.h ===
SHA256: b1cca4145ddd700ee126dffcbd35df93455a9e3520cab6f27ee3f89e063252b4
//===-- interception.h ------------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Machinery for providing replacements/wrappers for system functions.

//===----------------------------------------------------------------------===//

// These typedefs should be used only in the interceptor definitions to replace

// the standard system types (e.g. SSIZE_T instead of ssize_t)

// On Windows the system headers (basetsd.h) provide a conflicting definition

// of SIZE_T/SSIZE_T that do not match the real size_t/ssize_t for 32-bit

// systems (using long instead of the expected int). Work around the typedef

// redefinition by #defining SIZE_T instead of using a typedef.

// TODO: We should be using __sanitizer::usize (and a new ssize) instead of

// these new macros as long as we ensure they match the real system definitions.

// Ensure that (S)SIZE_T were already defined as we are about to override them.

// How to add an interceptor:

// Suppose you need to wrap/replace system function (generally, from libc):

//      int foo(const char *bar, double baz);

// You'll need to:

//      1) define INTERCEPTOR(int, foo, const char *bar, double baz) { ... } in

//         your source file. See the notes below for cases when

//         INTERCEPTOR_WITH_SUFFIX(...) should be used instead.

//      2) Call "INTERCEPT_FUNCTION(foo)" prior to the first call of "foo".

//         INTERCEPT_FUNCTION(foo) evaluates to "true" iff the function was

//         intercepted successfully.

// You can access original function by calling REAL(foo)(bar, baz).

// By default, REAL(foo) will be visible only inside your interceptor, and if

// you want to use it in other parts of RTL, you'll need to:

//      3a) add DECLARE_REAL(int, foo, const char*, double) to a

//          header file.

// However, if the call "INTERCEPT_FUNCTION(foo)" and definition for

// INTERCEPTOR(..., foo, ...) are in different files, you'll instead need to:

//      3b) add DECLARE_REAL_AND_INTERCEPTOR(int, foo, const char*, double)

//          to a header file.

// Notes: 1. Things may not work properly if macro INTERCEPTOR(...) {...} or

//           DECLARE_REAL(...) are located inside namespaces.

//        2. On Mac you can also use: "OVERRIDE_FUNCTION(foo, zoo)" to

//           effectively redirect calls from "foo" to "zoo". In this case

//           you aren't required to implement

//           INTERCEPTOR(int, foo, const char *bar, double baz) {...}

//           but instead you'll have to add

//           DECLARE_REAL(int, foo, const char *bar, double baz) in your

//           source file (to define a pointer to overriden function).

//        3. Some Mac functions have symbol variants discriminated by

//           additional suffixes, e.g. _$UNIX2003 (see

//           https://developer.apple.com/library/mac/#releasenotes/Darwin/SymbolVariantsRelNotes/index.html

//           for more details). To intercept such functions you need to use the

//           INTERCEPTOR_WITH_SUFFIX(...) macro.

// How it works on Linux

// ---------------------

//

// To replace system functions on Linux we just need to declare functions with

// the same names in our library and then obtain the real function pointers

// using dlsym().

//

// There is one complication: a user may also intercept some of the functions we

// intercept. To allow for up to 3 interceptors (including ours) of a given

// function "func", the interceptor implementation is in ___interceptor_func,

// which is aliased by a weak function __interceptor_func, which in turn is

// aliased (via a trampoline) by weak wrapper function "func".

//

// Most user interceptors should define a foreign interceptor as follows:

//

//  - provide a non-weak function "func" that performs interception;

//  - if __interceptor_func exists, call it to perform the real functionality;

//  - if it does not exist, figure out the real function and call it instead.

//

// In rare cases, a foreign interceptor (of another dynamic analysis runtime)

// may be defined as follows (on supported architectures):

//

//  - provide a non-weak function __interceptor_func that performs interception;

//  - if ___interceptor_func exists, call it to perform the real functionality;

//  - if it does not exist, figure out the real function and call it instead;

//  - provide a weak function "func" that is an alias to __interceptor_func.

//

// With this protocol, sanitizer interceptors, foreign user interceptors, and

// foreign interceptors of other dynamic analysis runtimes, or any combination

// thereof, may co-exist simultaneously.

//

// How it works on Mac OS

// ----------------------

//

// This is not so on Mac OS, where the two-level namespace makes our replacement

// functions invisible to other libraries. This may be overcomed using the

// DYLD_FORCE_FLAT_NAMESPACE, but some errors loading the shared libraries in

// Chromium were noticed when doing so.

//

// Instead we create a dylib containing a __DATA,__interpose section that

// associates library functions with their wrappers. When this dylib is

// preloaded before an executable using DYLD_INSERT_LIBRARIES, it routes all the

// calls to interposed functions done through stubs to the wrapper functions.

//

// As it's decided at compile time which functions are to be intercepted on Mac,

// INTERCEPT_FUNCTION() is effectively a no-op on this system.

// For __DARWIN_ALIAS_C().

// Just a pair of pointers.

// For a function foo() create a global pair of pointers { wrap_foo, foo } in

// the __DATA,__interpose section.

// As a result all the calls to foo() will be routed to wrap_foo() at runtime.

// For a function foo() and a wrapper function bar() create a global pair

// of pointers { bar, foo } in the __DATA,__interpose section.

// As a result all the calls to foo() will be routed to bar() at runtime.

// # define WRAPPER_NAME(x) "__interceptor_" #x

// AIX's linker will not select the weak symbol, so don't use weak for the

// interceptors.

// LINUX, FREEBSD, NETBSD, SOLARIS

// Weak aliases of weak aliases do not work, therefore we need to set up a

// trampoline function. The function "func" is a weak alias to the trampoline

// (so that we may check if "func" was overridden), which calls the weak

// function __interceptor_func, which in turn aliases the actual interceptor

// implementation ___interceptor_func:

//

//    [wrapper "func": weak] --(alias)--> [TRAMPOLINE(func)]

//                                                |

//                     +--------(tail call)-------+

//                     |

//                     v

//      [__interceptor_func: weak] --(alias)--> [WRAP(func)]

//

// We use inline assembly to define most of this, because not all compilers

// support functions with the "naked" attribute with every architecture.

// FreeBSD's dynamic linker (incompliantly) gives non-weak symbols higher

// priority than weak ones so weak aliases won't work for indirect calls

// in position-independent (-fPIC / -fPIE) mode.

// SANITIZER_FREEBSD || SANITIZER_NETBSD

// Keep trampoline implementation in sync with sanitizer_common/sanitizer_asm.h

// ASM_INTERCEPTOR_TRAMPOLINE_SUPPORT

// Some architectures cannot implement efficient interceptor trampolines with

// just a plain jump due to complexities of resolving a preemptible symbol. In

// those cases, revert to just this scheme:

//

//    [wrapper "func": weak] --(alias)--> [WRAP(func)]

//

// SANITIZER_FREEBSD || SANITIZER_NETBSD

// ASM_INTERCEPTOR_TRAMPOLINE_SUPPORT

// There is no general interception at all on Fuchsia.

// Sanitizer runtimes just define functions directly to preempt them,

// and have bespoke ways to access the underlying libc functions.

// Sanitizer runtimes on Emscripten just define functions directly to override

// the libc functions. If the real version is really needed, they can be defined

// with the emscripten_builtin_ prefix.

// SANITIZER_APPLE

// SANITIZER_APPLE

// Declare an interceptor and its wrapper defined in a different translation

// unit (ex. asm).

// Generally, you don't need to use DEFINE_REAL by itself, as INTERCEPTOR

// macros does its job. In exceptional cases you may need to call REAL(foo)

// without defining INTERCEPTOR(..., foo, ...). For example, if you override

// foo with an interceptor for other function.

// We need to define the __interceptor_func name just to get

// sanitizer_common/scripts/gen_dynamic_list.py to export func.

// But we don't need to export __interceptor_func to get that.

// We don't need INTERCEPTOR_WITH_SUFFIX on non-Darwin for now.

// SANITIZER_APPLE

/*no symbol variants*/

// Override |overridee| with |overrider|.

// ISO C++ forbids casting between pointer-to-function and pointer-to-object,

// so we use casts via uintptr_t (the local __sanitizer::uptr equivalent).

// The use of interceptors makes many sanitizers unusable for static linking.

// Define a function, if called, will cause a linker error (undefined _DYNAMIC).

// However, -static-pie (which is not common) cannot be detected at link time.

// namespace __interception

// INTERCEPTION_H


=== system/lib/compiler-rt/lib/interception/interception_aix.cpp ===
SHA256: 94212ff648bb2d67492a50307e13579e3c412c41a746ced8631bc30beffbc9b4
//===-- interception_aix.cpp ------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// AIX-specific interception methods.

//===----------------------------------------------------------------------===//

// for dlsym()

// AIX dlsym can only defect the functions that are exported, so

// on AIX, we can not intercept some basic functions like memcpy.

// FIXME: if we are going to ship dynamic asan library, we may need to search

// all the loaded modules with RTLD_DEFAULT if RTLD_NEXT failed.

// In case `name' is not loaded, dlsym ends up finding the actual wrapper.

// We don't want to intercept the wrapper and have it point to itself.

// namespace __interception

// SANITIZER_AIX


=== system/lib/compiler-rt/lib/interception/interception_aix.h ===
SHA256: 4a869acc70a23c81b4eca5693e4c6aae5773470df70e597462916bf86e57ff14
//===-- interception_aix.h --------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// AIX-specific interception methods.

//===----------------------------------------------------------------------===//

// namespace __interception

// INTERCEPTION_AIX_H

// SANITIZER_AIX


=== system/lib/compiler-rt/lib/interception/interception_linux.cpp ===
SHA256: 5a71c61b085177ea26202ca17b0daa29a2a4e5d8db9cefae8846329968341159
//===-- interception_linux.cpp ----------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Linux-specific interception methods.

//===----------------------------------------------------------------------===//

// for dlsym() and dlvsym()

// FIXME: Find a better way to handle renames

// If the lookup using RTLD_NEXT failed, the sanitizer runtime library is

// later in the library search order than the DSO that we are trying to

// intercept, which means that we cannot intercept this function. We still

// want the address of the real definition, though, so look it up using

// RTLD_DEFAULT.

// In case `name' is not loaded, dlsym ends up finding the actual wrapper.

// We don't want to intercept the wrapper and have it point to itself.

// dlvsym is a GNU extension supported by some other platforms.

// SANITIZER_GLIBC || SANITIZER_FREEBSD || SANITIZER_NETBSD

// namespace __interception

// SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD ||

// SANITIZER_SOLARIS || SANITIZER_HAIKU


=== system/lib/compiler-rt/lib/interception/interception_linux.h ===
SHA256: 411266cc7c9bde6d56f51b36e46e3a85cf10bd3b5d6c332700438afafa9a90ae
//===-- interception_linux.h ------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Linux-specific interception methods.

//===----------------------------------------------------------------------===//

// namespace __interception

// Cast func to type of REAL(func) before casting to uptr in case it is an

// overloaded function, which is the case for some glibc functions when

// _FORTIFY_SOURCE is used. This disambiguates which overload to use.

// dlvsym is a GNU extension supported by some other platforms.

// SANITIZER_GLIBC || SANITIZER_FREEBSD || SANITIZER_NETBSD

// INTERCEPTION_LINUX_H

// SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD ||

// SANITIZER_SOLARIS || SANITIZER_HAIKU || SANITIZER_EMSCRIPTEN


=== system/lib/compiler-rt/lib/interception/interception_mac.cpp ===
SHA256: f7ee1530044c0bf9e6467008dd2fb423b205b3c8ba1140e0e9720acec04663ca
//===-- interception_mac.cpp ------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Mac-specific interception methods.

//===----------------------------------------------------------------------===//

// SANITIZER_APPLE


=== system/lib/compiler-rt/lib/interception/interception_mac.h ===
SHA256: 0a043698526804886f9d0932d72ae4b6893386c08a50297bec2b19fafcb2f83d
//===-- interception_mac.h --------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Mac-specific interception methods.

//===----------------------------------------------------------------------===//

// INTERCEPTION_MAC_H

// SANITIZER_APPLE


=== system/lib/compiler-rt/lib/interception/interception_type_test.cpp ===
SHA256: 24a4bee15d97a8bb32c39f844f4038fe653a864b4b519c440dc87f12dcaebc4e
//===-- interception_type_test.cpp ------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Compile-time tests of the internal type definitions.

//===----------------------------------------------------------------------===//

// No ssize_t on Windows.

// TODO: These are not actually the same type on Linux (long vs long long)

// The following are the cases when pread (and friends) is used instead of

// pread64. In those cases we need OFF_T to match off_t. We don't care about the

// rest (they depend on _FILE_OFFSET_BITS setting when building an application).


=== system/lib/compiler-rt/lib/interception/interception_win.cpp ===
SHA256: ecd57971ff60785ef5bebdae97eb75219a8617d16a0baa6c9ee6135ed5c26dcf
//===-- interception_win.cpp ------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Windows-specific interception methods.

//

// This file is implementing several hooking techniques to intercept calls

// to functions. The hooks are dynamically installed by modifying the assembly

// code.

//

// The hooking techniques are making assumptions on the way the code is

// generated and are safe under these assumptions.

//

// On 64-bit architecture, there is no direct 64-bit jump instruction. To allow

// arbitrary branching on the whole memory space, the notion of trampoline

// region is used. A trampoline region is a memory space withing 2G boundary

// where it is safe to add custom assembly code to build 64-bit jumps.

//

// Hooking techniques

// ==================

//

// 1) Detour

//

//    The Detour hooking technique is assuming the presence of a header with

//    padding and an overridable 2-bytes nop instruction (mov edi, edi). The

//    nop instruction can safely be replaced by a 2-bytes jump without any need

//    to save the instruction. A jump to the target is encoded in the function

//    header and the nop instruction is replaced by a short jump to the header.

//

//        head:  5 x nop                 head:  jmp <hook>

//        func:  mov edi, edi    -->     func:  jmp short <head>

//               [...]                   real:  [...]

//

//    This technique is only implemented on 32-bit architecture.

//    Most of the time, Windows API are hookable with the detour technique.

//

// 2) Redirect Jump

//

//    The redirect jump is applicable when the first instruction is a direct

//    jump. The instruction is replaced by jump to the hook.

//

//        func:  jmp <label>     -->     func:  jmp <hook>

//

//    On a 64-bit architecture, a trampoline is inserted.

//

//        func:  jmp <label>     -->     func:  jmp <tramp>

//                                              [...]

//

//                                   [trampoline]

//                                      tramp:  jmp QWORD [addr]

//                                       addr:  .bytes <hook>

//

//    Note: <real> is equivalent to <label>.

//

// 3) HotPatch

//

//    The HotPatch hooking is assuming the presence of a header with padding

//    and a first instruction with at least 2-bytes.

//

//    The reason to enforce the 2-bytes limitation is to provide the minimal

//    space to encode a short jump. HotPatch technique is only rewriting one

//    instruction to avoid breaking a sequence of instructions containing a

//    branching target.

//

//    Assumptions are enforced by MSVC compiler by using the /HOTPATCH flag.

//      see: https://msdn.microsoft.com/en-us/library/ms173507.aspx

//    Default padding length is 5 bytes in 32-bits and 6 bytes in 64-bits.

//

//        head:   5 x nop                head:  jmp <hook>

//        func:   <instr>        -->     func:  jmp short <head>

//                [...]                  body:  [...]

//

//                                   [trampoline]

//                                       real:  <instr>

//                                              jmp <body>

//

//    On a 64-bit architecture:

//

//        head:   6 x nop                head:  jmp QWORD [addr1]

//        func:   <instr>        -->     func:  jmp short <head>

//                [...]                  body:  [...]

//

//                                   [trampoline]

//                                      addr1:  .bytes <hook>

//                                       real:  <instr>

//                                              jmp QWORD [addr2]

//                                      addr2:  .bytes <body>

//

// 4) Trampoline

//

//    The Trampoline hooking technique is the most aggressive one. It is

//    assuming that there is a sequence of instructions that can be safely

//    replaced by a jump (enough room and no incoming branches).

//

//    Unfortunately, these assumptions can't be safely presumed and code may

//    be broken after hooking.

//

//        func:   <instr>        -->     func:  jmp <hook>

//                <instr>

//                [...]                  body:  [...]

//

//                                   [trampoline]

//                                       real:  <instr>

//                                              <instr>

//                                              jmp <body>

//

//    On a 64-bit architecture:

//

//        func:   <instr>        -->     func:  jmp QWORD [addr1]

//                <instr>

//                [...]                  body:  [...]

//

//                                   [trampoline]

//                                      addr1:  .bytes <hook>

//                                       real:  <instr>

//                                              <instr>

//                                              jmp QWORD [addr2]

//                                      addr2:  .bytes <body>

//===----------------------------------------------------------------------===//

// This acts like an abort when no debugger is attached. According to an old

// comment, calling abort() leads to an infinite recursion in CheckFailed.

// In a 32-bit address space, the address calculation will wrap, so this check

// is unnecessary.

// FIXME: internal_str* and internal_mem* functions should be moved from the

// ASan sources into interception/.

// jmp [rip + <offset>] = FF 25 <offset> where <offset> is a relative

// offset.

// The offset is the distance from then end of the jump instruction to the

// memory location containing the targeted address. The displacement is still

// 32-bit in x64, so indirect_target must be located within +/- 2GB range.

// Emit an indirect jump through immediately following bytes:

//   jmp [rip + kBranchLength]

//   .quad <target>

// 2 gig

// Clamp {min,max}_addr to the accessible address space.

// This loop probes the virtual address space to find free memory in the

// [min_addr, max_addr] interval. The search starts from func_addr and

// proceeds "outwards" towards the interval bounds using two probes, lo_addr

// and hi_addr, for addresses lower/higher than func_addr. At each step, it

// considers the probe closest to func_addr. If that address is not free, the

// probe is advanced (lower or higher depending on the probe) to the next

// memory block and the search continues.

// Consider the in-range address closest to func_addr.

// Check whether a region can be allocated at |addr|.

// Used by unittests to release mapped memory space.

// Allocate memory within 2GB of the module (DLL or EXE file) so that any

// address within the module can be referenced with PC-relative operands.

// This allows us to not just jump to the trampoline with a PC-relative

// offset, but to relocate any instructions that we copy to the trampoline

// which have references to the original module. If we can't find the base

// address of the module (e.g. if func_address is in mmap'ed memory), just

// stay within 2GB of func_address.

// Check for overflow.

// Find a region within [min_addr,max_addr] with enough space to allocate

// |size| bytes.

// No valid region found, allocate a new region.

// The space can be allocated in the current region.

// Failed to find a region.

// Allocate the space in the current region.

// The following prologues cannot be patched because of the short jump

// jumping to the patching region.

// Short jump patterns  below are only for x86_64.

// ntdll!wcslen in Win11

//   488bc1          mov     rax,rcx

//   0fb710          movzx   edx,word ptr [rax]

//   4883c002        add     rax,2

//   6685d2          test    dx,dx

//   75f4            jne     -12

// ntdll!strrchr in Win11

//   4c8bc1          mov     r8,rcx

//   8a01            mov     al,byte ptr [rcx]

//   48ffc1          inc     rcx

//   84c0            test    al,al

//   75f7            jne     -9

// Returns 0 on error.

// An ARM64 instruction is 4 bytes long.

// stub: jmp over 6 x nop.

// 90 : nop

// C3 : ret   (for small/empty function interception

// CC : int 3  i.e. registering weak functions)

// push eax / rax

// push ecx / rcx

// push edx / rdx

// push ebx / rbx

// push esp / rsp

// push ebp / rbp

// push esi / rsi

// push edi / rdi

// pop ebp / rbp

// 6A XX = push XX

// This instruction can be encoded with a 16-bit immediate but that is

// incredibly unlikely.

// 68 XX XX XX XX : push imm32

// b8 XX XX XX XX : mov eax, XX XX XX XX

// b9 XX XX XX XX : mov ecx, XX XX XX XX

// ba XX XX XX XX : mov edx, XX XX XX XX

// Cannot overwrite control-instruction. Return 0 to indicate failure.

// E9 XX XX XX XX : jmp <label>

// E8 XX XX XX XX : call <func>

// EB XX : jmp XX (short jump)

// 7Y YY : jy XX (short conditional jump)

// 8A 01 : mov al, byte ptr [ecx]

// 8B FF : mov edi, edi

// 8B EC : mov ebp, esp

// 89 C8 : mov eax, ecx

// 89 D1 : mov ecx, edx

// 89 E5 : mov ebp, esp

// 8B C1 : mov eax, ecx

// 31 C0 : xor eax, eax

// 31 C9 : xor ecx, ecx

// 31 D2 : xor edx, edx

// 33 C0 : xor eax, eax

// 33 C9 : xor ecx, ecx

// 33 D2 : xor edx, edx

// 66 90 : xchg %ax,%ax (Two-byte NOP)

// 84 DB : test bl,bl

// 84 C0 : test al,al

// 84 C9 : test cl,cl

// 84 D2 : test dl,dl

// 80 39 XX : cmp BYTE PTR [rcx], XX

// 8B 4D XX : mov XX(%ebp), ecx

// 8B 55 XX : mov XX(%ebp), edx

// 8B 75 XX : mov XX(%ebp), esp

// 83 E4 XX : and esp, XX

// 83 EC XX : sub esp, XX

// F6 C1 XX : test cl, XX

// FF 89 XX XX XX XX : dec dword ptr [ecx + XX XX XX XX]

// 81 EC XX XX XX XX : sub esp, XX XX XX XX

// Cannot overwrite control-instruction. Return 0 to indicate failure.

// FF 25 XX YY ZZ WW : jmp dword ptr ds:[WWZZYYXX]

// 8D 4C 24 XX : lea ecx, [esp + XX]

// FF 74 24 XX : push qword ptr [rsp + XX]

// 8D A4 24 XX XX XX XX : lea esp, [esp + XX XX XX XX]

// C2 XX XX : ret XX (needed for registering weak functions)

// A1 XX XX XX XX XX XX XX XX :

//   movabs eax, dword ptr ds:[XXXXXXXX]

//  f2 0f 11 44 24 XX       movsd  QWORD PTR

//  [rsp + XX], xmm0

//  f2 0f 11 4c 24 XX       movsd  QWORD PTR

//  [rsp + XX], xmm1

//  f2 0f 11 54 24 XX       movsd  QWORD PTR

//  [rsp + XX], xmm2

//  f2 0f 11 5c 24 XX       movsd  QWORD PTR

//  [rsp + XX], xmm3

//  f2 0f 11 64 24 XX       movsd  QWORD PTR

//  [rsp + XX], xmm4

// 83 ModR/M SIB Disp8 Imm8

//   add|or|adc|sbb|and|sub|xor|cmp [r+disp8], imm8

// push rax

// push rcx

// push rdx

// push rbx

// push rsp

// push rbp

// push rsi

// push rdi

// push r12

// push r13

// push r14

// push r15

// test al, al

// mov al, byte ptr [rcx]

// 80 7E YY XX  cmp BYTE PTR [rsi+YY], XX

// 80 7D YY XX  cmp BYTE PTR [rbp+YY], XX

// 80 7A YY XX  cmp BYTE PTR [rdx+YY], XX

// 80 78 YY XX  cmp BYTE PTR [rax+YY], XX

// 80 7B YY XX  cmp BYTE PTR [rbx+YY], XX

// 80 79 YY XX  cmp BYTE ptr [rcx+YY], XX

// 8A 05 XX XX XX XX : mov al, byte ptr [XX XX XX XX]

// 8B 05 XX XX XX XX : mov eax, dword ptr [XX XX XX XX]

// 41 B8 XX XX XX XX : mov r8d, XX XX XX XX

// 81 7E YY XX XX XX XX  cmp DWORD PTR [rsi+YY], XX XX XX XX

// 81 7D YY XX XX XX XX  cmp DWORD PTR [rbp+YY], XX XX XX XX

// 81 7A YY XX XX XX XX  cmp DWORD PTR [rdx+YY], XX XX XX XX

// 81 78 YY XX XX XX XX  cmp DWORD PTR [rax+YY], XX XX XX XX

// 81 7B YY XX XX XX XX  cmp DWORD PTR [rbx+YY], XX XX XX XX

// 81 79 YY XX XX XX XX  cmp dword ptr [rcx+YY], XX XX XX XX

// 48 b8 XX XX XX XX XX XX XX XX :

//   movabsq XX XX XX XX XX XX XX XX, rax

// 48 ba XX XX XX XX XX XX XX XX :

//   movabsq XX XX XX XX XX XX XX XX, rdx

// 0f b7 10 : movzx edx, WORD PTR [rax]

// 4d 0b c0 : or r8, r8

// 45 33 c0 : xor r8d, r8d

// 48 85 c0 : test rax, rax

// 4d 85 c0 : test r8, r8

// 41 8b c0 : mov eax, r8d

// 48 ff c0 : inc rax

// 49 ff c0 : inc r8

// 41 8b c1 : mov eax, r9d

// 48 8b c1 : mov rax, rcx

// 4c 8b c1 : mov r8, rcx

// 48 ff c1 : inc rcx

// 49 ff c1 : inc r9

// 41 8b c2 : mov eax, r10d

// 0f b6 01 : movzx eax, BYTE PTR [rcx]

// 0f b6 09 : movzx ecx, BYTE PTR [rcx]

// 0f b6 11 : movzx edx, BYTE PTR [rcx]

// 0f b6 c2 : movzx eax, dl

// 48 ff c2 : inc rdx

// 49 ff c2 : inc r10

// 41 8b c3 : mov eax, r11d

// 48 ff c3 : inc rbx

// 49 ff c3 : inc r11

// 41 8b c4 : mov eax, r12d

// 48 8b c4 : mov rax, rsp

// 49 ff c4 : inc r12

// 49 ff c5 : inc r13

// 48 ff c6 : inc rsi

// 49 ff c6 : inc r14

// 48 ff c7 : inc rdi

// 49 ff c7 : inc r15

// 45 33 c9 : xor r9d, r9d

// 48 85 c9 : test rcx, rcx

// 4d 85 c9 : test r9, r9

// 4c 8b c9 : mov r9, rcx

// 48 29 d1 : sub rcx, rdx

// 48 2b ca : sub rcx, rdx

// 48 3b ca : cmp rcx, rdx

// 48 2b d1 : sub rdx, rcx

// 48 8b d1 : mov rdx, rcx

// 4c 8b d1 : mov r10, rcx

// 48 85 d2 : test rdx, rdx

// 4d 85 d2 : test r10, r10

// 4c 8b d2 : mov r10, rdx

// 0f b6 d2 : movzx edx, dl

// 0f be d2 : movsx edx, dl

// 4c 8b d9 : mov r11, rcx

// 48 f7 d9 : neg rcx

// 45 31 c0 : xor r8d,r8d

// 45 31 c9 : xor r9d,r9d

// 45 33 db : xor r11d, r11d

// 45 84 c0 : test r8b,r8b

// 45 84 d2 : test r10b,r10b

// 48 85 db : test rbx, rbx

// 4d 85 db : test r11, r11

// 4c 8b dc : mov r11, rsp

// 48 85 e4 : test rsp, rsp

// 4d 85 e4 : test r12, r12

// 48 89 c8 : mov rax,rcx

// 48 89 cb : mov rbx,rcx

// 48 89 d0 : mov rax,rdx

// 48 89 d1 : mov rcx,rdx

// 48 89 d3 : mov rbx,rdx

// 48 89 e5 : mov rbp, rsp

// 48 85 ed : test rbp, rbp

// 49 89 c8 : mov r8, rcx

// 49 89 c9 : mov r9, rcx

// 49 89 ca : mov r10,rcx

// 49 89 d0 : mov r8, rdx

// 49 89 d1 : mov r9, rdx

// 49 89 d2 : mov r10, rdx

// 49 89 d3 : mov r11, rdx

// 4d 85 ed : test r13, r13

// 4d 85 f6 : test r14, r14

// 4d 85 ff : test r15, r15

// 89 54 24 XX : mov DWORD PTR[rsp + XX], edx

// 44 8d 42 XX : lea r8d , [rdx + XX]

// 48 89 58 XX : mov QWORD PTR[rax + XX], rbx

// 48 83 ec XX : sub rsp, XX

// 49 83 f8 XX : cmp r8, XX

// 49 8d 48 XX : lea rcx, [...]

// 4c 8d 04 XX : lea r8, [...]

// 4e 8d 14 XX : lea r10, [...]

// 66 83 39 XX : cmp WORD PTR [rcx], XX

// 0F 1F 44 XX XX :   nop DWORD PTR [...]

// 83 64 24 XX YY :   and    DWORD PTR [rsp+XX], YY

// 66 81 78 XX YY YY  cmp WORD PTR [rax+XX], YY YY

// 66 81 79 XX YY YY  cmp WORD PTR [rcx+XX], YY YY

// 66 81 7a XX YY YY  cmp WORD PTR [rdx+XX], YY YY

// 66 81 7b XX YY YY  cmp WORD PTR [rbx+XX], YY YY

// 66 81 7e XX YY YY  cmp WORD PTR [rsi+XX], YY YY

// 66 81 7f XX YY YY  cmp WORD PTR [rdi+XX], YY YY

// 48 81 EC XX XX XX XX : sub rsp, XXXXXXXX

// 48 C7 C0 XX XX XX XX : mov rax, XX XX XX XX

// clang-format off

// 41 81 78 XX YY YY YY YY : cmp DWORD PTR [r8+YY], XX XX XX XX

// 41 81 79 XX YY YY YY YY : cmp DWORD PTR [r9+YY], XX XX XX XX

// 41 81 7a XX YY YY YY YY : cmp DWORD PTR [r10+YY], XX XX XX XX

// 41 81 7b XX YY YY YY YY : cmp DWORD PTR [r11+YY], XX XX XX XX

// 41 81 7d XX YY YY YY YY : cmp DWORD PTR [r13+YY], XX XX XX XX

// 41 81 7e XX YY YY YY YY : cmp DWORD PTR [r14+YY], XX XX XX XX

// 41 81 7f YY XX XX XX XX : cmp DWORD PTR [r15+YY], XX XX XX XX

// 81 7c 24 YY XX XX XX XX : cmp DWORD PTR [rsp+YY], XX XX XX XX

// clang-format on

// 48 8b 05 XX XX XX XX :

//   mov rax, QWORD PTR [rip + XXXXXXXX]

// 48 8d 05 XX XX XX XX :

//   lea rax, QWORD PTR [rip + XXXXXXXX]

// 48 89 0d XX XX XX XX :

//   mov QWORD PTR [rip + XXXXXXXX], rcx

// 48 89 15 XX XX XX XX :

//   mov QWORD PTR [rip + XXXXXXXX], rdx

// 48 ff 25 XX XX XX XX :

//   rex.W jmp QWORD PTR [rip + XXXXXXXX]

// 4c 8d 15 XX XX XX XX : lea r10, [rip + XX]

// Instructions having offset relative to 'rip' need offset adjustment.

// C7 44 24 XX YY YY YY YY

//   mov dword ptr [rsp + XX], YYYYYYYY

// 41 81 7c ZZ YY XX XX XX XX

// cmp DWORD PTR [reg+reg*n+YY], XX XX XX XX

// 44 0f b6 01 : movzx r8d, BYTE PTR [rcx]

// 44 0f b6 09 : movzx r9d, BYTE PTR [rcx]

// 44 0f b6 0a : movzx r8d, BYTE PTR [rdx]

// 44 0f b6 11 : movzx r10d, BYTE PTR [rcx]

// 44 0f b6 1a : movzx r11d, BYTE PTR [rdx]

// 48 8b 44 24 XX : mov rax, QWORD ptr [rsp + XX]

// 48 89 6C 24 XX : mov QWORD ptr [rsp + XX], rbp

// 48 89 5c 24 XX : mov QWORD PTR [rsp + XX], rbx

// 48 89 74 24 XX : mov QWORD PTR [rsp + XX], rsi

// 48 89 7c 24 XX : mov QWORD PTR [rsp + XX], rdi

// 48 89 4C 24 XX : mov QWORD PTR [rsp + XX], rcx

// 48 89 54 24 XX : mov QWORD PTR [rsp + XX], rdx

// 4c 89 4c 24 XX : mov QWORD PTR [rsp + XX], r9

// 4c 89 44 24 XX : mov QWORD PTR [rsp + XX], r8

// 44 89 4c 24 XX   mov DWORD PTR [rsp + XX], r9d

// 44 89 44 24 XX   mov DWORD PTR [rsp + XX], r8d

// 48 8d 6c 24 XX : lea rbp, [rsp + XX]

// 48 83 64 24 XX YY : and QWORD PTR [rsp + XX], YY

// 48 8D A4 24 XX XX XX XX : lea rsp, [rsp + XX XX XX XX]

// 66 48 0F 7E C0 : movq rax, xmm0

// A1 XX XX XX XX :  mov eax, dword ptr ds:[XXXXXXXX]

// 8B 45 XX : mov eax, dword ptr [ebp + XX]

// 8B 5D XX : mov ebx, dword ptr [ebp + XX]

// 8B 7D XX : mov edi, dword ptr [ebp + XX]

// 8B 75 XX : mov esi, dword ptr [ebp + XX]

// FF 75 XX : push dword ptr [ebp + XX]

// F7 C1 XX YY ZZ WW : test ecx, WWZZYYXX

// 83 3D XX YY ZZ WW TT : cmp TT, WWZZYYXX

// 83 7D XX YY : cmp dword ptr [ebp + XX], YY

// 8A 44 24 XX : mov eal, dword ptr [esp + XX]

// 8B 44 24 XX : mov eax, dword ptr [esp + XX]

// 8B 4C 24 XX : mov ecx, dword ptr [esp + XX]

// 8B 54 24 XX : mov edx, dword ptr [esp + XX]

// 8B 5C 24 XX : mov ebx, dword ptr [esp + XX]

// 8B 6C 24 XX : mov ebp, dword ptr [esp + XX]

// 8B 74 24 XX : mov esi, dword ptr [esp + XX]

// 8B 7C 24 XX : mov edi, dword ptr [esp + XX]

// 0F B6 44 24 XX : movzx eax, byte ptr [esp + XX]

// Unknown instruction! This might happen when we add a new interceptor, use

// a new compiler version, or if Windows changed how some functions are

// compiled. In either case, we print the address and 8 bytes of instructions

// to notify the user about the error and to help identify the unknown

// instruction. Don't treat this as a fatal error, though we can break the

// debugger if one has been attached.

// Returns 0 on error.

// we want to make sure that the new relative offset still fits in 32-bits

// this will be untrue if relocated_offset \notin [-2**31, 2**31)

// on 32-bit, the relative offset will always be correct

// Validate that the function is hookable.

// Change memory protection to writable.

// Write a relative jump to the redirected function.

// Write the short jump to the function prefix.

// Restore previous memory protection.

// Check whether the first instruction is a relative jump.

// If needed, get memory space for a trampoline jump.

// Change memory protection to writable.

// Write a relative jump to the redirected function.

// Restore previous memory protection.

// Validate that the function is hot patchable.

// Put the needed instructions into the trampoline bytes.

// If needed, get memory space for indirect address.

// Change memory protection to writable.

// Write jumps to the redirected function.

// Restore previous memory protection.

// Find out the number of bytes of the instructions we need to copy

// to the trampoline.

// Put the needed instructions into the trampoline bytes.

// Check if the targeted address can be encoded in the function padding.

// Otherwise, allocate it in the trampoline region.

// Change memory protection to writable.

// Patch the original function.

// Restore previous memory protection.

// VS2010

// VS2012

// VS2013

// VS2015

// Universal CRT

// VS2010

// VS2012

// VS2013

// VS2015

// Universal CRT

// libc++

// libunwind

// NTDLL must go last as it gets special treatment in OverrideFunction.

// Utility for reading loaded PE images.

// namespace

// Internal implementation of GetProcAddress. At least since Windows 8,

// GetProcAddress appears to initialize DLLs before returning function pointers

// into them. This is problematic for the sanitizers, because they typically

// want to intercept malloc *before* MSVCRT initializes. Our internal

// implementation walks the export list manually without doing initialization.

// Check that the module header is full and present.

// "MZ"

// "PE\0\0"

// Handle forwarded functions.

// An entry for a forwarded function is a string with the following

// format: "<module> . <function_name>" that is stored into the

// exported directory.

// This is the last DLL, i.e. NTDLL. It exports some functions that

// we only want to override in the CRT.

// Check that the module header is full and present.

// "MZ"

// "PE\0\0"

// Iterate the list of imported DLLs. FirstThunk will be null for the last

// entry.

// We have two parallel arrays: the import address table (IAT) and the table

// of names. They start out containing the same data, but the loader rewrites

// the IAT to hold imported addresses and leaves the name table in

// OriginalFirstThunk alone.

// Now we have the correct IAT entry. Do the swap. We have to make the page

// read/write first.

// Not clear if this failure bothers us.

// namespace __interception

// SANITIZER_WINDOWS


=== system/lib/compiler-rt/lib/interception/interception_win.h ===
SHA256: fed68b843913519316189ecf9602f261a7faff8f3eb4b6a46af66bb21d763b6a
//===-- interception_linux.h ------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of AddressSanitizer, an address sanity checker.

//

// Windows-specific interception methods.

//===----------------------------------------------------------------------===//

// All the functions in the OverrideFunction() family return true on success,

// false on failure (including "couldn't find the function").

// Overrides a function by its address.

// Overrides a function in a system DLL or DLL CRT by its exported name.

// Windows-only replacement for GetProcAddress. Useful for some sanitizers.

// Overrides a function only when it is called from a specific DLL. For example,

// this is used to override calls to HeapAlloc/HeapFree from ucrtbase without

// affecting other third party libraries.

// Sets a callback to be used for reporting errors by interception_win. The

// callback will be called with printf-like arguments. Intended to be used with

// __sanitizer::Report. Pass nullptr to disable error reporting (default).

// Exposed for unittests

// Exposed for unittests

// Exposed for unittests

// Exposed for unittests

// namespace __interception

// INTERCEPTION_WIN_H

// SANITIZER_WINDOWS


=== system/lib/compiler-rt/lib/lsan/lsan.cpp ===
SHA256: ac2706ae5a64ce514099971f9d4c66a6791f2a02e93785be91e67d75f36f0317
//=-- lsan.cpp ------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer.

// Standalone LSan RTL.

//

//===----------------------------------------------------------------------===//

///// Interface to the common LSan module. /////

// namespace __lsan

// Set all the default values.

// getenv on emscripten uses malloc, which we can't when using LSan.

// You can't run external symbolizers anyway.

// Override from user-specified string.

// SANITIZER_EMSCRIPTEN

// SANITIZER_EMSCRIPTEN

// Emscripten does not have signals


=== system/lib/compiler-rt/lib/lsan/lsan.h ===
SHA256: d5496dff43a2adad0e4169648c67a04e32bf305be7509e4e7697134fc4f16692
//=-- lsan.h --------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer.

// Private header for standalone LSan RTL.

//

//===----------------------------------------------------------------------===//

// namespace __lsan


=== system/lib/compiler-rt/lib/lsan/lsan_allocator.cpp ===
SHA256: ae6b62fdd68e7bfbb3c2aeef727b2b18eae0232067958d4994ca855716c36b96
//=-- lsan_allocator.cpp --------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer.

// See lsan_allocator.h for details.

//

//===----------------------------------------------------------------------===//

// Do not rely on the allocator to clear the memory (it's slow).

// OOM error is already taken care of by Allocate.

// pvalloc(0) should allocate one page.

///// Interface to the common LSan module. /////

// LargeMmapAllocator considers pointers to the meta-region of a chunk to be

// valid, but we don't want that.

// namespace __lsan

// extern "C"


=== system/lib/compiler-rt/lib/lsan/lsan_allocator.h ===
SHA256: c6fb7cdba56e095ee9a36aff56dd076954ba424470ff1ca19e1dc0f4c6bae045
//=-- lsan_allocator.h ----------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer.

// Allocator for standalone LSan.

//

//===----------------------------------------------------------------------===//

// Must be first.

// See the comments in compiler-rt/lib/asan/asan_allocator.h for why these

// values were chosen.

// 8GB

/*kNumBits=*/

/*kMinSizeLog=*/

/*kMidSizeLog=*/

/*kMaxSizeLog=*/

/*kNumCachedHintT=*/

/*kMaxBytesCachedLog=*/

// 4T.

// 128G.

// 4T.

// 4T.

// Allocator64 parameters. Deliberately using a short name.

// namespace __lsan

// LSAN_ALLOCATOR_H


=== system/lib/compiler-rt/lib/lsan/lsan_common.cpp ===
SHA256: 9df3d05d619cc22dabd02a476ac5e44305aeea003d536a3d1c4adc176cc90436
//=-- lsan_common.cpp -----------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer.

// Implementation of common leak checking functionality.

//

//===----------------------------------------------------------------------===//

// https://github.com/apple-oss-distributions/objc4/blob/8701d5672d3fd3cd817aeb84db1077aafe1a1604/runtime/objc-runtime-new.h#L127

// This mutex is used to prevent races between DoLeakCheck and IgnoreObject, and

// also to protect the global list of root regions.

// For more details refer to the SANITIZER_SUPPRESS_LEAK_ON_PTHREAD_EXIT

// definition.

// SANITIZER_SUPPRESS_LEAK_ON_PTHREAD_EXIT

// For Darwin and os_log/os_trace: https://reviews.llvm.org/D35173

// TLS leak in some glibc versions, described in

// https://sourceware.org/bugzilla/show_bug.cgi?id=12650.

// NOLINT

// Suppress by module name.

// Suppress by file or function name.

// The top frame is our malloc/calloc/etc. The next frame is the caller.

// Several pointers in the Objective-C runtime (method cache and class_rw_t,

// for example) are tagged with additional bits we need to strip.

// On Linux, treats all chunks allocated from ld-linux.so as reachable, which

// covers dynamically allocated TLS blocks, internal dynamic loader's loaded

// modules accounting etc.

// Dynamic TLS blocks contain the TLS variables of dynamically loaded modules.

// They are allocated with a __libc_memalign() call in allocate_and_init()

// (elf/dl-tls.c). Glibc won't tell us the address ranges occupied by those

// blocks, but we can make sure they come from our own allocator by intercepting

// __libc_memalign(). On top of that, there is no easy way to reach them. Their

// addresses are stored in a dynamically allocated array (the DTV) which is

// referenced from the static TLS. Unfortunately, we can't just rely on the DTV

// being reachable from the static TLS, and the dynamic TLS being reachable from

// the DTV. This is because the initial DTV is allocated before our interception

// mechanism kicks in, and thus we don't recognize it as allocated memory. We

// can't special-case it either, since we don't know its size.

// Our solution is to include in the root set all allocations made from

// ld-linux.so (which is where allocate_and_init() is implemented). This is

// guaranteed to include all dynamic TLS blocks (and possibly other allocations

// which we don't care about).

// On all other platforms, this simply checks to ensure that the caller pc is

// valid before reporting chunks as leaked.

// caller_pr will always be 0 if we use malloc_context_size=0 (or 1) which

// we recommend under emscripten to save memory.  It seems that this setting

// now (inadvertently?) suppreses all leaks.

// See https://reviews.llvm.org/D115319#3526676.

// If caller_pc is unknown, this chunk may be allocated in a coroutine. Mark

// it as reachable, as we can't properly report its allocation stack anyway.

// Initialization which can fail or print warnings should only be done if

// LSan is actually enabled.

// Since our heap is located in mmap-ed memory, we can assume a sensible lower

// bound on heap addresses.

// TODO: support LAM48 and 5 level page tables.

// LAM_U57 mask format

//  * top byte: 0x81 because the format is: [0] [6-bit tag] [0]

//  * top-1 byte: 0xff because it should be 0

//  * top-2 byte: 0x80 because Linux uses 128 TB VMA ending at 0x7fffffffffff

// TBI (Top Byte Ignore) feature of AArch64: bits [63:56] are ignored in

// address translation and can be used to store a tag.

// Accept up to 48 bit VMA.

// Allow 47-bit user-space VMA at current.

// namespace

// Scans the memory range, looking for byte patterns that point into allocator

// chunks. Marks those chunks with |tag| and adds them to |frontier|.

// There are two usage modes for this function: finding reachable chunks

// (|tag| = kReachable) and finding indirectly leaked chunks

// (|tag| = kIndirectlyLeaked). In the second case, there's no flood fill,

// so |frontier| = 0.

// Emscripten in non-threaded mode stores thread_local variables in the

// same place as normal globals. This means allocator_cache must be skipped

// when scanning globals instead of when scanning thread-locals.

// NOLINT

// Pointers to self don't count. This matters when tag == kIndirectlyLeaked.

// Do this check relatively late so we can log only the interesting cases.

// Scans a global range for pointers

// Fuchsia handles all threads together with its own callback.

// FIXME: Move this out into *libcdep.cpp

// Mark as reachable and add to frontier.

// Scans thread data (stacks and TLS) for heap pointers.

// `extra_ranges` is outside of the function and the loop to reused mapped

// memory.

// If a thread can't be found in the thread registry, it's probably in the

// process of destruction. Log this event and move on.

// SP is outside the recorded stack range (e.g. the thread is running a

// signal handler on alternate stack, or swapcontext was used).

// Again, consider the entire stack range to be reachable.

// Shrink the stack range to ignore out-of-scope values.

// If the tls and cache ranges don't overlap, scan full tls range,

// otherwise, only scan the non-overlapping portions

/*dso_idd*/

// FIXME: There might be a race-condition here (and in Bionic) if the

// thread is suspended in the middle of updating its DTLS. IOWs, we

// could scan already freed memory. (probably fine for now)

// We are handling a thread with DTLS under destruction. Log about

// this and continue.

// If unable to get SP, consider the entire stack to be reachable unless

// GetRegistersAndSP failed with ESRCH.

// Add pointers reachable from ThreadContexts

// !SANITIZER_EMSCRIPTEN

// SANITIZER_FUCHSIA

// A map that contains [region_begin, region_end) pairs.

// Scans root regions for heap pointers.

/*cache_enabled*/

// SANITIZER_EMSCRIPTEN

// ForEachChunk callback. If the chunk is marked as leaked, marks all chunks

// which are reachable from it as indirectly leaked.

/* frontier */

// ForEachChunk callback. If chunk is marked as ignored, adds its address to

// frontier.

// Sets the appropriate tag on each chunk.

// The check here is relatively expensive, so we do this in a separate flood

// fill. That way we can skip the check for chunks that are reachable

// otherwise.

// Iterate over leaked chunks and mark those that are reachable from other

// leaked chunks.

// ForEachChunk callback. Resets the tags to pre-leak-check state.

// ForEachChunk callback. Aggregates information about unreachable chunks into

// a LeakReport.

// Fuchsia provides a libc interface that guarantees all threads are

// covered, and SuspendedThreadList is never really used.

// !(SANITIZER_FUCHSIA || SANITIZER_EMSCRIPTEN)

// !SANITIZER_FUCHSIA

// Will crash on return.

// Clean up for subsequent leak checks. This assumes we did not overwrite any

// kIgnored tags.

// Inside LockStuffAndStopTheWorld we can't run symbolizer, so we can't match

// suppressions. However if a stack id was previously suppressed, it should be

// suppressed in future checks as well.

// Capture calling thread's stack pointer early, to avoid false negatives.

// Old frame with dead pointers might be overlapped by new frame inside

// CheckForLeaks which does not use bytes with pointers before the

// threads are suspended and stack pointers captured.

// No new suppressions stacks, so rerun will not help and we can report.

// No indirect leaks to report, so we are done here.

// We found a new previously unseen suppressed call stack. Rerun to make

// sure it does not hold indirect leaks.

///// LeakReport implementation. /////

// A hard limit on the number of distinct leaks, to avoid quadratic complexity

// in LeakReport::AddLeakedChunk(). We don't expect to ever see this many leaks

// in real-world applications.

// FIXME: Get rid of this limit by moving logic into DedupLeaks.

/* hit_count */

/* is_suppressed */

// namespace __lsan

// CAN_SANITIZE_LEAKS

// namespace __lsan

// CAN_SANITIZE_LEAKS

// Cannot use PointsIntoChunk or LsanMetadata here, since the allocator is not

// locked.

// CAN_SANITIZE_LEAKS

// CAN_SANITIZE_LEAKS

// CAN_SANITIZE_LEAKS

// CAN_SANITIZE_LEAKS

// CAN_SANITIZE_LEAKS

// extern "C"


=== system/lib/compiler-rt/lib/lsan/lsan_common.h ===
SHA256: 7f7dff1259b2e8180fbcad25a5d87a6ac58dbd3f45912671b0e80154ed93a807
//=-- lsan_common.h -------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer.

// Private LSan header.

//

//===----------------------------------------------------------------------===//

// LeakSanitizer relies on some Glibc's internals (e.g. TLS machinery) on Linux.

// Also, LSan doesn't like 32 bit architectures

// because of "small" (4 bytes) pointer size that leads to high false negative

// ratio on large leaks. But we still want to have it for some 32 bit arches

// (e.g. x86), see https://github.com/google/sanitizers/issues/403.

// To enable LeakSanitizer on a new architecture, one needs to implement the

// internal_clone function as well as (probably) adjust the TLS machinery for

// the new architecture inside the sanitizer library.

// Exclude leak-detection on arm32 for Android because `__aeabi_read_tp`

// is missing. This caused a link error.

// This section defines function and class prototypes which must be implemented

// by the parent tool linking in LSan. There are implementations provided by the

// LSan library which will be linked in when LSan is used as a standalone tool.

// Chunk tags.

// default

//// --------------------------------------------------------------------------

//// Poisoning prototypes.

//// --------------------------------------------------------------------------

// Returns true if [addr, addr + sizeof(void *)) is poisoned.

//// --------------------------------------------------------------------------

//// Thread prototypes.

//// --------------------------------------------------------------------------

// Wrappers for ThreadRegistry access.

// If called from the main thread, updates the main thread's TID in the thread

// registry. We need this to handle processes that fork() without a subsequent

// exec(), which invalidates the recorded TID. To update it, we must call

// gettid() from the main thread. Our solution is to call this function before

// leak checking and also before every call to pthread_create() (to handle cases

// where leak checking is initiated from a non-main thread).

//// --------------------------------------------------------------------------

//// Allocator prototypes.

//// --------------------------------------------------------------------------

// Wrappers for allocator's ForceLock()/ForceUnlock().

// Lock/unlock global mutext.

// Returns the address range occupied by the global allocator object.

// If p points into a chunk that has been allocated to the user, returns its

// user-visible address. Otherwise, returns 0.

// Returns address of user-visible chunk contained in this allocator chunk.

// Returns user-visible address for chunk. If memory tagging is used this

// function will return the tagged address.

// Wrapper for chunk metadata operations.

// Constructor accepts address of user-visible chunk.

// Iterate over all existing chunks. Allocator must be locked.

// Helper for __lsan_ignore_object().

// The rest of the LSan interface which is implemented by library.

// Aggregates leaks by stack trace prefix.

// Platform-specific functions.

// LockStuffAndStopTheWorld can start to use Scan* calls to collect into

// this Frontier vector before the StopTheWorldCallback actually runs.

// This is used when the OS has a unified callback API for suspending

// threads and enumerating roots.

// Run stoptheworld while holding any platform-specific locks, as well as the

// allocator and thread registry locks.

// Functions called from the parent tool.

// Used to implement __lsan::ScopedDisabler.

// Can be used to ignore memory allocated by an intercepted

// function.

// According to Itanium C++ ABI array cookie is a one word containing

// size of allocated array.

// According to ARM C++ ABI array cookie consists of two words:

// struct array_cookie {

//   std::size_t element_size; // element_size != 0

//   std::size_t element_count;

// };

// Special case for "new T[0]" where T is a type with DTOR.

// new T[0] will allocate a cookie (one or two words) for the array size (0)

// and store a pointer to the end of allocated chunk. The actual cookie layout

// varies between platforms according to their C++ ABI implementation.

// Return the linker module, if valid for the platform.

// Return true if LSan has finished leak checking and reported leaks.

// Run platform-specific leak handlers.

// namespace __lsan

// extern "C"

// LSAN_COMMON_H


=== system/lib/compiler-rt/lib/lsan/lsan_common_emscripten.cpp ===
SHA256: 8de6a542a4b55c79b8e81bfce19c1cbfb133b0e1b5ff68c98d6275852e7a325e
//=-- lsan_common_emscripten.cc--------------------------------------------===//

//

//                     The LLVM Compiler Infrastructure

//

// This file is distributed under the University of Illinois Open Source

// License. See LICENSE.TXT for details.

//

//===----------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer.

// Implementation of common leak checking functionality.

// Emscripten-specific code.

//

//===----------------------------------------------------------------------===//

// Scans global variables for heap pointers.

// While calling Die() here is undefined behavior and can potentially

// cause race conditions, it isn't possible to intercept exit on Emscripten,

// so we have no choice but to call Die() from the atexit handler.

// Currently, on Emscripten this does nothing and just calls the callback.

// This works fine on a single-threaded environment.

// This is based on ProcessThreads in lsan_common.cc.

// We changed this to be a callback that gets called per thread by

// ThreadRegistry::RunCallbackForEachThreadLocked.

// We do not scan registers or DTLS since we do not have those.

// Finally, we can only obtain the stack pointer for the current thread,

// so we scan the full stack for other threads.

// We can't get the SP for other threads to narrow down the range, but we

// can for the current thread.

// SP is outside the recorded stack range (e.g. the thread is running a

// signal handler on alternate stack, or swapcontext was used).

// Again, consider the entire stack range to be reachable.

// Shrink the stack range to ignore out-of-scope values.

// If the tls and cache ranges don't overlap, scan full tls range,

// otherwise, only scan the non-overlapping portions

// namespace __lsan

// CAN_SANITIZE_LEAKS && SANITIZER_EMSCRIPTEN


=== system/lib/compiler-rt/lib/lsan/lsan_common_fuchsia.cpp ===
SHA256: 46fd5cbaacf91a2e74581bd45721ad2ac04d6d1acd00a9ce88154979a4a1c2d5
//=-- lsan_common_fuchsia.cpp --------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer.

// Implementation of common leak checking functionality. Fuchsia-specific code.

//

//===---------------------------------------------------------------------===//

// Ensure that the Zircon system ABI is linked in.

// There is nothing left to do after the globals callbacks.

// Nothing to do here.

// On Fuchsia, we can intercept _Exit gracefully, and return a failing exit

// code if required at that point.  Calling Die() here is undefined

// behavior and causes rare race conditions.

// This is defined differently in asan_fuchsia.cpp and lsan_fuchsia.cpp.

// Callback from libc for globals (data/bss modulo relro), when enabled.

// Callback from libc for thread stacks.

// Callback from libc for thread registers.

// Collect the allocator cache range from each thread so these

// can all be excluded from the reported TLS ranges.

// Callback from libc for TLS regions.  This includes thread_local

// variables as well as C11 tss_set and POSIX pthread_setspecific.

// Split the range in two and omit the allocator cache within.

// This stops the world and then makes callbacks for various memory regions.

// The final callback is the last thing before the world starts up again.

// We don't use the thread registry at all for enumerating the threads

// and their stacks, registers, and TLS regions.  So use it separately

// just for the allocator cache, and to call ScanExtraStackRanges,

// which ASan needs.

// namespace __lsan

// This is declared (in extern "C") by <zircon/sanitizer.h>.

// _Exit calls this directly to intercept and change the status value.


=== system/lib/compiler-rt/lib/lsan/lsan_common_linux.cpp ===
SHA256: 12334ac56093648896afa8f1429c805d8b7b79ce8663db1da01395f1a7041330
//=-- lsan_common_linux.cpp -----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer.

// Implementation of common leak checking functionality. Linux/NetBSD-specific

// code.

//

//===----------------------------------------------------------------------===//

// SANITIZER_USE_GETAUXVAL

// We're looking for .data and .bss sections, which reside in writeable,

// loadable segments.

// Scans global variables for heap pointers.

// While calling Die() here is undefined behavior and can potentially

// cause race conditions, it isn't possible to intercept exit on linux,

// so we have no choice but to call Die() from the atexit handler.

// LSan calls dl_iterate_phdr() from the tracer task. This may deadlock: if one

// of the threads is frozen while holding the libdl lock, the tracer will hang

// in dl_iterate_phdr() forever.

// Luckily, (a) the lock is reentrant and (b) libc can't distinguish between the

// tracer task and the thread that spawned it. Thus, if we run the tracer task

// while holding the libdl lock in the parent thread, we can safely reenter it

// in the tracer. The solution is to run stoptheworld from a dl_iterate_phdr()

// callback in the parent thread.

// namespace __lsan


=== system/lib/compiler-rt/lib/lsan/lsan_common_mac.cpp ===
SHA256: 09b086853e9cb29b552c2f0c5b54e465bd46b8e960b0786588cf0509746b0997
//=-- lsan_common_mac.cpp -------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer.

// Implementation of common leak checking functionality. Darwin-specific code.

//

//===----------------------------------------------------------------------===//

// The main thread destructor requires the current thread,

// so we can't destroy it until it's been used and reset.

// Required on Linux for initialization of TLS behavior, but should not be

// required on Darwin.

// Sections which can't contain contain global pointers. This list errs on the

// side of caution to avoid false positives, at the expense of performance.

//

// Other potentially safe sections include:

// __all_image_info, __crash_info, __const, __got, __interpose, __objc_msg_break

//

// Sections which definitely cannot be included here are:

// __objc_data, __objc_const, __data, __bss, __common, __thread_data,

// __thread_bss, __thread_vars, __objc_opt_rw, __objc_opt_ptrs

// Scans global variables for heap pointers.

// Even when global scanning is disabled, we still need to scan

// system libraries for stashed pointers

// Sections storing global variables are writable and non-executable

// libxpc stashes some pointers in the Kernel Alloc Once page,

// make sure not to report those as leaks.

// Objective-C block trampolines use the Foundation region.

// Dispatch continuations use the libdispatch region. Empirically, there

// can be more than one region with this tag, so we'll optimistically

// assume that they're continguous. Otherwise, we would need to scan every

// region to ensure we find them all.

// Recursing over the full memory map is very slow, break out

// early if we don't need the full iteration.

// This additional root region scan is required on Darwin in order to

// detect root regions contained within mmap'd memory regions, because

// the Darwin implementation of sanitizer_procmaps traverses images

// as loaded by dyld, and not the complete set of all memory regions.

//

// TODO(fjricci) - remove this once sanitizer_procmaps_mac has the same

// behavior as sanitizer_procmaps_linux and traverses all memory regions

// On darwin, we can intercept _exit gracefully, and return a failing exit code

// if required at that point. Calling Die() here is undefined behavior and

// causes rare race conditions.

// namespace __lsan

// CAN_SANITIZE_LEAKS && SANITIZER_APPLE


=== system/lib/compiler-rt/lib/lsan/lsan_flags.inc ===
SHA256: 1c12b9dd36a3b6c926456a44e0303cb203172400240a32fe0fa391178b254713
//===-- lsan_flags.inc ------------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// LSan runtime flags.

//

//===----------------------------------------------------------------------===//

// LSAN_FLAG(Type, Name, DefaultValue, Description)

// See COMMON_FLAG in sanitizer_flags.inc for more details.

// Flags controlling the root set of reachable memory.


=== system/lib/compiler-rt/lib/lsan/lsan_fuchsia.cpp ===
SHA256: 50422e59ca2608a857b3f0b28a9152dca1e557fbafab8563f2e4c7b1908c8908
//=-- lsan_fuchsia.cpp ---------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer.

// Standalone LSan RTL code specific to Fuchsia.

//

//===---------------------------------------------------------------------===//

// LSan doesn't need to do anything else special in the startup hook.

// namespace __sanitizer

// On Fuchsia, the stack bounds of a new thread are available before

// the thread itself has started running.

// Stack bounds passed through from __sanitizer_before_thread_create_hook

// or InitializeMainThread.

// On Fuchsia, leak detection is done by a special hook after atexit hooks.

// So this doesn't install any atexit hook like on other platforms.

// ASan defines this to check its `halt_on_error` flag.

// namespace __lsan

// These are declared (in extern "C") by <zircon/sanitizer.h>.

// The system runtime will call our definitions directly.

// This is called before each thread creation is attempted.  So, in

// its first call, the calling thread is the initial and sole thread.

// This is called after creating a new thread (in the creating thread),

// with the pointer returned by __sanitizer_before_thread_create_hook (above).

// On success, there is nothing to do here.

// Clean up the thread registry for the thread creation that didn't happen.

// This is called in the newly-created thread before it runs anything else,

// with the pointer returned by __sanitizer_before_thread_create_hook (above).

// Each thread runs this just before it exits,

// with the pointer returned by BeforeThreadCreateHook (above).

// All per-thread destructors have already been called.

// SANITIZER_FUCHSIA


=== system/lib/compiler-rt/lib/lsan/lsan_fuchsia.h ===
SHA256: 9b148612af3224829436a9811494244263063f4c6eb1535736e6c47e20d868bb
//=-- lsan_fuchsia.h ---------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer.

// Standalone LSan RTL code specific to Fuchsia.

//

//===---------------------------------------------------------------------===//

// namespace __lsan

// LSAN_FUCHSIA_H


=== system/lib/compiler-rt/lib/lsan/lsan_interceptors.cpp ===
SHA256: 9a2bb92b57a7be068e2f6a016f487509349d84f542f461a4bd7aba999a7ab697
//=-- lsan_interceptors.cpp -----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer.

// Interceptors for standalone LSan.

//

//===----------------------------------------------------------------------===//

// Suppress leaks from dlerror(). Previously dlsym hack on global array was

// used by leak sanitizer as a root region.

///// Malloc/free interceptors. /////

// !SANITIZER_APPLE

// SANITIZER_INTERCEPT_MEMALIGN

// SANITIZER_INTERCEPT___LIBC_MEMALIGN

// SANITIZER_INTERCEPT_MALLOPT_AND_MALLINFO

// SANITIZER_INTERCEPT_PVALLOC

// SANITIZER_INTERCEPT_CFREE

// SANITIZER_INTERCEPT_MCHECK_MPROBE

// TODO(alekseys): throw std::bad_alloc instead of dying on OOM.

// On OS X it's not enough to just provide our own 'operator new' and

// 'operator delete' implementations, because they're going to be in the runtime

// dylib, and the main executable will depend on both the runtime dylib and

// libstdc++, each of has its implementation of new and delete.

// To make sure that C++ allocation/deallocation operators are overridden on

// OS X we need to intercept them using their mangled names.

/*nothrow*/

/*nothrow*/

/*nothrow*/

/*nothrow*/

/*nothrow*/

/*nothrow*/

/*nothrow*/

/*nothrow*/

// SANITIZER_APPLE

/*nothrow*/

/*nothrow*/

/*nothrow*/

/*nothrow*/

// !SANITIZER_APPLE

///// Thread initialization and finalization. /////

// REAL(pthread_atfork) cannot be called due to symbol indirections at least

// on NetBSD

// Wait until the last iteration to maximize the chance that we are the last

// destructor to run.

// In Emscripten sanitizer, attr can be nonzero but __ATTRP_C11_THREAD in case

// of C11 threads, in which case we need to run pthread_attr_init as well, so

// we treat __ATTRP_C11_THREAD like the nullptr in this function.

// Ignore all allocations made by pthread_create: thread stack/TLS may be

// stored by pthread for future reuse even after thread destruction, and

// the linked list it's stored in doesn't even hold valid pointers to the

// objects, the latter are calculated by obscure pointer arithmetic.

// SANITIZER_INTERCEPT_TRYJOIN

// SANITIZER_INTERCEPT_TIMEDJOIN

// Fuchsia doesn't use interceptors that require any setup.

// !SANITIZER_EMSCRIPTEN

// !SANITIZER_FUCHSIA

// namespace __lsan

// SANITIZER_EMSCRIPTEN


=== system/lib/compiler-rt/lib/lsan/lsan_linux.cpp ===
SHA256: 2637d631645dfbdaead435aa07988d615be4a30ebde7eefb86477f84ffd16504
//=-- lsan_linux.cpp ------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer. Linux/NetBSD/Fuchsia-specific code.

//

//===----------------------------------------------------------------------===//

// namespace __lsan

// SANITIZER_LINUX || SANITIZER_NETBSD || SANITIZER_FUCHSIA || SANITIZER_EMSCRIPTEN


=== system/lib/compiler-rt/lib/lsan/lsan_mac.cpp ===
SHA256: 83a8932d534e52d1cb0338d93c0e5f344b140e06cca8799d6de0813966f0c4b7
//===-- lsan_mac.cpp ------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer, a memory leak checker.

//

// Mac-specific details.

//===----------------------------------------------------------------------===//

// Support for the following functions from libdispatch on Mac OS:

//   dispatch_async_f()

//   dispatch_async()

//   dispatch_sync_f()

//   dispatch_sync()

//   dispatch_after_f()

//   dispatch_after()

//   dispatch_group_async_f()

//   dispatch_group_async()

// TODO(glider): libdispatch API contains other functions that we don't support

// yet.

//

// dispatch_sync() and dispatch_sync_f() are synchronous, although chances are

// they can cause jobs to run on a thread different from the current one.

// TODO(glider): if so, we need a test for this (otherwise we should remove

// them).

//

// The following functions use dispatch_barrier_async_f() (which isn't a library

// function but is exported) and are thus supported:

//   dispatch_source_set_cancel_handler_f()

//   dispatch_source_set_cancel_handler()

//   dispatch_source_set_event_handler_f()

//   dispatch_source_set_event_handler()

//

// The reference manual for Grand Central Dispatch is available at

//   http://developer.apple.com/library/mac/#documentation/Performance/Reference/GCD_libdispatch_Ref/Reference/reference.html

// The implementation details are at

//   http://libdispatch.macosforge.org/trac/browser/trunk/src/queue.c

// A wrapper for the ObjC blocks used to support libdispatch.

// For use by only those functions that allocated the context via

// alloc_lsan_context().

// Call the original dispatcher for the block.

// namespace __lsan

// Wrap |ctxt| and |func| into an lsan_block_context_t.

// The caller retains control of the allocated context.

// Define interceptor for dispatch_*_f function with the three most common

// parameters: dispatch_queue_t, context, dispatch_function_t.

// SANITIZER_APPLE


=== system/lib/compiler-rt/lib/lsan/lsan_malloc_mac.cpp ===
SHA256: 2ad65fa446af438c0af44ce0b469d7e1ec9c72e90f626f9f94269bbf3eb7b3c5
//===-- lsan_malloc_mac.cpp -----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer (LSan), a memory leak detector.

//

// Mac-specific malloc interception.

//===----------------------------------------------------------------------===//

// SANITIZER_APPLE


=== system/lib/compiler-rt/lib/lsan/lsan_posix.cpp ===
SHA256: 573dfdabc386649c6489f22ecba9763f75e6a65cbcce972e1aeefb4ed1ac052b
//=-- lsan_posix.cpp -----------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer.

// Standalone LSan RTL code common to POSIX-like systems.

//

//===---------------------------------------------------------------------===//

// FIXME: Implement FutexWait.

/* fork_child= */

/* fork_child= */

// namespace __lsan

// SANITIZER_POSIX


=== system/lib/compiler-rt/lib/lsan/lsan_posix.h ===
SHA256: 13e50199c1aa398579b223ffee528df451ac0db147988df4b7c98902c6bf6a5a
//=-- lsan_posix.h -----------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer.

// Standalone LSan RTL code common to POSIX-like systems.

//

//===---------------------------------------------------------------------===//

// namespace __lsan

// LSAN_POSIX_H


=== system/lib/compiler-rt/lib/lsan/lsan_preinit.cpp ===
SHA256: 77d76ace80d502f86d77a69bc782cb48d841f4dda782e318b0a9546a121833b6
//===-- lsan_preinit.cpp --------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer.

//

// Call __lsan_init at the very early stage of process startup.

//===----------------------------------------------------------------------===//

// This section is linked into the main executable when -fsanitize=leak is

// specified to perform initialization at a very early stage.


=== system/lib/compiler-rt/lib/lsan/lsan_thread.cpp ===
SHA256: 09d82777387fd075c8fc2f713618896f065eb78d51ceea0638c923978733dd77
//=-- lsan_thread.cpp -----------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer.

// See lsan_thread.h for details.

//

//===----------------------------------------------------------------------===//

///// Interface to the common LSan module. /////

// namespace __lsan

// namespace __sanitizer


=== system/lib/compiler-rt/lib/lsan/lsan_thread.h ===
SHA256: b2aad4ceee0283f1223d08047834b2cd9053cafa0b3e3caa3eb2d110d5a8714f
//=-- lsan_thread.h -------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of LeakSanitizer.

// Thread registry for standalone LSan.

//

//===----------------------------------------------------------------------===//

// The argument is passed on to the subclass's OnStarted member function.

// This subclass of ThreadContextLsanBase is declared in an OS-specific header.

// namespace __lsan

// LSAN_THREAD_H


=== system/lib/compiler-rt/lib/profile/GCDAProfiling.c ===
SHA256: 90b8914f8184faf331debcf91aadc7026088541c249271af4a67835ad05e235d
/*===- GCDAProfiling.c - Support library for GCDA file emission -----------===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
|*===----------------------------------------------------------------------===*|
|*
|* This file implements the call back routines for the gcov profiling
|* instrumentation pass. Link against this library when running code through
|* the -insert-gcov-profiling LLVM pass.
|*
|* We emit files in a corrupt version of GCOV's "gcda" file format. These files
|* are only close enough that LCOV will happily parse them. Anything that lcov
|* ignores is missing.
|*
|* TODO: gcov is multi-process safe by having each exit open the existing file
|* and append to it. We'd like to achieve that and be thread-safe too.
|*
\*===----------------------------------------------------------------------===*/

/* #define DEBUG_GCDAPROFILING */

// "gcda"

// GCOV_TAG_OBJECT_SUMMARY superseded GCOV_TAG_PROGRAM_SUMMARY in GCC 9.

/*
 * --- GCOV file format I/O primitives ---
 */

/*
 * The current file name we're outputting. Used primarily for error logging.
 */

/*
 * The current file we're outputting.
 */

/*
 * Buffer that we write things into.
 */

// The address of this variable identifies a given dynamic object.

/*
 * A list of functions to write out the data, shared between all dynamic objects.
 */

/*
 *  A list of reset functions, shared between all dynamic objects.
 */

// GCOV uses a lo-/hi-word format even on big-endian systems.

// See also GCOVBuffer::readInt64 in LLVM.

// GCOV uses a lo-/hi-word format even on big-endian systems.

// See also GCOVBuffer::readInt64 in LLVM.

/* A size of 0 means the file has been created just now (possibly by another
   * process in lock-after-open race condition). No need to mmap. */

/*
 * --- LLVM line counter API ---
 */

/* A file in this case is a translation unit. Each .o file built with line
 * profiling enabled will emit to a different file. Only one file may be
 * started at a time.
 */

/* Try just opening the file. */

/* Try creating the file. */

/* Try creating the directories first then opening the file. */

/* Another process may have created the file just now.
         * Try opening it without O_CREAT and O_EXCL. */

/* Bah! It's hopeless. */

/* Try to flock the file to serialize concurrent processes writing out to the
   * same GCDA. This can fail if the filesystem doesn't support it, but in that
   * case we'll just carry on with the old racy behaviour and hope for the best.
   */

/* Initialize the write buffer. */

/* The file has been created just now (file_size == 0) or mmap failed
     * unexpectedly. In the latter case, try to recover by clobbering. */

/* gcda file, version, stamp checksum. */

/* function tag */

/* There are counters present in the file. Merge them. */

/* Counter #1 (arcs) tag */

// We only want to increase the run count once.

/* There are counters present in the file. Merge them. */

/* length */

/* Add previous run count to new counter, if not already counted before. */

// sum_max

// Before gcov 4.8 (r190952), GCOV_TAG_SUMMARY_LENGTH was 9. r190952 set

// GCOV_TAG_SUMMARY_LENGTH to 22. We simply use the smallest length which

// can make gcov read "Runs:".

/* Write out EOF record. */

// __attribute__((destructor)) and destructors whose priorities are greater than

// 100 run before this function and can thus be tracked. The priority is

// compatible with GCC 7 onwards.

// The pid changed so we've a fork (one could have its own fork function)

// Just reset the counters for this child process

// threads.

/* Make sure we write out the data and delete the data structures. */


=== system/lib/compiler-rt/lib/profile/InstrProfiling.c ===
SHA256: 75f4245ca62a00fe23367213263692d9b869cea0ac4cdfd85eeeb9946a591c29
/*===- InstrProfiling.c - Support library for PGO instrumentation ---------===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

// Note: This is linked into the Darwin kernel, and must remain compatible

// with freestanding compilation. See `darwin_add_builtin_libraries`.

/* Return the number of bytes needed to add to SizeInBytes to make it
 *   the result a multiple of 8.
 */


=== system/lib/compiler-rt/lib/profile/InstrProfiling.h ===
SHA256: 5460896fc7913788cd9df234a727194ee9132e9f78b5c17cb93fe58450ecec55
/*===- InstrProfiling.h- Support library for PGO instrumentation ----------===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

// Make sure __LLVM_INSTR_PROFILE_GENERATE is always defined before

// including instr_prof_interface.h so the interface functions are

// declared correctly for the runtime.

// __LLVM_INSTR_PROFILE_GENERATE is always `#undef`ed after the header,

// because compiler-rt does not support profiling the profiling runtime itself.

/*!
 * \brief Return 1 if profile counters are continuously synced to the raw
 * profile via an mmap(). This is in contrast to the default mode, in which
 * the raw profile is written out at program exit time.
 */

/*!
 * \brief Enable continuous mode.
 *
 * See \ref __llvm_profile_is_continuous_mode_enabled. The behavior is undefined
 * if continuous mode is already enabled, or if it cannot be enable due to
 * conflicting options.
 */

/*!
 * \brief Disable continuous mode.
 *
 */

/*!
 * \brief Set the page size.
 *
 * This is a pre-requisite for enabling continuous mode. The buffer size
 * calculation code inside of libprofile cannot simply call getpagesize(), as
 * it is not allowed to depend on libc.
 */

/*!
 * \brief Get number of bytes necessary to pad the argument to eight
 * byte boundary.
 */

/*!
 * \brief Get required size for profile buffer.
 */

/*!
 * \brief Write instrumentation data to the given buffer.
 *
 * \pre \c Buffer is the start of a buffer at least as big as \a
 * __llvm_profile_get_size_for_buffer().
 */

/*!
 * \brief Merge profile data from buffer.
 *
 * Read profile data from buffer \p Profile and merge with in-process profile
 * counters and bitmaps. The client is expected to have checked or already
 * know the profile data in the buffer matches the in-process counter
 * structure before calling it. Returns 0 (success) if the profile data is
 * valid. Upon reading invalid/corrupted profile data, returns 1 (failure).
 */

/*! \brief Check if profile in buffer matches the current binary.
 *
 *  Returns 0 (success) if the profile data in buffer \p Profile with size
 *  \p Size was generated by the same binary and therefore matches
 *  structurally the in-process counters and bitmaps. If the profile data in
 *  buffer is not compatible, the interface returns 1 (failure).
 */

/*!
 * \brief Counts the number of times a target value is seen.
 *
 * Records the target value for the CounterIndex if not seen before. Otherwise,
 * increments the counter associated w/ the target value.
 * void __llvm_profile_instrument_target(uint64_t TargetValue, void *Data,
 *                                       uint32_t CounterIndex);
 */

/*!
 * \brief Write instrumentation data to the current file.
 *
 * Writes to the file with the last name given to \a *
 * __llvm_profile_set_filename(),
 * or if it hasn't been called, the \c LLVM_PROFILE_FILE environment variable,
 * or if that's not set, the last name set to INSTR_PROF_PROFILE_NAME_VAR,
 * or if that's not set,  \c "default.profraw".
 */

/*!
 * \brief Set the FILE object for writing instrumentation data. Return 0 if set
 * successfully or return 1 if failed.
 *
 * Sets the FILE object to be used for subsequent calls to
 * \a __llvm_profile_write_file(). The profile file name set by environment
 * variable, command-line option, or calls to \a  __llvm_profile_set_filename
 * will be ignored.
 *
 * \c File will not be closed after a call to \a __llvm_profile_write_file() but
 * it may be flushed. Passing NULL restores default behavior.
 *
 * If \c EnableMerge is nonzero, the runtime will always merge profiling data
 * with the contents of the profiling file. If EnableMerge is zero, the runtime
 * may still merge the data if it would have merged for another reason (for
 * example, because of a %m specifier in the file name).
 *
 * Note: There may be multiple copies of the profile runtime (one for each
 * instrumented image/DSO). This API only modifies the file object within the
 * copy of the runtime available to the calling image.
 *
 * Warning: This is a no-op if EnableMerge is 0 in continuous mode (\ref
 * __llvm_profile_is_continuous_mode_enabled), because disable merging requires
 * copying the old profile file to new profile file and this function is usually
 * used when the proess doesn't have permission to open file.
 */

/*! \brief Register to write instrumentation data to file at exit. */

/*! \brief Initialize file handling. */

/*! \brief Initialize the profile runtime. */

/*! \brief Initialize the gcov profile runtime. */

/*!
 * \brief Return path prefix (excluding the base filename) of the profile data.
 * This is useful for users using \c -fprofile-generate=./path_prefix who do
 * not care about the default raw profile name. It is also useful to collect
 * more than more profile data files dumped in the same directory (Online
 * merge mode is turned on for instrumented programs with shared libs).
 * Side-effect: this API call will invoke malloc with dynamic memory allocation.
 */

/*!
 * \brief Return filename (including path) of the profile data. Note that if the
 * user calls __llvm_profile_set_filename later after invoking this interface,
 * the actual file name may differ from what is returned here.
 * Side-effect: this API call will invoke malloc with dynamic memory allocation
 * (the returned pointer must be passed to `free` to avoid a leak).
 *
 * Note: There may be multiple copies of the profile runtime (one for each
 * instrumented image/DSO). This API only retrieves the filename from the copy
 * of the runtime available to the calling image.
 */

/*! \brief Get the magic token for the file format. */

/*! \brief Get the version of the file format. */

/*! \brief Get the number of entries in the profile data section. */

/*! \brief Get the size of the profile data section in bytes. */

/*! \brief Get the size in bytes of a single counter entry. */

/*! \brief Get the number of entries in the profile counters section. */

/*! \brief Get the size of the profile counters section in bytes. */

/*! \brief Get the number of bytes in the profile bitmap section. */

/*! \brief Get the size of the profile name section in bytes. */

/*! \brief Get the number of virtual table profile data entries */

/*! \brief Get the size of virtual table profile data in bytes. */

/* ! \brief Given the sizes of the data and counter information, computes the
 * number of padding bytes before and after the counter section, as well as the
 * number of padding bytes after other sections in the raw profile.
 * Returns -1 upon errors and 0 upon success. Output parameters should be used
 * iff return value is 0.
 *
 * Note: When mmap() mode is disabled, no padding bytes before/after counters
 * are needed. However, in mmap() mode, the counter section in the raw profile
 * must be page-aligned: this API computes the number of padding bytes
 * needed to achieve that.
 */

/*!
 * \brief Set the flag that profile data has been dumped to the file.
 * This is useful for users to disable dumping profile data to the file for
 * certain processes in case the processes don't have permission to write to
 * the disks, and trying to do so would result in side effects such as crashes.
 */

/*!
 * \brief Write custom target-specific profiling data to a separate file.
 * Used by offload PGO.
 */

/*!
 * This variable is defined in InstrProfilingRuntime.cpp as a hidden
 * symbol. Its main purpose is to enable profile runtime user to
 * bypass runtime initialization code -- if the client code explicitly
 * define this variable, then InstProfileRuntime.o won't be linked in.
 * Note that this variable's visibility needs to be hidden so that the
 * definition of this variable in an instrumented shared library won't
 * affect runtime initialization decision of the main program.
 *  __llvm_profile_profile_runtime. */

/*!
 * This variable is defined in InstrProfilingVersionVar.c as a hidden symbol
 * (except on Apple platforms where this symbol is checked by TAPI).  Its main
 * purpose is to encode the raw profile version value and other format related
 * information such as whether the profile is from IR based instrumentation. The
 * variable is defined as weak so that compiler can emit an overriding
 * definition depending on user option.
 */

/* __llvm_profile_raw_version */

/*!
 * This variable is a weak symbol defined in InstrProfiling.c. It allows
 * compiler instrumentation to provide overriding definition with value
 * from compiler command line. This variable has default visibility.
 */

/* __llvm_profile_filename. */

/* PROFILE_INSTRPROFILING_H_ */


=== system/lib/compiler-rt/lib/profile/InstrProfilingBuffer.c ===
SHA256: 2cd53d0ad1267ac5710638256fae583039101fac5b09947bf0a0a3c69a8e860d
/*===- InstrProfilingBuffer.c - Write instrumentation to a memory buffer --===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

// Note: This is linked into the Darwin kernel, and must remain compatible

// with freestanding compilation. See `darwin_add_builtin_libraries`.

/* When continuous mode is enabled (%c), this parameter is set to 1.
 *
 * This parameter is defined here in InstrProfilingBuffer.o, instead of in
 * InstrProfilingFile.o, to sequester all libc-dependent code in
 * InstrProfilingFile.o. The test `instrprof-without-libc` will break if this
 * layering is violated. */

/* The system page size. Only valid when non-zero. If 0, the page size is
 * unavailable. */

// NOTE: Caller should guarantee that `Begin` and `End` specifies a half-open

// interval [Begin, End). Namely, `End` is one-byte past the end of the array.

// Counts the number of `VTableProfData` elements within the range of [Begin,

// End). Caller should guarantee that End points to one byte past the inclusive

// range.

// FIXME: Add a compiler-rt test to make sure the number of vtables in the

// raw profile is the same as the number of vtable elements in the instrumented

// binary.

// Convert pointers to intptr_t to use integer arithmetic.

/// Calculate the number of padding bytes needed to add to \p Offset in order

/// for (\p Offset + Padding) to be page-aligned.

// Counter padding is needed only if continuous mode is enabled.

// Value profiling not supported in continuous mode at profile-write time.

// Return -1 to alert the incompatibility.

// In continuous mode, the file offsets for headers and for the start of

// counter sections need to be page-aligned.

// Set these two variables to zero to avoid uninitialized variables

// even if VTableSize and VNameSize are known to be zero.

/* Match logic in __llvm_profile_write_buffer(). */

/* Determine how much padding is needed before/after the counters and after
   * the names. */

/* VTableSize */

/* VNameSize */

// Set virtual table arguments to NULL since they are not supported yet.

/*VPDataReader=*/

/*VTableBegin=*/

/*VTableEnd=*/

/*VNamesBegin=*/

/*VNamesEnd=*/

/*SkipNameDataWrite=*/


=== system/lib/compiler-rt/lib/profile/InstrProfilingFile.c ===
SHA256: 174fe3ad6a4dddd16d214c39bde59bd65d042e54f71774e7018e5abf8980e0c0
/*===- InstrProfilingFile.c - Write instrumentation to a file -------------===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

/* For _alloca. */

/* For _chsize_s */

/* From where is profile name specified.
 * The order the enumerators define their
 * precedence. Re-order them may lead to
 * runtime behavior change. */

/* Data structure holding the result of parsed filename pattern. */

/* File name string possibly with %p or %h specifiers. */

/* A flag indicating if FilenamePat's memory is allocated
   * by runtime. */

/* When in-process merging is enabled, this parameter specifies
   * the total number of profile data files shared by all the processes
   * spawned from the same binary. By default the value is 1. If merging
   * is not enabled, its value should be 0. This parameter is specified
   * by the %[0-9]m specifier. For instance %2m enables merging using
   * 2 profile data files. %1m is equivalent to %m. Also %m specifier
   * can only appear once at the end of the name pattern. */

/* Get the sizes of various profile data sections. Taken from
   * __llvm_profile_get_size_for_buffer(). */

/* Check that the counter, bitmap, and data sections in this image are
   * page-aligned. */

/* Determine how much padding is needed before/after the counters and
   * after the names. */

/*VTableSize=*/

/*VNameSize=*/

/* Also mmap MCDC bitmap bytes. If there aren't any bitmap bytes, mmap()
   * will fail with EINVAL. */

/* This variable is a weak external reference which could be used to detect
 * whether or not the compiler defined this symbol. */

/* TODO: If there are two DSOs, the second DSO initialization will truncate the
 * first profile file. */

/* This symbol is defined by the compiler when runtime counter relocation is
 * used and runtime provides a weak alias so we can check if it's defined. */

/* Get the sizes of various profile data sections. Taken from
   * __llvm_profile_get_size_for_buffer(). */

/* Get the file size. */

/* Map the profile. */

/* Update the profile fields based on the current mapping. */

/* Return the memory allocated for counters to OS. */

/* Also mmap MCDC bitmap bytes. If there aren't any bitmap bytes, mmap()
   * will fail with EINVAL. */

/* Update profbm_bias. */

/* Update the profile fields based on the current mapping. */

/* Return the memory allocated for counters to OS. */

/* Return 1 if there is an error, otherwise return  0.  */

/* Get the size of the profile file. If there are any errors, print the
 * message under the assumption that the profile is being read for merging
 * purposes, and return -1. Otherwise return the file size in the inout param
 * \p ProfileFileSize. */

/* Restore file offset.  */

/* mmap() \p ProfileFile for profile merging purposes, assuming that an
 * exclusive lock is held on the file and that \p ProfileFileSize is the
 * length of the file. Return the mmap'd buffer in the inout variable
 * \p ProfileBuffer. Returns -1 on failure. On success, the caller is
 * responsible for unmapping the mmap'd buffer in \p ProfileBuffer. */

/* Read profile data in \c ProfileFile and merge with in-memory
   profile counters. Returns -1 if there is fatal error, otherwise
   0 is returned. Returning 0 does not mean merge is actually
   performed. If merge is actually done, *MergeDone is set to 1.
*/

/* Get the size of the profile on disk. */

/* Nothing to merge.  */

/* mmap() the profile and check that it is compatible with the data in
   * the current image. */

/* Now start merging */

// Truncate the file in case merging of value profile did not happen to

// prevent from leaving garbage data at the end of the profile file.

/* Create the directory holding the file, if needed. */

/* Open the profile data for merging. It opens the file in r+b mode with
 * file locking.  If the file has content which is compatible with the
 * current process, it also reads in the profile data in the file and merge
 * it with in-memory counters. After the profile data is merged in memory,
 * the original profile data is truncated and gets ready for the profile
 * dumper. With profile merging enabled, each executable as well as any of
 * its instrumented shared libraries dump profile data into their own data file.
 */

// initializeProfileForContinuousMode will lock the profile, but if

// ProfileFile is set by user via __llvm_profile_set_file_object, it's assumed

// unlocked at this point.

/* Write profile data to file \c OutputName.  */

/* Only create the profile directory and truncate an existing profile once.
   * In continuous mode, this is necessary, as the profile is written-to by the
   * runtime initializer. */

/* Create the profile dir (even if online merging is enabled), so that
   * the profile file can be set up if continuous mode is enabled. */

/* By pass file truncation to allow online raw profile merging. */

/* Truncate the file.  Later we'll reopen and append. */

/* Write a partial profile to \p Filename, which is required to be backed by
 * the open file object \p File. */

/* Get the sizes of counter section. */

/* We are merging profiles. Map the counter section as shared memory into
     * the profile, i.e. into each participating process. An increment in one
     * process should be visible to every other process with the same counter
     * section mapped. */

/* Grow the profile so that mmap() can succeed.  Leak the file handle, as
       * the file should stay open. */

/* The merged profile has a non-zero length. Check that it is compatible
       * with the data in this process. */

/* Check that the offset within the file is page-aligned. */

/* mmap() the profile counters so long as there is at least one counter.
   * If there aren't any counters, mmap() would fail with EINVAL. */

/* If FilenamePat[*I+J] is between '0' and '9', the next byte is guaranteed
     * to be in-bound as the string is null terminated. */

/* Assert that Idx does index past a string null terminator. Return the
 * result of the check. */

/* Parses the pattern string \p FilenamePat and stores the result to
 * lprofcurFilename structure. */

/* Clean up cached prefix and filename.  */

/* Check the filename for "%p", which indicates a pid-substitution. */

/* Advance to the next character. */

/* Check if binary ID does not exist or if its size is 0. */

/* The old profile name specifier takes precedence over the old one. */

/* When PNS >= OldPNS, the last one wins. */

/* Return buffer length that is required to store the current profile
 * filename with PID and hostname substitutions. */

/* The length to hold uint64_t followed by 3 digits pool id including '_' */

/* The length to hold 160-bit hash in hexadecimal form */

/* Reads binary ID length and then its data, writes it into lprofBinaryIdsBuffer
 * in hexadecimal form. */

/* Return the pointer to the current profile file name (after substituting
 * PIDs and Hostnames in filename pattern. \p FilenameBuf is the buffer
 * to store the resulting filename. If no substitution is needed, the
 * current filename pattern string is directly returned, unless ForceUseBuf
 * is enabled. */

/* Construct the new filename. */

/* Drop any unknown substitutions. */

/* Returns the pointer to the environment variable
 * string. Returns null if the env var is not set. */

/* This API initializes the file handling, both user specified
 * profile path via -fprofile-instr-generate= and LLVM_PROFILE_FILE
 * environment variable can override this default value.
 */

/* Pass CopyFilenamePat = 1, to ensure that the filename would be valid
       at the  moment when __llvm_profile_write_file() gets executed. */

/* This method is invoked by the runtime initialization hook
 * InstrProfilingRuntime.o if it is linked in.
 */

/* This API is directly called by the user application code. It has the
 * highest precedence compared with LLVM_PROFILE_FILE environment variable
 * and command line option -fprofile-instr-generate=<profile_name>.
 */

/* The public API for writing profile data into the file with name
 * set by previous calls to __llvm_profile_set_filename or
 * __llvm_profile_override_default_filename or
 * __llvm_profile_initialize_file. */

// Temporarily suspend getting SIGKILL when the parent exits.

/* Check the filename. */

/* Check if there is llvm/runtime version mismatch.  */

/* Write profile data to the file. */

// Restore SIGKILL.

/* The merged profile has a non-zero length. Check that it is compatible
       * with the data in this process. */

/* Save old profile data */

// Temporarily suspend getting SIGKILL when the parent exits.

/* Check if there is llvm/runtime version mismatch.  */

/* Get current filename */

/* Check the filename. */

/* Allocate new space for our target-specific PGO filename */

/* Find file basename and path sizes */

/* Prepend "TARGET." to current filename */

/* Open and truncate target-specific PGO file */

/* Write custom data */

/* Write custom data to the file */

// Restore SIGKILL.

/* Restore old profiling file */


=== system/lib/compiler-rt/lib/profile/InstrProfilingInternal.c ===
SHA256: bc9fd759ec4a14f5fe359a10266b62bb8d9a997217f7232d2c43054c733973ea
/*===- InstrProfilingInternal.c - Support library for PGO instrumentation -===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

// Note: This is linked into the Darwin kernel, and must remain compatible

// with freestanding compilation. See `darwin_add_builtin_libraries`.


=== system/lib/compiler-rt/lib/profile/InstrProfilingInternal.h ===
SHA256: 15f5865177030c25fc4190a4aa1b87a39fe8c908e506770400baffb10190ea1d
/*===- InstrProfiling.h- Support library for PGO instrumentation ----------===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

/*!
 * \brief Write instrumentation data to the given buffer, given explicit
 * pointers to the live data in memory.  This function is probably not what you
 * want.  Use __llvm_profile_get_size_for_buffer instead.  Use this function if
 * your program has a custom memory layout.
 */

/*!
 * \brief Write instrumentation data to the given buffer, given explicit
 * pointers to the live data in memory.  This function is probably not what you
 * want.  Use __llvm_profile_write_buffer instead.  Use this function if your
 * program has a custom memory layout.
 *
 * \pre \c Buffer is the start of a buffer at least as big as \a
 * __llvm_profile_get_size_for_buffer_internal().
 */

/*!
 * The data structure describing the data to be written by the
 * low level writer callback function.
 *
 * If \ref ProfDataIOVec.Data is null, and \ref ProfDataIOVec.UseZeroPadding is
 * 0, the write is skipped (the writer simply advances ElmSize*NumElm bytes).
 *
 * If \ref ProfDataIOVec.Data is null, and \ref ProfDataIOVec.UseZeroPadding is
 * nonzero, ElmSize*NumElm zero bytes are written.
 */

/*!
 * The data structure for buffered IO of profile data.
 */

/* The start of the buffer. */

/* Total size of the buffer. */

/* Current byte offset from the start of the buffer. */

/* The creator interface used by testing.  */

/*!
 * This is the interface to create a handle for buffered IO.
 */

/*!
 * The interface to destroy the bufferIO handle and reclaim
 * the memory.
 */

/*!
 * This is the interface to write \c Data of \c Size bytes through
 * \c BufferIO. Returns 0 if successful, otherwise return -1.
 */

/*!
 * The interface to flush the remaining data in the buffer.
 * through the low level writer callback.
 */

/* The low level interface to write data into a buffer. It is used as the
 * callback by other high level writer methods such as buffered IO writer
 * and profile data writer.  */

/*!
 * The class that defines a set of methods to read value profile
 * data for streaming/serialization from the instrumentation runtime.
 */

/* Function pointer to getValueProfRecordHeader method. */

/* Function pointer to getFirstValueProfRecord method. */

/* Return the number of value data for site \p Site.  */

/* Return the total size of the value profile data of the 
   * current function.  */

/*! 
   * Read the next \p N value data for site \p Site and store the data
   * in \p Dst. \p StartNode is the first value node to start with if
   * it is not null. The function returns the pointer to the value
   * node pointer to be used as the \p StartNode of the next batch reading.
   * If there is nothing left, it returns NULL.
   */

/* Write profile data to destination. If SkipNameDataWrite is set to 1,
   the name data is already in destination, we just skip over it. */

/* Merge value profile data pointed to by SrcValueProfData into
 * in-memory profile counters pointed by to DstData.  */

/* Internal interface used by test to reset the max number of 
 * tracked values per value site to be \p MaxVals.
 */

/* Return the profile header 'signature' value associated with the current
 * executable or shared library. The signature value can be used to for
 * a profile name that is unique to this load module so that it does not
 * collide with profiles from other binaries. It also allows shared libraries
 * to dump merged profile data into its own profile file. */

/* 
 * Return non zero value if the profile data has already been
 * dumped to the file.
 */

/* Pointer to the start of static value counters to be allocted. */

/*
 * Write binary ids into profiles if writer is given.
 * Return -1 if an error occurs, otherwise, return total size of binary ids.
 */

/*
 * Write binary id length and then its data, because binary id does not
 * have a fixed length.
 */


=== system/lib/compiler-rt/lib/profile/InstrProfilingMerge.c ===
SHA256: b4cd800882ec9adcbf2f6d8609cf8fe1b2b21d266fb1856c5e6678430f529f1d
/*===- InstrProfilingMerge.c - Profile in-process Merging  ---------------===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
|*===----------------------------------------------------------------------===*
|* This file defines the API needed for in-process merging of profile data
|* stored in memory buffer.
\*===---------------------------------------------------------------------===*/

/* A very fast way to compute a module signature.  */

/* Returns 1 if profile is not structurally compatible.  */

/* Check the header first.  */

/* Matched! */

// Skip names section, vtable profile data section and vtable names section

// for runtime profile merge. To merge runtime addresses from multiple

// profiles collected from the same instrumented binary, the binary should be

// loaded at fixed base address (e.g., build with -no-pie, or run with ASLR

// disabled). In this set-up these three sections remain unchanged.

// Merge counters by iterating the entire counter section when data section is

// empty due to correlation.

// For the in-memory destination, CounterPtr is the distance from the start

// address of the data to the start address of the counter. On WIN64,

// CounterPtr is a truncated 32-bit value due to COFF limitation. Sign

// extend CounterPtr to get the original value.

// SrcData is a serialized representation of the memory image. We need to

// compute the in-buffer counter offset from the in-memory address distance.

// The initial CountersDelta is the in-memory address difference

// start(__llvm_prf_cnts)-start(__llvm_prf_data), so SrcData->CounterPtr -

// CountersDelta computes the offset into the in-buffer counter section.

//

// On WIN64, CountersDelta is truncated as well, so no need for signext.

// CountersDelta needs to be decreased as we advance to the next data

// record.

// A value of zero signifies the function is covered.

// BitmapDelta also needs to be decreased as we advance to the next data

// record.

// NumBitmapBytes may legitimately be 0. Just keep going.

// Merge Src and Dst Bitmap bytes by simply ORing them together.

/* Now merge value profile data. */


=== system/lib/compiler-rt/lib/profile/InstrProfilingMergeFile.c ===
SHA256: ccd4aa78d4498cb627cd1688caeeb1e198d8e5344483ebdfc8aa3f1044fa8163
/*===- InstrProfilingMergeFile.c - Profile in-process Merging  ------------===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
|*===----------------------------------------------------------------------===
|* This file defines APIs needed to support in-process merging for profile data
|* stored in files.
\*===----------------------------------------------------------------------===*/

/* Merge value profile data pointed to by SrcValueProfData into
 * in-memory profile counters pointed by to DstData.  */


=== system/lib/compiler-rt/lib/profile/InstrProfilingNameVar.c ===
SHA256: 7f94805fe61285411f843db3b3c69d64e6d1f2bff10b4552d2254afd8a8a5f73
/*===- InstrProfilingNameVar.c - profile name variable setup  -------------===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

/* char __llvm_profile_filename[1]
 *
 * The runtime should only provide its own definition of this symbol when the
 * user has not specified one. Set this up by moving the runtime's copy of this
 * symbol to an object file within the archive.
 */


=== system/lib/compiler-rt/lib/profile/InstrProfilingPlatformAIX.c ===
SHA256: d27937cf2c8c3e2266176a6d0e42fa1a4a49be1368380e32ead2b290c5dcf941
/*===- InstrProfilingPlatformAIX.c - Profile data AIX platform ------------===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

// If found, write the build-id into the Result buffer.

// Use loadquery to get information about loaded modules; loadquery writes

// its result into a buffer of unknown size.

// should be plenty for any program.

// Locate the ld_xinfo corresponding to this module.

// Found my slot. Now search for the build-id.

// This is the loader string table

// If the build-id exists, it's the first entry.

// Each entry is comprised of a 2-byte size component, followed by the

// data.

// 200 bytes should be enough for the build-id hex string.

// Profile reading tools expect this to be 8-bytes long.

// -1 means we already checked for a BinaryId and didn't find one.

// Are we being called for the first time?

// assume even number of digits/chars, so 0xabc must be 0x0abc

// The numeric ID is represented as an ascii string in the loader section,

// so convert it to raw binary.

// Skip "0x" prefix if it exists.

// Return -1 rather goto fail to match the NT_GNU_BUILD_ID path.

// Empty stubs to allow linking object files using the registration-based scheme

// The __start_SECNAME and __stop_SECNAME symbols (for SECNAME \in

// {"__llvm_prf_cnts", "__llvm_prf_data", "__llvm_prf_name", "__llvm_prf_vnds",

// "__llvm_prf_vns", "__llvm_prf_vtab"})

// are always live when linking on AIX, regardless if the .o's being linked

// reference symbols from the profile library (for example when no files were

// compiled with -fprofile-generate). That's because these symbols are kept

// alive through references in constructor functions that are always live in the

// default linking model on AIX (-bcdtors:all). The __start_SECNAME and

// __stop_SECNAME symbols are only resolved by the linker when the SECNAME

// section exists. So for the scenario where the user objects have no such

// section (i.e. when they are compiled with -fno-profile-generate), we always

// define these zero length variables in each of the above 4 sections.

// To avoid GC'ing of the dummy variables by the linker, reference them in an

// array and reference the array in the runtime registration code

// (InstrProfilingRuntime.cpp)


=== system/lib/compiler-rt/lib/profile/InstrProfilingPlatformDarwin.c ===
SHA256: 822112e1e740fae3e30fc8e13b9a4e3443fe77463910e3d8c6d7ef0e23baedbb
/*===- InstrProfilingPlatformDarwin.c - Profile data on Darwin ------------===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

// Note: This is linked into the Darwin kernel, and must remain compatible

// with freestanding compilation. See `darwin_add_builtin_libraries`.

/* Use linker magic to find the bounds of the Data section. */


=== system/lib/compiler-rt/lib/profile/InstrProfilingPlatformFuchsia.c ===
SHA256: 049096c1979b50cf50fe9a532f05cc7daaad5b8139396769bce2b4cd1de964d3
/*===- InstrProfilingPlatformFuchsia.c - Profile data Fuchsia platform ----===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

/*
 * This file implements the profiling runtime for Fuchsia and defines the
 * shared profile runtime interface. Each module (executable or DSO) statically
 * links in the whole profile runtime to satisfy the calls from its
 * instrumented code. Several modules in the same program might be separately
 * compiled and even use different versions of the instrumentation ABI and data
 * format. All they share in common is the VMO and the offset, which live in
 * exported globals so that exactly one definition will be shared across all
 * modules. Each module has its own independent runtime that registers its own
 * atexit hook to append its own data into the shared VMO which is published
 * via the data sink hook provided by Fuchsia's dynamic linker.
 */

/* This variable is an external reference to symbol defined by the compiler. */

/* VMO that contains the profile data for this module. */

/* Current offset within the VMO where data should be written next. */

/* Compute the total length of data to be written. */

/* Resize the VMO to ensure there's sufficient space for the data. */

/* Copy the data into VMO. */

/* Resizing the VMO should zero fill. */

/* Record the profile size as a property of the VMO. */

/* This method is invoked by the runtime initialization hook
 * InstrProfilingRuntime.o if it is linked in. */

/* Check if there is llvm/runtime version mismatch. */

/* Don't publish a VMO if there are no counters. */

/* Create a VMO to hold the profile data. */

/* Give the VMO a name that includes the module signature. */

/* Write the profile data into the mapped region. */

/* Publish the VMO which contains profile data to the system. Note that this
   * also consumes the VMO handle. */

/* Update the profile fields based on the current mapping. */

/* Return the memory allocated for counters to OS. */


=== system/lib/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c ===
SHA256: 12f7290b9f6d85822867f1d18f2c33d7ad5ebe45726e497336f88619653fd2aa
/*===- InstrProfilingPlatformLinux.c - Profile data Linux platform ------===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

/* Declare section start and stop symbols for various sections
 * generated by compiler instrumentation.
 */

/*
 * Look for the note that has the name "GNU\0" and type NT_GNU_BUILD_ID
 * that contains build id. If build id exists, write binary id.
 *
 * Each note in notes section starts with a struct which includes
 * n_namesz, n_descsz, and n_type members. It is followed by the name
 * (whose length is defined in n_namesz) and then by the descriptor
 * (whose length is defined in n_descsz).
 *
 * Note sections like .note.ABI-tag and .note.gnu.build-id are aligned
 * to 4 bytes, so round n_namesz and n_descsz to the nearest 4 bytes.
 */

/*
 * Helper function that iterates through notes section and find build ids.
 * If writer is given, write binary ids into profiles.
 * If an error happens while writing, return -1.
 */

/* Calculate the offset of the next note in notes section. */

/*
 * Write binary ids into profiles if writer is given.
 * Return the total size of binary ids.
 * If an error happens while writing, return -1.
 */

/* Compute the added base address in case of position-independent code. */

/* Iterate through entries in the program header. */

/* Look for the notes segment in program header entries. */

/* There can be multiple notes segment, and examine each of them. */

/* !NT_GNU_BUILD_ID */

/*
 * Fallback implementation for targets that don't support the GNU
 * extensions NT_GNU_BUILD_ID and __ehdr_start.
 */


=== system/lib/compiler-rt/lib/profile/InstrProfilingPlatformOther.c ===
SHA256: 6b88479b2901b71da774bf9eebf7760d5495e2cb8debcb6811285b1871c5bf71
/*===- InstrProfilingPlatformOther.c - Profile data default platform ------===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

/*!
 * \brief Register an instrumented function.
 *
 * Calls to this are emitted by clang with -fprofile-instr-generate.  Such
 * calls are only required (and only emitted) on targets where we haven't
 * implemented linker magic to find the bounds of the sections.
 */

/* TODO: Only emit this function if we can't use linker magic. */


=== system/lib/compiler-rt/lib/profile/InstrProfilingPlatformWindows.c ===
SHA256: 8c61b8da35d6532b1a554020c5f13f582f6c51ddb35f3bd9c99dca93873d1fe6
/*===- InstrProfilingPlatformWindows.c - Profile data on Windows ----------===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

/* Merge read-write sections into .data. */

/* Do *NOT* merge .lprfn and .lcovmap into .rdata. llvm-cov must be able to find
 * after the fact.
 * Do *NOT* merge .lprfc .rdata. When binary profile correlation is enabled,
 * llvm-cov must be able to find after the fact.
 */

/* Allocate read-only section bounds. */

/* Allocate read-write section bounds. */

// Type profiling isn't implemented under MSVC ABI, so return NULL (rather than

// implementing linker magic on Windows) to make it more explicit. To elaborate,

// the current type profiling implementation maps a profiled vtable address to a

// vtable variable through vtables mangled name. Under MSVC ABI, the variable

// name for vtables might not be the mangled name (see

// MicrosoftCXXABI::getAddrOfVTable in MicrosoftCXXABI.cpp for more details on

// how a vtable name is computed). Note the mangled name is still in the vtable

// IR (just not variable name) for mapping purpose, but more implementation work

// is required.

// Type profiling isn't supported on Windows, so return NULl to make it more

// explicit.

/* lld-link provides __buildid symbol which points to the 16 bytes build id when
 * using /build-id flag. https://lld.llvm.org/windows_support.html#lld-flags */


=== system/lib/compiler-rt/lib/profile/InstrProfilingPort.h ===
SHA256: cb0540e2a7d56ccc28511dc2f8d62dc434ba7ea3d73634e08b7a3899a6d2230e
/*===- InstrProfilingPort.h- Support library for PGO instrumentation ------===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

/* This header must be included after all others so it can provide fallback
   definitions for stuff missing in system headers. */

/* FIXME: selectany does not have the same semantics as weak. */

/* Need to include <windows.h> */

/* Need to include <stdio.h> and <io.h> */

/* !defined(_WIN64) */

/* !defined(_WIN32) */

/* COMPILER_RT_HAS_ATOMICS != 1 */

/* DIR_SEPARATOR_2 */

/* DIR_SEPARATOR_2 */

/* defined(_WIN32) */

/* defined(_WIN32) */

/* defined(__FreeBSD__) */

/* defined(__FreeBSD__) && defined(__i386__) */

/* PROFILE_INSTRPROFILING_PORT_H_ */


=== system/lib/compiler-rt/lib/profile/InstrProfilingRuntime.cpp ===
SHA256: f390bc9d3fc6d517e4c23087a673a1c3e4609968acc2ff1548938a92b795a48c
//===- InstrProfilingRuntime.cpp - PGO runtime initialization -------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/* int __llvm_profile_runtime  */


=== system/lib/compiler-rt/lib/profile/InstrProfilingUtil.c ===
SHA256: 1d5b0c63779cb32341b542e995b57c596720b3c70571c66bcd0026cdcd6ee49f
/*===- InstrProfilingUtil.c - Support library for PGO instrumentation -----===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

// <sys/vmount.h> depends on `uint` to be a typedef from <sys/types.h> to

// `uint_t`; however, <sys/types.h> does not always declare `uint`. We provide

// the typedef prior to including <sys/vmount.h> to work around this issue.

// Avoid spammy selinux denial messages in Android by not attempting to

// create directories in GCOV_PREFIX.  These denials occur when creating (or

// even attempting to stat()) top-level directories like "/data".

//

// Do so by ignoring ${GCOV_PREFIX} when invoking mkdir().

/* Some of these will fail, ignore it. */

/* Until EOF.  */

// Windows doesn't have flock but WindowsMMap.h provides a shim

/* Until EOF.  */

// Windows doesn't have flock but WindowsMMap.h provides a shim

// FIXME: Use the wide variants to handle Unicode filenames.

/* Worst case no locking applied.  */

// Return 1 (true) if the file descriptor Fd represents a file that is on a

// local filesystem, otherwise return 0.

// mntctl returns -1 if `Buf` is `NULL`.

// Look for the correct vmount entry.

// There was an error in mntctl or vmount entry not found; "remote" is the

// conservative answer.

// For testing purposes.

// Read the entire file into memory.

// Reading was successful, record the result in the Buf parameter.

/* Negative GCOV_PREFIX_STRIP values are ignored */

/* Temporarily suspend getting SIGKILL upon exit of the parent process. */

// VE and WASI doesn't support madvise.

/* return 1 if stack is empty, 0 otherwise */

/* On AIX, atexit() functions registered by a shared library do not get called
 * when the library is dlclose'd, causing a crash when they are eventually
 * called at main program exit. However, a destructor does get called. So we
 * collect all atexit functions registered by profile-rt and at program
 * termination time (normal exit, shared library unload, or dlclose) we walk
 * the list and execute any function that is still sitting in the atexit system
 * queue.
 */


=== system/lib/compiler-rt/lib/profile/InstrProfilingUtil.h ===
SHA256: 8acefed462a4370ef552627de3267e1fd98ec309f93776cd51403e741b75740c
/*===- InstrProfilingUtil.h - Support library for PGO instrumentation -----===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

/*! \brief Create a directory tree. */

/*! Set the mode used when creating profile directories. */

/*! Return the directory creation mode. */

/*! Open file \c Filename for read+write with write
 * lock for exclusive access. The caller will block
 * if the lock is already held by another process. */

// Addr is not a valid address

// Addr was mmap'ed

// Addr was malloc'ed

/* Read the content of a file using mmap or fread into a buffer.
 * Certain files (e.g. NFS mounted) cannot be opened reliably with mmap,
 * so we use fread in those cases. The corresponding lprofReleaseBuffer
 * will free/munmap the buffer.
 */

/* PS4 doesn't have setenv/getenv/fork. Define a shim. */

/* #if __ORBIS__ */

/* GCOV_PREFIX and GCOV_PREFIX_STRIP support */

/* Return the path prefix specified by GCOV_PREFIX environment variable.
 * If GCOV_PREFIX_STRIP is also specified, the strip level (integer value)
 * is returned via \c *PrefixStrip. The prefix length is stored in *PrefixLen.
 */

/* Apply the path prefix specified in \c Prefix to path string in \c PathStr,
 * and store the result to buffer pointed to by \c Buffer. If \c PrefixStrip
 * is not zero, path prefixes are stripped from \c PathStr (the level of
 * stripping is specified by \c PrefixStrip) before \c Prefix is added.
 */

/* Returns a pointer to the first occurrence of \c DIR_SEPARATOR char in
 * the string \c Path, or NULL if the char is not found. */

/* Returns a pointer to the last occurrence of \c DIR_SEPARATOR char in
 * the string \c Path, or NULL if the char is not found. */

/* Temporarily suspend SIGKILL. Return value of 1 means a restore is needed.
 * Other return values mean no restore is needed.
 */

/* Restore previously suspended SIGKILL. */

/* Call atexit and perform other platform-specific bookkeeping. */

/* PROFILE_INSTRPROFILINGUTIL_H */


=== system/lib/compiler-rt/lib/profile/InstrProfilingValue.c ===
SHA256: f90000bb6b525d4bd7ede8dc9929bde7fc6ac51e8af80fd68443759e6a799857
/*===- InstrProfilingValue.c - Support library for PGO instrumentation ----===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

/* A shared static pool in addition to the vnodes statically
 * allocated by the compiler.  */

/* This method is only used in value profiler mock testing.  */

/* This method is only used in value profiler mock testing.  */

/* This method is only used in value profiler mock testing.  */

/* Allocate an array that holds the pointers to the linked lists of
 * value profile counter nodes. The number of element of the array
 * is the total number of value profile sites instrumented. Returns
 * 0 if allocation fails.
 */

/* This function will never be called when value site array is allocated
     statically at compile time.  */

/* When dynamic allocation is enabled, allow tracking the max number of
   * values allowd.  */

// If NumVSites = 0, calloc is allowed to return a non-null pointer.

/* Early check to avoid value wrapping around.  */

/* Due to section padding, EndVNode point to a byte which is one pass
   * an incomplete VNode, so we need to skip the last incomplete node. */

/* Bump down the min count node's count. If it reaches 0,
     * evict it. This eviction/replacement policy makes hot
     * targets more sticky while cold targets less so. In other
     * words, it makes it less likely for the hot targets to be
     * prematurally evicted during warmup/establishment period,
     * when their counts are still low. In a special case when
     * the number of values tracked is reduced to only one, this
     * policy will guarantee that the dominating target with >50%
     * total count will survive in the end. Note that this scheme
     * allows the runtime to track the min count node in an adaptive
     * manner. It can correct previous mistakes and eventually
     * lock on a cold target that is alread in stable state.
     *
     * In very rare cases,  this replacement scheme may still lead
     * to target loss. For instance, out of \c N value slots, \c N-1
     * slots are occupied by luke warm targets during the warmup
     * period and the remaining one slot is competed by two or more
     * very hot targets. If those hot targets occur in an interleaved
     * way, none of them will survive (gain enough weight to throw out
     * other established entries) due to the ping-pong effect.
     * To handle this situation, user can choose to increase the max
     * number of tracked values per value site. Alternatively, a more
     * expensive eviction mechanism can be implemented. It requires
     * the runtime to track the total number of evictions per-site.
     * When the total number of evictions reaches certain threshold,
     * the runtime can wipe out more than one lowest count entries
     * to give space for hot targets.
     */

/*
 * The target values are partitioned into multiple ranges. The range spec is
 * defined in InstrProfData.inc.
 */

// Map the target value to the representative value of its range.

/*
 * A wrapper struct that represents value profile runtime data.
 * Like InstrProfRecord class which is used by profiling host tools,
 * ValueProfRuntimeRecord also implements the abstract interfaces defined in
 * ValueProfRecordClosure so that the runtime data can be serialized using
 * shared C implementation.
 */

/* ValueProfRecordClosure Interface implementation. */

/* GetNumValueKinds */

/* RemapValueData */

/* GetValueForSite, */

/* AllocValueProfData */

/* Compute value count for each site. */


=== system/lib/compiler-rt/lib/profile/InstrProfilingVersionVar.c ===
SHA256: f13fe99b4a6cc607599569a4273013c69af24e68249203bf9d46f44930dbc525
/*===- InstrProfilingVersionVar.c - profile version variable setup  -------===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

/* uint64 __llvm_profile_raw_version
 *
 * The runtime should only provide its own definition of this symbol when the
 * user has not specified one. Set this up by moving the runtime's copy of this
 * symbol to an object file within the archive.
 */


=== system/lib/compiler-rt/lib/profile/InstrProfilingWriter.c ===
SHA256: 7b4ce229d31fbd1d15bd524876627d6b4f661f177496679af28200b7695e5396
/*===- InstrProfilingWriter.c - Write instrumentation to a file or buffer -===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

// Note: This is linked into the Darwin kernel, and must remain compatible

// with freestanding compilation. See `darwin_add_builtin_libraries`.

/* For _alloca */

/* The buffer writer is responsible in keeping writer state
 * across the call.
 */

/* Allocating the buffer should zero fill. */

/* Buffer is not large enough, it is time to flush.  */

/* Special case, bypass the buffer completely. */

/* Write the data to buffer */

/* Write out value profile data for function specified with \c Data.
 * The implementation does not use the method \c serializeValueProfData
 * which depends on dynamic memory allocation. In this implementation,
 * value profile data is written out to \c BufferIO piecemeal.
 */

/* Only use alloca for this small byte array to avoid excessive
       * stack growth.  */

/* If NumValueKinds returned is 0, there is nothing to write, report
     success and return. This should match the raw profile reader's behavior. */

/* First write the header structure. */

/* Make sure nothing else needs to be written before value profile
   * records. */

/* Write out the value profile record for each value kind
   * one by one. */

/* The size of the value prof record header without counting the
     * site count array .*/

/* Write out the record header.  */

/* Write out the site value count array including padding space. */

/* Write out the value profile data for each value site.  */

/* Read and write out value data in small chunks till it is done. */

/* ValueKind */

/* Site */

/* All done report success.  */

/* Match logic in __llvm_profile_write_buffer(). */

/* Calculate size of sections. */

/* Create the header. */

/* Determine how much padding is needed before/after the counters and after
   * the names. */

/* Initialize header structure.  */

/* On WIN64, label differences are truncated 32-bit values. Truncate
   * CountersDelta to match. */

/* The data and names sections are omitted in lightweight mode. */

/* Write the profile header. */

/* Write the binary id lengths and data. */

/* Write the profile data. */

/* Value profiling is not yet supported in continuous mode and profile
   * correlation mode. */

/*
 * Write binary id length and then its data, because binary id does not
 * have a fixed length.
 */

/* Successfully wrote binary id, report success. */


=== system/lib/compiler-rt/lib/profile/WindowsMMap.c ===
SHA256: e9f3d4d52b497a3dd7e811474301bb52d11ba8144992005420bbed52dd788787
/*
 * This code is derived from uClibc (original license follows).
 * https://git.uclibc.org/uClibc/tree/utils/mmap-windows.c
 */

/* mmap() replacement for Windows
 *
 * Author: Mike Frysinger <vapier@gentoo.org>
 * Placed into the public domain
 */

/* References:
 * CreateFileMapping: http://msdn.microsoft.com/en-us/library/aa366537(VS.85).aspx
 * CloseHandle:       http://msdn.microsoft.com/en-us/library/ms724211(VS.85).aspx
 * MapViewOfFile:     http://msdn.microsoft.com/en-us/library/aa366761(VS.85).aspx
 * UnmapViewOfFile:   http://msdn.microsoft.com/en-us/library/aa366882(VS.85).aspx
 */

/* ruh-ro, we leaked handle from CreateFileMapping() ... */

/* Not supported. */

/* Exactly one of MS_ASYNC or MS_SYNC must be specified. */

/* FIXME: No longer have access to handle from CreateFileMapping(). */

/*
     * if (!FlushFileBuffers(h))
     *   return -1;
     */

/* Not supported. */

// In non-blocking mode, return an error if the file is locked.

// EWOULDBLOCK

// If the error is ERROR_IO_PENDING, we need to wait until the operation

// finishes. Otherwise, we return an error.

/* _WIN32 */


=== system/lib/compiler-rt/lib/profile/WindowsMMap.h ===
SHA256: 4a311829a23ed5e744030626465c198925e067d18773aa93cc1ef15134be29f9
/*===- WindowsMMap.h - Support library for PGO instrumentation ------------===*\
|*
|* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|* See https://llvm.org/LICENSE.txt for license information.
|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|*
\*===----------------------------------------------------------------------===*/

/*
 * mmap() flags
 */

/*
 * msync() flags
 */

/* return immediately */

/* invalidate all cached data */

/* msync synchronously */

/*
 * madvise() flags
 */

/* no special treatment */

/* expect access in the near future */

/* do not expect access in the near future */

/*
 * flock() operations
 */

/* shared lock */

/* exclusive lock */

/* don't block when locking */

/* unlock */

/* _WIN32 */

/* PROFILE_INSTRPROFILING_WINDOWS_MMAP_H */


=== system/lib/compiler-rt/lib/sanitizer_common/sancov_flags.cpp ===
SHA256: dd6d90ba4d13c222a6a08ba51156d4335e117535e8bb7d365e4c4afef4bd7c8e
//===-- sancov_flags.cpp ----------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Sanitizer Coverage runtime flags.

//

//===----------------------------------------------------------------------===//

// use via flags();

// namespace __sancov


=== system/lib/compiler-rt/lib/sanitizer_common/sancov_flags.h ===
SHA256: 374ee8b4a201ac2ef77ca02fc14ed611a26c62f2caff4085a3d85948b0511950
//===-- sancov_flags.h ------------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Sanitizer Coverage runtime flags.

//

//===----------------------------------------------------------------------===//

// namespace __sancov


=== system/lib/compiler-rt/lib/sanitizer_common/sancov_flags.inc ===
SHA256: 6ea8347ae2b9b41bd1c2d6a58e6dbe7f1f87c21fcd42278eaecdf7353dc472ac
//===-- sancov_flags.inc ----------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Sanitizer Coverage runtime flags.

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_addrhashmap.h ===
SHA256: 43d6229b793798062ee1bfecffca53c1199bd9500daff88917230790e563868c
//===-- sanitizer_addrhashmap.h ---------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Concurrent uptr->T hashmap.

//

//===----------------------------------------------------------------------===//

// Concurrent uptr->T hashmap.

// T must be a POD type, kSize is preferably a prime but can be any number.

// Usage example:

//

// typedef AddrHashMap<uptr, 11> Map;

// Map m;

// {

//   Map::Handle h(&m, addr);

//   use h.operator->() to access the data

//   if h.created() then the element was just created, and the current thread

//     has exclusive access to it

//   otherwise the current thread has only read access to the data

// }

// {

//   Map::Handle h(&m, addr, true);

//   this will remove the data from the map in Handle dtor

//   the current thread has exclusive access to the data

//   if !h.exists() then the element never existed

// }

// {

//   Map::Handle h(&m, addr, false, true);

//   this will create a new element or return a handle to an existing element

//   if !h.created() this thread does *not* have exclusive access to the data

// }

// variable len

// ForEach acquires a lock on each bucket while iterating over

// elements. Note that this only ensures that the structure of the hashmap is

// unchanged, there may be a data race to the element itself.

// Iterate over any additional cells.

// If we want to remove the element, we need exclusive access to the bucket,

// so skip the lock-free phase.

// First try to find an existing element w/o read mutex.

// Check the embed cells.

// Check the add cells with read lock.

// Re-check existence under write lock.

// Embed cells.

// Add cells.

// The element does not exist, no need to create it if we want to remove.

// Now try to create it under the mutex.

// See if we have a free embed cell.

// Store in the add cells.

// Allocate a new add array.

// Grow existing add array.

// Store.

// Denote completion of insertion.

// After the following store, the element becomes available

// for lock-free reads.

// Denote that the cell is empty now.

// See if we need to compact the bucket.

// Removed from embed array, move an add element into the freed cell.

// Removed from add array, compact it.

// FIXME(dvyukov): free add?

// namespace __sanitizer

// SANITIZER_ADDRHASHMAP_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cpp ===
SHA256: 0b362152fbff53e84f18ae491a39ed175f3aa0a31d0f28ea1f9f90203edbae43
//===-- sanitizer_allocator.cpp -------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.

// This allocator is used inside run-times.

//===----------------------------------------------------------------------===//

// Default allocator names.

// LowLevelAllocator

// Align allocation size.

// Allocator's OOM and other errors handling support.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h ===
SHA256: 82e908ab59e4af8afa577ef3e652849ce296cf0d2c1a7de98ed0bc720c9db99e
//===-- sanitizer_allocator.h -----------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Specialized memory allocator for ThreadSanitizer, MemorySanitizer, etc.

//

//===----------------------------------------------------------------------===//

// Allows the tools to name their allocations appropriately.

// Since flags are immutable and allocator behavior can be changed at runtime

// (unit tests or ASan on Android are some examples), allocator_may_return_null

// flag value is cached here and can be altered later.

// Returns true if allocator detected OOM condition. Can be used to avoid memory

// hungry operations.

// Should be called by a particular allocator when OOM is detected.

// Callback type for iterating over chunks.

// ANSI C linear congruential PRNG.

// [0, n)

// namespace __sanitizer

// SANITIZER_ALLOCATOR_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_checks.cpp ===
SHA256: 55ea394338a7fb84b100ff5948647f571525598ddb5987c110892783419ce8fb
//===-- sanitizer_allocator_checks.cpp --------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Various checks shared between ThreadSanitizer, MemorySanitizer, etc. memory

// allocators.

//

//===----------------------------------------------------------------------===//

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_checks.h ===
SHA256: 028852d9358097fe3d0c79d993e07c5f1634261ee2fe1ad002244a3c5a00560d
//===-- sanitizer_allocator_checks.h ----------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Various checks shared between ThreadSanitizer, MemorySanitizer, etc. memory

// allocators.

//

//===----------------------------------------------------------------------===//

// The following is defined in a separate compilation unit to avoid pulling in

// sanitizer_errno.h in this header, which leads to conflicts when other system

// headers include errno.h. This is usually the result of an unlikely event,

// and as such we do not care as much about having it inlined.

// A common errno setting logic shared by almost all sanitizer allocator APIs.

// In case of the check failure, the caller of the following Check... functions

// should "return POLICY::OnBadRequest();" where POLICY is the current allocator

// failure handling policy.

// Checks aligned_alloc() parameters, verifies that the alignment is a power of

// two and that the size is a multiple of alignment for POSIX implementation,

// and a bit relaxed requirement for non-POSIX ones, that the size is a multiple

// of alignment.

// Checks posix_memalign() parameters, verifies that alignment is a power of two

// and a multiple of sizeof(void *).

// Returns true if calloc(size, n) call overflows on size*n calculation.

// Returns true if the size passed to pvalloc overflows when rounded to the next

// multiple of page_size.

// namespace __sanitizer

// SANITIZER_ALLOCATOR_CHECKS_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_combined.h ===
SHA256: 388fbc8de36a42caa54b1c5ae1f380df952811d1b36d405d91905589f277579e
//===-- sanitizer_allocator_combined.h --------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Part of the Sanitizer Allocator.

//

//===----------------------------------------------------------------------===//

// This class implements a complete memory allocator by using two

// internal allocators:

// PrimaryAllocator is efficient, but may not allocate some sizes (alignments).

//  When allocating 2^x bytes it should return 2^x aligned chunk.

// PrimaryAllocator is used via a local AllocatorCache.

// SecondaryAllocator can allocate anything, but is not efficient.

// Returning 0 on malloc(0) may break a lot of code.

// If alignment requirements are to be fulfilled by the frontend allocator

// rather than by the primary or secondary, passing an alignment lower than

// or equal to 8 will prevent any further rounding up, as well as the later

// alignment check.

// The primary allocator should return a 2^x aligned allocation when

// requested 2^x bytes, hence using the rounded up 'size' when being

// serviced by the primary (this is no longer true when the primary is

// using a non-fixed base address). The secondary takes care of the

// alignment without such requirement, and allocating 'size' would use

// extraneous memory, so we employ 'original_size'.

// This function does the same as GetBlockBegin, but is much faster.

// Must be called with the allocator locked.

// ForceLock() and ForceUnlock() are needed to implement Darwin malloc zone

// introspection API.

// Iterate over all existing chunks.

// The allocator must be locked when calling this function.


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_dlsym.h ===
SHA256: 1ef22bb4e0a505ae0d35496ac9909741e5bc0d02187dc78dbd4afb600c3bdcc5
//===-- sanitizer_allocator_dlsym.h -----------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Hack: Sanitizer initializer calls dlsym which may need to allocate and call

// back into uninitialized sanitizer.

//

//===----------------------------------------------------------------------===//

// Fuchsia doesn't use dlsym-based interceptors.

// Fuchsia doesn't use dlsym-based interceptors.

// namespace __sanitizer

// SANITIZER_ALLOCATOR_DLSYM_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_interface.h ===
SHA256: cd7d49ca16756db9e92748a70ad4482b7a0fee7c3b48a077c61654920026ba7f
//===-- sanitizer_allocator_interface.h ------------------------- C++ -----===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Re-declaration of functions from public sanitizer allocator interface.

//

//===----------------------------------------------------------------------===//

// extern "C"

// SANITIZER_ALLOCATOR_INTERFACE_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_internal.h ===
SHA256: 6cef0084e4de48cb74215c9f04ea364581e1b4ad1d14947dde7ba612468e1606
//===-- sanitizer_allocator_internal.h --------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This allocator is used inside run-times.

//

//===----------------------------------------------------------------------===//

// FIXME: Check if we may use even more compact size class map for internal

// purposes.

// namespace __sanitizer

// SANITIZER_ALLOCATOR_INTERNAL_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_local_cache.h ===
SHA256: 91f5a534bdfe454932dbb50be39e5e51d8875b281e5b0eb1a020034cbee159bb
//===-- sanitizer_allocator_local_cache.h -----------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Part of the Sanitizer Allocator.

//

//===----------------------------------------------------------------------===//

// Cache used by SizeClassAllocator64.

// If the first allocator call on a new thread is a deallocation, then

// max_count will be zero, leading to check failure.

// Cache used by SizeClassAllocator32.

// Returns a TransferBatch suitable for class_id.

// Destroys TransferBatch b.

// If the first allocator call on a new thread is a deallocation, then

// max_count will be zero, leading to check failure.

// If kUseSeparateSizeClassForBatch is true, all TransferBatch objects are

// allocated from kBatchClassID size class (except for those that are needed

// for kBatchClassID itself). The goal is to have TransferBatches in a totally

// different region of RAM to improve security.

// Precompute the class id to use to store batches for the current class

// id. 0 means the class size is large enough to store a batch within one

// of the chunks. If using a separate size class, it will always be

// kBatchClassID, except for kBatchClassID itself.

// Failure to allocate a batch while releasing memory is non recoverable.

// TODO(alekseys): Figure out how to do it without allocating a new batch.


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h ===
SHA256: cfb505ab3346f893e2cafa33218752e67280dd20d9e2b83f4ac393c02ac5b2d6
//===-- sanitizer_allocator_primary32.h -------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Part of the Sanitizer Allocator.

//

//===----------------------------------------------------------------------===//

// SizeClassAllocator32 -- allocator for 32-bit address space.

// This allocator can theoretically be used on 64-bit arch, but there it is less

// efficient than SizeClassAllocator64.

//

// [kSpaceBeg, kSpaceBeg + kSpaceSize) is the range of addresses which can

// be returned by MmapOrDie().

//

// Region:

//   a result of a single call to MmapAlignedOrDieOnFatalError(kRegionSize,

//                                                             kRegionSize).

// Since the regions are aligned by kRegionSize, there are exactly

// kNumPossibleRegions possible regions in the address space and so we keep

// a ByteMap possible_regions to store the size classes of each Region.

// 0 size class means the region is not used by the allocator.

//

// One Region is used to allocate chunks of a single size class.

// A Region looks like this:

// UserChunk1 .. UserChunkN <gap> MetaChunkN .. MetaChunk1

//

// In order to avoid false sharing the objects of this class should be

// chache-line aligned.

//  Bit masks.

// How much memory do we need for a batch containing n elements.

// This is empty here. Currently only implemented in 64-bit allocator.

// Currently implemented in 64-bit allocator only.

// 32-bit division

// 32-bit division

// No need to lock here.

// ForceLock() and ForceUnlock() are needed to implement Darwin malloc zone

// introspection API.

// Iterate over all existing chunks.

// The allocator must be locked when calling this function.

// Too slow: CHECK_EQ((void *)chunk, GetBlockBegin((void *)chunk));

// If using a separate class for batches, we do not need to shuffle it.

// The random state is initialized from ASLR (PIE) and time.


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h ===
SHA256: af70df7a9194755921d5186de6844e6c1fcc71d62c0d90bda4682e45b5c63a99
//===-- sanitizer_allocator_primary64.h -------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Part of the Sanitizer Allocator.

//

//===----------------------------------------------------------------------===//

// SizeClassAllocator64 -- allocator for 64-bit address space.

// The template parameter Params is a class containing the actual parameters.

//

// Space: a portion of address space of kSpaceSize bytes starting at SpaceBeg.

// If kSpaceBeg is ~0 then SpaceBeg is chosen dynamically by mmap.

// Otherwise SpaceBeg=kSpaceBeg (fixed address).

// kSpaceSize is a power of two.

// At the beginning the entire space is mprotect-ed, then small parts of it

// are mapped on demand.

//

// Region: a part of Space dedicated to a single size class.

// There are kNumClasses Regions of equal size.

//

// UserChunk: a piece of memory returned to user.

// MetaChunk: kMetadataSize bytes of metadata associated with a UserChunk.

// FreeArray is an array free-d chunks (stored as 4-byte offsets)

//

// A Region looks like this:

// UserChunk1 ... UserChunkN <gap> MetaChunkN ... MetaChunk1 FreeArray

//  Bit masks.

// Releases [from, to) range of pages back to OS.

// When we know the size class (the region base) we can represent a pointer

// as a 4-byte integer (offset from the region start shifted right by 4).

// If heap_start is nonzero, assumes kSpaceSize bytes are already mapped R/W

// at heap_start and places the heap there.  This mode requires kSpaceBeg ==

// ~(uptr)0.

// Combined allocator expects that an 2^N allocation is always aligned

// to 2^N. For this to work, the start of the space needs to be aligned

// as high as the largest size class (which also needs to be a power of

// 2).

// Check that the RegionInfo array is aligned on the CacheLine size.

/*force*/

// Failure to allocate free array space while releasing memory is non

// recoverable.

/*force*/

/* On Windows unmapping of memory during __sanitizer_purge_allocator is
    explicit and immediate, so unmapped regions must be explicitly mapped back
    in when they are accessed again. */

// Test-only.

// ForceLock() and ForceUnlock() are needed to implement Darwin malloc zone

// introspection API.

// Iterate over all existing chunks.

// The allocator must be locked when calling this function.

// Too slow: CHECK_EQ((void *)chunk, GetBlockBegin((void *)chunk));

// A packed array of counters. Each counter occupies 2^n bits, enough to store

// counter's max_value. Ctor will try to allocate the required buffer via

// mapper->MapPackedCounterArrayBuffer and the caller is expected to check

// whether the initialization was successful by checking IsAllocated() result.

// For the performance sake, none of the accessors check the validity of the

// arguments, it is assumed that index is always in [0, n) range and the value

// is not incremented past max_value.

// Rounding counter storage size up to the power of two allows for using

// bit shifts calculating particular counter's index and offset.

// Iterates over the free_array to identify memory pages containing freed

// chunks only and returns these pages back to OS.

// allocated_pages_count is the total number of pages allocated for the

// current bucket.

// Figure out the number of chunks per page and whether we can take a fast

// path (the number of chunks per page is the same for all pages).

// Same number of chunks per page, no cross overs.

// Some chunks are crossing page boundaries, which means that the page

// contains one or two partial chunks, but all pages contain the same

// number of chunks.

// Some chunks are crossing page boundaries, which means that the page

// contains one or two partial chunks.

// One chunk covers multiple pages, no cross overs.

// One chunk covers multiple pages, Some chunks are crossing page

// boundaries. Some pages contain one chunk, some contain two.

// Iterate over free chunks and count how many free chunks affect each

// allocated page.

// Each chunk affects one page only.

// In all other cases chunks might affect more than one page.

// Iterate over pages detecting ranges of pages with chunk counters equal

// to the expected number of chunks for the particular page.

// Fast path, every page has the same number of chunks affecting it.

// Show path, go through the pages keeping count how many chunks affect

// each page.

// The idea is to increment the current page pointer by the first chunk

// size, middle portion size (the portion of the page covered by chunks

// except the first and the last one) and then the last chunk size, adding

// up the number of chunks on the current page and checking on every step

// whether the page boundary was crossed.

// FreeArray is the array of free-d chunks (stored as 4-byte offsets).

// In the worst case it may require kRegionSize/SizeClassMap::kMinSize

// elements, but in reality this will not happen. For simplicity we

// dedicate 1/8 of the region's virtual space to FreeArray.

// kRegionSize should be able to satisfy the largest size class.

// kRegionSize must be <= 2^36, see CompactPtrT.

// Call mmap for user memory with at least this size.

// Call mmap for metadata memory with at least this size.

// Call mmap for free array memory with at least this size.

// True if the user has already mapped the entire heap R/W.

// Number of elements in the freearray.

// Bytes mapped for freearray.

// Bytes allocated for user memory.

// Bytes allocated for metadata.

// Bytes mapped for user memory.

// Bytes mapped for metadata.

// Seed for random shuffle, used if kRandomShuffleChunks.

// Whether region is out of space for new chunks.

// Here we divide by a non-constant. This is costly.

// size always fits into 32-bits. If the offset fits too, use 32-bit div.

// Check whether this size class is exhausted.

// region->mutex is held.

// Map more space for chunks, if necessary.

// The random state is initialized from ASLR.

// Postpone the first release to OS attempt for ReleaseToOSIntervalMs,

// preventing just allocated memory from being released sooner than

// necessary and also preventing extraneous ReleaseMemoryPagesToOS calls

// for short lived processes.

// Do it only when the feature is turned on, to avoid a potentially

// extraneous syscall.

// Do the mmap for the user memory.

// Calculate the required space for metadata.

// Map more space for metadata, if necessary.

// If necessary, allocate more space for the free array and populate it with

// newly allocated chunks.

// All necessary memory is mapped and now it is safe to advance all

// 'allocated_*' counters.

// TODO(alekseyshl): Consider bumping last_release_at_ns here to prevent

// MaybeReleaseToOS from releasing just allocated pages or protect these

// not yet used chunks some other way.

// Attempts to release RAM occupied by freed chunks back to OS. The region is

// expected to be locked.

//

// TODO(morehouse): Support a callback on memory release so HWASan can release

// aliases as well.

// No chance to release anything.

// Nothing new to release.

// Memory was returned recently.


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_report.cpp ===
SHA256: eaf55723996f195acbf7a54f6a28abbcf809c829e0d5788a066febcd91ef6a95
//===-- sanitizer_allocator_report.cpp --------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

///

/// \file

/// Shared allocator error reporting for ThreadSanitizer, MemorySanitizer, etc.

///

//===----------------------------------------------------------------------===//

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_report.h ===
SHA256: e874c34db8f9831134f152c3dad11cb29cf3704dc196857dc46a6206d4d39a4f
//===-- sanitizer_allocator_report.h ----------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

///

/// \file

/// Shared allocator error reporting for ThreadSanitizer, MemorySanitizer, etc.

///

//===----------------------------------------------------------------------===//

// namespace __sanitizer

// SANITIZER_ALLOCATOR_REPORT_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_secondary.h ===
SHA256: 125ec19b1e2dcc5d7683217b6f390d93b706cc0a0afe3794ead24cec256a59ee
//===-- sanitizer_allocator_secondary.h -------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Part of the Sanitizer Allocator.

//

//===----------------------------------------------------------------------===//

// Fixed array to store LargeMmapAllocator chunks list, limited to 32K total

// allocated chunks. To be used in memory constrained or not memory hungry cases

// (currently, 32 bits and internal allocator).

// Much less restricted LargeMmapAllocator chunks list (comparing to

// PtrArrayStatic). Backed by mmaped memory region and can hold up to 1M chunks.

// ReservedAddressRange was used instead of just MAP_NORESERVE to achieve the

// same functionality in Fuchsia case, which does not support MAP_NORESERVE.

// This class can (de)allocate only large chunks of memory using mmap/unmap.

// The main purpose of this allocator is to cover large and rare allocation

// sizes not covered by more efficient allocators (e.g. SizeClassAllocator64).

// Overflow.

// Align.

// At least page_size_/2 metadata bytes is available.

// Too slow: CHECK_EQ(p, GetBlockBegin(p));

// Cache-friendly linear search.

// p is at left to this chunk, skip it.

// This function does the same as GetBlockBegin, but is much faster.

// Must be called with the allocator locked.

// This loop is a log(n) lower_bound. It does not check for the exact match

// to avoid expensive cache-thrashing loads.

// Invariant: mid >= beg + 1

// We are not interested in chunks[mid].

// chunks[mid] may still be what we want.

// There are 2 chunks left, choose one.

// ForceLock() and ForceUnlock() are needed to implement Darwin malloc zone

// introspection API.

// Iterate over all existing chunks.

// The allocator must be locked when calling this function.

// Avoid doing the sort while iterating.

// Consistency check: verify that the array did not change.


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_size_class_map.h ===
SHA256: 991504f03eb4fd86cb075c1c493b062e221c95e9211514ab084bfac887362f23
//===-- sanitizer_allocator_size_class_map.h --------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Part of the Sanitizer Allocator.

//

//===----------------------------------------------------------------------===//

// SizeClassMap maps allocation sizes into size classes and back.

// Class 0 always corresponds to size 0.

// The other sizes are controlled by the template parameters:

//   kMinSizeLog: defines the class 1    as 2^kMinSizeLog.

//   kMaxSizeLog: defines the last class as 2^kMaxSizeLog.

//   kMidSizeLog: the classes starting from 1 increase with step

//                2^kMinSizeLog until 2^kMidSizeLog.

//   kNumBits: the number of non-zero bits in sizes after 2^kMidSizeLog.

//             E.g. with kNumBits==3 all size classes after 2^kMidSizeLog

//             look like 0b1xx0..0, where x is either 0 or 1.

//

// Example: kNumBits=3, kMinSizeLog=4, kMidSizeLog=8, kMaxSizeLog=17:

//

// Classes 1 - 16 correspond to sizes 16 to 256 (size = class_id * 16).

// Next 4 classes: 256 + i * 64  (i = 1 to 4).

// Next 4 classes: 512 + i * 128 (i = 1 to 4).

// ...

// Next 4 classes: 2^k + i * 2^(k-2) (i = 1 to 4).

// Last class corresponds to kMaxSize = 1 << kMaxSizeLog.

//

// This structure of the size class map gives us:

//   - Efficient table-free class-to-size and size-to-class functions.

//   - Difference between two consequent size classes is between 14% and 25%

//

// This class also gives a hint to a thread-caching allocator about the amount

// of chunks that need to be cached per-thread:

//  - kMaxNumCachedHint is a hint for maximal number of chunks per size class.

//    The actual number is computed in TransferBatch.

//  - (1 << kMaxBytesCachedLog) is the maximal number of bytes per size class.

//

// Part of output of SizeClassMap::Print():

// c00 => s: 0 diff: +0 00% l 0 cached: 0 0; id 0

// c01 => s: 16 diff: +16 00% l 4 cached: 256 4096; id 1

// c02 => s: 32 diff: +16 100% l 5 cached: 256 8192; id 2

// c03 => s: 48 diff: +16 50% l 5 cached: 256 12288; id 3

// c04 => s: 64 diff: +16 33% l 6 cached: 256 16384; id 4

// c05 => s: 80 diff: +16 25% l 6 cached: 256 20480; id 5

// c06 => s: 96 diff: +16 20% l 6 cached: 256 24576; id 6

// c07 => s: 112 diff: +16 16% l 6 cached: 256 28672; id 7

//

// c08 => s: 128 diff: +16 14% l 7 cached: 256 32768; id 8

// c09 => s: 144 diff: +16 12% l 7 cached: 256 36864; id 9

// c10 => s: 160 diff: +16 11% l 7 cached: 256 40960; id 10

// c11 => s: 176 diff: +16 10% l 7 cached: 256 45056; id 11

// c12 => s: 192 diff: +16 09% l 7 cached: 256 49152; id 12

// c13 => s: 208 diff: +16 08% l 7 cached: 256 53248; id 13

// c14 => s: 224 diff: +16 07% l 7 cached: 256 57344; id 14

// c15 => s: 240 diff: +16 07% l 7 cached: 256 61440; id 15

//

// c16 => s: 256 diff: +16 06% l 8 cached: 256 65536; id 16

// c17 => s: 320 diff: +64 25% l 8 cached: 204 65280; id 17

// c18 => s: 384 diff: +64 20% l 8 cached: 170 65280; id 18

// c19 => s: 448 diff: +64 16% l 8 cached: 146 65408; id 19

//

// c20 => s: 512 diff: +64 14% l 9 cached: 128 65536; id 20

// c21 => s: 640 diff: +128 25% l 9 cached: 102 65280; id 21

// c22 => s: 768 diff: +128 20% l 9 cached: 85 65280; id 22

// c23 => s: 896 diff: +128 16% l 9 cached: 73 65408; id 23

//

// c24 => s: 1024 diff: +128 14% l 10 cached: 64 65536; id 24

// c25 => s: 1280 diff: +256 25% l 10 cached: 51 65280; id 25

// c26 => s: 1536 diff: +256 20% l 10 cached: 42 64512; id 26

// c27 => s: 1792 diff: +256 16% l 10 cached: 36 64512; id 27

//

// ...

//

// c48 => s: 65536 diff: +8192 14% l 16 cached: 1 65536; id 48

// c49 => s: 81920 diff: +16384 25% l 16 cached: 1 81920; id 49

// c50 => s: 98304 diff: +16384 20% l 16 cached: 1 98304; id 50

// c51 => s: 114688 diff: +16384 16% l 16 cached: 1 114688; id 51

//

// c52 => s: 131072 diff: +16384 14% l 17 cached: 1 131072; id 52

//

//

// Another example (kNumBits=2):

// c00 => s: 0 diff: +0 00% l 0 cached: 0 0; id 0

// c01 => s: 32 diff: +32 00% l 5 cached: 64 2048; id 1

// c02 => s: 64 diff: +32 100% l 6 cached: 64 4096; id 2

// c03 => s: 96 diff: +32 50% l 6 cached: 64 6144; id 3

// c04 => s: 128 diff: +32 33% l 7 cached: 64 8192; id 4

// c05 => s: 160 diff: +32 25% l 7 cached: 64 10240; id 5

// c06 => s: 192 diff: +32 20% l 7 cached: 64 12288; id 6

// c07 => s: 224 diff: +32 16% l 7 cached: 64 14336; id 7

// c08 => s: 256 diff: +32 14% l 8 cached: 64 16384; id 8

// c09 => s: 384 diff: +128 50% l 8 cached: 42 16128; id 9

// c10 => s: 512 diff: +128 33% l 9 cached: 32 16384; id 10

// c11 => s: 768 diff: +256 50% l 9 cached: 21 16128; id 11

// c12 => s: 1024 diff: +256 33% l 10 cached: 16 16384; id 12

// c13 => s: 1536 diff: +512 50% l 10 cached: 10 15360; id 13

// c14 => s: 2048 diff: +512 33% l 11 cached: 8 16384; id 14

// c15 => s: 3072 diff: +1024 50% l 11 cached: 5 15360; id 15

// c16 => s: 4096 diff: +1024 33% l 12 cached: 4 16384; id 16

// c17 => s: 6144 diff: +2048 50% l 12 cached: 2 12288; id 17

// c18 => s: 8192 diff: +2048 33% l 13 cached: 2 16384; id 18

// c19 => s: 12288 diff: +4096 50% l 13 cached: 1 12288; id 19

// c20 => s: 16384 diff: +4096 33% l 14 cached: 1 16384; id 20

// c21 => s: 24576 diff: +8192 50% l 14 cached: 1 24576; id 21

// c22 => s: 32768 diff: +8192 33% l 15 cached: 1 32768; id 22

// c23 => s: 49152 diff: +16384 50% l 15 cached: 1 49152; id 23

// c24 => s: 65536 diff: +16384 33% l 16 cached: 1 65536; id 24

// c25 => s: 98304 diff: +32768 50% l 16 cached: 1 98304; id 25

// c26 => s: 131072 diff: +32768 33% l 17 cached: 1 131072; id 26

// kMaxNumCachedHintT is a power of two. It serves as a hint

// for the size of TransferBatch, the actual size could be a bit smaller.

// Estimate the result for kBatchClassID because this class does not know

// the exact size of TransferBatch. It's OK since we are using the actual

// sizeof(TransferBatch) where it matters.

// Force a 32-bit division if the template parameters allow for it.

// Printf("Validate: c%zd\n", c);

// Printf("s%zd => c%zd\n", s, c);

// The following SizeClassMap only holds a way small number of cached entries,

// allowing for denser per-class arrays, smaller memory footprint and usually

// better performances in threaded environments.

// Similar to VeryCompact map above, this one has a small number of different

// size classes, and also reduced thread-local caches.


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_stats.h ===
SHA256: 121ccbbb2463206d2246824b0881ce5477b8c46a0c1510ab79b7c8378ff13160
//===-- sanitizer_allocator_stats.h -----------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Part of the Sanitizer Allocator.

//

//===----------------------------------------------------------------------===//

// Memory allocator statistics

// Per-thread stats, live in per-thread cache.

// Global stats, used for aggregation and querying.

// All stats must be non-negative.


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_array_ref.h ===
SHA256: f4f5e7197e7fe56a781a88ba19a494c903fc13583a456033556d0520c4a5b430
//===-- sanitizer_array_ref.h -----------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/// ArrayRef - Represent a constant reference to an array (0 or more elements

/// consecutively in memory), i.e. a start pointer and a length.  It allows

/// various APIs to take consecutive elements easily and conveniently.

///

/// This class does not own the underlying data, it is expected to be used in

/// situations where the data resides in some other buffer, whose lifetime

/// extends past that of the ArrayRef. For this reason, it is not in general

/// safe to store an ArrayRef.

///

/// This is intended to be trivially copyable, so it should be passed by

/// value.

/// equals - Check for element-wise equality.

/// slice(n, m) - Chop off the first N elements of the array, and keep M

/// elements in the array.

/// slice(n) - Chop off the first N elements of the array.

/// Drop the first \p N elements of the array.

/// Drop the last \p N elements of the array.

/// Return a copy of *this with only the first \p N elements.

/// Return a copy of *this with only the last \p N elements.

// namespace __sanitizer

// SANITIZER_ARRAY_REF_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_asm.h ===
SHA256: 763c9dccf68db0470df8b8c07173ad1e90d473fb01a3a43af0135fab91e3d2ef
//===-- sanitizer_asm.h -----------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Various support for assembler.

//

//===----------------------------------------------------------------------===//

// Some toolchains do not support .cfi asm directives, so we have to hide

// them inside macros.

// GCC defined __GCC_HAVE_DWARF2_CFI_ASM if it supports CFI.

// Clang seems to support CFI by default (or not?).

// We need two versions of macros: for inline asm and standalone asm files.

// No CFI

// Currently, almost all of the shared libraries rely on the value of

// $t9 to get the address of current function, instead of PCREL, even

// on MIPSr6. To be compatiable with them, we have to set $t9 properly.

// MIPS uses GOT to get the address of preemptible functions.

// For details, see interception.h

// Architecture supports interceptor trampoline

// Keep trampoline implementation in sync with interception/interception.h

// Architecture supports interceptor trampoline

// clang-format off

// clang-format on


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_atomic.h ===
SHA256: 59afde82f3a6c4ba37bd86f6979fdb6ee74c43380f834ebdb708f4e9337d1c87
//===-- sanitizer_atomic.h --------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of ThreadSanitizer/AddressSanitizer runtime.

//

//===----------------------------------------------------------------------===//

// If the __atomic atomic builtins are supported (Clang/GCC), use the

// compiler provided macro values so that we can map the atomic operations

// to __atomic_* directly.

// On 32-bit platforms u64 is not necessary aligned on 8 bytes.

// namespace __sanitizer

// Clutter-reducing helpers.

// namespace __sanitizer

// SANITIZER_ATOMIC_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang.h ===
SHA256: 17d6d4e88ced4f4e12d9f969ebec2429496051ae8081ac14d989b63296c1c8bd
//===-- sanitizer_atomic_clang.h --------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of ThreadSanitizer/AddressSanitizer runtime.

// Not intended for direct inclusion. Include sanitizer_atomic.h.

//

//===----------------------------------------------------------------------===//

// Helper to suppress warnings related to 8-byte atomic accesses when the target

// is 32-bit AIX (where such accesses use libatomic).

// We use the compiler builtin atomic operations for loads and stores, which

// generates correct code for all architectures, but may require libatomic

// on platforms where e.g. 64-bit atomics are not supported natively.

// See http://www.cl.cam.ac.uk/~pes20/cpp/cpp0xmappings.html

// for mappings of the memory model to different processors.

// Transitioned from __sync_val_compare_and_swap to support targets like

// SPARC V8 that cannot inline atomic cmpxchg.  __atomic_compare_exchange

// can then be resolved from libatomic.  __ATOMIC_SEQ_CST is used to best

// match the __sync builtin memory order.

// namespace __sanitizer

// SANITIZER_ATOMIC_CLANG_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_atomic_msvc.h ===
SHA256: 274d2208e0df4cdad80658f7b5f05ab35ef4c3b72b4a21967bf6a750eeb5b75e
//===-- sanitizer_atomic_msvc.h ---------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of ThreadSanitizer/AddressSanitizer runtime.

// Not intended for direct inclusion. Include sanitizer_atomic.h.

//

//===----------------------------------------------------------------------===//

// FIXME(dvyukov): 64-bit load is not atomic on 32-bits.

// FIXME(dvyukov): 64-bit store is not atomic on 32-bits.

// namespace __sanitizer

// SANITIZER_ATOMIC_CLANG_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_bitvector.h ===
SHA256: 86974971b15f8090f11af2bec57d8690dbc5658d19623747ee85e8de26f67688
//===-- sanitizer_bitvector.h -----------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Specializer BitVector implementation.

//

//===----------------------------------------------------------------------===//

// Fixed size bit vector based on a single basic integer.

// No CTOR.

// Returns true if the bit has changed from 0 to 1.

// Returns true if the bit has changed from 1 to 0.

// Do "this |= v" and return whether new bits have been added.

// Do "this &= v" and return whether any bits have been removed.

// Do "this &= ~v" and return whether any bits have been removed.

// Returns true if 'this' intersects with 'v'.

// for (BasicBitVector<>::Iterator it(bv); it.hasNext();) {

//   uptr idx = it.next();

//   use(idx);

// }

// Fixed size bit vector of (kLevel1Size*BV::kSize**2) bits.

// The implementation is optimized for better performance on

// sparse bit vectors, i.e. the those with few set bits.

// This is essentially a 2-level bit vector.

// Set bit in the first level BV indicates that there are set bits

// in the corresponding BV of the second level.

// This structure allows O(kLevel1Size) time for clear() and empty(),

// as well fast handling of sparse BVs.

// No CTOR.

// Returns true if the bit has changed from 0 to 1.

// Printf("%s: %zd => %zd %zd %zd; %d\n", __func__,

// idx, i0, i1, i2, res);

// Printf("%s: %zd => %zd %zd %zd\n", __func__, idx, i0, i1, i2);

// Printf("getAndClearFirstOne: %zd %zd %zd => %zd\n", i0, i1, i2, res);

// Do "this |= v" and return whether new bits have been added.

// Do "this &= v" and return whether any bits have been removed.

// Do "this &= ~v" and return whether any bits have been removed.

// Returns true if 'this' intersects with 'v'.

// for (TwoLevelBitVector<>::Iterator it(bv); it.hasNext();) {

//   uptr idx = it.next();

//   use(idx);

// }

// Printf("++++: %zd %zd; %d %d; size %zd\n", i0_, i1_, it1_.hasNext(),

//       it2_.hasNext(), kSize);

// Printf("+i0: %zd %zd; %d %d; size %zd\n", i0_, i1_, it1_.hasNext(),

//   it2_.hasNext(), kSize);

// Printf("++i1: %zd %zd; %d %d; size %zd\n", i0_, i1_, it1_.hasNext(),

//       it2_.hasNext(), kSize);

// Printf("+ret: %zd %zd; %d %d; size %zd; res: %zd\n", i0_, i1_,

//       it1_.hasNext(), it2_.hasNext(), kSize, res);

// namespace __sanitizer

// SANITIZER_BITVECTOR_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_bvgraph.h ===
SHA256: 57ae9fe5142b9bb2911c25bf6e9452716e3eb109d32deba32c5c0ea707925971
//===-- sanitizer_bvgraph.h -------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of Sanitizer runtime.

// BVGraph -- a directed graph.

//

//===----------------------------------------------------------------------===//

// Directed graph of fixed size implemented as an array of bit vectors.

// Not thread-safe, all accesses should be protected by an external lock.

// No CTOR.

// Returns true if a new edge was added.

// Returns true if at least one new edge was added.

// *EXPERIMENTAL*

// Returns true if an edge from=>to exist.

// This function does not use any global state except for 'this' itself,

// and thus can be called from different threads w/o locking.

// This would be racy.

// FIXME: investigate how much we can prove about this race being "benign".

// Returns true if the edge from=>to was removed.

// Returns true if at least one edge *=>to was removed.

// Returns true if at least one edge from=>* was removed.

// Returns true if there is a path from the node 'from'

// to any of the nodes in 'targets'.

// Finds a path from 'from' to one of the nodes in 'target',

// stores up to 'path_size' items of the path into 'path',

// returns the path length, or 0 if there is no path of size 'path_size'.

// The function is recursive, so we don't want to create BV on stack.

// Instead of a getAndClearFirstOne loop we use the slower iterator.

// Same as findPath, but finds a shortest path.

// Keep temporary vectors here since we can not create large objects on stack.

// namespace __sanitizer

// SANITIZER_BVGRAPH_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_chained_origin_depot.cpp ===
SHA256: db4aba4cf77cd4ff2fbd29b2fc53f17ac170173c7c44952b3504f074df32cfe3
//===-- sanitizer_chained_origin_depot.cpp --------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// A storage for chained origins.

//===----------------------------------------------------------------------===//

// namespace

/* This is murmur2 hash for the 64->32 bit case.
   It does not behave all that well because the keys have a very biased
   distribution (I've seen 7-element buckets with the table only 14% full).

   here_id is built of
   * (1 bits) Reserved, zero.
   * (8 bits) Part id = bits 13..20 of the hash value of here_id's key.
   * (23 bits) Sequential number (each part has each own sequence).

   prev_id has either the same distribution as here_id (but with 3:8:21)
   split, or one of two reserved values (-1) or (-2). Either case can
   dominate depending on the workload.
*/

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_chained_origin_depot.h ===
SHA256: e1b838b95513c4b645b556afcc864d5a3398cca31ecb4937405a64db7e34cb2b
//===-- sanitizer_chained_origin_depot.h ------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// A storage for chained origins.

//===----------------------------------------------------------------------===//

// Gets the statistic of the origin chain storage.

// Stores a chain with StackDepot ID here_id and previous chain ID prev_id.

// If successful, returns true and the new chain id new_id.

// If the same element already exists, returns false and sets new_id to the

// existing ID.

// Retrieves the stored StackDepot ID for the given origin ID.

// namespace __sanitizer

// SANITIZER_CHAINED_ORIGIN_DEPOT_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_common.cpp ===
SHA256: 9ab8d967e2514c99ddc2a3b84b576949e9ac1aec7dad02a1ba79369240854118
//===-- sanitizer_common.cpp ----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.

//===----------------------------------------------------------------------===//

// PID of the tracer task in StopTheWorld. It shares the address space with the

// main process, but has a different PID and thus requires special handling.

// Cached pid of parent process - if the parent process dies, we want to keep

// writing to the same log file.

// If raw report is requested or we went into recursion just die.  The

// Report() and CHECK calls below may call mmap recursively and fail.

// If raw report is requested or we went into recursion just die.  The

// Report() and CHECK calls below may call munmap recursively and fail.

// On Windows, both slash and backslash are possible.

// Pick the one that goes last.

// Removes the ANSI escape sequences from the input string (in-place).

// We are going to remove the escape sequences in place.

// Skip over ANSI escape sequences with pointer 's'.

// 's' now points at a character we want to keep. Copy over the buffer

// content if the escape sequence has been perviously skipped andadvance

// both pointers.

// If we have not seen an escape sequence, just advance both pointers.

// Null terminate the string.

// Since for now mmap_limit_mb is not a user-facing flag, just kill

// a program. Use RAW_CHECK to avoid extra mmaps in reporting.

/*out*/

// Call once to make sure that binary_name_cache_str is initialized

/*out*/

/*out*/

// Malloc hooks.

// Returns '1' if the call to free() should be ignored (based on

// __sanitizer_ignore_free_hook), or '0' otherwise.

// namespace __sanitizer

// Provide default (no-op) implementation of malloc hooks.

// extern "C"


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_common.h ===
SHA256: 41da6cafa65aa750b05d5856231d05490ea8b1e6305fbe75c73c57b216ffc5ed
//===-- sanitizer_common.h --------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between run-time libraries of sanitizers.

//

// It declares common functions and classes that are used in both runtimes.

// Implementation of some functions are provided in sanitizer_common, while

// others must be defined by run-time library itself.

//===----------------------------------------------------------------------===//

// Constants.

// 1Gb

// Denotes fake PC values that come from JIT/JAVA/etc.

// For such PC values __tsan_symbolize_external_ex() will be called.

// Can be changed by the tool.

// 32-bit Android only has 4k pages.

// Threads

// Memory management

/*raw_report*/

// Behaves just like MmapOrDie, but tolerates out of memory condition, in that

// case returns nullptr.

// Behaves just like MmapFixedOrDie, but tolerates out of memory condition, in

// that case returns nullptr.

// Map aligned chunk of address space; size and alignment are powers of two.

// Dies on all but out of memory errors, in the latter case returns nullptr.

// Disallow access to a memory range.  Use MmapFixedNoAccess to allocate an

// unaccessible memory.

// Zero previously mmap'd memory. Currently used only on Windows.

// Unmap memory. Currently only used on Linux.

// Maps shadow_size_bytes of shadow memory and returns shadow address. It will

// be aligned to the mmap granularity * 2^shadow_scale, or to

// 2^min_shadow_base_alignment if that is larger. The returned address will

// have max(2^min_shadow_base_alignment, mmap granularity) on the left, and

// shadow_size_bytes bytes on the right, which on linux is mapped no access.

// The high_mem_end may be updated if the original shadow size doesn't fit.

// Let S = max(shadow_size, num_aliases * alias_size, ring_buffer_size).

// Reserves 2*S bytes of address space to the right of the returned address and

// ring_buffer_size bytes to the left.  The returned address is aligned to 2*S.

// Also creates num_aliases regions of accessible memory starting at offset S

// from the returned address.  Each region has size alias_size and is backed by

// the same physical memory.

// Reserve memory range [beg, end]. If madvise_shadow is true then apply

// madvise (e.g. hugepages, core dumping) requested by options.

// Protect size bytes of memory starting at addr. Also try to protect

// several pages at the start of the address space as specified by

// zero_base_shadow_start, at most up to the size or zero_base_max_shadow_start.

// Find an available address space.

// Used to check if we can map shadow memory to a fixed location.

// Releases memory pages entirely within the [beg, end) address range. Noop if

// the provided range does not contain at least one entire page.

// Check if the built VMA size matches the runtime one.

/*out*/

// Parse the contents of /proc/self/smaps and generate a memory profile.

// |cb| is a tool-specific callback that fills the |stats| array.

// Simple low-level (mmap-based) allocator for internal use. Doesn't have

// constructor, so all instances of LowLevelAllocator should be

// linker initialized.

//

// NOTE: Users should instead use the singleton provided via

// `GetGlobalLowLevelAllocator()` rather than create a new one. This way, the

// number of mmap fragments can be reduced and use the same contiguous mmap

// provided by this singleton.

// Requires an external lock.

// Set the min alignment of LowLevelAllocator to at least alignment.

// Allows to register tool-specific callbacks for LowLevelAllocator.

// Passing NULL removes the callback.

// IO

// Lock sanitizer error reporting and protects against nested errors.

// Returns true if the entire range can be read.

// Attempts to copy `n` bytes from memory range starting at `src` to `dest`.

// Returns true if the entire range can be read. Returns `false` if any part of

// the source range cannot be read, in which case the contents of `dest` are

// undefined.

// Copies accessible memory, and zero fill inaccessible.

// Error report formatting.

// Strip the directories from the module name.

// OS

/*out*/

/*out*/

/*out*/

/*out*/

// Other

// Exit

// Returns true if the platform-specific error reported is an OOM error.

// This reports an error in the form:

//

//   `ERROR: {{SanitizerToolName}}: out of memory: {{err_msg}}`

//

// Downstream tools that read sanitizer output will know that errors starting

// in this format are specifically OOM errors.

// Specific tools may override behavior of "Die" function to do tool-specific

// job.

// It's possible to add several callbacks that would be run when "Die" is

// called. The callbacks will be run in the opposite order. The tools are

// strongly recommended to setup all callbacks during initialization, when there

// is only a single thread.

// Functions related to signal handling.

// Signal reporting.

// Each sanitizer uses slightly different implementation of stack unwinding.

// Print deadly signal report and die.

// Part of HandleDeadlySignal, exposed for asan.

// Part of HandleDeadlySignal, exposed for asan.

// Alternative signal stack (POSIX-only).

// Construct a one-line string:

//   SUMMARY: SanitizerToolName: error_message

// and pass it to __sanitizer_report_error_summary.

// If alt_tool_name is provided, it's used in place of SanitizerToolName.

// Same as above, but construct error_message as:

//   error_type file:line[:column][ function]

// Same as above, but obtains AddressInfo by symbolizing top stack trace frame.

// Skips frames which we consider internal and not usefull to the users.

// Math

// Don't use std::min, std::max or std::swap, to minimize dependency

// on libstdc++.

// Char handling

// A low-level vector based on mmap. May incur a significant memory overhead for

// small vectors.

// WARNING: The current implementation supports only POD types.

// Never downsize internal buffer.

// Disallow copies and moves.

// HeapSort for arrays and InternalMmapVector.

// Stage 1: insert elements to the heap.

// Stage 2: swap largest element with the last one,

// and sink the new top.

// Works like std::lower_bound: finds the first element that is not less

// than the val.

// Sorts and removes duplicates from the container.

// Opens the file 'file_name" and reads up to 'max_len' bytes.

// The resulting buffer is mmaped and stored in '*buff'.

// Returns true if file was successfully opened and read.

// Opens the file 'file_name" and reads up to 'max_len' bytes.

// This function is less I/O efficient than ReadFileToVector as it may reread

// file multiple times to avoid mmap during read attempts. It's used to read

// procmap, so short reads with mmap in between can produce inconsistent result.

// The resulting buffer is mmaped and stored in '*buff'.

// The size of the mmaped region is stored in '*buff_size'.

// The total number of read bytes is stored in '*read_len'.

// Returns true if file was successfully opened and read.

// When adding a new architecture, don't forget to also update

// script/asan_symbolize.py and sanitizer_symbolizer_libcdep.cpp.

// Represents a binary loaded into virtual memory (e.g. this can be an

// executable or a shared object).

// Owned.

// List of LoadedModules. OS-dependent implementation is responsible for

// filling this information.

// Uses fallback init if available, otherwise clears

// We rarely have more than 16K loaded modules.

// Callback type for iterating over a set of memory ranges.

// Initialize Android logging. Any writes before this are silently lost.

// FIXME: MacOS implementation could use CRSetCrashLogMessage.

// Unused on Windows.

// Make the compiler think that something is going on there.

// Use this inside a loop that looks like memset/memcpy/etc to prevent the

// compiler from recognising it and turning it into an actual call to

// memset/memcpy/etc.

// In some cases the kernel cannot provide the true faulting address; `addr`

// will be zero then.  This field allows to distinguish between these cases

// and dereferences of null.

// VS2013 doesn't implement unrestricted unions, so we need a trivial default

// constructor

// Creates signal context in a platform-specific manner.

// SignalContext is going to keep pointers to siginfo and context without

// owning them.

// Type of signal e.g. SIGSEGV or EXCEPTION_ACCESS_VIOLATION.

// String description of the signal.

// Returns true if signal is stack overflow.

// Platform specific initialization.

// A simple scope guard. Usage:

// auto cleanup = at_scope_exit([]{ do_cleanup; });

// Linux on 64-bit s390 had a nasty bug that crashes the whole machine

// if a process uses virtual memory over 4TB (as many sanitizers like

// to do).  This function will abort the process if running on a kernel

// that looks vulnerable.

// The default value for allocator_release_to_os_interval_ms common flag to

// indicate that sanitizer allocator should not attempt to release memory to OS.

// Returns the requested amount of random data (up to 256 bytes) that can then

// be used to seed a PRNG. Defaults to blocking like the underlying syscall.

// Returns the number of logical processors on the system.

// namespace __sanitizer

// SANITIZER_COMMON_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc ===
SHA256: 173ee609e8b210ace54d6b28ca5a1682477264f61aabfe9d0ba426628b59ce27
//===-- sanitizer_common_interceptors.inc -----------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Common function interceptors for tools like AddressSanitizer,

// ThreadSanitizer, MemorySanitizer, etc.

//

// This file should be included into the tool's interceptor file,

// which has to define its own macros:

//   COMMON_INTERCEPTOR_ENTER

//   COMMON_INTERCEPTOR_ENTER_NOIGNORE

//   COMMON_INTERCEPTOR_READ_RANGE

//   COMMON_INTERCEPTOR_WRITE_RANGE

//   COMMON_INTERCEPTOR_INITIALIZE_RANGE

//   COMMON_INTERCEPTOR_DIR_ACQUIRE

//   COMMON_INTERCEPTOR_FD_ACQUIRE

//   COMMON_INTERCEPTOR_FD_RELEASE

//   COMMON_INTERCEPTOR_FD_ACCESS

//   COMMON_INTERCEPTOR_SET_THREAD_NAME

//   COMMON_INTERCEPTOR_DLOPEN

//   COMMON_INTERCEPTOR_ON_EXIT

//   COMMON_INTERCEPTOR_SET_PTHREAD_NAME

//   COMMON_INTERCEPTOR_HANDLE_RECVMSG

//   COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED

//   COMMON_INTERCEPTOR_MMAP_IMPL

//   COMMON_INTERCEPTOR_MUNMAP_IMPL

//   COMMON_INTERCEPTOR_COPY_STRING

//   COMMON_INTERCEPTOR_STRNDUP_IMPL

//   COMMON_INTERCEPTOR_STRERROR

//===----------------------------------------------------------------------===//

// SANITIZER_INTERCEPTOR_HOOKS

// _WIN32

// On 32-bit Linux/sparc64, double and long double are identical and glibc

// uses a __nldbl_ (no long double) prefix for various stdio functions.

// musl 1.2.0 on existing 32-bit architectures uses new symbol names for the

// time-related functions that take 64-bit time_t values.  See

// https://musl.libc.org/time64.html

// If we could not find the versioned symbol, fall back to an unversioned

// lookup. This is needed to work around a GLibc bug that causes dlsym

// with RTLD_NEXT to return the oldest versioned symbol.

// See https://sourceware.org/bugzilla/show_bug.cgi?id=14932.

// For certain symbols (e.g. regexec) we have to perform a versioned lookup,

// but that versioned symbol will only exist for architectures where the

// oldest Glibc version pre-dates support for that architecture.

// For example, regexec@GLIBC_2.3.4 exists on x86_64, but not RISC-V.

// See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98920.

// For open_memstream().

/* remove */

/* create */

// SI_POSIX

// Sometimes strlen is called prior to InitializeCommonInterceptors,

// in which case the REAL(strlen) typically used in

// COMMON_INTERCEPTOR_ENTER will fail.  We use internal_strlen here

// to handle that.

// SANITIZER_INTERCEPT_STRNDUP

// SANITIZER_INTERCEPT___STRNDUP

// If strict_string_checks is enabled, we check the whole first argument

// string on the first call (strtok saves this string in a static buffer

// for subsequent calls). We do not need to check strtok's result.

// As the delimiters can change, we check them every call.

// However, when strict_string_checks is disabled we cannot check the

// whole string on the first call. Instead, we check the result string

// which is guaranteed to be a NULL-terminated substring of the first

// argument. We also conservatively check one character of str and the

// delimiters.

// No delimiter were found, it's safe to assume that the entire str was

// scanned.

// SANITIZER_INTERCEPT_MEMMEM

// Keep strlen as macro argument, as macro may ignore it.

// Common code for `memcmp` and `bcmp`.

// Check the entire regions even if the first bytes of the buffers are

// different.

// Fallthrough to REAL(memcmp) below.

// Assuming frexp() always writes to |exp|.

// SANITIZER_INTERCEPT_FREXP

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// libc file streams can call user-supplied functions, see fopencookie.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: this check should be _before_ the call to

// COMMON_INTERCEPTOR_BLOCK_REAL(write), not after

// libc file streams can call user-supplied functions, see fopencookie.

// libc file streams can call user-supplied functions, see fopencookie.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// libc file streams can call user-supplied functions, see fopencookie.

// `fputs(NULL, file)` is supported on Darwin.

// libc file streams can call user-supplied functions, see fopencookie.

// `puts(NULL)` is supported on Darwin.

// SANITIZER_INTERCEPT_PRCTL

// SANITIZER_INTERCEPT_TIME

// AIX tm struct does not have tm_zone field.

// Can not use COMMON_INTERCEPTOR_WRITE_RANGE here, because tm->tm_zone

// can point to shared memory and tsan would report a data race.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// SANITIZER_INTERCEPT_LOCALTIME_AND_FRIENDS

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// Do not call unpoison_tm here, because strptime does not, in fact,

// initialize the entire struct tm. For example, tm_zone pointer is left

// uninitialized.

// SANITIZER_INTERCEPT_ISOC99_SCANF

// FIXME: under ASan the REAL() call below may write to freed memory and

// corrupt its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the REAL() call below may write to freed memory and

// corrupt its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the REAL() call below may write to freed memory and

// corrupt its metadata. See

// https://github.com/google/sanitizers/issues/321.

// SANITIZER_INTERCEPT_PRINTF_L

// SANITIZER_INTERCEPT_ISOC99_PRINTF

// SANITIZER_INTERCEPT_ISOC99_PRINTF

// SANITIZER_INTERCEPT_PRINTF

// AIX does not have [v]asprintf.

// We need a frame pointer, because we call into ioctl_common_[pre|post] which

// can trigger a report and we need to be able to unwind through this

// function.  On Mac in debug mode we might not have a frame pointer, because

// ioctl_common_[pre|post] doesn't get inlined here.

// Note: TSan does not use common flags, and they are zero-initialized.

// This effectively disables ioctl handling in TSan.

// Although request is unsigned long, the rest of the interceptor uses it

// as just "unsigned" to save space, because we know that all values fit in

// "unsigned" - they are compile-time constants.

// FIXME: some ioctls have different return values for success and failure.

// SANITIZER_POSIX

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// The only thing these interceptors do is disable any nested interceptors.

// These functions may open nss modules and call uninstrumented functions from

// them, and we don't want things like strlen() to trigger.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// extern "C"

// namespace __sanitizer

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// itimerval can contain padding that may be legitimately uninitialized

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// We don't yet know if ts is addressable, so we use our own scratch buffer

// +1 for NULL pointer at the end.

// SANITIZER_SOLARIS

// SANITIZER_INTERCEPT_GLOB

// SANITIZER_INTERCEPT_GLOB

// SANITIZER_INTERCEPT_GLOB64

// SANITIZER_INTERCEPT_GLOB64

// SANITIZER_INTERCEPT___B64_TO

// SANITIZER_INTERCEPT___B64_TO

// Changed with https://sourceware.org/git/?p=glibc.git;h=640bbdf

// TODO: add read check if __dn_comp intercept added

// SANITIZER_INTERCEPT_DN_COMP_EXPAND

// SANITIZER_INTERCEPT_DN_COMP_EXPAND

// SANITIZER_INTERCEPT_POSIX_SPAWN

// SANITIZER_INTERCEPT_POSIX_SPAWN

// According to sys/wait.h, wait(), waitid(), waitpid() may have symbol version

// suffixes on Darwin. See the declaration of INTERCEPTOR_WITH_SUFFIX for

// details.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// On FreeBSD id_t is always 64-bit wide.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// SANITIZER_ANDROID

// FIXME: figure out read size based on the address family.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: figure out read size based on the address family.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: consider adding READ_RANGE(sockaddr, salen)

// There is padding in in_addr that may make this too noisy

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// SANITIZER_INTERCEPT_GETHOSTBYNAME

// SANITIZER_INTERCEPT_GETHOSTBYNAME2

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// Some kernel might zero the iovec::iov_base in case of invalid

// write access.  In this case copy the invalid address for further

// inspection.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// Note that PEEK* requests assign different meaning to the return value.

// This function does not handle them (nor does it need to).

// These arrays contain 256 regular elements in unsigned char range + 1 EOF

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// No digits were found at strtol call, we need to find out the last

// symbol accessed by strtoll on our own.

// We get this symbol by skipping leading blanks and optional +/- sign.

// If base has unsupported value, strtol can exit with EINVAL

// without reading any characters. So do additional checks only

// if base is valid.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// This function, and several others, may or may not write the terminating

// \0 character. They write it iff they clear *src.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// Workaround a bug in glibc where dlsym(RTLD_NEXT, ...) returns the oldest

// version of a versioned symbol. For realpath(), this gives us something

// (called __old_realpath) that does not handle NULL in the second argument.

// Handle it as part of the interceptor.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// There are 2 versions of strerror_r:

//  * POSIX version returns 0 on success, negative error code on failure,

//    writes message to buf.

//  * GNU version returns message pointer, which points to either buf or some

//    static storage.

// POSIX version. Spec is not clear on whether buf is NULL-terminated.

// At least on OSX, buf contents are valid even when the call fails.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// GNU version.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

//(_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE ||

//SANITIZER_APPLE

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// This version always returns a null-terminated string.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// 'buffer' might be freed memory, hence it is unsafe to directly call

// REAL(backtrace)(buffer, size). Instead, we use our own known-good

// scratch buffer.

// The COMMON_INTERCEPTOR_READ_RANGE above ensures that 'buffer' is

// valid for reading.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the REAL() call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// We may need to call the real pthread_attr_getstack from the run-time

// in sanitizer_common, but we don't want to include the interception headers

// there. So, just define this function here.

// extern "C"

// namespace __sanitizer

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// !mac !android

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// PTHREAD_MAX_NAMELEN_NP=32

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt its

// metadata. See

// https://github.com/google/sanitizers/issues/321.

// There's no __getdelim() on FreeBSD so we supply the getdelim() interceptor

// with its own body.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// If you see any crashes around this functions, there are 2 known issues with

// it: 1. __tls_get_addr can be called with mis-aligned stack due to:

// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58066

// 2. It can be called recursively if sanitizer code uses __tls_get_addr

// to access thread local variables (it should not happen normally,

// because sanitizers use initial-exec tls model).

// New DTLS block has been allocated.

// On PowerPC, we also need to intercept __tls_get_addr_opt, which has

// mostly the same semantics as __tls_get_addr, but its presence enables

// some optimizations in linker (which are safe to ignore here).

// SANITIZER_S390

// On s390, we have to intercept two functions here:

// - __tls_get_addr_internal, which is a glibc-internal function that is like

//   the usual __tls_get_addr, but returns a TP-relative offset instead of

//   a proper pointer.  It is used by dlsym for TLS symbols.

// - __tls_get_offset, which is like the above, but also takes a GOT-relative

//   descriptor offset as an argument instead of a pointer.  GOT address

//   is passed in r12, so it's necessary to write it in assembly.  This is

//   the function used by the compiler.

// New DTLS block has been allocated.

// SANITIZER_S390

// We need a hidden symbol aliasing the above, so that we can jump

// directly to it from the assembly below.

// Now carefully intercept __tls_get_offset.

// The __intercept_ version has to exist, so that gen_dynamic_list.py

// exports our symbol.

// Assembly wrapper to call REAL(__tls_get_offset)(arg)

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// Here and below, size == 0 is a special case where nothing is written to the

// buffer, and res contains the desired buffer size.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// As long as getifaddrs()/freeifaddrs() use calloc()/free(), we don't need to

// intercept freeifaddrs(). If that ceases to be the case, we might need to

// intercept it to poison the memory again.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// On Linux this is a union, but the other member also points to a

// struct sockaddr, so the following is sufficient.

// FIXME(smatveev): Unpoison p->ifa_data as well.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// We can also return -1 and write to hdrp->version if the version passed in

// hdrp->version is unsupported. But that's not a trivial condition to check,

// and anyway COMMON_INTERCEPTOR_READ_RANGE protects us to some extent.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// SANITIZER_INTERCEPT_FTIME

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// It's not obvious how much data individual xdr_ routines write.

// Simply unpoison the entire target buffer in advance.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: intercept xdr_array, opaque, union, vector, reference, pointer,

// wrapstring, sizeof

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// SANITIZER_INTERCEPT_XDR

// This doesn't apply to the solaris version as it has a different function

// signature.

// We can't allocate a wrapper on the stack, as the handle is used outside

// this stack frame. So we put it on the heap, and keep track of it with

// the HashMap (keyed by x_private). When we later need to xdr_destroy,

// we can index the map, free the wrapper, and then clean the map entry.

// We have to intercept this to be able to free wrapper memory;

// otherwise it's not necessary.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// SANITIZER_HAS_STRUCT_FILE

// These guys are called when a .c source is built with -O2.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: handle fp == NULL

// We care about a very specific use-case: dladdr on

// statically-linked ASan may return <main program>

// instead of the library.

// We therefore only take effect if the sanitizer is statically

// linked, and we don't bother canonicalizing paths because

// dladdr should return the same address both times (we assume

// the user did not canonicalize the result from dladdr).

// It's possible they copied the string from dladdr, so

// we do a string comparison rather than pointer comparison.

// RTLD_DEFAULT

// !SANITIZER_DYNAMIC

// Linux kernel has a bug that leads to kernel deadlock if a process

// maps TBs of memory and then calls mlock().

// SANITIZER_INTERCEPT_MLOCKX

// SANITIZER_INTERCEPT_FOPENCOOKIE

// Workaround a bug in glibc's "old" semaphore implementation by

// zero-initializing the sem_t contents. This has to be done here because

// interceptors bind to the lowest version before glibc 2.36, hitting the

// buggy code path while the non-sanitized build of the same code works fine.

// SANITIZER_INTERCEPT_SEM

// prevent "set but not used" warning

// Can't check dstaddr as it may have uninitialized padding at the end.

// FIXME: add other *stat interceptor

// Keep strnlen as macro argument, as macro may ignore it.

// src is checked in the strlcpy() interceptor

// Reuse the rest of the code in the strlcpy() interceptor

// One handles the trailing \0

// One handles the trailing \0

// One handles the trailing \0

// One handles the trailing \0

// The implementation demands and hardcodes 10 elements

// Hardcode 10 elements as this is hardcoded size

// TODO(kamil): handle compar callback

// Skip rnode, it's rarely used and not trivial to sanitize

// It's also used mostly internally

// TODO(kamil): Implement strtoll as a common inteceptor

// dst is NULL terminated and end points to the NULL char

// nvis cannot make sure the dst is NULL terminated

// The interface will be valid even if there is no space for NULL char

// FIXME: only need to be checked when "flag | VIS_NOLOCALE" doesn't hold

// according to the implementation

// The interface will be valid even if there is no space for NULL char

// FIXME: only need to be checked when "flag | VIS_NOLOCALE" doesn't hold

// according to the implementation

// If GRND_NONBLOCK is set in the flags, it is non blocking.

// Run the comparator over all array elements to detect any memory issues.

// Glibc qsort uses a temporary buffer allocated either on stack or on heap.

// Poisoned memory from there may get copied into the comparator arguments,

// where it needs to be dealt with. But even that is not enough - the results of

// the sort may be copied into the input/output array based on the results of

// the comparator calls, but directly from the temp memory, bypassing the

// unpoisoning done in wrapped_qsort_compar. We deal with this by, again,

// unpoisoning the entire array after the sort is done.

//

// We can not check that the entire array is initialized at the beginning. IMHO,

// it's fine for parts of the sorted objects to contain uninitialized memory,

// ex. as padding in structs.

// Run the comparator over all array elements to detect any memory issues.

// Handle qsort() implementations that recurse using an

// interposable function call:

// This case should only happen if the qsort() implementation calls itself

// using a preemptible function call (e.g. the FreeBSD libc version).

// Check that the size and comparator arguments are as expected.

// reap_acquire/reap_release bears no arguments.

// FreeBSD's <sys/utsname.h> define uname() as

// static __inline int uname(struct utsname *name) {

//   return __xuname(SYS_NMLN, (void*)name);

// }

// namespace __sanitizer

// FIXME: add other *stat interceptors.


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_format.inc ===
SHA256: 20ac58fd47f9681947f72a35775535d422182a3dba8ec8eda58cf5d4b4b56e09
//===-- sanitizer_common_interceptors_format.inc ----------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Scanf/printf implementation for use in *Sanitizer interceptors.

// Follows http://pubs.opengroup.org/onlinepubs/9699919799/functions/fscanf.html

// and http://pubs.opengroup.org/onlinepubs/9699919799/functions/fprintf.html

// with a few common GNU extensions.

//

//===----------------------------------------------------------------------===//

// n$

// Otherwise, do not change p. This will be re-parsed later as the field

// width.

// Returns true if the character is an integer conversion specifier.

// Returns true if the character is an floating point conversion specifier.

// Returns string output character size for string-like conversions,

// or 0 if the conversion is invalid.

// Store size not known in advance; can be calculated as wcslen() of the

// destination buffer.

// Store size not known in advance; can be calculated as strlen() of the

// destination buffer.

// Invalid conversion specifier.

// Returns the memory size of a format directive (if >0), or a value of

// FormatStoreSize.

// Printf promotes floats to doubles but scanf does not

// argument index, or -1 if not specified ("%n$")

// suppress assignment ("*")

// allocate space ("m")

// Parse scanf format string. If a valid directive in encountered, it is

// returned in dir. This function returns the pointer to the first

// unprocessed character, or 0 in case of error.

// In case of the end-of-string, a pointer to the closing \0 is returned.

// %%

// %n$

// *

// Field width

// Width if at all must be non-zero

// m

// Length modifier.

// Conversion specifier.

// Consume %[...] expression.

// unexpected end of string

// Consume the closing ']'.

// This is unfortunately ambiguous between old GNU extension

// of %as, %aS and %a[...] and newer POSIX %a followed by

// letters s, S or [.

// Watch for %a[h-j%d], if % appears in the

// [...] range, then we need to give up, we don't know

// if scanf will parse it as POSIX %a [h-j %d ] or

// GNU allocation of string with range dh-j plus %.

// Consume the closing ']'.

// This is ambiguous, so check the smaller size of char * (if it is

// a GNU extension of %as, %aS or %a[...]) and float (if it is

// POSIX %a followed by s, S or [ letters).

// Common part of *scanf interceptors.

// Process format string and va_list, and report all store ranges.

// Stops when "consuming" n_inputs input items.

// This can only happen at the end of the format string.

// Here the directive is valid. Do what it says.

// Unsupported.

// FIXME: actually use wcslen() to calculate it.

// For %mc/%mC/%ms/%m[/%mS, write the allocated output buffer as well.

// 's' or '['

// width argument index, or -1 if not specified ("%*n$")

// precision argument index, or -1 if not specified (".*n$")

// Parse printf format string. Same as scanf_parse_next.

// %%

// %n$

// Flags

// Field width

// Precision

// Actual precision is optional (surprise!)

// m$

// Length modifier.

// Conversion specifier.

// Common part of *printf interceptors.

// Process format string and va_list, and report all load ranges.

// This can only happen at the end of the format string.

// Here the directive is valid. Do what it says.

// Unsupported.

// Dynamic width

// Dynamic precision

// %m does not require an argument: strlen(errno).

// FIXME: properly support starred precision for strings.

// Won't read more than "precision" symbols.

// Whole string will be accessed.

// FIXME: Properly support wide-character strings (via wcsrtombs).

// Skip non-pointer args

// SANITIZER_INTERCEPT_PRINTF


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc ===
SHA256: 67298bef01c139cc2b1eac73ba13eae7d00e69382bec3fb4e18722ff9b385992
//===-- sanitizer_common_interceptors_ioctl.inc -----------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Ioctl handling in common sanitizer interceptors.

//===----------------------------------------------------------------------===//

// FIXME: support read+write arguments. Currently READWRITE and WRITE do the

// same thing.

// XXX: The declarations below may use WRITE instead of READWRITE, unless

// explicitly noted.

// This can not be declared as a global, because references to struct_*_sz

// require a global initializer. And this table must be available before global

// initializers are run.

// Conflicting request ids.

// _(CDROMAUDIOBUFSIZ, NONE, 0);

// _(SNDCTL_TMR_CONTINUE, NONE, 0);

// _(SNDCTL_TMR_START, NONE, 0);

// _(SNDCTL_TMR_STOP, NONE, 0);

// _(SOUND_MIXER_READ_LOUD, WRITE, sizeof(int)); // same as ...READ_ENHANCE

// _(SOUND_MIXER_READ_MUTE, WRITE, sizeof(int)); // same as ...READ_ENHANCE

// _(SOUND_MIXER_WRITE_LOUD, WRITE, sizeof(int)); // same as ...WRITE_ENHANCE

// _(SOUND_MIXER_WRITE_MUTE, WRITE, sizeof(int)); // same as ...WRITE_ENHANCE

// fixup

// fixup

// fixup

// _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE

// The following ioctl requests are shared between AX25, IPX, netrom and

// mrouted.

// _(SIOCAIPXITFCRT, READ, sizeof(char));

// _(SIOCAX25GETUID, READ, struct_sockaddr_ax25_sz);

// _(SIOCNRGETPARMS, WRITE, struct_nr_parms_struct_sz);

// _(SIOCAIPXPRISLT, READ, sizeof(char));

// _(SIOCNRSETPARMS, READ, struct_nr_parms_struct_sz);

// _(SIOCAX25ADDUID, READ, struct_sockaddr_ax25_sz);

// _(SIOCNRDECOBS, NONE, 0);

// _(SIOCAX25DELUID, READ, struct_sockaddr_ax25_sz);

// _(SIOCIPXCFGDATA, WRITE, struct_ipx_config_data_sz);

// _(SIOCAX25NOUID, READ, sizeof(int));

// _(SIOCNRRTCTL, READ, sizeof(int));

// _(SIOCAX25DIGCTL, READ, sizeof(int));

// _(SIOCAX25GETPARMS, WRITE, struct_ax25_parms_struct_sz);

// _(SIOCAX25SETPARMS, READ, struct_ax25_parms_struct_sz);

// Handle the most evil ioctls that encode argument value as part of request id.

// Strip size and event number.

// Strip absolute axis number.

// Sanity check.

// Size can be 0 iff type is NONE.

// Sanity check.

// Try stripping access size from the request id.

// Sanity check: requests that encode access size are either read or write and

// have size of 0 in the table.

// FIXME: add verbose output


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_memintrinsics.inc ===
SHA256: 2c715a8977b025791e2d62a40a36b4796da1f64d85a394237849194ea2fc37e8
//===-- sanitizer_common_interceptors_memintrinsics.inc ---------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Memintrinsic function interceptors for tools like AddressSanitizer,

// ThreadSanitizer, MemorySanitizer, etc.

//

// These interceptors are part of the common interceptors, but separated out so

// that implementations may add them, if necessary, to a separate source file

// that should define SANITIZER_COMMON_NO_REDEFINE_BUILTINS at the top.

//

// This file should be included into the tool's memintrinsic interceptor file,

// which has to define its own macros:

//   COMMON_INTERCEPTOR_ENTER

//   COMMON_INTERCEPTOR_READ_RANGE

//   COMMON_INTERCEPTOR_WRITE_RANGE

//   COMMON_INTERCEPTOR_MEMSET_IMPL

//   COMMON_INTERCEPTOR_MEMMOVE_IMPL

//   COMMON_INTERCEPTOR_MEMCPY_IMPL

//   COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED

//===----------------------------------------------------------------------===//

// Platform-specific options.

// SANITIZER_APPLE

// On OS X, calling internal_memcpy here will cause memory corruptions,

// because memcpy and memmove are actually aliases of the same

// implementation.  We need to use internal_memmove here.

// N.B.: If we switch this to internal_ we'll have to use internal_memmove

// due to memcpy being an alias of memmove on OS X.

// Note the argument order.

// SANITIZER_INTERCEPT_AEABI_MEM

// SANITIZER_INTERCEPT___BZERO

// SANITIZER_INTERCEPT_BZERO

// This does not need to be called if InitializeCommonInterceptors() is called.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_netbsd_compat.inc ===
SHA256: 775ce34b792d4cebc5fda277f0abbc3fd4a26d1f2b515ff4d9206c3064df12dd
//===-- sanitizer_common_interceptors_netbsd_compat.inc ---------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Common function interceptors for tools like AddressSanitizer,

// ThreadSanitizer, MemorySanitizer, etc.

//

// Interceptors for NetBSD old function calls that have been versioned.

//

// NetBSD minimal version supported 9.0.

// NetBSD current version supported 9.99.26.

//

//===----------------------------------------------------------------------===//

// First undef all mangled symbols.

// Next, define compat interceptors.

// Finally, undef INIT_ and redefine it.

// This allows to avoid preprocessor issues.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.

// FIXME: under ASan the call below may write to freed memory and corrupt

// its metadata. See

// https://github.com/google/sanitizers/issues/321.


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_common_interface.inc ===
SHA256: fda82c6701775b80c25ab8e3a6bbc210a378032d4f5a73ee2109196a9f583cf1
//===-- sanitizer_common_interface.inc ------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Sanitizer Common interface list.

//===----------------------------------------------------------------------===//

// Sanitizer weak hooks

// Stacktrace interface.

// Allocator interface.

// Memintrinsic functions.


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_common_interface_posix.inc ===
SHA256: 4009a60eebea6832b245d78b6c705620274385d58ba1b60b4783eb3a8b005ff5
//===-- sanitizer_common_interface_posix.inc ------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Sanitizer Common interface list only available for Posix systems.

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cpp ===
SHA256: a92349cfe2ecac9dc188d7cbef4b37f32a0ece40031cc9d9f9f3d8353d0f0dae
//===-- sanitizer_common_libcdep.cpp --------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.

//===----------------------------------------------------------------------===//

// Weak default implementation for when sanitizer_stackdepot is not linked in.

// If RSS has grown 10% since last time, print some information.

// If stack depot has grown 10% since last time, print it too.

// Check RSS against the limit.

// Need to implement/test on other platforms.

// Start the background thread if one of the rss limits is given.

// Can't spawn the thread anyway.

// We avoid global-constructors to be sure that globals are ready when

// sanitizers need them. This can happend before global constructors executed.

// Here we don't mind if thread is started on later stages.

// Print one line at a time.

// syslog, at least on Android, has an implicit message length limit.

// Print remaining characters, if there are any.

// Note that this will add an extra newline at the end.

// FIXME: buffer extra output. This would need a thread-local buffer, which

// on Android requires plugging into the tools (ex. ASan's) Thread class.

// Reserve memory range [beg, end].

// We need to use inclusive range because end+1 may not be representable.

// Don't count the shadow against mmap_limit_mb.

// A few pages at the start of the address space can not be protected.

// But we really want to protect as much as possible, to prevent this memory

// being returned as a result of a non-FIXED mmap().

// !SANITIZER_FUCHSIA

// Weak default implementation for when sanitizer_stackdepot is not linked in.

// SANITIZER_WEAK_ATTRIBUTE is unsupported.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_common_nolibc.cpp ===
SHA256: aca20a30700d7e5512c6960a93b9322c2e36b220a6ef08b210298b25718d5a73
//===-- sanitizer_common_nolibc.cpp ---------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file contains stubs for libc function to facilitate optional use of

// libc in no-libcdep sources.

//===----------------------------------------------------------------------===//

// The Windows implementations of these functions use the win32 API directly,

// bypassing libc.

// !SANITIZER_WINDOWS

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_common_syscalls.inc ===
SHA256: 7e56c4e150ef9499f77448f0ecb6a03e6bbfeda64157b57bc381036b6890fa19
//===-- sanitizer_common_syscalls.inc ---------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Common syscalls handlers for tools like AddressSanitizer,

// ThreadSanitizer, MemorySanitizer, etc.

//

// This file should be included into the tool's interceptor file,

// which has to define it's own macros:

//   COMMON_SYSCALL_PRE_READ_RANGE

//          Called in prehook for regions that will be read by the kernel and

//          must be initialized.

//   COMMON_SYSCALL_PRE_WRITE_RANGE

//          Called in prehook for regions that will be written to by the kernel

//          and must be addressable. The actual write range may be smaller than

//          reported in the prehook. See POST_WRITE_RANGE.

//   COMMON_SYSCALL_POST_READ_RANGE

//          Called in posthook for regions that were read by the kernel. Does

//          not make much sense.

//   COMMON_SYSCALL_POST_WRITE_RANGE

//          Called in posthook for regions that were written to by the kernel

//          and are now initialized.

//   COMMON_SYSCALL_ACQUIRE(addr)

//          Acquire memory visibility from addr.

//   COMMON_SYSCALL_RELEASE(addr)

//          Release memory visibility to addr.

//   COMMON_SYSCALL_FD_CLOSE(fd)

//          Called before closing file descriptor fd.

//   COMMON_SYSCALL_FD_ACQUIRE(fd)

//          Acquire memory visibility from fd.

//   COMMON_SYSCALL_FD_RELEASE(fd)

//          Release memory visibility to fd.

//   COMMON_SYSCALL_PRE_FORK()

//          Called before fork syscall.

//   COMMON_SYSCALL_POST_FORK(long res)

//          Called after fork syscall.

//   COMMON_SYSCALL_BLOCKING_START()

//         Called before blocking syscall.

//   COMMON_SYSCALL_BLOCKING_END()

//         Called after blocking syscall.

//===----------------------------------------------------------------------===//

// FIXME: do some kind of PRE_READ for all syscall arguments (int(s) and such).

// Real sigset size is always passed as a syscall argument.

// Declare it "void" to catch sizeof(kernel_sigset_t).

// This functions uses POST_READ, because it needs to run after syscall to know

// the real read range.

// !SANITIZER_ANDROID

// SANITIZER_GLIBC

// SANITIZER_GLIBC

// (*ctx) is actually a pointer to a kernel mapped page, and there are

// people out there who are crazy enough to peek into that page's 32-byte

// header.

// We synchronize io_submit -> io_getevents/io_cancel using the

// user-provided data context. Data is not necessary a pointer, it can be

// an int, 0 or whatever; acquire/release will correctly handle this.

// This scheme can lead to false negatives, e.g. when all operations

// synchronize on 0. But there does not seem to be a better solution

// (except wrapping all operations in own context, which is unreliable).

// We can not reliably extract fildes in io_getevents.

// See comment in io_getevents.

// See comment in io_getevents.

// SANITIZER_USES_UID16_SYSCALLS

// FIXME: POST_READ

// FIXME: POST_READ

// SANITIZER_ANDROID

// Note that this is different from the interceptor in

// sanitizer_common_interceptors.inc.

// PEEK* requests return resulting values through data pointer.

// The third argument to this system call is nowadays unused.

// Missing definition of 'struct old_linux_dirent'.

// extern "C"

// SANITIZER_LINUX


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_fuchsia.cpp ===
SHA256: e166155503b1b22af5cf3918738d99531a2beca45a039ce85bc6905178de7471
//===-- sanitizer_coverage_fuchsia.cpp ------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Sanitizer Coverage Controller for Trace PC Guard, Fuchsia-specific version.

//

// This Fuchsia-specific implementation uses the same basic scheme and the

// same simple '.sancov' file format as the generic implementation.  The

// difference is that we just produce a single blob of output for the whole

// program, not a separate one per DSO.  We do not sort the PC table and do

// not prune the zeros, so the resulting file is always as large as it

// would be to report 100% coverage.  Implicit tracing information about

// the address ranges of DSOs allows offline tools to split the one big

// blob into separate files that the 'sancov' tool can understand.

//

// Unlike the traditional implementation that uses an atexit hook to write

// out data files at the end, the results on Fuchsia do not go into a file

// per se.  The 'coverage_dir' option is ignored.  Instead, they are stored

// directly into a shared memory object (a Zircon VMO).  At exit, that VMO

// is handed over to a system service that's responsible for getting the

// data out to somewhere that it can be fed into the sancov tool (where and

// how is not our problem).

// TODO(mcgrathr): Move the constant into a header shared with other impls.

// Collects trace-pc guard coverage.

// This class relies on zero-initialization.

// For each PC location being tracked, there is a u32 reserved in global

// data called the "guard".  At startup, we assign each guard slot a

// unique index into the big results array.  Later during runtime, the

// first call to TracePcGuard (below) will store the corresponding PC at

// that index in the array.  (Each later call with the same guard slot is

// presumed to be from the same PC.)  Then it clears the guard slot back

// to zero, which tells the compiler not to bother calling in again.  At

// the end of the run, we have a big array where each element is either

// zero or is a tracked PC location that was hit in the trace.

// This is called from global constructors.  Each translation unit has a

// contiguous array of guard slots, and a constructor that calls here

// with the bounds of its array.  Those constructors are allowed to call

// here more than once for the same array.  Usually all of these

// constructors run in the initial thread, but it's possible that a

// dlopen call on a secondary thread will run constructors that get here.

// Complete the setup before filling in any guards with indices.

// This avoids the possibility of code called from Setup reentering

// TracePcGuard.

// Publish the VMO to the system, where it can be collected and

// analyzed after this process exits.  This always consumes the VMO

// handle.  Any failure is just logged and not indicated to us.

// This will route to __sanitizer_log_write, which will ensure that

// information about shared libraries is written out.  This message

// uses the `dumpfile` symbolizer markup element to highlight the

// dump.  See the explanation for this in:

// https://fuchsia.googlesource.com/zircon/+/master/docs/symbolizer_markup.md

// We map in the largest possible view into the VMO: one word

// for every possible 32-bit index value.  This avoids the need

// to change the mapping when increasing the size of the VMO.

// We can always spare the 32G of address space.

// The first sample goes at [1] to reserve [0] for the magic number.

// Give the VMO a name including our process KOID so it's easy to spot.

// Map the largest possible view we might need into the VMO.  Later

// we might need to increase the VMO's size before we can use larger

// indices, but we'll never move the mapping address so we don't have

// any multi-thread synchronization issues with that.

// Hereafter other threads are free to start storing into

// elements [1, next_index_) of the big array.

// Store the magic number.

// Hereafter, the VMO serves as the contents of the '.sancov' file.

// The VMO is already mapped in, but it's not big enough to use the

// new indices.  So increase the size to cover the new maximum index.

// namespace

// namespace __sancov

// namespace __sanitizer

// Default empty implementations (weak). Users should redefine them.

// extern "C"

// !SANITIZER_FUCHSIA


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_interface.inc ===
SHA256: d78b633d5ea088783147ed91941502eb5357876d4f0bcee5d35a46c7823f570b
//===-- sanitizer_coverage_interface.inc ----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Sanitizer Coverage interface list.

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cpp ===
SHA256: 79de1187735da9d70157913049b445dd1825c4279a4731c4f47640a1bc70bf37
//===-- sanitizer_coverage_libcdep_new.cpp --------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Sanitizer Coverage Controller for Trace PC Guard.

// Collects trace-pc guard coverage.

// This class relies on zero-initialization.

// we start indices from 1.

// A basic default implementation of callbacks for

// -fsanitize-coverage=inline-8bit-counters,pc-table.

// Use TOOL_OPTIONS (UBSAN_OPTIONS, etc) to dump the coverage data:

// * cov_8bit_counters_out=PATH to dump the 8bit counters.

// * cov_pcs_out=PATH to dump the pc table.

//

// Most users will still need to define their own callbacks for greater

// flexibility.

// namespace SingletonCounterCoverage

// namespace

// namespace __sancov

// May happen if two sanitizer enable coverage in the same process.

// namespace __sanitizer

// Default implementations (weak).

// Either empty or very simple.

// Most users should redefine them.

// extern "C"

// Weak definition for code instrumented with -fsanitize-coverage=stack-depth

// and later linked with code containing a strong definition.

// E.g., -fsanitize=fuzzer-no-link

// FIXME: Update Apple deployment target so that thread_local is always

// supported, and remove the #if.

// FIXME: Figure out how this should work on Windows, exported thread_local

// symbols are not supported:

// "data with thread storage duration may not have dll interface"

// !SANITIZER_FUCHSIA


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_win_runtime_thunk.cpp ===
SHA256: 0eec3310daeec1dc35169b8ad6cb880474694e58d62adf081caafa51951f549b
//===-- sanitizer_coverage_win_runtime_thunk.cpp --------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file defines things that need to be present in the application modules

// to interact with Sanitizer Coverage, when it is included in a dll.

//

//===----------------------------------------------------------------------===//

// Define weak alias for all weak functions imported from sanitizer coverage.

// defined(SANITIZER_DYNAMIC_RUNTIME_THUNK) ||

// defined(SANITIZER_STATIC_RUNTIME_THUNK)

// Add one, otherwise unused, external symbol to this object file so that the

// Visual C++ linker includes it and reads the .drective section.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_win_sections.cpp ===
SHA256: d2d4a615dfaba682bed796a7800eec934b37851fea162911eb8f54787b74d950
//===-- sanitizer_coverage_win_sections.cpp -------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file defines delimiters for Sanitizer Coverage's section. It contains

// Windows specific tricks to coax the linker into giving us the start and stop

// addresses of a section, as ELF linkers can do, to get the size of certain

// arrays. According to https://msdn.microsoft.com/en-us/library/7977wcck.aspx

// sections with the same name before "$" are sorted alphabetically by the

// string that comes after "$" and merged into one section. We take advantage

// of this by putting data we want the size of into the middle (M) of a section,

// by using the letter "M" after "$". We get the start of this data (ie:

// __start_section_name) by making the start variable come at the start of the

// section (using the letter A after "$"). We do the same to get the end of the

// data by using the letter "Z" after "$" to make the end variable come after

// the data. Note that because of our technique the address of the start

// variable is actually the address of data that comes before our middle

// section. We also need to prevent the linker from adding any padding. Each

// technique we use for this is explained in the comments below.

//===----------------------------------------------------------------------===//

// Use uint64_t so the linker won't need to add any padding if it tries to word

// align the start of the 8-bit counters array. The array will always start 8

// bytes after __start_sancov_cntrs.

// Even though we said not to align __stop__sancov_cntrs (using the "align"

// declspec), MSVC's linker may try to align the section, .SCOV$CZ, containing

// it. This can cause a mismatch between the number of PCs and counters since

// each PCTable element is 8 bytes (unlike counters which are 1 byte) so no

// padding would be added to align .SCOVP$Z, However, if .SCOV$CZ section is 1

// byte, the linker won't try to align it on an 8-byte boundary, so use a

// uint8_t for __stop_sancov_cntrs.

// The guard array and counter array should both be merged into the .data

// section to reduce the number of PE sections. However, because PCTable is

// constant it should be merged with the .rdata section.

// SANITIZER_WINDOWS


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_dbghelp.h ===
SHA256: c5cd5b7b185eb9ee4eedf73d40f5afcd096abc6cc395ba23f048e7ff41ba884a
//===-- sanitizer_dbghelp.h ------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Wrappers for lazy loaded dbghelp.dll. Provides function pointers and a

// callback to initialize them.

//

//===----------------------------------------------------------------------===//

// namespace __sanitizer

// SANITIZER_SYMBOLIZER_WIN_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_deadlock_detector.h ===
SHA256: ef16c70079a5f255967470e7bc48f549092185ccea04056c9632992ae39b2c79
//===-- sanitizer_deadlock_detector.h ---------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of Sanitizer runtime.

// The deadlock detector maintains a directed graph of lock acquisitions.

// When a lock event happens, the detector checks if the locks already held by

// the current thread are reachable from the newly acquired lock.

//

// The detector can handle only a fixed amount of simultaneously live locks

// (a lock is alive if it has been locked at least once and has not been

// destroyed). When the maximal number of locks is reached the entire graph

// is flushed and the new lock epoch is started. The node ids from the old

// epochs can not be used with any of the detector methods except for

// nodeBelongsToCurrentEpoch().

//

// FIXME: this is work in progress, nothing really works yet.

//

//===----------------------------------------------------------------------===//

// Thread-local state for DeadlockDetector.

// It contains the locks currently held by the owning thread.

// No CTOR.

// Returns true if this is the first (non-recursive) acquisition of this lock.

// The lock is already held by this thread, it must be recursive.

// lock_id < BV::kSize, can cast to a smaller int.

// probably addLock happened before flush

// DeadlockDetector.

// For deadlock detection to work we need one global DeadlockDetector object

// and one DeadlockDetectorTLS object per evey thread.

// This class is not thread safe, all concurrent accesses should be guarded

// by an external lock.

// Most of the methods of this class are not thread-safe (i.e. should

// be protected by an external lock) unless explicitly told otherwise.

// No CTOR.

// Allocate new deadlock detector node.

// If we are out of available nodes first try to recycle some.

// If there is nothing to recycle, flush the graph and increment the epoch.

// Associate 'data' (opaque user's object) with the new node.

// removeEdgesFrom was called in removeNode.

// We are out of vacant nodes. Flush and increment the current_epoch_.

// Get data associated with the node created by newNode().

// Returns true if there is a cycle in the graph after this lock event.

// Ideally should be called before the lock is acquired so that we can

// report a deadlock before a real deadlock happens.

// Add cur_node to the set of locks held currently by dtls.

// Experimental *racy* fast path function.

// Returns true if all edges from the currently held locks to cur_node exist.

// Read from current_epoch_ is racy.

// Adds edges from currently held locks to cur_node,

// returns the number of added edges, and puts the sources of added edges

// into added_edges[].

// Should be called before onLockAfter.

// Test-only function. Handles the before/after lock events,

// returns true if there is a cycle.

// Handles the try_lock event, returns false.

// When a try_lock event happens (i.e. a try_lock call succeeds) we need

// to add this lock to the currently held locks, but we should not try to

// change the lock graph or to detect a cycle.  We may want to investigate

// whether a more aggressive strategy is possible for try_lock.

// Returns true iff dtls is empty (no locks are currently held) and we can

// add the node to the currently held locks w/o changing the global state.

// This operation is thread-safe as it only touches the dtls.

// Finds a path between the lock 'cur_node' (currently not held in dtls)

// and some currently held lock, returns the length of the path

// or 0 on failure.

// Handle the unlock event.

// This operation is thread-safe as it only touches the dtls.

// Tries to handle the lock event w/o writing to global state.

// Returns true on success.

// This operation is thread-safe as it only touches the dtls

// (modulo racy nature of hasAllEdges).

// idx1 and idx2 are raw indices to g_, not lock IDs.

// namespace __sanitizer

// SANITIZER_DEADLOCK_DETECTOR_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_deadlock_detector1.cpp ===
SHA256: 8ad75b27a98d1ab9eb51427580e5267d9d1fb46d9495ef8acf61a29e4c8d9353
//===-- sanitizer_deadlock_detector1.cpp ----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Deadlock detector implementation based on NxN adjacency bit matrix.

//

//===----------------------------------------------------------------------===//

// DeadlockDetector's bit vector.

// This will be the first lock held by lt.

// We already have all edges.

// FIXME: allow this only for recursive locks.

// Actually add this edge now so that we have all the stack traces.

// A cycle of 20+ locks? Well, that's a bit odd...

// Printf("Edge: %zd=>%zd: %u/%u T%d\n", from, to, stk_from, stk_to,

//    unique_tid);

// Printf("T%p MutexLock:   %zx stk %u\n", lt, m->id, stk);

// Only a recursive rlock may be held.

// Printf("T%p MutexUnLock: %zx\n", cb->lt, m->id);

// namespace __sanitizer

// #if SANITIZER_DEADLOCK_DETECTOR_VERSION == 1


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_deadlock_detector2.cpp ===
SHA256: 25d1a3448d3d63a9b5fe9ef7703455a5b0fdbd752b08577d1f919b73a9170415
//===-- sanitizer_deadlock_detector2.cpp ----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Deadlock detector implementation based on adjacency lists.

//

//===----------------------------------------------------------------------===//

// FIXME(dvyukov): don't allocate id if lt->nlocked == 0?

// FIXME(dvyukov): check stale links

// FIXME(dvyukov): check stale links

// Remove the mutex from lt->locked if there.

// Clear and invalidate the mutex descriptor.

// Return id to cache.

// Bingo!

// MutexState *mtx2 = getMutex(link->id);

// FIXME(dvyukov): fast seq check

// FIXME(dvyukov): fast nlink != 0 check

// FIXME(dvyukov): fast pending check?

// FIXME(dvyukov): npending can be larger than kMaxMutex

// namespace __sanitizer

// #if SANITIZER_DEADLOCK_DETECTOR_VERSION == 2


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_deadlock_detector_interface.h ===
SHA256: 82296c5ff0fee5760f4fa0489b1a289a6906f434b92e24f35053e97b964b8810
//===-- sanitizer_deadlock_detector_interface.h -----------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of Sanitizer runtime.

// Abstract deadlock detector interface.

// FIXME: this is work in progress, nothing really works yet.

//

//===----------------------------------------------------------------------===//

// dd - deadlock detector.

// lt - logical (user) thread.

// pt - physical (OS) thread.

// creation stack

// number of entries in loop

// user thread context

// user mutex context, start of the edge

// user mutex context, end of the edge

// stack ids for the edge

// namespace __sanitizer

// SANITIZER_DEADLOCK_DETECTOR_INTERFACE_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_dense_map.h ===
SHA256: 062b5561c5a824df7480bfb08cafd7162f67fab2da9b4ba91cf537b6296e2d95
//===- sanitizer_dense_map.h - Dense probed hash table ----------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This is fork of llvm/ADT/DenseMap.h class with the following changes:

//  * Use mmap to allocate.

//  * No iterators.

//  * Does not shrink.

//

//===----------------------------------------------------------------------===//

/// Grow the densemap so that it can contain at least \p NumEntries items

/// before resizing again.

// Use a simpler loop when values don't need destruction.

/// Return true if the specified key is in the map, false otherwise.

/// Return 1 if the specified key is in the map, 0 otherwise.

/// Alternate version of find() which allows a different, and possibly

/// less expensive, key type.

/// The DenseMapInfo is responsible for supplying methods

/// getHashValue(LookupKeyT) and isEqual(LookupKeyT, KeyT) for each key

/// type used.

/// lookup - Return the entry for the specified key, or a default

/// constructed value if no such entry exists.

// Inserts key,value pair into the map if the key isn't already in the map.

// If the key is already in the map, it returns false and doesn't update the

// value.

// Inserts key,value pair into the map if the key isn't already in the map.

// If the key is already in the map, it returns false and doesn't update the

// value.

// Inserts key,value pair into the map if the key isn't already in the map.

// The value is constructed in-place if the key is not in the map, otherwise

// it is not moved.

// Already in map.

// Otherwise, insert the new element.

// Inserts key,value pair into the map if the key isn't already in the map.

// The value is constructed in-place if the key is not in the map, otherwise

// it is not moved.

// Already in map.

// Otherwise, insert the new element.

/// Alternate version of insert() which allows a different, and possibly

/// less expensive, key type.

/// The DenseMapInfo is responsible for supplying methods

/// getHashValue(LookupKeyT) and isEqual(LookupKeyT, KeyT) for each key

/// type used.

// Already in map.

// Otherwise, insert the new element.

// not in map.

/// Iterate over active entries of the container.

///

/// Function can return fast to stop the process.

// Nothing to do.

/// Returns the number of buckets to allocate to ensure that the DenseMap can

/// accommodate \p NumEntries without need to grow().

// Ensure that "NumEntries * 4 < NumBuckets * 3"

// +1 is required because of the strict equality.

// For example if NumEntries is 48, we need to return 401.

/* NextPowerOf2 */

// Insert all the old elements.

// Insert the key/value into the new table.

// silence warning.

// Free the value.

// If the load of the hash table is more than 3/4, or if fewer than 1/8 of

// the buckets are empty (meaning that many are filled with tombstones),

// grow the table.

//

// The later case is tricky.  For example, if we had one empty bucket with

// tons of tombstones, failing lookups (e.g. for insertion) would have to

// probe almost the entire table until it found the empty bucket.  If the

// table completely filled with tombstones, no lookup would ever succeed,

// causing infinite loops in lookup.

// Only update the state after we've grown our bucket space appropriately

// so that when growing buckets we have self-consistent entry count.

// If we are writing over a tombstone, remember this.

// Otherwise, it's a hash collision or a tombstone, continue quadratic

// probing.

/// LookupBucketFor - Lookup the appropriate bucket for Val, returning it in

/// FoundBucket.  If the bucket contains the key and a value, this returns

/// true, otherwise it returns a bucket with an empty marker or tombstone and

/// returns false.

// FoundTombstone - Keep track of whether we find a tombstone while probing.

// Found Val's bucket?  If so, return it.

// If we found an empty bucket, the key doesn't exist in the set.

// Insert it and return the default value.

// If we've already seen a tombstone while probing, fill it in instead

// of the empty bucket we eventually probed to.

// If this is a tombstone, remember it.  If Val ends up not in the map, we

// prefer to return it than something that would require more probing.

// Remember the first tombstone found.

// Otherwise, it's a hash collision or a tombstone, continue quadratic

// probing.

/// Return the approximate size (in bytes) of the actual map.

/// This is just the raw memory used by DenseMap.

/// If entries are pointers to objects, the size of the referenced objects

/// are not included.

/// Equality comparison for DenseMap.

///

/// Iterates over elements of LHS confirming that each (key, value) pair in LHS

/// is also in RHS, and that no additional pairs are in RHS.

/// Equivalent to N calls to RHS.find and N value comparisons. Amortized

/// complexity is linear, worst case is O(N^2) (if every hash collides).

/// Inequality comparison for DenseMap.

///

/// Equivalent to !(LHS == RHS). See operator== for performance notes.

// Lift some types from the dependent base class into this class for

// simplicity of referring to them.

/// Create a DenseMap with an optional \p InitialReserve that guarantee that

/// this number of elements can be inserted in the map without grow()

// Free the old table.

// We always allocate at least a page, so use entire space.

// namespace __sanitizer

// SANITIZER_DENSE_MAP_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_dense_map_info.h ===
SHA256: 77651fb69c6f372eeb87feb50a5633f1617c893615842c820305a51d440e7d57
//===- sanitizer_dense_map_info.h - Type traits for DenseMap ----*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/// Simplistic combination of 32-bit hash values into 32-bit hash values.

// We extend a pair to allow users to override the bucket type with their own

// implementation without requiring two members.

// end namespace detail

// static T getEmptyKey();

// static T getTombstoneKey();

// static unsigned getHashValue(const T &Val);

// static bool isEqual(const T &LHS, const T &RHS);

// Provide DenseMapInfo for all pointers. Come up with sentinel pointer values

// that are aligned to alignof(T) bytes, but try to avoid requiring T to be

// complete. This allows clients to instantiate DenseMap<T*, ...> with forward

// declared key types. Assume that no pointer key type requires more than 4096

// bytes of alignment.

// The following should hold, but it would require T to be complete:

// static_assert(alignof(T) <= (1 << Log2MaxAlign),

//               "DenseMap does not support pointer keys requiring more than "

//               "Log2MaxAlign bits of alignment");

// Provide DenseMapInfo for chars.

// Provide DenseMapInfo for unsigned chars.

// Provide DenseMapInfo for unsigned shorts.

// Provide DenseMapInfo for unsigned ints.

// Provide DenseMapInfo for unsigned longs.

// Provide DenseMapInfo for unsigned long longs.

// Provide DenseMapInfo for shorts.

// Provide DenseMapInfo for ints.

// Provide DenseMapInfo for longs.

// Provide DenseMapInfo for long longs.

// Provide DenseMapInfo for all pairs whose members have info.

// namespace __sanitizer

// SANITIZER_DENSE_MAP_INFO_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_dl.cpp ===
SHA256: 2bd93a7ecac7564f273db348d3abb774675cd7abe4f94eef66c550ddb252d8f3
//===-- sanitizer_dl.cpp --------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file has helper functions that depend on libc's dynamic loading

// introspection.

//

//===----------------------------------------------------------------------===//

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_dl.h ===
SHA256: 4b6b5ee84aa040d60c09bbcc2f98242eb9204b4508dc5a90bbd60561b76b107e
//===-- sanitizer_dl.h ----------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file has helper functions that depend on libc's dynamic loading

// introspection.

//

//===----------------------------------------------------------------------===//

// Returns the path to the shared object or - in the case of statically linked

// sanitizers

// - the main program itself, that contains the sanitizer.

// namespace __sanitizer

// SANITIZER_DL_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_emscripten.cpp ===
SHA256: 1c90fd6dc1d6339f8bf893f9aa5655ec6dad6bbc9b2b1a69a2d89d69d964e733
//===-- sanitizer_emscripten.cc -------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This provides implementations of some functions in sanitizer_linux_libcdep.c

// on emscripten. We are not using sanitizer_linux_libcdep.c because it contains

// a lot of threading and other code that does not work with emscripten yet,

// so instead, some minimal implementations are provided here so that UBSan can

// work.

//===----------------------------------------------------------------------===//

// Emscripten represents program counters as offsets into WebAssembly

// modules. For JavaScript code, the "program counter" is the line number

// of the JavaScript code with the high bit set.

// Therefore, PC values 0x80000000 and beyond represent JavaScript code.

// As a result, 0x00000000 to 0x7FFFFFFF represents PC values for WASM code.

// We consider WASM code as main_module.

/*executable*/

/*writable*/

// The remaining PC values, 0x80000000 to 0xFFFFFFFF, are JavaScript,

// and we consider it a separate module, js_module.

/*executable*/

/*writable*/

// TODO: have some workable alternative, since we can't just fork and suspend

// the parent process. This does not matter when single thread.

// madvise is currently ignored

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_errno.cpp ===
SHA256: be7560687cbe1a4b141c66967359189f59be4f60078c5346354bcdee5c1aa5d7
//===-- sanitizer_errno.cpp -------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between sanitizers run-time libraries.

//

// Defines errno to avoid including errno.h and its dependencies into other

// files (e.g. interceptors are not supposed to include any system headers).

//

//===----------------------------------------------------------------------===//

// EOWNERDEAD is not present in some older platforms.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_errno.h ===
SHA256: a7231423db966e0448bd2cdf66bb81b67d21d8e824170b9b2ce2f97ffde69ef1
//===-- sanitizer_errno.h ---------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between sanitizers run-time libraries.

//

// Defines errno to avoid including errno.h and its dependencies into sensitive

// files (e.g. interceptors are not supposed to include any system headers).

// It's ok to use errno.h directly when your file already depend on other system

// includes though.

//

//===----------------------------------------------------------------------===//

// SANITIZER_ERRNO_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_errno_codes.h ===
SHA256: fd9ab4cf3ed3bc3fbf2d7ccbc5814b7529d4dfa0a3a28a9986bbc4f37514f2a0
//===-- sanitizer_errno_codes.h ---------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between sanitizers run-time libraries.

//

// Defines errno codes to avoid including errno.h and its dependencies into

// sensitive files (e.g. interceptors are not supposed to include any system

// headers).

// It's ok to use errno.h directly when your file already depend on other system

// includes though.

//

//===----------------------------------------------------------------------===//

// XXX EMSCRIPTEN: use wasi errno codes, which is what our musl port now uses

// Those might not present or their value differ on different platforms.

// namespace __sanitizer

// SANITIZER_ERRNO_CODES_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_file.cpp ===
SHA256: d4ed08f3f190502ef5feeed0742809e3698fa6a746694f416dbefd1133b328c0
//===-- sanitizer_file.cpp -----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.  It defines filesystem-related interfaces.  This

// is separate from sanitizer_common.cpp so that it's simpler to disable

// all the filesystem support code for a port that doesn't use it.

//

//===---------------------------------------------------------------------===//

// If in tracer, use the parent's file.

// If the report file is already opened by the current process,

// do nothing. Otherwise the report file was opened by the parent

// process, close it now.

/// Parse the report path \p pattern and copy the parsed path to \p dest.

///

/// * `%%` becomes `%`

/// * `%H` expands to the environment variable `HOME`

/// * `%t` expands to the environment variable `TMPDIR`

/// * `%p` expands to the process ID (PID)

// Copy over previous substring.

// Use printf directly to write the PID since it's not a static string.

// Invalid pattern: fallback to original pattern.

// The files we usually open are not seekable, so try different buffer sizes.

// Read up to one page at a time.

// We've read the whole file.

// namespace __sanitizer

// extern "C"

// !SANITIZER_FUCHSIA


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_file.h ===
SHA256: 9624879e1ca7c99e6f29e848ace21c6a6f270dac111faa3d4577e8b6484f7e46
//===-- sanitizer_file.h ---------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

//

// This file is shared between run-time libraries of sanitizers.

// It declares filesystem-related interfaces.  This is separate from

// sanitizer_common.h so that it's simpler to disable all the filesystem

// support code for a port that doesn't use it.

//

//===---------------------------------------------------------------------===//

// Don't use fields directly. They are only declared public to allow

// aggregate initialization.

// Protects fields below.

// Opened file descriptor. Defaults to stderr. It may be equal to

// kInvalidFd, in which case new file will be opened when necessary.

// Path prefix of report file, set via __sanitizer_set_report_path.

// Full path to report, obtained as <path_prefix>.PID

// PID of the process that opened fd. If a fork() occurs,

// the PID of child will be different from fd_pid.

// Returns kInvalidFd on error.

// Return true on success, false on error.

// Scoped file handle closer.

// OS

// Returns true on success, false on failure.

// Starts a subprocess and returns its pid.

// If *_fd parameters are not kInvalidFd their corresponding input/output

// streams will be redirect to the file. The files will always be closed

// in parent process even in case of an error.

// The child process will close all fds after STDERR_FILENO

// before passing control to a program.

// Checks if specified process is still running

// Waits for the process to finish and returns its exit code.

// Returns -1 in case of an error.

// Maps given file to virtual memory, and returns pointer to it

// (or NULL if mapping fails). Stores the size of mmaped region

// in '*buff_size'.

// namespace __sanitizer

// SANITIZER_FILE_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.cpp ===
SHA256: 1f75a4b3d826bd2ab38499b8b5782ea281eef4fe372e94739169a4b4b6abcc1f
//===-- sanitizer_flag_parser.cpp -----------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of ThreadSanitizer/AddressSanitizer runtime.

//

//===----------------------------------------------------------------------===//

// consume the closing quote

// Do a sanity check for certain flags.

// Backup current parser state to allow nested ParseString() calls.

// Unrecognized flag. This is not a fatal error, we may print a warning later.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.h ===
SHA256: f5da2b64c5966d6537fccd2c350d7bcd87fe6c6dc663aee1b33dabcc41363d67
//===-- sanitizer_flag_parser.h ---------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of ThreadSanitizer/AddressSanitizer runtime.

//

//===----------------------------------------------------------------------===//

// Write the C string representation of the current value (truncated to fit)

// into the buffer of size `size`. Returns false if truncation occurred and

// returns true otherwise.

// namespace __sanitizer

// SANITIZER_FLAG_REGISTRY_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_flags.cpp ===
SHA256: 768791198267fda5c50e17d8e2ea463866e2136d0af777d37203aa2dab467054
//===-- sanitizer_flags.cpp -----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of ThreadSanitizer/AddressSanitizer runtime.

//

//===----------------------------------------------------------------------===//

// Copy the string from "s" to "out", making the following substitutions:

// %b = binary basename

// %p = pid

// %d = binary directory

// skip "%b"

// skip "%p"

// skip "%d"

// Note `original_path_` isn't actually what's parsed due to `%`

// substitutions. Printing the substituted path would require holding onto

// mmap'ed memory.

/*ignore_missing*/

/*ignore_missing*/

// need to record coverage to generate coverage report.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_flags.h ===
SHA256: 4a7c3860e0de09f6d0f6b04071176b6cb671cf39b47712bd6980e6643339d894
//===-- sanitizer_flags.h ---------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of ThreadSanitizer/AddressSanitizer runtime.

//

//===----------------------------------------------------------------------===//

// Functions to get/set global CommonFlags shared by all sanitizer runtimes:

// This function can only be used to setup tool-specific overrides for

// CommonFlags defaults. Generally, it should only be used right after

// SetCommonFlagsDefaults(), but before ParseCommonFlagsFromString(), and

// only during the flags initialization (i.e. before they are used for

// the first time).

// Should be called after parsing all flags. Sets up common flag values

// and perform initializations common to all sanitizers (e.g. setting

// verbosity).

// Platform specific flags initialization.

// namespace __sanitizer

// SANITIZER_FLAGS_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_flags.inc ===
SHA256: 694b3494a98237cb8f3029a6f3f572c4a27fdbbddbedafcb42ec44364234127b
//===-- sanitizer_flags.h ---------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file describes common flags available in all sanitizers.

//

//===----------------------------------------------------------------------===//

// COMMON_FLAG(Type, Name, DefaultValue, Description)

// Supported types: bool, const char *, int, uptr.

// Default value must be a compile-time constant.

// Description must be a string literal.

// ARM thumb/thumb2 frame pointer is inconsistent on GCC and Clang [1]

// and fast-unwider is also unreliable with mixing arm and thumb code [2].

// [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92172

// [2] https://bugs.llvm.org/show_bug.cgi?id=44158

// With static linking, dladdr((void*)pthread_join) or similar will return the

// path to the main program. This flag will replace dlopen(<main program,...>

// with dlopen(NULL,...), which is the correct way to get a handle to the main

// program.


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_flat_map.h ===
SHA256: 200754e2c43d9f36a9f761db79ee20c590145d263bb2352783a03563a244b770
//===-- sanitizer_flat_map.h ------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Part of the Sanitizer Allocator.

//

//===----------------------------------------------------------------------===//

// Maps integers in rage [0, kSize) to values.

// TwoLevelMap maps integers in range [0, kSize1*kSize2) to values.

// It is implemented as a two-dimensional array: array of kSize1 pointers

// to kSize2-byte arrays. The secondary arrays are mmaped on demand.

// Each value is initially zero and can be set to something else only once.

// Setting and getting values from multiple threads is safe w/o extra locking.

// This code needs to use memory_order_acquire/consume, but we use

// memory_order_relaxed for performance reasons (matters for arm64). We

// expect memory_order_relaxed to be effectively equivalent to

// memory_order_consume in this case for all relevant architectures: all

// dependent data is reachable only by dereferencing the resulting pointer.

// If relaxed load fails to see stored ptr, the code will fall back to

// Create() and reload the value again with locked mutex as a memory

// barrier.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp ===
SHA256: 0745c2cf20433f686aa15b7b62ecae668d7e215f223e1b60b5962505f09a909f
//===-- sanitizer_fuchsia.cpp ---------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and other sanitizer

// run-time libraries and implements Fuchsia-specific functions from

// sanitizer_common.h.

//===----------------------------------------------------------------------===//

// Why doesn't this return void?

// Normal race.

// For any sanitizer internal that needs to map something which can be unmapped

// later, first attempt to map to a pre-allocated VMAR. This helps reduce

// fragmentation from many small anonymous mmap calls. A good value for this

// VMAR size would be the total size of your typical sanitizer internal objects

// allocated in an "average" process lifetime. Examples of this include:

// FakeStack, LowLevelAllocator mappings, TwoLevelMap, InternalMmapVector,

// StackStore, CreateAsanThread, etc.

//

// This is roughly equal to the total sum of sanitizer internal mappings for a

// large test case.

/*vmo_offset=*/

// This means there's no space in the heap VMAR, so fallback to the root

// VMAR.

/*vmo_offset=*/

/*vmar_offset=*/

// If there wasn't any space in the heap vmar, the fallback was the root

// vmar.

// Destroying the vmar effectively unmaps the whole mapping.

// Partial unmapping does not affect the fact that the initial range is still

// reserved, and the resulting unmapped memory can't be reused.

/*raw_report=*/

// This should never be called.

// Map a larger size to get a chunk of address space big enough that

// it surely contains an aligned region of the requested size.  Then

// overwrite the aligned middle portion with a mapping from the

// beginning of the VMO, and unmap the excess before and after.

/*vmar_offset=*/

// TODO(mcgrathr): write it

// TODO(mcgrathr): Figure out a better way.

// TODO: implement.

// FIXME implement on this platform.

// Flush all complete lines before returning.

/*out*/

/*out*/

// namespace __sanitizer

// Handle the initialization code in each sanitizer, but no other calls.

// This setting is never consulted on Fuchsia.

// extern "C"

// SANITIZER_FUCHSIA


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.h ===
SHA256: 3f6346b11b42c7d9ac49c12d0def5386d03b1466aad6b1bcbfd0c60dec5766d2
//===-- sanitizer_fuchsia.h ------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

//

// Fuchsia-specific sanitizer support.

//

//===---------------------------------------------------------------------===//

// Current index into the vector.

// Individual sanitizers can define this to explicitly run something at the end

// of `__sanitizer_startup_hook`. This can be useful if a sanitizer needs to do

// extra work after the common startup hook code is called and before module

// ctors are invoked. For example, hwasan can explicitly call its initializing

// function here so it can be set up before libc extensions are initialized.

// namespace __sanitizer

// SANITIZER_FUCHSIA

// SANITIZER_FUCHSIA_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_getauxval.h ===
SHA256: 6f79d528fca8818293b45fbc07a6666c00d145c76570cbd7e72b25bcb961da52
//===-- sanitizer_getauxval.h -----------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Common getauxval() guards and definitions.

// getauxval() is not defined until glibc version 2.16, or until API level 21

// for Android.

// Implement the getauxval() compat function for NetBSD.

//

//===----------------------------------------------------------------------===//

// The weak getauxval definition allows to check for the function at runtime.

// This is useful for Android, when compiled at a lower API level yet running

// on a more recent platform that offers the function.

// SANITIZER_GETAUXVAL_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_glibc_version.h ===
SHA256: 80336fca92678a8cc15b5b21dbc3be0b793486b678c2cb62a9203404b13f72ab
//===-- sanitizer_glibc_version.h -----------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of Sanitizer common code.

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_haiku.cpp ===
SHA256: 6fc02ad7e5c55134e79725119e8511e422141549e3ff9fb509b54d58618292b5
//===-- sanitizer_haiku.cpp -----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between Sanitizer run-time libraries and implements

// Haiku-specific functions from sanitizer_libc.h.

//===----------------------------------------------------------------------===//

// --------------- sanitizer_libc.h

// Unreachable.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_hash.h ===
SHA256: a6c0174196bc82111a63bd61309e8998c912b91c3b65c627db166d448e68358a
//===-- sanitizer_common.h --------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements a simple hash function.

//===----------------------------------------------------------------------===//

// namespace __sanitizer

// SANITIZER_HASH_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc ===
SHA256: 2e6f885c457e19ab1e67eebe64b006584a76b4cb923fae069051780c9d3fc2ef
//===-- sanitizer_interceptors_ioctl_netbsd.inc -----------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Ioctl handling in common sanitizer interceptors.

//===----------------------------------------------------------------------===//

// FIXME: support read+write arguments. Currently READWRITE and WRITE do the

// same thing.

// XXX: The declarations below may use WRITE instead of READWRITE, unless

// explicitly noted.

// This can not be declared as a global, because references to struct_*_sz

// require a global initializer. And this table must be available before global

// initializers are run.

/* Entries from file: altq/altq_afmap.h */

/* Entries from file: altq/altq.h */

/* Entries from file: altq/altq_blue.h */

/* Entries from file: altq/altq_cbq.h */

/* Entries from file: altq/altq_cdnr.h */

/* Entries from file: altq/altq_fifoq.h */

/* Entries from file: altq/altq_hfsc.h */

/* Entries from file: altq/altq_jobs.h */

/* Entries from file: altq/altq_priq.h */

/* Entries from file: altq/altq_red.h */

/* Entries from file: altq/altq_rio.h */

/* Entries from file: altq/altq_wfq.h */

/* Entries from file: crypto/cryptodev.h */

/* Entries from file: dev/apm/apmio.h */

/* Entries from file: dev/dm/netbsd-dm.h */

/* Entries from file: dev/dmover/dmover_io.h */

/* Entries from file: dev/dtv/dtvio_demux.h */

/* Entries from file: dev/dtv/dtvio_frontend.h */

/* Entries from file: dev/hdaudio/hdaudioio.h */

/* Entries from file: dev/hdmicec/hdmicecio.h */

/* Entries from file: dev/hpc/hpcfbio.h */

/* Entries from file: dev/i2o/iopio.h */

/* Entries from file: dev/ic/athioctl.h */

/* Entries from file: dev/ic/bt8xx.h */

/* Entries from file: dev/ic/icp_ioctl.h */

/* Entries from file: dev/ic/isp_ioctl.h */

/* Entries from file: dev/ic/mlxio.h */

/* Entries from file: dev/ic/nvmeio.h */

/* Entries from file: dev/ic/qemufwcfgio.h */

/* Entries from file: dev/ir/irdaio.h */

/* Entries from file: dev/isa/isvio.h */

/* Entries from file: dev/isa/wtreg.h */

/* Entries from file: dev/iscsi/iscsi_ioctl.h */

/* Entries from file: dev/ofw/openfirmio.h */

/* Entries from file: dev/pci/amrio.h */

/* Entries from file: dev/pci/mlyio.h */

/* Entries from file: dev/pci/pciio.h */

/* Entries from file: dev/pci/tweio.h */

/* Entries from file: dev/pcmcia/if_cnwioctl.h */

/* Entries from file: dev/pcmcia/if_rayreg.h */

/* Entries from file: dev/raidframe/raidframeio.h */

/* Entries from file: dev/sbus/mbppio.h */

/* Entries from file: dev/scsipi/ses.h */

/* Entries from file: dev/sun/disklabel.h */

/* Entries from file: dev/sun/fbio.h */

/* Entries from file: dev/sun/kbio.h */

/* Entries from file: dev/sun/vuid_event.h */

/* Entries from file: dev/tc/sticio.h */

/* Entries from file: dev/usb/ukyopon.h */

/* Entries from file: dev/usb/usb.h */

/* Entries from file: dev/usb/utoppy.h */

/* Entries from file: dev/vme/xio.h */

/* Entries from file: dev/wscons/wsdisplay_usl_io.h */

/* Entries from file: dev/wscons/wsconsio.h */

/* Entries from file: dev/biovar.h */

/* Entries from file: dev/md.h */

/* Entries from file: dev/ccdvar.h */

/* Entries from file: dev/cgdvar.h */

/* Entries from file: dev/fssvar.h */

/* Entries from file: dev/bluetooth/btdev.h */

/* Entries from file: dev/bluetooth/btsco.h */

/* Entries from file: dev/kttcpio.h */

/* Entries from file: dev/lockstat.h */

/* Entries from file: dev/vndvar.h */

/* Entries from file: dev/spkrio.h */

/* Entries from file: dev/nvmm/nvmm_ioctl.h */

/* Entries from file: dev/spi/spi_io.h */

/* Entries from file: fs/autofs/autofs_ioctl.h */

/* Entries from file: net/bpf.h */

/* Entries from file: net/if_gre.h */

/* Entries from file: net/if_ppp.h */

/* Entries from file: net/npf.h */

/* Entries from file: net/if_pppoe.h */

/* Entries from file: net/if_sppp.h */

/* Entries from file: net/if_srt.h */

/* Entries from file: net/if_tap.h */

/* Entries from file: net/if_tun.h */

/* Entries from file: net/pfvar.h */

/* Entries from file: netbt/hci.h */

/* Entries from file: netinet/ip_nat.h */

/* Entries from file: netinet/sctp_uio.h */

/* Entries from file: netinet6/in6_var.h */

/* Entries from file: netsmb/smb_dev.h */

/* Entries from file: sys/agpio.h */

/* Entries from file: sys/audioio.h */

/* Entries from file: sys/ataio.h */

/* Entries from file: sys/cdio.h */

/* Entries from file: sys/chio.h */

/* Entries from file: sys/clockctl.h */

/* Entries from file: sys/cpuio.h */

/* Entries from file: sys/dkio.h */

/* Entries from file: sys/drvctlio.h */

/* Entries from file: sys/dvdio.h */

/* Entries from file: sys/envsys.h */

/* Entries from file: sys/event.h */

/* Entries from file: sys/fdio.h */

/* Entries from file: sys/filio.h */

/* Entries from file: sys/gpio.h */

/* Entries from file: sys/ioctl.h */

/* Entries from file: sys/ioctl_compat.h */

/* Entries from file: sys/joystick.h */

/* Entries from file: sys/ksyms.h */

/* Entries from file: sys/lua.h */

/* Entries from file: sys/midiio.h */

/* Entries from file: sys/mtio.h */

/* Entries from file: sys/power.h */

/* Entries from file: sys/radioio.h */

/* Entries from file: sys/rndio.h */

/* Entries from file: sys/scanio.h */

/* Entries from file: sys/scsiio.h */

/* Entries from file: sys/sockio.h */

/* Entries from file: sys/timepps.h */

/* Entries from file: sys/ttycom.h */

/* Entries from file: sys/verified_exec.h */

/* Entries from file: sys/videoio.h */

/* Entries from file: sys/wdog.h */

/* Entries from file: sys/kcov.h */

/* Entries from file: sys/ipmi.h */

/* Entries from file: soundcard.h */

/* Entries from file: dev/filemon/filemon.h (compat <= 9.99.26) */

/* Entries from file: dev/usb/urio.h (compat <= 9.99.43) */

// Sanity check.

// Size can be 0 iff type is NONE.

// Sanity check.

// Try stripping access size from the request id.

// Sanity check: requests that encode access size are either read or write and

// have size of 0 in the table.

// FIXME: add verbose output

// SANITIZER_NETBSD


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_interface_internal.h ===
SHA256: 7f26e5e91ce59417b4dcea9d02a05bce14dc3dfcdc29df5b82d8afe7efd67242
//===-- sanitizer_interface_internal.h --------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between run-time libraries of sanitizers.

//

// This header declares the sanitizer runtime interface functions.

// The runtime library has to define these functions so the instrumented program

// could call them.

//

// See also include/sanitizer/common_interface_defs.h

//===----------------------------------------------------------------------===//

// Tell the tools to write their reports to "path.<pid>" instead of stderr.

// The special values are "stdout" and "stderr".

// Tell the tools to write their reports to the provided file descriptor

// (casted to void *).

// Get the current full report file path, if a path was specified by

// an earlier call to __sanitizer_set_report_path. Returns null otherwise.

// Notify the tools that the sandbox is going to be turned on.

// This function is called by the tool when it has just finished reporting

// an error. 'error_summary' is a one-line string that summarizes

// the error message. This function can be overridden by the client.

// Returns size of dynamically allocated block. This function can be overridden

// by the client.

// Returns 1 on the first call, then returns 0 thereafter.  Called by the tool

// to ensure only one report is printed when multiple errors occur

// simultaneously.

// extern "C"

// SANITIZER_INTERFACE_INTERNAL_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h ===
SHA256: 9cf514a3d9c9584e4c2b5bcbcbbd9519331220c2b37d09517ce2b0ae868f4922
//===-- sanitizer_internal_defs.h -------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer.

// It contains macro used in run-time libraries code.

//===----------------------------------------------------------------------===//

// GCC does not understand __has_feature.

// Only use SANITIZER_*ATTRIBUTE* before the function return type!

// SANITIZER_APPLE

// SANITIZER_WINDOWS

//--------------------------- WEAK FUNCTIONS ---------------------------------//

// When working with weak functions, to simplify the code and make it more

// portable, when possible define a default implementation using this macro:

//

// SANITIZER_INTERFACE_WEAK_DEF(<return_type>, <name>, <parameter list>)

//

// For example:

//   SANITIZER_INTERFACE_WEAK_DEF(bool, compare, int a, int b) { return a > b; }

//

// SANITIZER_SUPPORTS_WEAK_HOOKS means that we support real weak functions that

// will evaluate to a null pointer when not defined.

// Before Xcode 4.5, the Darwin linker doesn't reliably support undefined

// weak symbols.  Mac OS X 10.9/Darwin 13 is the first release only supported

// by Xcode >= 4.5.

// SANITIZER_SUPPORTS_WEAK_HOOKS

// For some weak hooks that will be called very often and we want to avoid the

// overhead of executing the default implementation when it is not necessary,

// we can use the flag SANITIZER_SUPPORTS_WEAK_HOOKS to only define the default

// implementation for platforms that doesn't support weak symbols. For example:

//

//   #if !SANITIZER_SUPPORT_WEAK_HOOKS

//     SANITIZER_INTERFACE_WEAK_DEF(bool, compare_hook, int a, int b) {

//       return a > b;

//     }

//   #endif

//

// And then use it as: if (compare_hook) compare_hook(a, b);

//----------------------------------------------------------------------------//

// We can use .preinit_array section on Linux to call sanitizer initialization

// functions very early in the process startup (unless PIC macro is defined).

//

// On FreeBSD, .preinit_array functions are called with rtld_bind_lock writer

// lock held. It will lead to dead lock if unresolved PLT functions (which helds

// rtld_bind_lock reader lock) are called inside .preinit_array functions.

//

// FIXME: do we have anything like this on Mac?

// Before Solaris 11.4, .preinit_array is fully supported only with GNU ld.

// FIXME: Check for those conditions.

// SANITIZER_CAN_USE_PREINIT_ARRAY

// GCC does not understand __has_feature

// Older GCCs do not understand __has_attribute.

// For portability reasons we do not include stddef.h, stdint.h or any other

// system header, but we do need some basic types that are not defined

// in a portable way by the language itself.

// Linux Arm headers redefine __UINTPTR_TYPE__ and disagree with clang/gcc.

// 64-bit Windows uses LLP64 data model.

// defined(__UINTPTR_TYPE__)

// Since x32 uses ILP32 data model in 64-bit hardware mode, we must use

// 64-bit pointer to unwind stack frame.

// On Windows, files are HANDLE, which is a synonim of void*.

// Use void* to avoid including <windows.h> everywhere.

// ----------- ATTENTION -------------

// This header should NOT include any other headers to avoid portability issues.

// Common defs.

// Platform-specific defs.

// FIXME(timurrrr): do we need this on Windows?

/* _mm_prefetch(x, _MM_HINT_NTA) */

// _MSC_VER

// Please only use the ALIGNED macro before the type.

// Using ALIGNED after the variable declaration is not portable!

// __builtin_prefetch(x) generates prefetchnt0 on x86

// _MSC_VER

// Unaligned versions of basic types.

// namespace __sanitizer

// _WIN32

// _WIN32

// NOTE: Functions below must be defined in each run-time.

// Check macro

/**/

// Limits for integral types. We have to redefine it in case we don't

// have stdint.h (like in Visual Studio 9).

// SANITIZER_WORDSIZE == 64

// SANITIZER_WORDSIZE == 64

// CaptureStackBackTrace doesn't need to know BP on Windows.

// Forces the compiler to generate a frame pointer in the function.

// Internal thread identifier allocated by ThreadRegistry.

// Stack depot stack identifier.

// namespace __sanitizer

// SANITIZER_DEFS_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_leb128.h ===
SHA256: 126f02a09d64dc7e4e45248a7d18b4d95ebd92146d0324aece511cf443dc3f45
//===-- sanitizer_leb128.h --------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// NOTE: this assumes that this signed shift is an arithmetic right shift.

// namespace __sanitizer

// SANITIZER_LEB128_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_lfstack.h ===
SHA256: 892122990ac0bc50911404cd9e08eb42e0d599b8a525626eeb81aff5e803a438
//===-- sanitizer_lfstack.h -=-----------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Lock-free stack.

// Uses 32/17 bits as ABA-counter on 32/64-bit platforms.

// The memory passed to Push() must not be ever munmap'ed.

// The type T must contain T *next field.

//

//===----------------------------------------------------------------------===//

// private:

// namespace __sanitizer

// SANITIZER_LFSTACK_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_libc.cpp ===
SHA256: cfc232000353eec044ef9062622f95256ad00726bf78631206e47148255ebd7e
//===-- sanitizer_libc.cpp ------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries. See sanitizer_libc.h for details.

//===----------------------------------------------------------------------===//

// Do not redefine builtins; this file is defining the builtin replacements.

// Optimize for the most performance-critical case:

// The next line prevents Clang from making a call to memset() instead of the

// loop below.

// FIXME: building the runtime with -ffreestanding is a better idea. However

// there currently are linktime problems due to PR12396.

// extern "C"

// This is O(N^2), but we are not using it in hot places.

// Sanity check.

// Prologue.

// Aligned loop.

// Epilogue.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_libc.h ===
SHA256: a93e82c92d895858f95be618b5701cacd8f9d9a272c92fc060d88bcc9c63d2ab
//===-- sanitizer_libc.h ----------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.

// These tools can not use some of the libc functions directly because those

// functions are intercepted. Instead, we implement a tiny subset of libc here.

// FIXME: Some of functions declared in this file are in fact POSIX, not libc.

//===----------------------------------------------------------------------===//

// ----------- ATTENTION -------------

// This header should NOT include any other headers from sanitizer runtime.

// internal_X() is a custom implementation of X() for use in RTL.

// These are used as builtin replacements; see sanitizer_redefine_builtins.h.

// In normal runtime code, use the __sanitizer::internal_X() aliases instead.

// extern "C"

// String functions

// Should not be used in performance-critical places.

// Works only for base=10 and doesn't set errno.

// Return true if all bytes in [mem, mem+size) are zero.

// Optimized for the case when the result is true.

// I/O

// Define these as macros so we can use them in linker initialized global

// structs without dynamic initialization.

// OS

// Threading

// Error handling

// namespace __sanitizer

// SANITIZER_LIBC_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cpp ===
SHA256: e313f5166e06283957c1ea00df737daafedb205d01df857854963ea8880b1f8f
//===-- sanitizer_libignore.cpp -------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Try to match suppressions with symlink target.

// Scan suppressions list and find newly loaded and unloaded libraries.

// Record the index of the ignored range.

// The library is unloaded so mark the ignored code range as unloaded.

// Track instrumented ranges.

// namespace __sanitizer

// SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_APPLE ||

// SANITIZER_NETBSD


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_libignore.h ===
SHA256: dae47b2afc00a4f3b85dfe7c6a4f5a5249e04ddc53de3aad2a65a8338f8b01fd
//===-- sanitizer_libignore.h -----------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// LibIgnore allows to ignore all interceptors called from a particular set

// of dynamic libraries. LibIgnore can be initialized with several templates

// of names of libraries to be ignored. It finds code ranges for the libraries;

// and checks whether the provided PC value belongs to the code ranges.

//

//===----------------------------------------------------------------------===//

// Must be called during initialization.

// Must be called after a new dynamic library is loaded.

// Must be called after a dynamic library is unloaded.

// Checks whether the provided PC belongs to one of the ignored libraries or

// the PC should be ignored because it belongs to an non-instrumented module

// (when ignore_noninstrumented_modules=1). Also returns true via

// "pc_in_ignored_lib" if the PC is in an ignored library, false otherwise.

// Checks whether the provided PC belongs to an instrumented module.

// target of symlink

// A value of 0 means the associated module was unloaded.

// Hot part:

// Cold part:

// Disallow copying of LibIgnore objects.

// not implemented

// not implemented

// namespace __sanitizer

// SANITIZER_LIBIGNORE_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp ===
SHA256: 53804a6ebea7059495f336e652ddc4c6bae38617cd0ca06e34e6549e206095e6
//===-- sanitizer_linux.cpp -----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries and implements linux-specific functions from

// sanitizer_libc.h.

//===----------------------------------------------------------------------===//

// For mips64, syscall(__NR_stat) fills the buffer in the 'struct kernel_stat'

// format. Struct kernel_stat is defined as 'struct stat' in asm/stat.h. To

// access stat from asm/stat.h, without conflicting with definition in

// sys/stat.h, we use this trick.  sparc64 is similar, using

// syscall(__NR_stat64) and struct kernel_stat64.

// The weak `strerrorname_np` (introduced in API level 35) definition,

// allows for checking the API level at runtime.

// <sys/umtx.h> must be included after <errno.h> and <sys/types.h> on

// FreeBSD 9.2 and 10.0.

// SANITIZER_FREEBSD

// For NAME_MAX

// SANITIZER_NETBSD

// For INFINITY

// For emscripten_futex_wait

// <linux/time.h>

// <linux/futex.h> is broken on some linux distributions.

// SANITIZER_LINUX

// Are we using 32-bit or 64-bit Linux syscalls?

// x32 (which defines __x86_64__) has SANITIZER_WORDSIZE == 32

// but it still needs to use 64-bit syscalls.

// Note : FreeBSD implemented both Linux and OpenBSD apis.

// SANITIZER_LINUX && defined(__NR_getrandom)

// Deletes the specified signal from newset, if it is not present in oldset

// Equivalently: newset[signum] = newset[signum] & oldset[signum]

// FIXME: https://github.com/google/sanitizers/issues/1816

// Block asynchronous signals

// FIXME: https://github.com/google/sanitizers/issues/1816

// Glibc uses SIGSETXID signal during setuid call. If this signal is blocked

// on any thread, setuid call hangs.

// See test/sanitizer_common/TestCases/Linux/setuid.c.

// !SANITIZER_ANDROID

// Seccomp-BPF-sandboxed processes rely on SIGSYS to handle trapped syscalls.

// If this signal is blocked, such calls cannot be handled and the process may

// hang.

// Don't block synchronous signals

// but also don't unblock signals that the user had deliberately blocked.

// FIXME: https://github.com/google/sanitizers/issues/1816

//! SANITIZER_ANDROID

// SANITIZER_LINUX

// --------------- sanitizer_libc.h

// mmap2 specifies file offset in 4096-byte units.

// !SANITIZER_S390

// Undefine compatibility macros from <sys/stat.h>

// so that they would not clash with the kernel_stat

// st_[a|m|c]time fields

// Bionic sys/stat.h defines additional macros

// for compatibility with the old NDKs and

// they clash with the kernel_stat structure

// st_[a|m|c]time_nsec fields.

// For mips64, fstat syscall fills buffer in the format of kernel_stat

// For sparc64, fstat64 syscall fills buffer in the format of kernel_stat64

// !SANITIZER_SOLARIS && !SANITIZER_NETBSD && !SANITIZER_HAIKU &&

// !SANITIZER_EMSCRIPTEN

// Unreachable.

// !SANITIZER_NETBSD && !SANITIZER_HAIKU && !SANITIZER_EMSCRIPTEN

// ----------------- sanitizer_common.h

// Sanity check: filename is a regular file.

// TgKill is expected to return -1 on error, not an errno.

// Used by real_clock_gettime.

// Like getenv, but reads env directly from /proc (on Linux) or parses the

// 'environ' array (on some others) and does not use libc. This function

// should be called first inside __asan_init.

// Not found.

// will happen at the \0\0 that terminates the buffer

// proc file has the format NAME=value\0NAME=value\0NAME=value\0...

// this entry isn't NUL terminated

// Match.

// point after =

// Not found.

// FIXME: make this more flexible.

// On FreeBSD, retrieving the argument and environment arrays is done via the

// kern.ps_strings sysctl, which returns a pointer to a structure containing

// this information. See also <sys/exec.h>.

// SANITIZER_FREEBSD

// Linux/sparc64 needs an adjustment, cf. glibc

// sysdeps/sparc/sparc{32,64}/dl-machine.h (DL_STACK_END).

// Normally argc can be obtained from *stack_end, however, on ARM glibc's

// _start clobbers it:

// https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/arm/start.S;hb=refs/heads/release/2.31/master#l75

// Do not special-case ARM and infer argc from argv everywhere.

// !SANITIZER_GO

// !SANITIZER_GO

// SANITIZER_FREEBSD

// !SANITIZER_EMSCRIPTEN

/* No userspace futex-like synchronization */

/* No userspace futex-like synchronization */

// !SANITIZER_SOLARIS

// ----------------- sanitizer_linux.h

// The actual size of this structure is specified by d_reclen.

// Note that getdents64 uses a different structure format. We only provide the

// 32-bit syscall here.

// Not used

// Syscall wrappers.

/* rusage */

// Currently internal_arch_prctl() is only needed on x86_64.

// The clone syscall interface on SPARC differs massively from the rest,

// so fall back to __fork.

// Note: this function can be called during startup, so we need to avoid

// calling any interceptable functions. On FreeBSD >= 1300045 sysctlbyname()

// is a real syscall, but for older versions it calls sysctlnametomib()

// followed by sysctl(). To avoid calling the intercepted version and

// asserting if this happens during startup, call the real sysctlnametomib()

// followed by internal_sysctl() if the syscall is not available.

// Doesn't set sa_restorer if the caller did not set it, so use with caution

//(see below).

// Without SA_RESTORER kernel ignores the calls (probably returns EINVAL).

// FIXME: most often sa_restorer is unset, however the kernel requires it

// to point to a valid signal restorer that calls the rt_sigreturn syscall.

// If sa_restorer passed to the kernel is NULL, the program may crash upon

// signal delivery or fail to unwind the stack in the signal handler.

// libc implementation of sigaction() passes its own restorer to

// rt_sigaction, so we need to do the same (we'll need to reimplement the

// restorers; for x86_64 the restorer address can be obtained from

// oldact->sa_restorer upon a call to sigaction(xxx, NULL, oldact).

// SANITIZER_LINUX

// !SANITIZER_SOLARIS && !SANITIZER_NETBSD && !SANITIZER_EMSCRIPTEN

// ThreadLister implementation.

// Inode 1 is for bad blocks and also can be a reason for early return.

// Should be emitted if kernel tried to output terminating thread.

// See proc_task_readdir implementation in Linux.

// Now we are going to detect short-read or early EOF. In such cases Linux

// can return inconsistent list with missing alive threads.

// Code will just remember that the list can be incomplete but it will

// continue reads to return as much as possible.

// The first one was a short-read by definition.

// Read was close to the buffer size. So double the size and assume the

// worst.

// Maybe Linux early returned from read on terminated thread (!pid_alive)

// and failed to restore read position.

// See next_tid and proc_task_instantiate in Linux.

// Resize back to capacity if it is downsized by `ReadFileToVector`.

// /proc/%d/task/%d/status uses same call to detect alive threads as

// proc_task_readdir. See task_state implementation in Linux.

// Take care of unusable kernel area in top gigabyte.

// Firstly check if there are writable segments

// mapped to top gigabyte (e.g. stack).

/*cache_enabled*/

// Even if nothing is mapped, top Gb may still be accessible

// if we are running on 64-bit kernel.

// Uname may report misleading results if personality type

// is modified (e.g. under schroot) so check this as well.

// SANITIZER_ANDROID

// Top gigabyte is reserved for kernel.

// SANITIZER_LINUX && !SANITIZER_X32

// SANITIZER_WORDSIZE == 32

// (0x00007f8000000000 - PAGE_SIZE)

// On PowerPC64 we have two different address space layouts: 44- and 46-bit.

// We somehow need to figure out which one we are using now and choose

// one of 0x00000fffffffffffUL and 0x00003fffffffffffUL.

// Note that with 'ulimit -s unlimited' the stack is moved away from the top

// of the address space, so simply checking the stack address is not enough.

// This should (does) work for both PowerPC64 Endian modes.

// Similarly, aarch64 has multiple address space layouts: 39, 42 and 47-bit.

// loongarch64 also has multiple address space layouts: default is 47-bit.

// RISC-V 64 also has multiple address space layouts: 39, 48 and 57-bit.

// 0x000000ffffffffffUL;

// 0x001fffffffffffffUL;

// 0x00007fffffffffffUL;

// SANITIZER_WORDSIZE == 32

// 0x7fffffff;

// 0xffffffff;

// SANITIZER_WORDSIZE

// Use sysctl as sysconf can trigger interceptors internally.

// The 16 KB page size was introduced in Android 15 (API level 35), while

// earlier versions of Android always used a 4 KB page size.

// We are checking the weak definition of `strerrorname_np` (introduced in API

// level 35) because some earlier API levels crashed when

// `getauxval(AT_PAGESZ)` was called from the `.preinit_array`.

// EXEC_PAGESIZE may not be trustworthy.

/*out*/

// We can't read binary name for some reason, assume it's unknown.

/*out*/

// Match full names of the form /path/to/base_name{-,.}*

// Strip path.

// Call cb for each region mapped by map.

// !SANITIZER_FREEBSD

// Find the segment with the minimum base so we can "relocate" the p_vaddr

// fields.  Typically ET_DYN objects (DSOs) have base of zero and ET_EXEC

// objects have a non-zero base.

// Compute the delta from the real base to get a relocation delta.

// Now we can figure out what the loader really mapped.

// None of these values are aligned.  We consider the ragged edges of the

// load command as defined, since they are mapped from the file.

// We cannot use glibc's clone wrapper, because it messes with the child

// task's TLS. It writes the PID and TID of the child task to its thread

// descriptor, but in our case the child task shares the thread descriptor with

// the parent (because we don't know how to allocate a new thread

// descriptor to keep glibc happy). So the stock version of clone(), when

// used with CLONE_VM, would end up corrupting the parent's thread descriptor.

/* %rax = syscall(%rax = SYSCALL(clone),
       *                %rdi = flags,
       *                %rsi = child_stack,
       *                %rdx = parent_tidptr,
       *                %r8  = new_tls,
       *                %r10 = child_tidptr)
       */

/* if (%rax != 0)
       *   return;
       */

/* In the child. Terminate unwind chain. */

// XXX: We should also terminate the CFI unwind chain

// here. Unfortunately clang 3.2 doesn't support the

// necessary CFI directives, so we skip that part.

/* Call "fn(arg)". */

/* Call _exit(%rax). */

/* Return to parent. */

// We don't have proper CFI directives here because it requires alot of code

// for very marginal benefits.

/* $v0 = syscall($v0 = __NR_clone,
       * $a0 = flags,
       * $a1 = child_stack,
       * $a2 = parent_tidptr,
       * $a3 = new_tls,
       * $a4 = child_tidptr)
       */

/* Store the fifth argument on stack
   * if we are using 32-bit abi.
   */

/* if ($v0 != 0)
       * return;
       */

/* Call "fn(arg)". */

/* Call _exit($v0). */

/* Return to parent. */

/* if (a0 != 0)
       *   return a0;
       */

// In the child, now. Call "fn(arg)".

// Call _exit(a0).

/* flags  */

/* ptid  */

/* tls  */

/* ctid  */

/* clone  */

/* if (%r0 != 0)
       *   return %r0;
       */

/* In the child, now. Call "fn(arg)". */

/* Call _exit(%r0).  */

// if ($a0 != 0)

//   return $a0;

// In the child, now. Call "fn(arg)".

// Call _exit($a0).

// Stack frame structure.

//   Back chain == 0        (SP + 112)

// Frame (112 bytes):

//   Parameter save area    (SP + 48), 8 doublewords

//   TOC save area          (SP + 40)

//   Link editor doubleword (SP + 32)

//   Compiler doubleword    (SP + 24)

//   LR save area           (SP + 16)

//   CR save area           (SP + 8)

//   Back chain             (SP + 0)

//   Back chain == 0        (SP + 32)

// Frame (32 bytes):

//   TOC save area          (SP + 24)

//   LR save area           (SP + 16)

//   CR save area           (SP + 8)

//   Back chain             (SP + 0)

/* fn and arg are saved across the syscall */

/* syscall
        r0 == __NR_clone
        r3 == flags
        r4 == child_stack
        r5 == parent_tidptr
        r6 == newtls
        r7 == child_tidptr */

/* Test if syscall was successful */

/* Set up stack frame */

/* Do the function call */

/* Call _exit(r3) */

/* Return to parent */

/* %eax = syscall(%eax = SYSCALL(clone),
       *                %ebx = flags,
       *                %ecx = child_stack,
       *                %edx = parent_tidptr,
       *                %esi  = new_tls,
       *                %edi = child_tidptr)
       */

/* Obtain flags */

/* Do the system call */

/* Remember the flag value.  */

/* if (%eax != 0)
       *   return;
       */

/* terminate the stack frame */

/* Call FN. */

/* Call exit */

/* %r0 = syscall(%r7 = SYSCALL(clone),
       *               %r0 = flags,
       *               %r1 = child_stack,
       *               %r2 = parent_tidptr,
       *               %r3  = new_tls,
       *               %r4 = child_tidptr)
       */

/* Do the system call */

/* if (%r0 != 0)
       *   return %r0;
       */

/* In the child, now. Call "fn(arg)". */

/* Call _exit(%r0). */

// SANITIZER_LINUX

// Start the thread with signals blocked, otherwise it can steal user signals.

// Android headers in the older NDK releases miss this definition.

// FreeBSD doesn't provide ESR in the ucontext.

// FIXME: ucontext->uc_mcontext.r13;

// The err register was added on the main branch and not

// available with the current release. To be reverted later.

// https://github.com/haiku/haiku/commit/11adda21aa4e6b24f71a496868a44d7607bc3764

// SANITIZER_FREEBSD

// FIXME: Add support for FPU, microMIPS, DSP, MSA memory instructions.

// sb

// sh

// sw

// sd

// sdl

// sdr

// swl

// swr

// lb

// lbu

// lh

// lhu

// lw

// lwu

// ld

// ldl

// ldr

// lwl

// lwr

// pcrel

// lwpc

// lwupc

// In the musl environment, the Linux kernel uapi sigcontext.h is not

// included in signal.h. To avoid missing the SC_ADDRERR_{RD,WR} macros,

// copy them here. The LoongArch Linux kernel uapi is already stable,

// so there's no need to worry about the value changing.

// Address error was due to memory load

// Address error was due to memory store

// Decode the instruction to determine the access type.

// From OpenSolaris $SRC/uts/sun4/os/trap.c (get_accesstype).

// Historical BSDism here.

// it's a compressed instruction

// set op_bits to the instruction bits [1, 0, 15, 14, 13]

// bits 7-11, inclusive

// c.lwsp (rd != x0)

// c.ldsp (rd != x0)

// c.lw

// c.flwsp

// c.flw / c.ld

// c.fld

// c.fldsp

// c.sw

// c.swsp

// c.fsw / c.sd

// c.fswsp / c.sdsp

// c.fsd

// c.fsdsp

// lower 7 bits

// bits 12-14, inclusive

// loads

// lb

// lh

// lw

// ld

// lbu

// lhu

// stores

// sb

// sh

// sw

// sd

// floating-point loads

// flw

// fld

// floating-point stores

// fsw

// fsd

// FIXME: Implement.

// SIGSEGV signals without a true fault address have si_code set to 128.

// SANITIZER_LINUX && SANITIZER_GLIBC

// SANITIZER_LINUX && SANITIZER_GLIBC && (defined(__arm__) ||

// defined(__aarch64__))

// Duplication of this report print is caused by partial support

// of register values dumping. In case of unsupported yet architecture let's

// avoid printing 'Register values:' without actual values in the following

// output.

// FIXME: Implement this for other OSes and architectures.

// This covers all NetBSD architectures

/* GCC uses %r3 whenever a frame pointer is needed.  */

/* Use the numeric values: the symbolic ones are undefined by llvm
     include/llvm/Support/Solaris.h.  */

// REG_PC

// REG_FP

// REG_SP

// The powerpc{,64}-linux ABIs do not specify r31 as the frame

// pointer, but GCC always uses r31 when we need a frame pointer.

// Avoid SEGV when dereferencing sp on stack overflow with non-faulting load.

// This requires a SPARC V9 CPU.  Cannot use #ASI_PNF here: only supported

// since clang-19.

// Historical BSDism here.

// We're making things less 'dramatic' here since

// the cmd is not necessarily guaranteed to be here

// just yet regarding FreeBSD release

// Disable ASLR for Linux PPC64LE.

// Do nothing

// Do nothing

// SANITIZER_USE_GETENTROPY

// Up to 256 bytes, getrandom will not be interrupted.

// SANITIZER_USE_GETRANDOM

// Up to 256 bytes, a read off /dev/urandom will not be interrupted.

// blocking is moot here, O_NONBLOCK has no effect when opening /dev/urandom.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_linux.h ===
SHA256: 066198fc2647d99e0e0433da5709cd06666b81abcda6595d8ed87990b95549ec
//===-- sanitizer_linux.h ---------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Linux-specific syscall wrappers and classes.

//

//===----------------------------------------------------------------------===//

// Opaque type returned by dlopen().

// Dirent structure for getdents(). Note that this structure is different from

// the one in <dirent.h>, which is used by readdir().

// SANITIZER_HAIKU

// Syscall wrappers.

// Linux-only syscalls.

// Used only by sanitizer_stoptheworld. Signal handlers that are actually used

// (like the process-wide error reporting SEGV handler) must use

// internal_sigaction instead.

// SANITIZER_LINUX

// This class reads thread IDs from /proc/<pid>/task using only syscalls.

// Exposed for testing.

// Matches a library's file name against a base name (stripping path and version

// information).

// Call cb for each region mapped by map.

// Releases memory pages entirely within the [beg, end) address range.

// The pages no longer count toward RSS; reads are guaranteed to return 0.

// Requires (but does not verify!) that pages are MAP_PRIVATE.

// man madvise on Linux promises zero-fill for anonymous private pages.

// Testing shows the same behaviour for private (but not anonymous) mappings

// of shm_open() files, as long as the underlying file is untouched.

// On mips32r1, this goes via a kernel illegal instruction trap that's

// optimized for v1.

// The Android Bionic team has allocated a TLS slot for sanitizers starting

// with Q, given that Android currently doesn't support ELF TLS. It is used to

// store sanitizer thread specific data.

// SANITIZER_ANDROID

// namespace __sanitizer

// SANITIZER_LINUX_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp ===
SHA256: 1ec0ba9a037070c878da437ffc1f5aca93419b9cb12bb9dfd29c12fc2ecabdb4
//===-- sanitizer_linux_libcdep.cpp ---------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries and implements linux-specific functions from

// sanitizer_libc.h.

//===----------------------------------------------------------------------===//

// for __lwp_gettcb_fast() / __lwp_getprivate_fast()

// for dlsym()

// The MAP_NORESERVE define has been removed in FreeBSD 11.x, and even before

// that, it was never implemented. So just define it to zero.

// On FreeBSD, call the sigaction syscall directly (part of libsys in FreeBSD

// 15) since the libc version goes via a global interposing table. Due to

// library initialization order the table can be relocated after the call to

// InitializeDeadlySignals() which then crashes when dereferencing the

// uninitialized pointer in libc.

// This is the main thread. Libpthread may not be initialized yet.

// Find the mapping that contains a stack variable.

/*cache_enabled*/

// Get stacksize from rlimit, but clip it so that it does not overlap

// with other mappings.

// When running with unlimited stack size, we still want to set some limit.

// The unlimited stack size is caused by 'ulimit -s unlimited'.

// Also, for some reason, GNU make spawns subprocesses with unlimited stack.

// Edge case: the stack mapping on some systems may be off-by-one e.g.,

//     fffffffdf000-1000000000000 rw-p 00000000 00:00 0 [stack]

// instead of:

//     fffffffdf000- ffffffffffff

// The out-of-range stack_top can result in an invalid shadow address

// calculation, since those usually assume the parameters are in range.

// !SANITIZER_SOLARIS

// SANITIZER_SOLARIS

// True if we can use dlpi_tls_data. glibc before 2.25 may leave NULL (BZ

// #19826) so dlpi_tls_data cannot be used.

//

// musl before 1.2.3 and FreeBSD as of 12.2 incorrectly set dlpi_tls_data to

// the TLS initialization image

// https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254774

// Caller does not expect anything else.

/* sizeof(struct pthread) values from various glibc versions.  */

// Assume only one particular version for x32.

// For ARM sizeof(struct pthread) changed in Glibc 2.23.

// Unknown version

// minor == 32

// TODO: consider adding an optional runtime check for an unknown (untested)

// glibc version

// WARNING: the highest tested version is 2.29

// no guarantees for this one

// tested against glibc 2.29, 2.31

// tested against glibc 2.32

// The size of a prefix of TCB including pthread::{specific_1stblock,specific}

// suffices. Just return offsetof(struct pthread, specific_used), which hasn't

// changed since 2007-05. Technically this applies to i386/x86_64 as well but

// we call _dl_get_tls_static_info and need the precise size of struct

// pthread.

// TODO(sagarthakur): add more values as per different glibc versions.

// from glibc 2.36

// The sizeof (struct pthread) is the same from GLIBC 2.17 to 2.22.

// from glibc.ppc64le 2.20-8.fc21

// SANITIZER_GLIBC && !SANITIZER_GO

// FIXME: Implementation is very GLIBC specific, but it's used by FreeBSD.

// The size of a prefix of TCB including pthread::{specific_1stblock,specific}

// suffices. Just return offsetof(struct pthread, specific_used), which hasn't

// changed since 2007-05. Technically this applies to i386/x86_64 as well but

// we call _dl_get_tls_static_info and need the precise size of struct

// pthread.

// TODO(sagarthakur): add more values as per different glibc versions.

// from glibc 2.36

// The sizeof (struct pthread) is the same from GLIBC 2.17 to 2.22.

// from glibc.ppc64le 2.20-8.fc21

// SANITIZER_FREEBSD && !SANITIZER_GO

// On glibc x86_64, ThreadDescriptorSize() needs to be precise due to the usage

// of g_tls_size. On other targets, ThreadDescriptorSize() is only used by lsan

// to get the pointer to thread-specific data keys in the thread control block.

// sizeof(struct pthread) from glibc.

// _thread_db_sizeof_pthread is a GLIBC_PRIVATE symbol that is exported in

// glibc 2.34 and later.

// Can be null if static link.

// SANITIZER_GLIBC

// TlsPreTcbSize includes size of struct pthread_descr and size of tcb

// head structure. It lies before the static tls blocks.

// sizeof (tcbhead_t)

// sizeof (tcbhead_t)

// sizeof (tcbhead_t)

// sizeof (tcbhead_t)

// (SANITIZER_FREEBSD || SANITIZER_GLIBC) && !SANITIZER_GO

// (SANITIZER_FREEBSD || SANITIZER_GLIBC) && !SANITIZER_GO

// namespace

// The __tls_get_offset ABI requires %r12 to point to GOT and %r2 to be an

// offset of a struct tls_index inside GOT. We don't possess either of the

// two, so violate the letter of the "ELF Handling For Thread-Local

// Storage" document and assume that the implementation just dereferences

// %r2 + %r12.

// dlpi_tls_modid is only available since Solaris 11.4 SRU 10.  Use

// dlinfo(RTLD_DI_LINKMAP) instead which works on all of Solaris 11.3,

// 11.4, and Illumos.  The tlsmodid of the executable was changed to 1 in

// 11.4 to match other implementations.

// Call __tls_get_addr as a fallback. This forces TLS allocation on glibc

// and FreeBSD.

// Find the range with tls_modid == main_tls_modid. For glibc, because

// libc.so uses PT_TLS, this module is guaranteed to exist and is one of

// the initially loaded modules.

// This may happen with musl if no module uses PT_TLS.

// Find the maximum consecutive ranges. We consider two modules consecutive if

// the gap is smaller than the alignment of the latter range. The dynamic

// loader places static TLS blocks this way not to waste space.

// (x86_64 || i386 || mips || ...) && (SANITIZER_FREEBSD ||

// SANITIZER_LINUX) && !SANITIZER_ANDROID && !SANITIZER_GO

// SANITIZER_NETBSD

// Bionic provides this API since S.

// For aarch64 and x86-64, use an O(1) approach which requires relatively

// precise ThreadDescriptorSize. g_tls_size was initialized in InitTlsSize.

// Workaround for glibc<2.25(?). 2.27 is known to not need this.

// lsan requires the range to additionally cover the static TLS surplus

// (elf/dl-tls.c defines 1664). Otherwise there may be false positives for

// allocations only referenced by tls in dynamically loaded modules.

// RTLD_STATIC_TLS_EXTRA

// Extend the range to include the thread control block. On glibc, lsan needs

// the range to include pthread::{specific_1stblock,specific} so that

// allocations only referenced by pthread_setspecific can be scanned. This may

// underestimate by at most TLS_TCB_ALIGN-1 bytes but it should be fine

// because the number of bytes after pthread::specific is larger.

// RTLD_STATIC_TLS_EXTRA

// arm and aarch64 reserve two words at TP, so this underestimates the range.

// However, this is sufficient for the purpose of finding the pointers to

// thread-specific data keys.

// Find size (p_memsz) of dlpi_tls_modid 1 (TLS block of the main program).

// ld.elf_so hardcodes the index 1.

// The block has been found and tcb_dtv[1] contains the base address

// Stub implementation for Go.

// If stack and tls intersect, make them non-intersecting.

// "GNU" with NUL-byte.

// Something is very wrong, bail out instead of reading potentially

// arbitrary memory.

// First module is the binary itself.

// getrusage does not give us the current RSS, only the max RSS.

// Still, this is better than nothing if /proc/self/statm is not available

// for some reason, e.g. due to a sandbox.

// Failed, probably due to a sandbox.

// ru_maxrss is in Kb.

// The format of the file is:

// 1084 89 69 11 0 79 0

// We need the second number which is RSS in pages.

// Skip the first number.

// Skip whitespaces.

// Read the number.

// sysconf(_SC_NPROCESSORS_{CONF,ONLN}) cannot be used on most platforms as

// they allocate memory.

// ANDROID_LOG_INFO is 4, but can't be resolved at runtime.

// async_safe_write_log is a new public version of __libc_write_log that is

// used behind syslog. It is preferable to syslog as it will not do any dynamic

// memory allocation or formatting.

// If the function is not available, syslog is preferred for L+ (it was broken

// pre-L) as __android_log_write triggers a racey behavior with the strncpy

// interceptor. Fallback to __android_log_write pre-L.

// SANITIZER_ANDROID

// SANITIZER_LINUX

// glibc crashes when using clock_gettime from a preinit_array function as the

// vDSO function pointers haven't been initialized yet. __progname is

// initialized after the vDSO function pointers, so if it exists, is not null

// and is not empty, we can use clock_gettime.

// MonotonicNanoTime is a timing function that can leverage the vDSO by calling

// clock_gettime. real_clock_gettime only exists if clock_gettime is

// intercepted, so define it weakly and use it if available.

// Non-glibc & Go always use the regular function.

// SANITIZER_GLIBC && !SANITIZER_GO

// Calling execve with /proc/self/exe sets that as $EXEC_ORIGIN. Binaries that

// rely on that will fail to load shared libraries. Query AT_EXECFN instead.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_linux_s390.cpp ===
SHA256: e7410582d8600d0a2aabe098798ab5d0f60c11a83a52037ce93054624669ef6d
//===-- sanitizer_linux_s390.cpp ------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries and implements s390-linux-specific functions from

// sanitizer_libc.h.

//===----------------------------------------------------------------------===//

// --------------- sanitizer_libc.h

// Minimum frame size.

// Terminate unwind chain.

// And pass parameters.

/* Clone. */

/* if (%r2 != 0)
   *   return;
   */

/* Call "fn(arg)". */

/* Call _exit(%r2). */

/* Return to parent. */

// Try to determine if the running kernel has a fix for CVE-2016-2143,

// return false if in doubt (better safe than sorry).  Distros may want to

// adjust this for their own kernels.

// This should never fail, but just in case...

// At least first 2 should be matched.

// Third is optional.

// Check RHEL6

// 2.6.32-657.el6 or later

// 2.6.32-642.9.1.el6 or later

// <3.0 is bad.

// 3.2.79+ is OK.

// 3.12.58+ is OK.

// Check RHEL7

// 3.10.0-426.el7 or later

// 3.10.0-327.27.1.el7 or later

// Otherwise, bad.

// 4.1.21+ is OK.

// 4.4.6+ is OK.

// Check Ubuntu 16.04

// 4.4.0-13 or later

// Otherwise, OK if 4.5+.

// Linux 5 and up are fine.

// Older kernels are affected by CVE-2016-2143 - they will crash hard

// if someone uses 4-level page tables (ie. virtual addresses >= 4TB)

// and fork() in the same process.  Unfortunately, sanitizers tend to

// require such addresses.  Since this is very likely to crash the whole

// machine (sanitizers themselves use fork() for llvm-symbolizer, for one),

// abort the process at initialization instead.

// namespace __sanitizer

// SANITIZER_LINUX && SANITIZER_S390


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_list.h ===
SHA256: 3eaad1e1ac17728eed3e3b5fd1ab0e869e9d016181db7c0b18a8dcc633de8ac4
//===-- sanitizer_list.h ----------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file contains implementation of a list class to be used by

// ThreadSanitizer, etc run-times.

//

//===----------------------------------------------------------------------===//

// Intrusive singly-linked list with size(), push_back(), push_front()

// pop_front(), append_front() and append_back().

// This class should be a POD (so that it can be put into TLS)

// and an object with all zero fields should represent a valid empty list.

// This class does not have a CTOR, so clear() should be called on all

// non-zero-initialized objects before using.

// private, don't use directly.

// namespace __sanitizer

// SANITIZER_LIST_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_local_address_space_view.h ===
SHA256: cdd0478d5935ea7cf2dd6009cfef0308e30d75b6f39fa7bc6557cdd864e32d59
//===-- sanitizer_local_address_space_view.h --------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// `LocalAddressSpaceView` provides the local (i.e. target and current address

// space are the same) implementation of the `AddressSpaceView` interface which

// provides a simple interface to load memory from another process (i.e.

// out-of-process)

//

// The `AddressSpaceView` interface requires that the type can be used as a

// template parameter to objects that wish to be able to operate in an

// out-of-process manner. In normal usage, objects are in-process and are thus

// instantiated with the `LocalAddressSpaceView` type. This type is used to

// load any pointers in instance methods. This implementation is effectively

// a no-op. When an object is to be used in an out-of-process manner it is

// instantiated with the `RemoteAddressSpaceView` type.

//

// By making `AddressSpaceView` a template parameter of an object, it can

// change its implementation at compile time which has no run time overhead.

// This also allows unifying in-process and out-of-process code which avoids

// code duplication.

//

//===----------------------------------------------------------------------===//

// Load memory `sizeof(T) * num_elements` bytes of memory from the target

// process (always local for this implementation) starting at address

// `target_address`. The local copy of this memory is returned as a pointer.

// The caller should not write to this memory. The behaviour when doing so is

// undefined. Callers should use `LoadWritable()` to get access to memory

// that is writable.

//

// The lifetime of loaded memory is implementation defined.

// The target address space is the local address space so

// nothing needs to be copied. Just return the pointer.

// Load memory `sizeof(T) * num_elements` bytes of memory from the target

// process (always local for this implementation) starting at address

// `target_address`. The local copy of this memory is returned as a pointer.

// The memory returned may be written to.

//

// Writes made to the returned memory will be visible in the memory returned

// by subsequent `Load()` or `LoadWritable()` calls provided the

// `target_address` parameter is the same. It is not guaranteed that the

// memory returned by previous calls to `Load()` will contain any performed

// writes.  If two or more overlapping regions of memory are loaded via

// separate calls to `LoadWritable()`, it is implementation defined whether

// writes made to the region returned by one call are visible in the regions

// returned by other calls.

//

// Given the above it is recommended to load the largest possible object

// that requires modification (e.g. a class) rather than individual fields

// from a class to avoid issues with overlapping writable regions.

//

// The lifetime of loaded memory is implementation defined.

// The target address space is the local address space so

// nothing needs to be copied. Just return the pointer.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_lzw.h ===
SHA256: 7fca862df1d499dfe411e4b5efd87935c1c97eb730494566c7430673b8c1c459
//===-- sanitizer_lzw.h -----------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Lempel–Ziv–Welch encoding/decoding

//

//===----------------------------------------------------------------------===//

/* Prefix */

/* Next input */

// Sentinel value for substrings of len 1.

// Add all substring of len 1 as initial dictionary.

// Slightly helps with later delta encoding.

// For large sizeof(T) we have to store dict_len1. Smaller types like u8 can

// just generate them.

// Remap after the Sort.

// Main LZW encoding loop.

// Extend match with the new item.

// This is a new substring, but emit the code for the current match

// (before extend). This allows LZW decoder to recover the dictionary.

// Reset the match to a single item, which must be already in the map.

// Already known, use as the current match.

// Load dictionary of len 1 substrings. Theses correspont to lowest codes.

// Substrings of len 2 and up. Indexes are shifted because [0,

// dict_len1.size()) stored in dict_len1. Substings get here after being

// emitted to the output, so we can use output position.

/* begin. */

/* end */

// Copies already emitted substrings into the output again.

// Returns lens of the substring with the given code.

// Main LZW decoding loop.

// Special LZW case. The code is not in the dictionary yet. This is

// possible only when the new substring is the same as previous one plus

// the first item of the previous substring. We can emit that in two

// steps.

// Every time encoded emits the code, it also creates substing of len + 1

// including the first item of the just emmited substring. Do the same here.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp ===
SHA256: d7d26e37260851994b0348220298b7ee55264c52ee03ce6d87a30384ec3600d8
//===-- sanitizer_mac.cpp -------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between various sanitizers' runtime libraries and

// implements OSX-specific functions.

//===----------------------------------------------------------------------===//

// Use 64-bit inodes in file operations. ASan does not support OS X 10.5, so

// the clients will most certainly use 64-bit ones as well.

// for _NSGetEnviron

// Integrate with CrashReporter library if available

// for _NSGetArgv and _NSGetEnviron

// for dladdr()

// From <crt_externs.h>, but we don't have that file on iOS.

// From <mach/mach_vm.h>, but we don't have that file on iOS.

// Direct syscalls, don't call libmalloc hooks (but not available on 10.6).

// ---------------------- sanitizer_libc.h

// From <mach/vm_statistics.h>, but not on older OSs.

// XNU on Darwin provides a mmap flag that optimizes allocation/deallocation of

// giant memory regions (i.e. shadow memory regions).

// 2 GB

// Don't use sigprocmask here, because it affects all threads.

// Doesn't call pthread_atfork() handlers (but not available on 10.6).

// We need a new pseudoterminal to avoid buffering problems. The 'atos' tool

// in particular detects when it's talking to a pipe and forgets to flush the

// output stream after sending a response.

// Use TIOCPTYGNAME instead of ptsname() to avoid threading problems.

// File descriptor actions

// Spawn attributes

// In the spawned process, close all file descriptors that are not explicitly

// described by the file actions object. This is Darwin-specific extension.

// posix_spawn

// Disable echo in the new terminal, disable CR.

// On success, do not close primary_fd on scope exit.

// The client program may close its stdin and/or stdout and/or stderr thus

// allowing open/posix_openpt to reuse file descriptors 0, 1 or 2. In this

// case the communication is broken if either the parent or the child tries to

// close or duplicate these descriptors. We temporarily reserve these

// descriptors here to prevent this.

// ----------------- sanitizer_common.h

// Sanity check: filename is a regular file.

// pthread_get_stacksize_np() returns an incorrect stack size for the main

// thread on Mavericks. See

// https://github.com/google/sanitizers/issues/261

// Most often rl.rlim_cur will be the desired 8M.

// Match.

// String starting after =.

/*out*/

// On OS X the executable path is saved to the stack by dyld. Reading it

// from there is much faster than calling dladdr, especially for large

// binaries with symbols.

/*out*/

// Do nothing

// Do nothing

// We need to make sure that sanitizer_zone is registered as malloc_zones[0]. If

// libmalloc tries to set up a different zone as malloc_zones[0], it will call

// mprotect(malloc_zones, ..., PROT_READ).  This interceptor will catch that and

// make sure we are still the first (default) zone.

// Swap malloc_zones[0] and malloc_zones[i].

// FIXME: implement actual blocking.

// This needs to be called during initialization to avoid being racy.

// clearing lower bits, cpu id stored there

// The size of the tls on darwin does not appear to be well documented,

// however the vm memory map suggests that it is 1024 uptrs in size,

// with a size of 0x2000 bytes on x86_64 and 0x1000 bytes on i386.

// Handling fatal signals on watchOS and tvOS devices is disallowed.

// Offset example:

// XNU 17 -- macOS 10.13 -- iOS 11 -- tvOS 11 -- watchOS 4

// macOS 11+

// macOS 10.15 and below

// XNU 17 (macOS 10.13) and below do not provide the sysctl

// `kern.osproductversion` entry (res != 0).

// For launchd, sanitizer initialization runs before sysctl is setup

// (res == 0 && len != strlen(vers), vers is not a valid version).  However,

// the kernel version `kern.osrelease` is available.

// Format: <major>.<minor>[.<patch>]\0

/*base=*/

/*base=*/

// Aligned versions example:

// macOS 10.15 -- iOS 13 -- tvOS 13 -- watchOS 6

// macOS 11+

// macOS 10.15 and below

// Start the thread with signals blocked, otherwise it can steal user signals.

// as_log is deprecated.

// buffer to store crash report application information

// Available in CRASHREPORTER_ANNOTATIONS_VERSION 5+

// Support for older CrashRerporter annotiations

// Revert to previous crash reporter API if client header is not available

// HAVE_CRASHREPORTERCLIENT_H

// extern "C"

// Log all printf output to CrashLog.

// Log with os_log_error. This will make it into the crash log.

// Log to syslog.

// The logging on OS X may call pthread_create so we need the threading

// environment to be fully initialized. Also, this should never be called when

// holding the thread registry lock since that may result in a deadlock. If

// the reporting thread holds the thread registry mutex, and asl_log waits

// for GCD to dispatch a new thread, the process will deadlock, because the

// pthread_create wrapper needs to acquire the lock as well.

// The report is added to CrashLog as part of logging all of Printf output.

// !SANITIZER_GO

/*T_PF_WRITE*/

/*ISS_DA_WNR*/

// "Real" SIGSEGV codes (e.g., SEGV_MAPERR, SEGV_MAPERR) are non-zero.

// ASan/TSan use mmap in a way that creates “deallocation gaps” which triggers

// EXC_GUARD exceptions on macOS 10.15+ (XNU 19.0+).

// Only use xnu_fast_mmap when on x86_64 and the kernel supports it.

// Call to initialize mach_timebase_info

// Restrict "interceptors working?" check

// Verify that interceptors really work.  We'll use dlsym to locate

// "puts", if interceptors are working, it should really point to

// "wrap_puts" within our own dylib.

// Change the value of the env var |name|, leaking the original value.

// If |name_value| is NULL, the variable is deleted from the environment,

// otherwise the corresponding "NAME=value" string is replaced with

// |name_value|.

// Match.

// Replace the old value with the new one.

// Shift the subsequent pointers back.

// DYLD_INSERT_LIBRARIES is set and contains the runtime library. Let's remove

// the dylib from the environment variable, because interceptors are installed

// and we don't want our children to inherit the variable.

// Allocate memory to hold the previous env var name, its value, the '='

// sign and the '\0' char.

// Iterate over colon-separated pieces of |dyld_insert_libraries|.

// If the current piece isn't the runtime library name,

// append it to new_env.

// Move on to the next piece.

// Can't use setenv() here, because it requires the allocator to be

// initialized.

// FIXME: instead of filtering DYLD_INSERT_LIBRARIES here, do it in

// a separate function called after InitializeAllocator().

// SANITIZER_GO

// The task_vm_info struct is normally provided by the macOS SDK, but we need

// fields only available in 10.12+. Declare the struct manually to be able to

// build against older SDKs.

/* zero initialize */

// xnu cannot provide vm address limit

// !SANITIZER_IOS

// 0x00007fffffffffffUL;

// SANITIZER_WORDSIZE == 32

// 0xffffffff;

// If the shadow doesn't fit, restrict the address space to make it fit.

// Start searching for available memory region past PAGEZERO, which is

// 4KB on 32-bit and 4GB on 64-bit.

// There are cases where going beyond the processes' max vm does

// not return KERN_INVALID_ADDRESS so we check for going beyond that

// max address as well.

// No more regions beyond "address", consider the gap at the end of VM.

// break after this iteration.

// We found a free region [free_begin..address-1].

// Move to the next region.

// We looked at all free regions and could not find one large enough.

// FIXME implement on this platform.

// Do nothing.

// arc4random never fails.

// Pthread introspection hook

//

// * GCD worker threads are created without a call to pthread_create(), but we

//   still need to register these threads (with ThreadCreate/Start()).

// * We use the "pthread introspection hook" below to observe the creation of

//   such threads.

// * GCD worker threads don't have parent threads and the CREATE event is

//   delivered in the context of the thread itself.  CREATE events for regular

//   threads, are delivered on the parent.  We use this to tell apart which

//   threads are GCD workers with `thread == pthread_self()`.

//

// create -> start -> terminate -> destroy

// * create/destroy are usually (not guaranteed) delivered on the parent and

//   track resource allocation/reclamation

// * start/terminate are guaranteed to be delivered in the context of the

//   thread and give hooks into "just after (before) thread starts (stops)

//   executing"

// namespace __sanitizer

// SANITIZER_APPLE


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_mac.h ===
SHA256: d59bee6d616b418827180398560d496c3a83908cdff651986a47db4156fd8546
//===-- sanitizer_mac.h -----------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between various sanitizers' runtime libraries and

// provides definitions for OSX-specific functions.

//===----------------------------------------------------------------------===//

// namespace __sanitizer

// SANITIZER_APPLE

// SANITIZER_APPLE_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_mac_libcdep.cpp ===
SHA256: f9d0120f1c80a2788af06b1292c0c268b7f26543805fec41ec14303aa5567a34
//===-- sanitizer_mac_libcdep.cpp -----------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between various sanitizers' runtime libraries and

// implements OSX-specific functions.

//===----------------------------------------------------------------------===//

// namespace __sanitizer

// SANITIZER_APPLE


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_mallinfo.h ===
SHA256: 630355370686471060c24c1280e5670c2ce853603c0cd88bac546ea7a7e4f49b
//===-- sanitizer_mallinfo.h ----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of Sanitizer common code.

//

// Definition for mallinfo on different platforms.

//===----------------------------------------------------------------------===//

// namespace __sanitizer

// SANITIZER_MALLINFO_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_malloc_mac.inc ===
SHA256: ac31daf4f86611a15bbd6eb88ce5bf7ecdb73d1cc08585ae4d3194d0d6f45fbb
//===-- sanitizer_malloc_mac.inc --------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file contains Mac-specific malloc interceptors and a custom zone

// implementation, which together replace the system allocator.

//

//===----------------------------------------------------------------------===//

// Similar code is used in Google Perftools,

// https://github.com/gperftools/gperftools.

// IMPORTANT: Do not change the order, alignment, or types of these fields to

// maintain binary compatibility. You should only add fields to this struct.

// Used to track changes to the allocator that will affect

// zone enumeration.

// This represents the current allocator ABI version.

// This field should be incremented every time the Allocator

// ABI changes in a way that breaks allocator enumeration.

// namespace __sanitizer

// The name will be changed anyway.

// Prevent the client app from overwriting the zone contents.

// Library functions that need to modify the zone will set PROT_WRITE on it.

// This matches the behavior of malloc_create_zone() on OSX 10.7 and higher.

// We're explicitly *NOT* registering the zone.

// We don't need to do anything here.  We're not registering new zones, so we

// don't to unregister.  Just un-mprotect and free() the zone.

// Claimed by sanitizer zone?

// FIXME: ASan should support purgeable allocations.

// https://github.com/google/sanitizers/issues/139

// FIXME: ASan should support purgeable allocations. Ignoring them is fine

// for now.

// FIXME: ASan should support purgeable allocations. Ignoring them is fine

// for now.

// Must return 0 if the contents were not purged since the last call to

// malloc_make_purgeable().

// Call the system malloc's implementation for both external and our zones,

// since that appropriately changes VM region protections on the zone.

// TODO(glider): the __sanitizer_mz_* functions should be united with the Linux

// wrappers, as they are basically copied from there.

// TODO(glider): the allocation callbacks need to be refactored.

// We can't recover from reallocating an unknown address, because

// this would require reading at most |new_size| bytes from

// potentially unaccessible memory.

// A no-op -- we will not be destroyed!

// This public API exists purely for testing purposes.

// This function is currently unused, and we build with -Werror.

// TODO(glider): check that |size| is valid.

// Forward declare and expect the implementation to provided by

// includer.

// Provide stub implementation that fails.

// Not supported.

// Forward declare and expect the implementation to provided by

// includer.

// Just zero initialize the fields.

// I think it's always safe to return size, but we maybe could do better.

// I don't think we support anything like this

// UNIMPLEMENTED();

// unnamed namespace

// Ok to use internal_memset, these places are not performance-critical.

// Set current allocator enumeration version.

// Perform any sanitizer specific initialization.

// Use version 6 for OSX >= 10.6.

// Register the zone.

// namespace COMMON_MALLOC_NAMESPACE


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_mutex.cpp ===
SHA256: 4d1c9afd61a471f906f1332ad97eb7631a15a5cec794bfc61ce76a86887c4048
//===-- sanitizer_mutex.cpp -----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.

//===----------------------------------------------------------------------===//

// An empty mutex meta table, it effectively disables deadlock detection.

// Each tool can override the table to define own mutex hierarchy and

// enable deadlock detection.

// The table defines a static mutex type hierarchy (what mutex types can be locked

// under what mutex types). This table is checked to be acyclic and then

// actual mutex lock/unlock operations are checked to adhere to this hierarchy.

// The checking happens on mutex types rather than on individual mutex instances

// because doing it on mutex instances will both significantly complicate

// the implementation, worsen performance and memory overhead and is mostly

// unnecessary (we almost never lock multiple mutexes of the same type recursively).

// Adjacency matrix of what mutexes can be locked under what mutexes.

// Mutex types with MutexMulti mark.

// Build adjacency matrix.

// Indicates the array is not properly terminated.

// Add leaf mutexes.

// Build the transitive closure and check that the graphs is acyclic.

// Find the last locked mutex type.

// This is the type we will use for hierarchy checks.

// Recursive lock of the same type.

// This variable is used by the __tls_get_addr interceptor, so cannot use the

// global-dynamic TLS model, as that would result in crashes.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_mutex.h ===
SHA256: d44379b53a8041644ad47600686de05f9209f4eee3779d17dd7b31413c2cd533
//===-- sanitizer_mutex.h ---------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of ThreadSanitizer/AddressSanitizer runtime.

//

//===----------------------------------------------------------------------===//

// Semaphore provides an OS-dependent way to park/unpark threads.

// The last thread returned from Wait can destroy the object

// (destruction-safety).

// Used as sentinel and to catch unassigned types

// (should not be used as real Mutex type).

// Each tool own mutexes must start at this number.

// Type for legacy mutexes that are not checked for deadlocks.

// Special marks that can be used in MutexMeta::can_lock table.

// The leaf mutexes can be locked under any other non-leaf mutex,

// but no other mutex can be locked while under a leaf mutex.

// Multiple mutexes of this type can be locked at the same time.

// Go linker does not support THREADLOCAL variables,

// so we can't use per-thread state.

// Disable checked locks on Darwin. Although Darwin platforms support

// THREADLOCAL variables they are not usable early on during process init when

// `__sanitizer::Mutex` is used.

// The table fixes what mutexes can be locked under what mutexes.

// If the entry for MutexTypeFoo contains MutexTypeBar,

// then Bar mutex can be locked while under Foo mutex.

// Can also contain the special MutexLeaf/MutexMulti marks.

// Checks that the current thread does not hold any mutexes

// (e.g. when returning from a runtime function to user code).

// Reader-writer mutex.

// Derive from CheckedMutex for the purposes of EBO.

// We could make it a field marked with [[no_unique_address]],

// but this attribute is not supported by some older compilers.

// The mutex is not read-/write-locked, try to lock.

// We've spun enough, increment waiting writers count and block.

// The counter will be decremented by whoever wakes us.

// Active spinning, but denote our presence so that unlocking

// thread does not wake up other threads.

// Active spinning.

// We've locked the mutex.

// We've incremented waiting writers, so now block.

// We've set kWriterSpinWait, but we are still in active spinning.

// We either blocked and were unblocked,

// or we just spun but set kWriterSpinWait.

// Either way we need to reset kWriterSpinWait

// next time we take the lock or block again.

// The mutex is not read-/write-locked, try to lock.

// Active spinning, but denote our presence so that unlocking

// thread does not wake up other threads.

// Active spinning.

// We've locked the mutex.

// We've incremented waiting readers, so now block.

// We've set kReaderSpinWait, but we are still in active spinning.

// This function does not guarantee an explicit check that the calling thread

// is the thread which owns the mutex. This behavior, while more strictly

// correct, causes problems in cases like StopTheWorld, where a parent thread

// owns the mutex but a child checks that it is locked. Rather than

// maintaining complex state to work around those situations, the check only

// checks that the mutex is owned.

// The state has 3 counters:

//  - number of readers holding the lock,

//    if non zero, the mutex is read-locked

//  - number of waiting readers,

//    if not zero, the mutex is write-locked

//  - number of waiting writers,

//    if non zero, the mutex is read- or write-locked

// And 2 flags:

//  - writer lock

//    if set, the mutex is write-locked

//  - a writer is awake and spin-waiting

//    the flag is used to prevent thundering herd problem

//    (new writers are not woken if this flag is set)

//  - a reader is awake and spin-waiting

//

// Both writers and readers use active spinning before blocking.

// But readers are more aggressive and always take the mutex

// if there are any other readers.

// After wake up both writers and readers compete to lock the

// mutex again. This is needed to allow repeated locks even in presence

// of other blocked threads.

// namespace __sanitizer

// SANITIZER_MUTEX_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_netbsd.cpp ===
SHA256: 623b5b34b8ca7916e05c45c8076e7d23e109d764e0014f1c3719c7df8a7faa08
//===-- sanitizer_netbsd.cpp ----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between Sanitizer run-time libraries and implements

// NetBSD-specific functions from sanitizer_libc.h.

//===----------------------------------------------------------------------===//

// --------------- sanitizer_libc.h

// Unreachable.

/* rusage */

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_placement_new.h ===
SHA256: 57ef12051adee51ba0f9e249de397d4e7fdc0acffdb0dd886e2edd9a57ca956d
//===-- sanitizer_placement_new.h -------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.

//

// The file provides 'placement new'.

// Do not include it into header files, only into source files.

//===----------------------------------------------------------------------===//

// SANITIZER_PLACEMENT_NEW_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_platform.h ===
SHA256: ce4a4470ea21ace949cd6eb0333c232c710127bebfd0137c485e12cb902676f7
//===-- sanitizer_platform.h ------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Common platform macros.

//===----------------------------------------------------------------------===//

// Get __GLIBC__ on a glibc platform. Exclude Android: features.h includes C

// function declarations into a .S file which doesn't compile.

// https://crbug.com/1162741

// - SANITIZER_APPLE: all Apple code

//   - TARGET_OS_OSX: macOS

//   - SANITIZER_IOS: devices (iOS and iOS-like)

//     - SANITIZER_WATCHOS

//     - SANITIZER_TVOS

//   - SANITIZER_IOSSIM: simulators (iOS and iOS-like)

//   - SANITIZER_DRIVERKIT

// Assume linux that is not glibc or android is musl libc.

// 64-bit PPC has two ABIs (v1 and v2).  The old powerpc64 target is

// big-endian, and uses v1 ABI (known for its function descriptors),

// while the new powerpc64le target is little-endian and uses v2.

// In theory, you could convince gcc to compile for their evil twins

// (eg. big-endian v2), but you won't find such combinations in the wild

// (it'd require bootstrapping a whole system, which would be quite painful

// - there's no target triple for that).  LLVM doesn't support them either.

// By default we allow to use SizeClassAllocator64 on 64-bit platform.

// But in some cases SizeClassAllocator64 does not work well and we need to

// fallback to SizeClassAllocator32.

// For such platforms build this code with -DSANITIZER_CAN_USE_ALLOCATOR64=0 or

// change the definition of SANITIZER_CAN_USE_ALLOCATOR64 here.

// The first address that can be returned by mmap.

// The range of addresses which can be returned my mmap.

// FIXME: this value should be different on different platforms.  Larger values

// will still work but will consume more memory for TwoLevelByteMap.

// FIXME: Rather than hardcoding the VMA here, we should rely on

// GetMaxUserVirtualAddress(). This will require some refactoring though since

// many places either hardcode some value or SANITIZER_MMAP_RANGE_SIZE is

// assumed to be some constant integer.

// Darwin iOS/ARM64 has a 36-bit VMA, 64GiB VM

// Whether the addresses are sign-extended from the VMA range to the word.

// The SPARC64 Linux port implements this to split the VMA space into two

// non-contiguous halves with a huge hole in the middle.

// udi16 syscalls can only be used when the following conditions are

// met:

// * target is one of arm32, x86-32, sparc32, sh or m68k

// * libc version is libc5, glibc-2.0, glibc-2.1 or glibc-2.2 to 2.15

//   built against > linux-2.2 kernel headers

// Since we don't want to include libc headers here, we check the

// target only.

/// \macro MSC_PREREQ

/// \brief Is the compiler MSVC of at least the specified version?

/// The common \param version values to check for are:

///  * 1800: Microsoft Visual Studio 2013 / 12.0

///  * 1900: Microsoft Visual Studio 2015 / 14.0

// On linux, some architectures had an ABI transition from 64-bit long double

// (ie. same as double) to 128-bit long double.  On those, glibc symbols

// involving long doubles come in two versions, and we need to pass the

// correct one to dlvsym when intercepting them.

// On PowerPC and ARM Thumb, calling pthread_exit() causes LSan to detect leaks.

// pthread_exit() performs unwinding that leads to dlopen'ing libgcc_s.so.

// dlopen mallocs "libgcc_s.so" string which confuses LSan, it fails to realize

// that this allocation happens in dynamic linker and should be ignored.

// Older gcc have issues aligning to a constexpr, and require an integer.

// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56859 among others.

// Enable offline markup symbolizer for Fuchsia.

// Enable ability to support sanitizer initialization that is

// compatible with the sanitizer library being loaded via

// `dlopen()`.

// SANITIZER_SUPPORTS_THREADLOCAL

// 1 - THREADLOCAL macro is supported by target

// 0 - THREADLOCAL macro is not supported by target

// TODO: Support other compilers here

// Workaround for

// https://lab.llvm.org/buildbot/#/builders/clang-thumbv7-full-2stage

// or

// https://lab.llvm.org/staging/#/builders/clang-thumbv7-full-2stage

// It fails *rss_limit_mb_test* without meaningful errors.

// Workaround for

// glibc/commit/3d3572f59059e2b19b8541ea648a6172136ec42e

// Linux: Keep termios ioctl constants strictly internal

// SANITIZER_PLATFORM_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h ===
SHA256: 615d1862b2a7c3010a786e4ff5e16b4ac49cb980f87e6cd31428494baaa462a0
//===-- sanitizer_platform_interceptors.h -----------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file defines macro telling whether sanitizer tools can/should intercept

// given library functions on a given platform.

//

//===----------------------------------------------------------------------===//

// aligned_alloc was introduced in OSX 10.15

// Linking will fail when using an older SDK

// macOS 10.15 is greater than our minimal deployment target.  To ensure we

// generate a weak reference so the dylib continues to work on older

// systems, we need to forward declare the intercepted function as "weak

// imports".

// defined(__MAC_10_15)

// SANITIZER_APPLE

// memmem on Darwin doesn't exist on 10.6

// FIXME: enable memmem on Windows.

// AIX libc does not export FREXP and FREXPF.

// TODO: This should be SI_POSIX, adding glibc first until I have time

// to verify all timer_t typedefs on other platforms.

// FIXME: getline seems to be available on OSX 10.7

// sigaltstack on i386 macOS cannot be intercepted due to setjmp()

// calling it and assuming that it does not clobber registers.

// FIXME: also available from musl 1.2.5

// Until free_sized and free_aligned_sized are more generally available,

// we can only unconditionally intercept on ELF-based platforms where it

// is okay to have undefined weak symbols.

// This macro gives a way for downstream users to override the above

// interceptor macros irrespective of the platform they are on. They have

// to do two things:

// 1. Build compiler-rt with -DSANITIZER_OVERRIDE_INTERCEPTORS.

// 2. Provide a header file named sanitizer_intercept_overriders.h in the

//    include path for their compiler-rt build.

// An example of an overrider for strlen interceptor that one can list in

// sanitizer_intercept_overriders.h is as follows:

//

// #ifdef SANITIZER_INTERCEPT_STRLEN

// #undef SANITIZER_INTERCEPT_STRLEN

// #define SANITIZER_INTERCEPT_STRLEN <value of choice>

// #endif

//

// This "feature" is useful for downstream users who do not want some of

// their libc funtions to be intercepted. They can selectively disable

// interception of those functions.

// #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp ===
SHA256: 18b0b3c7c88595fbed6caf0386c330114ef1a366e9c8f5bb40fafe832d7aa14e
//===-- sanitizer_platform_limits_freebsd.cpp -----------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of Sanitizer common code.

//

// Sizes and layouts of platform-specific FreeBSD data structures.

//===----------------------------------------------------------------------===//

//

//

// Include these after system headers to avoid name clashes and ambiguities.

// For FreeBSD the actual size of a directory entry is not always in d_reclen.

// Use the appropriate macro to get the correct size for all cases (e.g. NFS).

// ioctl arguments

// namespace __sanitizer

// There are more undocumented fields in dl_phdr_info that we are not interested

// in.

// Can't write checks for sa_handler and sa_sigaction due to them being

// preprocessor macros.

// SANITIZER_FREEBSD


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h ===
SHA256: df2f4acb615d9c625aa732c54ff0e10d0c373df446cd648983dab0fffae468be
//===-- sanitizer_platform_limits_freebsd.h -------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of Sanitizer common code.

//

// Sizes and layouts of platform-specific FreeBSD data structures.

//===----------------------------------------------------------------------===//

// Get sys/_types.h, because that tells us whether 64-bit inodes are

// used in struct dirent below.

// Simply crazy.

// Luckily, we don't need these.

// (struct sockaddr *)

// (struct sockaddr *)

// (struct sockaddr *)

// 'clock_t' is 32 bits wide on x64 FreeBSD

// This thing depends on the platform. We are only interested in the upper

// limit. Verified with a compiler assert in .cpp.

// uint32_t * 4

/* struct stat* */

/* struct stat* */

// This simplifies generic code

// ioctl arguments

// procctl reaper data for PROCCTL_REAPER flags

// ioctl request identifiers

// A special value to mark ioctls that are not present on the target platform,

// when it can not be determined without including any system headers.

// namespace __sanitizer

// For sigaction, which is a function and struct at the same time,

// and thus requires explicit "struct" in sizeof() expression.

// SANITIZER_FREEBSD


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cpp ===
SHA256: 7112201465474fbf560b0089255d5a4500e761a419d910eb943fa7b0b901f4b2
//===-- sanitizer_platform_limits_linux.cpp -------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of Sanitizer common code.

//

// Sizes and layouts of linux kernel data structures.

//===----------------------------------------------------------------------===//

// This is a separate compilation unit for linux headers that conflict with

// userspace headers.

// Most "normal" includes go in sanitizer_platform_limits_posix.cpp

// For offsetof -> __builtin_offsetof definition.

// With old kernels (and even new kernels on powerpc) asm/stat.h uses types that

// are not defined anywhere in userspace headers. Fake them. This seems to work

// fine with newer headers, too.

// This header seems to contain the definitions of _kernel_ stat* structs.

// Skip aio_key, it's weird.

// SANITIZER_LINUX


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp ===
SHA256: 270ba580512d102f1ff5927ca5668883d483738e36316f7f8aab535ce7b84708
//===-- sanitizer_platform_limits_netbsd.cpp ------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of Sanitizer common code.

//

// Sizes and layouts of platform-specific NetBSD data structures.

//===----------------------------------------------------------------------===//

// clang-format off

// Compat for NetBSD < 9.99.30.

/* Fallback for MKISCSI=no */

/* from <sys/scsiio.h> */

/* Fallback for MKIPFILTER=no */

// clang-format on

// Include these after system headers to avoid name clashes and ambiguities.

// ioctl arguments

// namespace __sanitizer

// There are more undocumented fields in dl_phdr_info that we are not interested

// in.

// Can't write checks for sa_handler and sa_sigaction due to them being

// preprocessor macros.

// Compare against the union, because we can't reach into the union in a

// compliant way.

// Compat with 9.0

// SANITIZER_NETBSD


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h ===
SHA256: b8fe0f4567fe73a1b0ca18f95e3a0362fb256e45cb4212aad96ff9278c1c0895
//===-- sanitizer_platform_limits_netbsd.h --------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of Sanitizer common code.

//

// Sizes and layouts of platform-specific NetBSD data structures.

//===----------------------------------------------------------------------===//

// (struct sockaddr *)

// (struct sockaddr *)

// (struct sockaddr *)

// more fields that we don't care about

// uint32_t * 4

// The size is determined by looking at sizeof of real siginfo_t on linux.

/* struct stat* */

/* struct stat* */

// This simplifies generic code

// ioctl arguments

// ioctl request identifiers

// A special value to mark ioctls that are not present on the target platform,

// when it can not be determined without including any system headers.

// namespace __sanitizer

// For sigaction, which is a function and struct at the same time,

// and thus requires explicit "struct" in sizeof() expression.

// Compat with 9.0

// SANITIZER_NETBSD


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp ===
SHA256: adf0bcf23c448607879ed34820d8f24e0101513f7b27cb2003695745547f21fa
//===-- sanitizer_platform_limits_posix.cpp -------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of Sanitizer common code.

//

// Sizes and layouts of platform-specific POSIX data structures.

//===----------------------------------------------------------------------===//

// Tests in this file assume that off_t-dependent data structures match the

// libc ABI. For example, struct dirent here is what readdir() function (as

// exported from libc) returns, and not the user-facing "dirent", which

// depends on _FILE_OFFSET_BITS setting.

// To get this "true" dirent definition, we undefine _FILE_OFFSET_BITS below.

// Must go after undef _FILE_OFFSET_BITS.

// Must go after undef _FILE_OFFSET_BITS.

/*fpregs*/

/*fpscr*/

// SANITIZER_GLIBC

// SANITIZER_ANDROID

// SANITIZER_LINUX

// Include these after system headers to avoid name clashes and ambiguities.

// SANITIZER_HAS_STAT64

// SANITIZER_HAS_STATFS64

// SANITIZER_GLIBC || SANITIZER_FREEBSD || SANITIZER_NETBSD ||

// SANITIZER_APPLE

// Added in Linux kernel 3.4.0, merged to glibc in 2.16

// See kernel arch/x86/kernel/fpu/signal.c for details.

// The member names differ across header versions, but the actual layout

// is always the same.  So avoid using members, just use arithmetic.

// !SANITIZER_ANDROID

// SANITIZER_LINUX

// SANITIZER_LINUX

// Use pre-computed size of struct ustat to avoid <sys/ustat.h> which

// has been removed from glibc 2.28.

// Not used. The minimum Glibc version available for LoongArch is 2.36

// so ustat() wrapper is already gone.

// SANITIZER_GLIBC

// SANITIZER_LINUX && !SANITIZER_ANDROID

// !SANITIZER_ANDROID && !SANITIZER_HAIKU

// __mips64 || __powerpc64__ || __aarch64__ || __loongarch__

// __x86_64 || __mips64 || __powerpc64__ || __aarch64__ || __arm__

// || __s390__ || __loongarch__ || SANITIZER_RISCV64 || __sparc__

// PTRACE_GETFPXREGS/PTRACE_SETFPXREGS

// PTRACE_GETSIGINFO/PTRACE_SETSIGINFO

// PTRACE_GETREGSET/PTRACE_SETREGSET

// ioctl arguments

// SANITIZER_LINUX

// SANITIZER_LINUX

// SANITIZER_GLIBC

// SOUND_VERSION

// SOUND_VERSION

// SANITIZER_LINUX

// SANITIZER_LINUX && !SANITIZER_ANDROID

// (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID

// namespace __sanitizer

// FIXME: We define those on Linux and Mac, but only check on Linux.

// SANITIZER_LINUX

// There are more undocumented fields in dl_phdr_info that we are not interested

// in.

// SANITIZER_LINUX || SANITIZER_FREEBSD

// SANITIZER_GLIBC || SANITIZER_FREEBSD

// In POSIX, int msg_iovlen; socklen_t msg_controllen; socklen_t cmsg_len; but

// many implementations don't conform to the standard. Since we pick the

// non-conforming glibc definition, exclude the checks for musl (incompatible

// sizes but compatible offsets).

// There is no 'd_off' field on FreeBSD.

// !SANITIZER_EMSCRIPTEN

// Can't write checks for sa_handler and sa_sigaction due to them being

// preprocessor macros.

// On s390x glibc 2.19 and earlier sa_flags was unsigned long, and sa_resv

// didn't exist.

// !SANITIZER_EMSCRIPTEN

/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit
   on many architectures.  */

// Compare against the union, because we can't reach into the union in a

// compliant way.

// SANITIZER_FREEBSD

// SANITIZER_LINUX

// SANITIZER_GLIBC

// SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_APPLE


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h ===
SHA256: 72362be6a7f75b69ca1fbc9bf8d17fa9107421f801db224439ee145216c1fc8c
//===-- sanitizer_platform_limits_posix.h ---------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of Sanitizer common code.

//

// Sizes and layouts of platform-specific POSIX data structures.

//===----------------------------------------------------------------------===//

// Must be SANITIZER_LINUX then

// For sigset_t

// For clock_t and clockid_t

// FIXME: This can't be included from tsan which does not support sparc yet.

// !SANITIZER_ANDROID

// RISCV64 does not use stat64

// More fields that vary with the kernel version.

// SANITIZER_LINUX

// Simply crazy.

// Luckily, we don't need these.

// SANITIZER_LINUX

// SANITIZER_LINUX && !SANITIZER_ANDROID

// (struct sockaddr *)

// (struct sockaddr *)

// This is a union on Linux.

// (struct sockaddr *)

// !SANITIZER_ANDROID

/* seconds */

/* nanoseconds */

/* timer period */

/* timer expiration */

// variable sized

// In POSIX, int msg_iovlen; socklen_t msg_controllen; socklen_t cmsg_len; but

// many implementations don't conform to the standard.

// more fields that we don't care about

// more fields that we don't care about

// more fields that we don't care about

// more fields that we don't care about

// more fields that we don't care about

// eventfd is Unix-specific.

// This thing depends on the platform. We are only interested in the upper

// limit. Verified with a compiler assert in .cpp.

// The size is determined by looking at sizeof of real sigset_t on linux.

// x32 siginfo_t is aligned to 8 bytes.

// Require uptr, because siginfo_t is always pointer-size aligned on Linux.

// Linux system headers define the 'sa_handler' and 'sa_sigaction' macros.

// check this before WORDSIZE == 32

// !SANITIZER_ANDROID

// On sparc glibc 2.19 and earlier sa_flags was unsigned long.

// To maintain ABI compatibility on sparc64 when switching to an int,

// __glibc_reserved0 was added.

// !SANITIZER_ANDROID

// Linux system headers define the 'sa_handler' and 'sa_sigaction' macros.

// LINUX

// SANITIZER_LINUX

// !SANITIZER_ANDROID

// !SANITIZER_ANDROID

// Helper for the ptrace interceptor.

// As described in ptrace(2), the meanings of addr and data are reversed

// for the PTRACE_GETREGS, PTRACE_GETFPREGS, PTRACE_GETREGS, and

// PTRACE_GETFPREGS requests on Linux/sparc64.

// ioctl arguments

// In sparc the 14 bits SIZE field overlaps with the

// least significant bit of DIR, so either IOC_READ or

// IOC_WRITE shall be 1 in order to get a non-zero SIZE.

// SANITIZER_LINUX

// SANITIZER_LINUX

// SANITIZER_LINUX && !SANITIZER_ANDROID

// (SANITIZER_LINUX || SANITIZER_FREEBSD) && !SANITIZER_ANDROID

// ioctl request identifiers

// A special value to mark ioctls that are not present on the target platform,

// when it can not be determined without including any system headers.

// SANITIZER_LINUX

// namespace __sanitizer

// For sigaction, which is a function and struct at the same time,

// and thus requires explicit "struct" in sizeof() expression.

// SANITIZER_LINUX || SANITIZER_APPLE || SANITIZER_HAIKU ||

// SANITIZER_EMSCRIPTEN


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_solaris.cpp ===
SHA256: a09355044c4bdd50b51604655dd5bcb5a1e86e60898ec5ade68d3309eb43810d
//===-- sanitizer_platform_limits_solaris.cpp -----------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of Sanitizer common code.

//

// Sizes and layouts of platform-specific Solaris data structures.

//===----------------------------------------------------------------------===//

// Include these after system headers to avoid name clashes and ambiguities.

// ioctl arguments

// namespace __sanitizer

// There are more undocumented fields in dl_phdr_info that we are not interested

// in.

// There are additional fields we are not interested in.

// Can't write checks for sa_handler and sa_sigaction due to them being

// preprocessor macros.

// Compare against the union, because we can't reach into the union in a

// compliant way.

// SANITIZER_SOLARIS


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_solaris.h ===
SHA256: 7f0019f703b5523491990d2bc7a705f09a959193ab50a7ad3f7a4d86e469b8d2
//===-- sanitizer_platform_limits_solaris.h -------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of Sanitizer common code.

//

// Sizes and layouts of platform-specific Solaris data structures.

//===----------------------------------------------------------------------===//

//u64 data[6];

// uid_t

// gid_t

// uid_t

// gid_t

// mode_t

// uint_t

// key_t

// size_t

// uintptr_t

// ushort_t

// pid_t

// pid_t

// shmatt_t

// ulong_t

// time_t

// uint64_t

// uint64_t

// int64_t

// time_t

// int32_t

// time_t

// int32_t

// time_t

// uint64_t

// uint64_t

// uint64_t

// (struct sockaddr *)

// (struct sockaddr *)

// This is a union on Linux.

// (struct sockaddr *)

// uid_t

// gid_t

// more fields that we don't care about

// more fields that we don't care about

// more fields that we don't care about

// This thing depends on the platform. We are only interested in the upper

// limit. Verified with a compiler assert in .cpp.

// uint32_t * 4

// The size is determined by looking at sizeof of real siginfo_t on linux.

// This simplifies generic code

// ioctl arguments

// <sys/ioccom.h>

// IOC_VOID

// IOC_OUT

// IOC_IN

// In sparc the 14 bits SIZE field overlaps with the

// least significant bit of DIR, so either IOC_READ or

// IOC_WRITE shall be 1 in order to get a non-zero SIZE.

// ioctl request identifiers

// A special value to mark ioctls that are not present on the target platform,

// when it can not be determined without including any system headers.

// namespace __sanitizer

// For sigaction, which is a function and struct at the same time,

// and thus requires explicit "struct" in sizeof() expression.

// SANITIZER_SOLARIS


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_posix.cpp ===
SHA256: 9adb0138a8c6ad7dce9c11035d52396b2d7233692e722f4eb92638c6e29e7e3c
//===-- sanitizer_posix.cpp -----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries and implements POSIX-specific functions from

// sanitizer_posix.h.

//===----------------------------------------------------------------------===//

// The MAP_NORESERVE define has been removed in FreeBSD 11.x, and even before

// that, it was never implemented.  So just define it to zero.

// ------------- sanitizer_common.h

// We want to map a chunk of address space aligned to 'alignment'.

// We do it by mapping a bit more and then unmapping redundant pieces.

// We probably can do it with fewer syscalls in some OS-dependent way.

// mmap maps entire pages and rounds up map_size needs to be a an integral

// number of pages.

// We need to be aware of this size for calculating end and for unmapping

// fragments before and after the alignment region.

// Emscripten's fake mmap doesn't support partial unmapping

/*tolerate_enomem*/

/*tolerate_enomem*/

/*range_start*/

/*range_end*/

// TODO: actually implement this.

// FIXME: this is thread-unsafe, but should not cause problems most of the time.

// When the shadow is mapped only a single thread usually exists (plus maybe

// several worker threads on Mac, which aren't expected to map big chunks of

// memory).

/*cache_enabled*/

// and hope for the best

// Empty range.

/*cache_enabled*/

// Code is not mapped in memory in Emscripten, so this operation is meaningless

// and thus always fails.

/*cache_enabled*/

// namespace __sanitizer

// SANITIZER_POSIX


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_posix.h ===
SHA256: b0f22a0fabf67c13441e3fa2e90f34ab7d091ca95074ec653c823097fa87bc93
//===-- sanitizer_posix.h -------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries and declares some useful POSIX-specific functions.

//===----------------------------------------------------------------------===//

// ----------- ATTENTION -------------

// This header should NOT include any other headers from sanitizer runtime.

// I/O

// Don't use directly, use __sanitizer::OpenFile() instead.

// Memory

// OS

// -1 on error.

// These functions call appropriate pthread_ functions directly, bypassing

// the interceptor. They are weak and may not be present in some tools.

// namespace __sanitizer

// A routine named real_sigaction() must be implemented by each sanitizer in

// order for internal_sigaction() to bypass interceptors.

// Move the fd out of {0, 1, 2} range.

// Create a non-file mapping with a given /proc/self/maps name.

// Platforms should implement at most one of these.

// 1. Provide a pre-decorated file descriptor to use instead of an anonymous

// mapping.

// 2. Add name to an existing anonymous mapping. The caller must keep *name

// alive at least as long as the mapping exists.

// namespace __sanitizer

// SANITIZER_POSIX

// SANITIZER_POSIX_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp ===
SHA256: 3737bcb6b8550b56a6727fa0a3118aed48b30277d075a97472d7382f9470dd99
//===-- sanitizer_posix_libcdep.cpp ---------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries and implements libc-dependent POSIX-specific functions

// from sanitizer_libc.h.

//===----------------------------------------------------------------------===//

// The MAP_NORESERVE define has been removed in FreeBSD 11.x, and even before

// that, it was never implemented.  So just define it to zero.

// May not be defined on old systems.

// MADV_NOHUGEPAGE

// MADV_DONTDUMP

// On Linux, if the kernel.core_pattern sysctl starts with a '|' (i.e. it

// is being piped to a coredump handler such as systemd-coredumpd), the

// kernel ignores RLIMIT_CORE (since we aren't creating a file in the file

// system) except for the magic value of 1, which disables coredumps when

// piping. 1 byte is too small for any kind of valid core dump, so it

// also disables coredumps if kernel.core_pattern creates files directly.

// While most piped coredump handlers do respect the crashing processes'

// RLIMIT_CORE, this is notable not the case for Debian's systemd-coredump

// due to a local patch that changes sysctl.d/50-coredump.conf to ignore

// the specified limit and instead use RLIM_INFINITY.

//

// The alternative to using RLIMIT_CORE=1 would be to use prctl() with the

// PR_SET_DUMPABLE flag, however that also prevents ptrace(), so makes it

// impossible to attach a debugger.

//

// Note: we use rlim_max in the Min() call here since that is the upper

// limit for what can be set without getting an EINVAL error.

// If we are handling SIGABRT, unhandle it first.

// TODO(vitalybuka): Check if handler belongs to sanitizer.

// TODO(glider): different tools may require different altstack size.

// Note: since GLIBC_2.31, SIGSTKSZ may be a function call, so this may be

// more costly that you think. However GetAltStackSize is only call 2-3 times

// per thread so don't cache the evaluation.

// If the alternate stack is already in place, do nothing.

// Android always sets an alternate stack, but it's too small for us.

// TODO(glider): the mapped stack should have the MAP_STACK flag in the

// future. It is not required by man 2 sigaltstack now (they're using

// malloc()).

// Some sane value required on Darwin.

// Do not block the signal from being received in that signal's handler.

// Clients are responsible for handling this correctly.

// Set the alternate signal stack for the main thread.

// This will cause SetAlternateSignalStack to be called twice, but the stack

// will be actually set only once.

// Access at a reasonable offset above SP, or slightly below it (to account

// for x86_64 or PowerPC redzone, ARM push of multiple registers, etc) is

// probably a stack overflow.

// On s390, the fault address in siginfo points to start of the page, not

// to the precise word that was accessed.  Mask off the low bits of sp to

// take it into account.

// Let's accept up to a page size away from top of stack. Things like stack

// probing can trigger accesses with such large offsets.

// Large stack frames can be allocated with e.g.

//   lis r0,-10000

//   stdux r1,r1,r0 # store sp to [sp-10000] and update sp by -10000

// If the store faults then sp will not have been updated, so test above

// will not work, because the fault address will be more than just "slightly"

// below sp.

// Check for store-with-update to sp. The instructions we accept are:

//   stbu rs,d(ra)          stbux rs,ra,rb

//   sthu rs,d(ra)          sthux rs,ra,rb

//   stwu rs,d(ra)          stwux rs,ra,rb

//   stdu rs,ds(ra)         stdux rs,ra,rb

// where ra is r1 (the stack pointer).

// __powerpc__

// We also check si_code to filter out SEGV caused by something else other

// then hitting the guard page or unmapped memory, like, for example,

// unaligned memory access.

// SANITIZER_GO

// Avoid pulling in __sys_pipe for the trick below, which doesn't work on

// WebAssembly anyways because there are no memory protections.

// `read` from `fds[0]` into a dummy buffer to free up the pipe buffer for

// more `write` is slower than just recreating a pipe.

// SANITIZER_EMSCRIPTEN

// Some kinds of sandboxes may forbid filesystem access, so we won't be able

// to read the file mappings from /proc/self/maps. Luckily, neither the

// process will be able to load additional libraries, so it's fine to use the

// cached mappings.

// MAP_NORESERVE is implicit with FreeBSD

// unsupported

// Uses fixed_addr for now.

// Will use offset instead once we've implemented this function for real.

// If we unmap the whole range, just null out the base.

// This function is defined elsewhere if we intercepted pthread_attr_getstack.

// extern "C"

// GLibC will return (0 - stacksize) as the stack address in the case when

// stacksize is set, but stackaddr is not.

// We place a lot of tool data into TLS, account for that.

// !SANITIZER_GO

// Child subprocess

// namespace __sanitizer

// SANITIZER_POSIX


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_printf.cpp ===
SHA256: da4a0f6db539bbd3be32b27060f62e0722d826c830bed48af053fc8fb3e3bcfd
//===-- sanitizer_printf.cpp ----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer.

//

// Internal printf function, used inside run-time libraries.

// We can't use libc printf because we intercept some of the functions used

// inside it.

//===----------------------------------------------------------------------===//

// Appends number in a given base to buffer. If its length is less than

// |minimal_num_length|, it is padded with leading zeroes or spaces, depending

// on the value of |pad_with_zero|.

// Make sure compiler doesn't insert call to memset here.

/* negative */

/* uppercase */

// Use the fact that explicitly requesting 0 width (%0s) results in UB and

// interpret width == 0 as "no width requested":

// width == 0 - no width requested

// width  < 0 - left-justify s within and pad it to -width chars, if necessary

// width  > 0 - right-justify s, not implemented yet

// Only the left justified strings are supported.

/* pad_with_zero */

/* uppercase */

// At the moment only %s supports precision and left-justification.

// Only left-justified width is supported.

// Can be overriden in frontend.

// Implementation must be defined in frontend.

// First try to print a message using a local buffer, and then fall back to

// mmaped buffer.

// Fuchsia's logging infrastructure always keeps track of the logging

// process, thread, and timestamp, so never prepend such information.

// If the message fit into the buffer, print it and exit.

// Remove color sequences from the message.

// |local_buffer| is small enough not to overflow the stack and/or violate

// the stack limit enforced by TSan (-Wframe-larger-than=512). On the other

// hand, the bigger the buffer is, the more the chance the error report will

// fit into it.

// Like Printf, but prints the current PID before the output string.

// Writes at most "length" symbols to "buffer" (including trailing '\0').

// Returns the number of symbols that should have been written to buffer

// (not including trailing '\0'). Thus, the string is truncated

// iff return value is not less than "length".

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h ===
SHA256: fe9949ed7879b7d7cd2124ddb74c43ff1d040986ff0565445e45b63e06ed1652
//===-- sanitizer_procmaps.h ------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer.

//

// Information about the process mappings.

//===----------------------------------------------------------------------===//

// Memory protection masks.

// owned by caller

// This field is assigned and owned by MemoryMappingLayout if needed

// This destructor cannot be virtual, as it would cause an operator new() linking

// failures in hwasan test cases. However non-virtual destructors emit warnings

// in macOS build, hence disabling those

// In some cases, e.g. when running under a sandbox on Linux, ASan is unable

// to obtain the memory mappings. It should fall back to pre-cached data

// instead of aborting.

// Adds all mapped objects into a vector.

// Returns code range for the specified module.

// namespace __sanitizer

// SANITIZER_PROCMAPS_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_bsd.cpp ===
SHA256: d364efce35d7a9b8decc7980d1b09ebd9c185e0b2e9a3a1de621e0a996165999
//===-- sanitizer_procmaps_bsd.cpp ----------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Information about the process mappings

// (FreeBSD and NetBSD-specific parts).

//===----------------------------------------------------------------------===//

// clang-format off

// clang-format on

// can not fail

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_common.cpp ===
SHA256: 7f2cac8a23789b50de704136da5f704e58b457a9e3330b8d125704246fd84c22
//===-- sanitizer_procmaps_common.cpp -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Information about the process mappings (common parts).

//===----------------------------------------------------------------------===//

// Parse a number and promote 'p' up to the first non-digit character.

// data_ should be unused on this platform

// FIXME: in the future we may want to cache the mappings on demand only.

// Read maps after the cache update to capture the maps/unmaps happening in

// the process of updating.

// Only unmap the buffer if it is different from the cached one. Otherwise

// it will be unmapped when the cache is refreshed.

// static

// Don't invalidate the cache if the mappings are unavailable.

// Don't subtract 'cur_beg' from the first entry:

// * If a binary is compiled w/o -pie, then the first entry in

//   process maps is likely the binary itself (all dynamic libs

//   are mapped higher in address space). For such a binary,

//   instruction offset in binary coincides with the actual

//   instruction address in virtual memory (as code section

//   is mapped to a fixed memory range).

// * If a binary is compiled with -pie, all the modules are

//   mapped high at address space (in particular, higher than

//   shadow memory of the tool), so the module can't be the

//   first entry.

// The following parsing can crash on almost every line

// in the case of malformed/truncated input.

// Fixing that is hard b/c e.g. ParseDecimal does not

// even accept end of the buffer and assumes well-formed input.

// So instead we patch end of the input a bit,

// it does not affect well-formed complete inputs.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_fuchsia.cpp ===
SHA256: f8ce9b3469f5b917781461e67f4fd7de285abb2df186ebc0e7c933d771b2dd34
//===-- sanitizer_procmaps_fuchsia.cpp

//----------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Information about the process mappings (Fuchsia-specific parts).

//===----------------------------------------------------------------------===//

// The cache flag is ignored on Fuchsia because a process can always get this

// information via its process-self handle.

// namespace __sanitizer

// SANITIZER_FUCHSIA


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_haiku.cpp ===
SHA256: 21bf7491ed88fdf3fa4cfe73388501618f951e48f22ed40ba5f98e181f6f23a2
//===-- sanitizer_procmaps_haiku.cpp --------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Information about the process mappings

// (Haiku-specific parts).

//===----------------------------------------------------------------------===//

// data_ should be unused on this platform

// static

// Don't subtract 'cur_beg' from the first entry:

// * If a binary is compiled w/o -pie, then the first entry in

//   process maps is likely the binary itself (all dynamic libs

//   are mapped higher in address space). For such a binary,

//   instruction offset in binary coincides with the actual

//   instruction address in virtual memory (as code section

//   is mapped to a fixed memory range).

// * If a binary is compiled with -pie, all the modules are

//   mapped high at address space (in particular, higher than

//   shadow memory of the tool), so the module can't be the

//   first entry.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_linux.cpp ===
SHA256: b3192b7afe39a7aeb1f2238ecdb3689fffecccdf1d264489563864cc5cb93acb
//===-- sanitizer_procmaps_linux.cpp --------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Information about the process mappings (Linux-specific parts).

//===----------------------------------------------------------------------===//

// simulate empty maps

// Example: 08048000-08056000 r-xp 00000000 03:0c 64593   /foo/bar

// Qemu may lack the trailing space.

// https://github.com/google/sanitizers/issues/160

// CHECK_EQ(*data_.current++, ' ');

// Skip spaces.

// Fill in the filename.

// namespace __sanitizer

// SANITIZER_LINUX


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_mac.cpp ===
SHA256: 05599bf2d0295b8141d0c0b5ea5efcdc97674e080ae90136235f27706992707e
//===-- sanitizer_procmaps_mac.cpp ----------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Information about the process mappings (Mac-specific parts).

//===----------------------------------------------------------------------===//

// These are not available in older macOS SDKs.

/* Haswell */

/* Swift */

// Contains information used to iterate through sections.

/*executable=*/

// Don't iterate over sections when the caller hasn't set up the

// data pointer, when there are no sections, or when the segment

// is executable. Avoid iterating over executable sections because

// it will confuse libignore, and because the extra granularity

// of information is not needed by any sanitizers.

// More information about Mach-O headers can be found in mach-o/loader.h

// Each Mach-O image has a header (mach_header or mach_header_64) starting with

// a magic number, and a list of linker load commands directly following the

// header.

// A load command is at least two 32-bit words: the command type and the

// command size in bytes. We're interested only in segment load commands

// (LC_SEGMENT and LC_SEGMENT_64), which tell that a part of the file is mapped

// into the task's address space.

// The |vmaddr|, |vmsize| and |fileoff| fields of segment_command or

// segment_command_64 correspond to the memory address, memory size and the

// file offset of the current memory segment.

// Because these fields are taken from the images as is, one needs to add

// _dyld_get_image_vmaddr_slide() to get the actual addresses at runtime.

// Count down from the top.

// TODO(glider): as per man 3 dyld, iterating over the headers with

// _dyld_image_count is thread-unsafe. We need to register callbacks for

// adding and removing images which will invalidate the MemoryMappingLayout

// state.

// The dyld load address should be unchanged throughout process execution,

// and it is expensive to compute once many libraries have been loaded,

// so cache it here and do not reset.

// static

// No-op on Mac for now.

// No-op on Mac for now.

// _dyld_get_image_header() and related APIs don't report dyld itself.

// We work around this by manually recursing through the memory map

// until we hit a Mach header matching dyld instead. These recurse

// calls are expensive, but the first memory map generation occurs

// early in the process, when dyld is one of the only images loaded,

// so it will be hit after only a few iterations.  These assumptions don't hold

// on macOS 13+ anymore (dyld itself has moved into the shared cache).

// current version 2

// following fields all exist in version 1

// pointer invalid at end of iterations

// following fields all exist in version 2

// offset from start of cache

// extern "C"

// On macOS 13+, dyld itself has moved into the shared cache.  Looking it up

// via vm_region_recurse_64() causes spins/hangs/crashes.

// Next and NextSegmentLoad were inspired by base/sysinfo.cc in

// Google Perftools, https://github.com/gperftools/gperftools.

// NextSegmentLoad scans the current image for the next segment load command

// and returns the start and end addresses and file offset of the corresponding

// segment.

// Note that the segment addresses are not necessarily sorted.

// vmaddr is masked with 0xfffff because on macOS versions < 10.12,

// it contains an absolute address rather than an offset for dyld.

// To make matters even more complicated, this absolute address

// isn't actually the absolute segment address, but the offset portion

// of the address is accurate when combined with the dyld base address,

// and the mask will give just this offset.

// Most callers don't need section information, so only fill this struct

// when required.

// Return the initial protection.

/*MH_EXECUTE*/

// Set up for this image;

// data_.current_magic may be only one of MH_MAGIC, MH_MAGIC_64.

// If we get here, no more load_cmd's in this image talk about

// segments.  Go on to the next image.

// This will trigger loading next image

// skip the __PAGEZERO segment, its vmsize is 0

// namespace __sanitizer

// SANITIZER_APPLE


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_solaris.cpp ===
SHA256: 7f14eaf080fd889eab371fd1f719676abcb1098010a85c4d44e5b9a28e8589aa
//===-- sanitizer_procmaps_solaris.cpp ------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Information about the process mappings (Solaris-specific parts).

//===----------------------------------------------------------------------===//

// Avoid conflict between `_TIME_BITS` defined vs. `_FILE_OFFSET_BITS`

// undefined in some Linux configurations.

// Allow for additional entries by following mmap.

// simulate empty maps

// Avoid unnecessary readlink on unnamed entires.

// If readlink failed, the map is anonymous.

// readlink doesn't NUL-terminate.

// namespace __sanitizer

// SANITIZER_SOLARIS


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_ptrauth.h ===
SHA256: 54d5327b312b61051e17b9fb5f4c2dfbce28e53eaa9a928dcf418c0bf16668ba
//===-- sanitizer_ptrauth.h -------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// On the stack the link register is protected with Pointer

// Authentication Code when compiled with -mbranch-protection.

// Let's stripping the PAC unconditionally because xpaclri is in

// the NOP space so will do nothing when it is not enabled or not available.

// Copied from <ptrauth.h>

// SANITIZER_PTRAUTH_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_quarantine.h ===
SHA256: f82943ce08f6bf1a0afe6121a392d9ef9b227663a0537671d5917dd61ddb9d3d
//===-- sanitizer_quarantine.h ----------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Memory quarantine for AddressSanitizer and potentially other tools.

// Quarantine caches some specified amount of memory in per-thread caches,

// then evicts to global FIFO queue. When the queue reaches specified threshold,

// oldest memory is recycled.

//

//===----------------------------------------------------------------------===//

// Account for the batch size.

// The total size of quarantined nodes recorded in this batch.

// 8Kb.

// Thread local quarantine size can be zero only when global quarantine size

// is zero (it allows us to perform just one atomic read per Put() call).

// 90% of max size.

// GetMaxCacheSize() == 0 only when GetMaxSize() == 0 (see Init).

// Check cache size anyway to accommodate for runtime cache_size change.

// It assumes that the world is stopped, just as the allocator's PrintStats.

// Read-only data.

// Go over the batches and merge partially filled ones to

// save some memory, otherwise batches themselves (since the memory used

// by them is counted against quarantine limit) can overcome the actual

// user's quarantined chunks, which diminishes the purpose of the

// quarantine.

// Do the merge only when overhead exceeds this predefined limit (might

// require some tuning). It saves us merge attempt when the batch list

// quarantine is unlikely to contain batches suitable for merge.

// Extract enough chunks from the quarantine to get below the max

// quarantine size and leave some leeway for the newly quarantined chunks.

// Per-thread cache of memory blocks.

// Total memory used, including internal accounting.

// Memory used for internal accounting.

// Move all the chunks into the current batch.

// Remove the next batch from the list and account for its size.

// Add it to deallocation list.

// namespace __sanitizer

// SANITIZER_QUARANTINE_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_range.cpp ===
SHA256: ce5144596a7cce112af4b11b42acd2aa90ef3970666000b7f84108bb95fe2c9b
//===-- sanitizer_range.cpp -----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_range.h ===
SHA256: c941ea4be8155d4621eb48dfdb1c233b46e8880f95c16d902b7dc8fed5903d7a
//===-- sanitizer_range.h ---------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Contais Range and related utilities.

//

//===----------------------------------------------------------------------===//

// Calculates intersection of two sets of regions in O(N log N) time.

// namespace __sanitizer

// SANITIZER_RANGE_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_redefine_builtins.h ===
SHA256: a87d9e2ea0a1ba3959625b0fa8a1a770f2262cf51a8937148d83cd45a2911633
//===-- sanitizer_redefine_builtins.h ---------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Redefine builtin functions to use internal versions. This is needed where

// compiler optimizations end up producing unwanted libcalls!

//

//===----------------------------------------------------------------------===//

// The asm hack only works with GCC and Clang.

// XXX Emscripten This does not work in Wasm.

// The builtins should not be redefined in source files that make use of C++

// standard libraries, in particular where C++STL headers with inline functions

// are used. The redefinition in such cases would lead to ODR violations.

//

// Try to break the build in common cases where builtins shouldn't be redefined.

// namespace std

// __cpluplus

// !_WIN32 && !__wasm__

// SANITIZER_REDEFINE_BUILTINS_H

// SANITIZER_COMMON_NO_REDEFINE_BUILTINS


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_report_decorator.h ===
SHA256: 82fbf350f133dd1b1ca8a4ede181b3039512e6c58a192e299ffda54f35c88985
//===-- sanitizer_report_decorator.h ----------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Tags to decorate the sanitizer reports.

// Currently supported tags:

//   * None.

//   * ANSI color sequences.

//

//===----------------------------------------------------------------------===//

// FIXME: This is not portable. It assumes the special strings are printed to

// stdout, which is not the case on Windows (see SetConsoleTextAttribute()).

// namespace __sanitizer

// SANITIZER_REPORT_DECORATOR_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_ring_buffer.h ===
SHA256: 7dbf17b4f494c1a2d6ef39210a49c8b7ac7f152c31070084f8452464d21011cb
//===-- sanitizer_ring_buffer.h ---------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Simple ring buffer.

//

//===----------------------------------------------------------------------===//

// RingBuffer<T>: fixed-size ring buffer optimized for speed of push().

// T should be a POD type and sizeof(T) should be divisible by sizeof(void*).

// At creation, all elements are zero.

// Data layout:

// LNDDDDDDDD

// D: data elements.

// L: last_, always points to the last data element.

// N: next_, initially equals to last_, is decremented on every push,

//    wraps around if it's less or equal than its own address.

// flexible array.

// A ring buffer with externally provided storage that encodes its state in 8

// bytes. Has significant constraints on size and alignment of storage.

// See a comment in hwasan/hwasan_thread_list.h for the motivation behind this.

// Top byte of long_ stores the buffer size in pages.

// Lower bytes store the address of the next buffer element.

// A copy constructor of sorts.

// namespace __sanitizer

// SANITIZER_RING_BUFFER_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_signal_interceptors.inc ===
SHA256: 51fdce1dd743009add703211f785ffd0ee53725a83f3246625e43edc2c3db9ce
//===-- sanitizer_signal_interceptors.inc -----------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Signal interceptors for sanitizers.

//

//===----------------------------------------------------------------------===//

// SANITIZER_INTERCEPT_BSD_SIGNAL

// SANITIZER_INTERCEPT_BSD_SIGNAL

// namespace __sanitizer

// SANITIZER_INTERCEPT_SIGNAL_AND_SIGACTION

// We need to have defined REAL(sigaction) on other systems.

// SANITIZER_INTERCEPT_SIGNAL_AND_SIGACTION


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp ===
SHA256: d34ae448d10d7bb79bb1180dac67550aee7597c2c052d3e6eb8d2e83a2cca557
//===-- sanitizer_solaris.cpp ---------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between various sanitizers' runtime libraries and

// implements Solaris-specific functions.

//===----------------------------------------------------------------------===//

//#include "sanitizer_syscall_generic.inc"

// ---------------------- sanitizer_libc.h

/*size_t*/

// Illumos' declaration of madvise cannot be made visible if _XOPEN_SOURCE

// is defined as g++ does on Solaris.

//

// This declaration is consistent with Solaris 11.4. Both Illumos and Solaris

// versions older than 11.4 declared madvise with a caddr_t as the first

// argument, but we don't currently support Solaris versions older than 11.4,

// and as mentioned above the declaration is not visible on Illumos so we can

// use any declaration we like on Illumos.

// FIXME: There's only _ftruncate64 beginning with Solaris 11.

// FIXME: This might be wrong: _getdents doesn't take a struct linux_dirent *.

// FIXME: This might be wrong: _sigfillset doesn't take a

// __sanitizer_sigset_t *.

// FIXME: This might be wrong: _sigprocmask doesn't take __sanitizer_sigset_t *.

// TODO(glider): this may call user's pthread_atfork() handlers which is bad.

// FIXME: No internal variant.

// ----------------- sanitizer_common.h

// FIXME: implement actual blocking.

// namespace __sanitizer

// SANITIZER_SOLARIS


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_solaris.h ===
SHA256: a6c990bec2164f07b35d00c4e4a299231be35e0b9e0a12e4b68dd861128ada0a
//===-- sanitizer_solaris.h -------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is a part of Sanitizer runtime. It contains Solaris-specific

// definitions.

//

//===----------------------------------------------------------------------===//

// Beginning of declaration from OpenSolaris/Illumos

// $SRC/cmd/sgs/include/rtld.h.

// Structure matching the Solaris 11.4 struct dl_phdr_info used to determine

// presence of dlpi_tls_modid field at runtime.  Cf. Solaris 11.4

// dl_iterate_phdr(3C), Example 2.

// namespace __sanitizer

// SANITIZER_SOLARIS

// SANITIZER_SOLARIS_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_stack_store.cpp ===
SHA256: 2b42c6b927e22751f6e1dd0e5ab77587fdfbdfd0a3c0fe85b685344571f097f0
//===-- sanitizer_stack_store.cpp -------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace

// No more space.

// Optimisic lock-free allocation, essentially try to bump the

// total_frames_.

// Fits into a single block.

// No more available blocks.  Indicate inability to allocate more memory.

// Retry. We can't use range allocated in two different blocks.

// Mark tail/head of these blocks as "stored".to avoid waiting before we can

// Pack().

// Idiomatic double-checked locking uses memory_order_acquire here. But

// relaxed is fine for us, justification is similar to

// TwoLevelMap::GetOrCreate.

// Disable 'nonstandard extension used: zero-sized array in struct/union'.

// namespace

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_stack_store.h ===
SHA256: a7bce0b71b643a05918eb1db46808ec5ce57b791264a3b34430e753935345771
//===-- sanitizer_stack_store.h ---------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Enough for 2^32 * sizeof(uptr) bytes of traces.

/* number of blocks completed by this call */

// Packs all blocks which don't expect any more writes. A block is going to be

// packed once. As soon trace from that block was requested, it will unpack

// and stay unpacked after that.

// Returns the number of released bytes.

// Avoid zero as id.

// This makes UINT32_MAX to 0 and it will be retrived as and empty stack.

// But this is not a problem as we will not be able to store anything after

// that anyway.

// Avoid zero as id.

// Total number of allocated frames.

// Tracks total allocated memory in bytes.

// Each block will hold pointer to exactly kBlockSizeFrames.

// Counter to track store progress to know when we can Pack() the block.

// Protects alloc of new blocks.

// namespace __sanitizer

// SANITIZER_STACK_STORE_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.cpp ===
SHA256: cd2eda945f56569d88d51537fdc815bed16aed8d7fbcd443b377c293cb8d95b2
//===-- sanitizer_stackdepot.cpp ------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.

//===----------------------------------------------------------------------===//

// FIXME(dvyukov): this single reserved bit is used in TSan.

// Keep mutable data out of frequently access nodes to improve caching

// efficiency.

/* for testing or debugging */

// Allow to restart after Unlock() if needed.

// namespace

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_stackdepot.h ===
SHA256: 8bbec5bc0872aebbaacda941ff0afc86986ff07f8a15b4e379e0823c4b6bb9dd
//===-- sanitizer_stackdepot.h ----------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.

//===----------------------------------------------------------------------===//

// StackDepot efficiently stores huge amounts of stack traces.

// Retrieves a stored stack trace by the id.

// namespace __sanitizer

// SANITIZER_STACKDEPOT_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_stackdepotbase.h ===
SHA256: d2dde99e3ade07eee633670930efb6a67ab5413e103598c1e1f550d8aa52ebb1
//===-- sanitizer_stackdepotbase.h ------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Implementation of a mapping from arbitrary values to unique 32-bit

// identifiers.

//===----------------------------------------------------------------------===//

/* At least 1 bit for locking. */

// Hash table size.

// Maps stack trace to an unique id.

// Retrieves a stored stack trace by the id.

// Hash table of Node's.

// Searches linked list s for the stack, returns its id.

// Uses the pointer lsb as mutex.

// First, try to find the existing stack.

// If failed, lock, retry and insert new.

// Do not lock hash table. It's very expensive, but it's not rely needed. The

// parent process will neither lock nor unlock. Child process risks to be

// deadlocked on already locked buckets. To avoid deadlock we will unlock

// every locked buckets in `UnlockAfterFork`. This may affect consistency of

// the hash table, but the only issue is a few items inserted by parent

// process will be not found by child, and the child may insert them again,

// wasting some space in `stackStore`.

// We still need to lock nodes.

// Only unlock in child process to avoid deadlock. See `LockBeforeFork`.

// namespace __sanitizer

// SANITIZER_STACKDEPOTBASE_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cpp ===
SHA256: 142a1d8296d9d3334a8aad2b3dde4e54fcaf9d057ee5691bfbbbe700b95615d9
//===-- sanitizer_stacktrace.cpp ------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.

//===----------------------------------------------------------------------===//

// Current check order is 4 -> 2 -> 6 -> 8

// xxxxxxxxxxxbbb11 | 32 bit | bbb != 111

// xxxxxxxxxxxxxxaa | 16 bit | aa != 11

// RISC-V encoding allows instructions to be up to 8 bytes long

// xxxxxxxxxx011111 | 48 bit |

// xxxxxxxxx0111111 | 64 bit |

// bail-out if could not figure out the instruction size

// Sparc and Emscripten implementions are in their own files.

// In GCC on ARM bp points to saved lr, not fp, so we should check the next

// cell in stack to be a saved frame pointer. GetCanonicFrame returns the

// pointer to saved frame pointer in any case.

// The next frame pointer does not look right. This could be a GCC frame, step

// back by 1 word and try again.

// Nope, this does not look right either. This means the frame after next does

// not have a valid frame pointer, but we can still extract the caller PC.

// Unfortunately, there is no way to decide between GCC and LLVM frame

// layouts. Assume LLVM.

// TODO(yln): add arg sanity check for stack_top/stack_bottom

// Sanity check for stack top.

// Lowest possible address that makes sense as the next frame pointer.

// Goes up as we walk the stack.

// Avoid infinite loop when frame == frame[0] by using frame > prev_frame.

// PowerPC ABIs specify that the return address is saved at offset

// 16 of the *caller's* stack frame.  Thus we must dereference the

// back chain to find the caller frame before extracting it.

// frame[-1] contains the return address

// Let's assume that any pointer in the 0th page (i.e. <0x1000 on i386 and

// x86_64) is invalid and stop unwinding here.  If we're adding support for

// a platform where this isn't true, we need to reconsider this check.

// frame[-2] contain fp of the previous frame

// !defined(__sparc__)

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h ===
SHA256: fc703671e3c39a8156097bf2c1ffd7d5c6ea511241988dee7baf9a3fba71c911
//===-- sanitizer_stacktrace.h ----------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.

//===----------------------------------------------------------------------===//

// Fast unwind is the only option on Mac for now; we will need to

// revisit this macro when slow unwind works on Mac, see

// https://github.com/google/sanitizers/issues/137

// Tool specific tags start here.

// Prints a symbolized stacktrace, followed by an empty line.

// Prints a symbolized stacktrace to the output string, followed by an empty

// line.

// Prints a symbolized stacktrace to the output buffer, followed by an empty

// line. Returns the number of symbols that should have been written to buffer

// (not including trailing '\0'). Thus, the string is truncated iff return

// value is not less than "out_buf_size".

// Performance-critical, must be in the header.

// T32 (Thumb) branch instructions might be 16 or 32 bit long,

// so we return (pc-2) in that case in order to be safe.

// For A32 mode we return (pc-4) because all instructions are 32 bit long.

// RV-64 has variable instruction length...

// C extentions gives us 2-byte instructoins

// RV-64 has 4-byte instructions

// + RISC-V architecture allows instructions up to 8 bytes

// It seems difficult to figure out the exact instruction length -

// pc - 2 seems like a safe option for the purposes of stack tracing

// StackTrace that owns the buffer used to store the addresses.

// Optional bp of a top frame.

// Get the stack trace with the given pc and bp.

// The pc will be in the position 0 of the resulting stack trace.

// The bp may refer to the current frame or to the caller's frame.

// Small max_depth optimization

// Every runtime defines its own implementation of this method

// UnwindFast/Slow have platform-specific implementations

// Check if given pointer points into allocated stack area.

// namespace __sanitizer

// Use this macro if you want to print stack trace with the caller

// of the current function in the top frame.

// Use this macro if you want to print stack trace with the current

// function in the top frame.

// GET_CURRENT_PC() is equivalent to StackTrace::GetCurrentPc().

// Optimized x86 version is faster than GetCurrentPc because

// it does not involve a function call, instead it reads RIP register.

// Reads of RIP by an instruction return RIP pointing to the next

// instruction, which is exactly what we want here, thus 0 offset.

// It needs to be a macro because otherwise we will get the name

// of this function on the top of most stacks. Attribute artificial

// does not do what it claims to do, unfortunatley. And attribute

// __nodebug__ is clang-only. If we would have an attribute that

// would remove this function from debug info, we could simply make

// StackTrace::GetCurrentPc() faster.

// SANITIZER_STACKTRACE_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_emscripten.cpp ===
SHA256: cfa125ba506c64936e09294da06b75864f62edd8a6d71745966183132c7042dd
//===-- sanitizer_stacktrace_emscripten.cc --------------------------------===//

//

//                     The LLVM Compiler Infrastructure

//

// This file is distributed under the University of Illinois Open Source

// License. See LICENSE.TXT for details.

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.

//

// Implementation of fast stack unwinding for Emscripten.

//===----------------------------------------------------------------------===//

// namespace __sanitizer

// __EMSCRIPTEN__


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cpp ===
SHA256: 45ae2685faa0f1401d7d680ff1d2b0eab921a1b1f427ccf598af8ab21471513b
//===-- sanitizer_stacktrace_libcdep.cpp ----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.

//===----------------------------------------------------------------------===//

// Extend the dedup token by appending a new frame.

// namespace

// PCs in stack traces are actually the return addresses, that is,

// addresses of the next instructions after the call.

// On Emscripten, the stack traces are obtained from JavaScript, and the

// addresses are not return addresses.

// Always add a trailing empty line after stack trace.

// Append deduplication token, if non-empty.

// Ensures all call sites get what they requested.

// Avoid doing any work for small max_depth.

// If there are too few frames, the program may be built with

// -fno-asynchronous-unwind-tables. Fall back to fast unwinder below.

// namespace __sanitizer

// extern "C"


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_printer.cpp ===
SHA256: 77584bc9e1f16f61e25ae054c72d468ed4bd9797bf0480dc581ebc6fe93871a5
//===-- sanitizer_common.cpp ----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between sanitizers' run-time libraries.

//

//===----------------------------------------------------------------------===//

// sanitizer_symbolizer_markup.cpp implements these differently.

// NetBSD uses indirection for old threading functions for historical reasons

// The mangled names are internal implementation detail and should not be

// exposed even in backtraces.

// info will be null in the case where symbolization is not needed for the

// given format. This ensures that the code below will get a hard failure

// rather than print incorrect information in case RenderNeedsSymbolization

// ever ends up out of sync with this function. If non-null, the addresses

// should match.

// Frame number and all fields of AddressInfo structure.

/*PrefixSpace=*/

// Smarter special cases.

// Function name and offset, if file is unknown.

// File/line information.

// Source location, or module location.

/*PrefixSpace=*/

// Module basename and offset, or PC.

// There PCs are not meaningful.

// Always strip the module name for %M.

/*PrefixSpace=*/

// frame_no

// address

// !SANITIZER_SYMBOLIZER_MARKUP

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_printer.h ===
SHA256: 535e509595ea1c3684b7979823de21b9fa787b32edd0a9aecdd5c4a8c2e95d8a
//===-- sanitizer_stacktrace_printer.h --------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between sanitizers' run-time libraries.

//

//===----------------------------------------------------------------------===//

// StacktracePrinter is an interface that is implemented by

// classes that can perform rendering of the different parts

// of a stacktrace.

// Strip interceptor prefixes from function name.

// Should be pure virtual, but we can't depend on __cxa_pure_virtual.

// Should be pure virtual, but we can't depend on __cxa_pure_virtual.

// Should be pure virtual, but we can't depend on __cxa_pure_virtual.

// To be called from StackTracePrinter::GetOrInit

// Render the contents of "info" structure, which represents the contents of

// stack frame "frame_no" and appends it to the "buffer". "format" is a

// string with placeholders, which is copied to the output with

// placeholders substituted with the contents of "info". For example,

// format string

//   "  frame %n: function %F at %S"

// will be turned into

//   "  frame 10: function foo::bar() at my/file.cc:10"

// You may additionally pass "strip_path_prefix" to strip prefixes of paths to

// source files and modules.

// Here's the full list of available placeholders:

//   %% - represents a '%' character;

//   %n - frame number (copy of frame_no);

//   %p - PC in hex format;

//   %m - path to module (binary or shared object);

//   %o - offset in the module in hex format;

//   %f - function name;

//   %q - offset in the function in hex format (*if available*);

//   %s - path to source file;

//   %l - line in the source file;

//   %c - column in the source file;

//   %F - if function is known to be <foo>, prints "in <foo>", possibly

//        followed by the offset in this function, but only if source file

//        is unknown;

//   %S - prints file/line/column information;

//   %L - prints location information: file/line/column, if it is known, or

//        module+offset if it is known, or (<unknown module>) string.

//   %M - prints module basename and offset, if it is known, or PC.

// Same as RenderFrame, but for data section (global variables).

// Accepts %s, %l from above.

// Also accepts:

//   %g - name of the global variable.

// namespace __sanitizer

// SANITIZER_STACKTRACE_PRINTER_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_sparc.cpp ===
SHA256: bac4b0b530d746e36ef73f882bf9e6ce5feff12746d2db1e82b6b46df82bb406
//===-- sanitizer_stacktrace_sparc.cpp ------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.

//

// Implementation of fast stack unwinding for Sparc.

//===----------------------------------------------------------------------===//

// TODO(yln): add arg sanity check for stack_top/stack_bottom

// Sanity check for stack top.

// Flush register windows to memory

// On the SPARC, the return address is not in the frame, it is in a

// register.  There is no way to access it off of the current frame

// pointer, but it can be accessed off the previous frame pointer by

// reading the value from the register window save area.

// Lowest possible address that makes sense as the next frame pointer.

// Goes up as we walk the stack.

// Avoid infinite loop when frame == frame[0] by using frame > prev_frame.

// %o7 contains the address of the call instruction and not the

// return address, so we need to compensate.

// Let's assume that any pointer in the 0th page is invalid and

// stop unwinding here.  If we're adding support for a platform

// where this isn't true, we need to reconsider this check.

// namespace __sanitizer

// !defined(__sparc__)


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld.h ===
SHA256: 201eb643fe3143b60d9ab6c80d1c32b84c6485b188517705b5e4b613e4b56bfc
//===-- sanitizer_stoptheworld.h --------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Defines the StopTheWorld function which suspends the execution of the current

// process and runs the user-supplied callback in the same address space.

//

//===----------------------------------------------------------------------===//

// Holds the list of suspended threads and provides an interface to dump their

// register contexts.

// Can't declare pure virtual functions in sanitizer runtimes:

// __cxa_pure_virtual might be unavailable. Use UNIMPLEMENTED() instead.

// Prohibit copy and assign.

// Suspend all threads in the current process and run the callback on the list

// of suspended threads. This function will resume the threads before returning.

// The callback should not call any libc functions. The callback must not call

// exit() nor _exit() and instead return to the caller.

// This function should NOT be called from multiple threads simultaneously.

// namespace __sanitizer

// SANITIZER_STOPTHEWORLD_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_fuchsia.cpp ===
SHA256: d93353783b2f9f0f47827d1e44b21fcad08d909fcc2a15383cc24b645f7d0331
//===-- sanitizer_stoptheworld_fuchsia.cpp -------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

//

// See sanitizer_stoptheworld.h for details.

//

//===---------------------------------------------------------------------===//

// The Fuchsia implementation stops the world but doesn't offer a real

// SuspendedThreadsList argument.  This is enough for ASan's use case,

// and LSan does not use this API on Fuchsia.

// namespace __sanitizer

// SANITIZER_FUCHSIA


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_fuchsia.h ===
SHA256: 5edd3add840825e38b9a22055a28d2d2b9416a88251cd3d540d5652255b53a1a
//===-- sanitizer_stoptheworld_fuchsia.h ------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __sanitizer

// SANITIZER_STOPTHEWORLD_FUCHSIA_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp ===
SHA256: 5c2148a5be80fbb23d91b2b956935fe3c9d681df28972f5fd59dc6dc1f7f3451
//===-- sanitizer_stoptheworld_linux_libcdep.cpp --------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// See sanitizer_stoptheworld.h for details.

// This implementation was inspired by Markus Gutschke's linuxthreads.cc.

//

//===----------------------------------------------------------------------===//

// for CLONE_* definitions

// for PR_* definitions

// for PTRACE_* definitions

// for pid_t

// for iovec

// for NT_PRSTATUS

// GLIBC 2.20+ sys/user does not include asm/ptrace.h

// for user_regs_struct

// clang-format off

// <asm/sgidefs.h> must be included before <asm/reg.h>

// for mips SP register

// clang-format on

// for signal-related stuff

// Sufficiently old kernel headers don't provide this value, but we can still

// call prctl with it. If the runtime kernel is new enough, the prctl call will

// have the desired effect; if the kernel is too old, the call will error and we

// can ignore said error.

// This module works by spawning a Linux task which then attaches to every

// thread in the caller process with ptrace. This suspends the threads, and

// PTRACE_GETREGS can then be used to obtain their register state. The callback

// supplied to StopTheWorld() is run in the tracer task while the threads are

// suspended.

// The tracer task must be placed in a different thread group for ptrace to

// work, so it cannot be spawned as a pthread. Instead, we use the low-level

// clone() interface (we want to share the address space with the caller

// process, so we prefer clone() over fork()).

//

// We don't use any libc functions, relying instead on direct syscalls. There

// are two reasons for this:

// 1. calling a library function while threads are suspended could cause a

// deadlock, if one of the treads happens to be holding a libc lock;

// 2. it's generally not safe to call libc functions from the tracer task,

// because clone() does not set up a thread-local storage for it. Any

// thread-local variables used by libc will be shared between the tracer task

// and the thread which spawned it.

// Structure for passing arguments into the tracer thread.

// The tracer thread waits on this mutex while the parent finishes its

// preparations.

// Tracer thread signals its completion by setting done.

// This class handles thread suspending/unsuspending in the tracer thread.

// Either the thread is dead, or something prevented us from attaching.

// Log this event and move on.

// The thread is not guaranteed to stop before ptrace returns, so we must

// wait on it. Note: if the thread receives a signal concurrently,

// we can get notification about the signal before notification about stop.

// In such case we need to forward the signal to the thread, otherwise

// the signal will be missed (as we do PTRACE_DETACH with arg=0) and

// any logic relying on signals will break. After forwarding we need to

// continue to wait for stopping, because the thread is not stopped yet.

// We do ignore delivery of SIGSTOP, because we want to make stop-the-world

// as invisible as possible.

// Got a ECHILD error. I don't think this situation is possible, but it

// doesn't hurt to report it.

// Either the thread is dead, or we are already detached.

// The latter case is possible, for instance, if this function was called

// from a signal handler.

// Are we already attached to this thread?

// Currently this check takes linear time, however the number of threads

// is usually small.

// Pointer to the ThreadSuspender instance for use in signal handler.

// Synchronous signals that should not be blocked.

// Generally a call to Die() in the tracer thread should be fatal to the

// parent process as well, because they share the address space.

// This really only works correctly if all the threads are suspended at this

// point. So we correctly handle calls to Die() from within the callback, but

// not those that happen before or after the callback. Hopefully there aren't

// a lot of opportunities for that to happen...

// Signal handler to wake up suspended threads when the tracer thread dies.

// Size of alternative stack for signal handlers in the tracer thread.

// This function will be run as a cloned task.

// Check if parent is already dead.

// Wait for the parent thread to finish preparations.

// Global pointer for the signal handler.

// Alternate stack for signal handling.

// Install our handler for synchronous signals. Other signals should be

// blocked by the mask we inherited from the parent thread.

// FIXME: Omitting MAP_STACK here works in current kernels but might break

// in the future.

// We have a limitation on the stack frame size, so some stuff had to be moved

// into globals.

// Make this process dumpable. Processes that are not dumpable cannot be

// attached to.

// Restore the dumpable flag.

// When sanitizer output is being redirected to file (i.e. by using log_path),

// the tracer should write to the parent's log instead of trying to open a new

// file. Alert the logging code to the fact that we have a tracer.

// Prepare the arguments for TracerThread.

// Block the execution of TracerThread until after we have set ptrace

// permissions.

// Signal handling story.

// We don't want async signals to be delivered to the tracer thread,

// so we block all async signals before creating the thread. An async signal

// handler can temporary modify errno, which is shared with this thread.

// We ought to use pthread_sigmask here, because sigprocmask has undefined

// behavior in multithreaded programs. However, on linux sigprocmask is

// equivalent to pthread_sigmask with the exception that pthread_sigmask

// does not allow to block some signals used internally in pthread

// implementation. We are fine with blocking them here, we are really not

// going to pthread_cancel the thread.

// The tracer thread should not raise any synchronous signals. But in case it

// does, we setup a special handler for sync signals that properly kills the

// parent as well. Note: we don't pass CLONE_SIGHAND to clone, so handlers

// in the tracer thread won't interfere with user program. Double note: if a

// user does something along the lines of 'kill -11 pid', that can kill the

// process even if user setup own handler for SEGV.

// Thing to watch out for: this code should not change behavior of user code

// in any observable way. In particular it should not override user signal

// handlers.

/* parent_tidptr */

/* newtls */

/* child_tidptr */

// On some systems we have to explicitly declare that we want to be traced

// by the tracer thread.

// Allow the tracer thread to start.

// NOTE: errno is shared between this thread and the tracer thread.

// internal_waitpid() may call syscall() which can access/spoil errno,

// so we can't call it now. Instead we for the tracer thread to finish using

// the spin loop below. Man page for sched_yield() says "In the Linux

// implementation, sched_yield() always succeeds", so let's hope it does not

// spoil errno. Note that this spin loop runs only for brief periods before

// the tracer thread has suspended us and when it starts unblocking threads.

// Now the tracer thread is about to exit and does not touch errno,

// wait for it.

// Platform-specific methods from SuspendedThreadsList.

// Support ptrace extensions even when compiled without required kernel support

// Compiler may use FP registers to store pointers.

// sys/ucontext.h already defines REG_SP as 2. Undefine it first.

// SANITIZER_ANDROID && defined(__arm__)

// NT_X86_XSTATE requires 64bit alignment.

// Far enough from the buffer size, no need to resize and repeat.

// Accept the first available and do not report errors.

// ESRCH means that the given thread is not suspended or already dead.

// Therefore it's unsafe to inspect its data (e.g. walk through stack) and

// we should notify caller about this.

// namespace __sanitizer

// SANITIZER_LINUX && (defined(__x86_64__) || defined(__mips__)

// || defined(__aarch64__) || defined(__powerpc64__)

// || defined(__s390__) || defined(__i386__) || defined(__arm__)

// || SANITIZER_LOONGARCH64


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_mac.cpp ===
SHA256: 0e7ab15f1478b2abf9e90f1f789f1b43cfe861b8b59f5e0a201b5480352892bb
//===-- sanitizer_stoptheworld_mac.cpp ------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// See sanitizer_stoptheworld.h for details.

//

//===----------------------------------------------------------------------===//

// MIG_ARRAY_TOO_LARGE, means that the state is too large, but it's

// still safe to proceed.

// On x86_64 and aarch64, we must account for the stack redzone, which is 128

// bytes.

// namespace __sanitizer

// SANITIZER_APPLE && (defined(__x86_64__) || defined(__aarch64__)) ||

//                   defined(__i386))


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cpp ===
SHA256: b0e2fa227228146e0a7490f8404c3f4f39de012001a54c8769eb241235f56a54
//===-- sanitizer_stoptheworld_netbsd_libcdep.cpp -------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// See sanitizer_stoptheworld.h for details.

// This implementation was inspired by Markus Gutschke's linuxthreads.cc.

//

// This is a NetBSD variation of Linux stoptheworld implementation

// See sanitizer_stoptheworld_linux_libcdep.cpp for code comments.

//

//===----------------------------------------------------------------------===//

// Pointer to the ThreadSuspender instance for use in signal handler.

// Synchronous signals that should not be blocked.

// Signal handler to wake up suspended threads when the tracer thread dies.

// Size of alternative stack for signal handlers in the tracer thread.

// This function will be run as a cloned task.

// Check if parent is already dead.

// Wait for the parent thread to finish preparations.

// Global pointer for the signal handler.

// Alternate stack for signal handling.

// Install our handler for synchronous signals. Other signals should be

// blocked by the mask we inherited from the parent thread.

// FIXME: Omitting MAP_STACK here works in current kernels but might break

// in the future.

// Prepare the arguments for TracerThread.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_win.cpp ===
SHA256: ccb7e7dbc86c89058245da13557ab1c5b2398f56ca25bc35c96e40a999f40195
//===-- sanitizer_stoptheworld_win.cpp ------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// See sanitizer_stoptheworld.h for details.

//

//===----------------------------------------------------------------------===//

// windows.h needs to be included before tlhelp32.h

// Stack Pointer register names on different architectures

// Take a snapshot of all Threads

// Skip the Thread if it was already suspended

// Between the call to `CreateToolhelp32Snapshot` and suspending the

// relevant Threads, new Threads could have potentially been created. So

// continue to find and suspend new Threads until we don't find any.

// Now all Threads of this Process except of this Thread should be suspended.

// Execute the callback function.

// Resume all Threads

// namespace

// namespace __sanitizer

// SANITIZER_WINDOWS


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_suppressions.cpp ===
SHA256: 5d8f451446d7c5cc04857d1d20d2cdb6bfbabababa268e40a672ba2b891b7338
//===-- sanitizer_suppressions.cpp ----------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Suppression parsing/matching code.

//

//===----------------------------------------------------------------------===//

/*out*/

/*out*/

// If we cannot find the file, check if its location is relative to

// the location of the executable.

// Read the file.

// Context must not mutate once Match has been called.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_suppressions.h ===
SHA256: 9f0ca5ec738f28a68b2d52533eb0a4de35110237df90dd2076c1de8c37a19359
//===-- sanitizer_suppressions.h --------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Suppression parsing/matching code.

//

//===----------------------------------------------------------------------===//

// Create new SuppressionContext capable of parsing given suppression types.

// namespace __sanitizer

// SANITIZER_SUPPRESSIONS_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer.cpp ===
SHA256: 0fa5cb6b67d067c817878de3a8824597b6ed224d4bb2882a8a8587e55ec1e6d0
//===-- sanitizer_symbolizer.cpp ------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.

//===----------------------------------------------------------------------===//

// 'str' will be the same string multiple times in a row, optimize this case.

// FIXME: this is linear search.

// We should optimize this further if this turns out to be a bottleneck later.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer.h ===
SHA256: 05902217a8436caa8df67e2fa115311997a6439a9fa01e04469dad49d07030c9
//===-- sanitizer_symbolizer.h ----------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Symbolizer is used by sanitizers to map instruction address to a location in

// source code at run-time. Symbolizer either uses __sanitizer_symbolize_*

// defined in the program, or (if they are missing) tries to find and

// launch "llvm-symbolizer" commandline tool in a separate process and

// communicate with it.

//

// Generally we should try to avoid calling system library functions during

// symbolization (and use their replacements from sanitizer_libc.h instead).

//===----------------------------------------------------------------------===//

// Owns all the string members. Storage for them is

// (de)allocated using sanitizer internal allocator.

// Deletes all strings and resets all fields.

// Linked list of symbolized frames (each frame is described by AddressInfo).

// Deletes current, and all subsequent frames in the linked list.

// The object cannot be accessed after the call to this function.

// For now, DataInfo is used to describe global variable.

// Owns all the string members. Storage for them is

// (de)allocated using sanitizer internal allocator.

/// Initialize and return platform-specific implementation of symbolizer

/// (if it wasn't already initialized).

// Returns a list of symbolized frames for a given address (containing

// all inlined functions, if necessary).

// The module names Symbolizer returns are stable and unique for every given

// module.  It is safe to store and compare them as pointers.

// Release internal caches (if any).

// Attempts to demangle the provided C++ mangled name. Never returns nullptr.

// Allow user to install hooks that would be called before/after Symbolizer

// does the actual file/line info fetching. Specific sanitizers may need this

// to distinguish system library calls made in user code from calls made

// during in-process symbolization.

// May be called at most once.

// GetModuleNameAndOffsetForPC has to return a string to the caller.

// Since the corresponding module might get unloaded later, we should create

// our owned copies of the strings that we can safely return.

// ModuleNameOwner does not provide any synchronization, thus calls to

// its method should be protected by |mu_|.

/// Platform-specific function for creating a Symbolizer object.

// If stale, need to reload the modules before looking up addresses.

// Platform-specific default demangler, returns nullptr on failure.

// Mutex locked from public methods of |Symbolizer|, so that the internals

// (including individual symbolizer tools and platform-specific methods) are

// always synchronized.

// Backup errno in case symbolizer change the value.

// namespace __sanitizer

// SANITIZER_SYMBOLIZER_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_emscripten.cpp ===
SHA256: 10f5912f544cd4eda033a2758937a075eee3a6c001d45bd66c05eae072154031
//===-- sanitizer_symbolizer_emscripten.cc --------------------------------===//

//

//                     The LLVM Compiler Infrastructure

//

// This file is distributed under the University of Illinois Open Source

// License. See LICENSE.TXT for details.

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.

// Emscripten-specific implementation of symbolizer parts.

//===----------------------------------------------------------------------===//

// namespace __sanitizer

// SANITIZER_EMSCRIPTEN


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_internal.h ===
SHA256: 393b6d0adfbefb45c2762f170d535320aa984cb9ee8077b59beae4d5085c1f32
//===-- sanitizer_symbolizer_internal.h -------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Header for internal classes and functions to be used by implementations of

// symbolizers.

//

//===----------------------------------------------------------------------===//

// Parsing helpers, 'str' is searched for delimiter(s) and a string or uptr

// is extracted. When extracting a string, a newly allocated (using

// InternalAlloc) and null-terminated buffer is returned. They return a pointer

// to the next characted after the found delimiter.

// SymbolizerTool is an interface that is implemented by individual "tools"

// that can perform symbolication (external llvm-symbolizer, libbacktrace,

// Windows DbgHelp symbolizer, etc.).

// The main |Symbolizer| class implements a "fallback chain" of symbolizer

// tools. In a request to symbolize an address, if one tool returns false,

// the next tool in the chain will be tried.

// Can't declare pure virtual functions in sanitizer runtimes:

// __cxa_pure_virtual might be unavailable.

// The |stack| parameter is inout. It is pre-filled with the address,

// module base and module offset values and is to be used to construct

// other stack frames.

// The |info| parameter is inout. It is pre-filled with the module base

// and module offset values.

// Return nullptr to fallback to the default platform-specific demangler.

// SymbolizerProcess encapsulates communication between the tool and

// external symbolizer program, running in a different subprocess.

// SymbolizerProcess may not be used from two threads simultaneously.

/// The maximum number of arguments required to invoke a tool process.

// Customizable by subclasses.

// Return the environment to run the symbolizer in.

/// Fill in an argv array to invoke the child process.

// This tool invokes llvm-symbolizer in a subprocess. It should be as portable

// as the llvm-symbolizer tool is.

// Parses one or more two-line strings in the following format:

//   <function_name>

//   <file_name>:<line_number>[:<column_number>]

// Used by LLVMSymbolizer, Addr2LinePool and InternalSymbolizer, since all of

// them use the same output format.  Returns true if any useful debug

// information was found.

// Parses a two-line string in the following format:

//   <symbol_name>

//   <start_address> <size>

// Used by LLVMSymbolizer and InternalSymbolizer.

// Parses repeated strings in the following format:

//   <function_name>

//   <var_name>

//   <file_name>:<line_number>[:<column_number>]

//   [<frame_offset>|??] [<size>|??] [<tag_offset>|??]

// Used by LLVMSymbolizer and InternalSymbolizer.

// namespace __sanitizer

// SANITIZER_SYMBOLIZER_INTERNAL_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.cpp ===
SHA256: 6689b491a1918cfde09cbf8dd0b783d60bf530c82264ac755f61f16248858da7
//===-- sanitizer_symbolizer_libbacktrace.cpp -----------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.

// Libbacktrace implementation of symbolizer parts.

//===----------------------------------------------------------------------===//

// extern "C"

// SANITIZER_CP_DEMANGLE

/*always_alloc*/

/*always_alloc*/

/*always_alloc*/

// extern "C"

// namespace

// State created in backtrace_create_state is leaked.

// SANITIZER_LIBBACKTRACE

// SANITIZER_LIBBACKTRACE

/*always_alloc*/

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.h ===
SHA256: d11b816b46b4d5c00512862db182a6d0ccb2e00770179690aa88e85b4ea35699
//===-- sanitizer_symbolizer_libbacktrace.h ---------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.

// Header for libbacktrace symbolizer.

//===----------------------------------------------------------------------===//

// May return NULL if demangling failed.

// Leaked.

// namespace __sanitizer

// SANITIZER_SYMBOLIZER_LIBBACKTRACE_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp ===
SHA256: 59af9703fd91b736d0278607ab80b334bd0230ce04343f29d746592d455f6e3c
//===-- sanitizer_symbolizer_libcdep.cpp ----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.

//===----------------------------------------------------------------------===//

// See sanitizer_symbolizer_markup.cpp.

// Always fill data about module name and offset.

// dlopen/dlclose interceptors invalidate the module list, but when

// interception is disabled, we need to retry if the lookup fails in

// case the module list changed.

// For now we assume the following protocol:

// For each request of the form

//   <module_name> <module_offset>

// passed to STDIN, external symbolizer prints to STDOUT response:

//   <function_name>

//   <file_name>:<line_number>:<column_number>

//   <function_name>

//   <file_name>:<line_number>:<column_number>

//   ...

//   <empty line>

/*use_posix_spawn=*/

// Empty line marks the end of llvm-symbolizer output.

// When adding a new architecture, don't forget to also update

// script/asan_symbolize.py and sanitizer_common.h.

// Parse a <file>:<line>[:<column>] buffer. The file path may contain colons on

// Windows, so extract tokens from the right hand side first. The column info is

// also optional.

// Truncate the string at the colon to keep only filename.

// Parses one or more two-line strings in the following format:

//   <function_name>

//   <file_name>:<line_number>[:<column_number>]

// Used by LLVMSymbolizer, Addr2LinePool and InternalSymbolizer, since all of

// them use the same output format.

// There are no more frames.

// Functions and filenames can be "??", in which case we write 0

// to address info to mark that names are unknown.

// Parses a two- or three-line string in the following format:

//   <symbol_name>

//   <start_address> <size>

//   <filename>:<column>

// Used by LLVMSymbolizer and InternalSymbolizer. LLVMSymbolizer added support

// for symbolizing the third line in D123538, but we support the older two-line

// information as well.

// Note: If the third line isn't present, these calls will set info.{file,

// line} to empty strings.

// Add the base address.

// Start or restart symbolizer if we failed to send command to it.

// We can't read 0 bytes, as we don't expect external symbolizer to close

// its stdout.

// !SANITIZER_SYMBOLIZER_MARKUP

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp ===
SHA256: 3869386efbc01d895c0bca6d2618a1d1f01bc0ab94e5979d9425bd11429949e6
//===-- sanitizer_symbolizer_mac.cpp --------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between various sanitizers' runtime libraries.

//

// Implementation of Mac-specific "atos" symbolizer.

//===----------------------------------------------------------------------===//

// Compute offset if possible. `dladdr()` doesn't always ensure that `addr >=

// sym_addr` so only compute the offset when this holds. Failure to find the

// function offset is not treated as a failure because it might still be

// possible to get the symbol name.

/*use_posix_spawn*/

// Put the string command line argument in the object so that it outlives

// the call to GetArgV.

// Configure sandbox before starting atos process.

// On Mavericks atos prints a deprecation warning which we suppress by

// passing -d. The warning isn't present on other OSX versions, even the

// newer ones.

// Trim ending newlines.

// The line from `atos` is in one of these formats:

//   myfunction (in library.dylib) (sourcefile.c:17)

//   myfunction (in library.dylib) + 0x1fe

//   myfunction (in library.dylib) + 15

//   0xdeadbeef (in library.dylib) + 0x1fe

//   0xdeadbeef (in library.dylib) + 15

//   0xdeadbeef (in library.dylib)

//   0xdeadbeef

// Fallback to dladdr() to get function start address if atos doesn't report

// it.

// Only assign to `function_offset` if we were able to get the function's

// start address and we got a sensible `start_address` (dladdr doesn't always

// ensure that `addr >= sym_addr`).

// namespace __sanitizer

// SANITIZER_APPLE


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.h ===
SHA256: 44cab0bd5fbe003e8bc7fdaee682ba3c30911caac8e61fa421e7281c71c44e6b
//===-- sanitizer_symbolizer_mac.h ------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between various sanitizers' runtime libraries.

//

// Header for Mac-specific "atos" symbolizer.

//===----------------------------------------------------------------------===//

// namespace __sanitizer

// SANITIZER_APPLE

// SANITIZER_SYMBOLIZER_MAC_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup.cpp ===
SHA256: 023269cd7efd7647a3e563729588a376ba41977db7463138985eafc231dd3173
//===-- sanitizer_symbolizer_markup.cpp -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between various sanitizers' runtime libraries.

//

// This generic support for offline symbolizing is based on the

// Fuchsia port.  We don't do any actual symbolization per se.

// Instead, we emit text containing raw addresses and raw linkage

// symbol names, embedded in Fuchsia's symbolization markup format.

// See the spec at:

// https://llvm.org/docs/SymbolizerMarkupFormat.html

//===----------------------------------------------------------------------===//

// We don't support the stack_trace_format flag at all.

// Fuchsia's implementation of symbolizer markup doesn't need to emit contextual

// elements at this point.

// Fuchsia's logging infrastructure emits enough information about

// process memory layout that a post-processing filter can do the

// symbolization and pretty-print the markup.

// All module mmaps are readable at least

//{{{mmap:%starting_addr:%size_in_hex:load:%moduleId:r%(w|x):%relative_addr}}}

// module.base_address == dlpi_addr

// range.beg == dlpi_addr + p_vaddr

// relative address == p_vaddr == range.beg - module.base_address

// symbolizer markup id, used to refer to this modules from other contextual

// elements

// kModuleUUIDSize is the size of curModule.uuid

// !SANITIZER_FUCHSIA

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup.h ===
SHA256: ffee459ea26a7ce8ac6eb79f6b6e2bcf7284e9fa5571a8deaed81b071e275ed6
//===-- sanitizer_symbolizer_markup.h -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

//  This file is shared between various sanitizers' runtime libraries.

//

//  Header for the offline markup symbolizer.

//===----------------------------------------------------------------------===//

// Simplier view of a LoadedModule. It only holds information necessary to

// identify unique modules.

// BuildId

// We don't support the stack_trace_format flag at all.

// We ignore the format argument to __sanitizer_symbolize_global.

// Keeps track of the modules that have been rendered to avoid re-rendering

// them

// This is used in some places for suppression checking, which we

// don't really support for Fuchsia.  It's also used in UBSan to

// identify a PC location to a function name, so we always fill in

// the function member with a string containing markup around the PC

// value.

// TODO(mcgrathr): Under SANITIZER_GO, it's currently used by TSan

// to render stack frames, but that should be changed to use

// RenderStackFrame.

// Always claim we succeeded, so that RenderDataInfo will be called.

// May return NULL if demangling failed.

// This is used by UBSan for type names, and by ASan for global variable

// names. It's expected to return a static buffer that will be reused on each

// call.

// namespace __sanitizer

// SANITIZER_SYMBOLIZER_MARKUP_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup_constants.h ===
SHA256: 66f828441ec6c245e9e1c12d6e683434966f6a35142c590179a3d9a1b61c0c70
//===-- sanitizer_symbolizer_markup_constants.h

//-----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between various sanitizers' runtime libraries.

//

// Define string formats and limits for the markup symbolizer.

//===----------------------------------------------------------------------===//

// See the spec at:

// https://fuchsia.googlesource.com/zircon/+/master/docs/symbolizer_markup.md

// This is used by UBSan for type names, and by ASan for global variable names.

// Arbitrary.

// Function name or equivalent from PC location.

// More than big enough for 64-bit hex.

// Global variable name or equivalent from data memory address.

// One frame in a backtrace (printed on a line by itself).

// Module contextual element.

// mmap for a module segment.

// Dump trigger element.

// namespace __sanitizer

// SANITIZER_SYMBOLIZER_MARKUP_CONSTANTS_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup_fuchsia.cpp ===
SHA256: 2bb597fb840bd39ad35bb3349288837e6e4f6311d7d343af37acc4be2d213a76
//===-- sanitizer_symbolizer_markup_fuchsia.cpp ---------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between various sanitizers' runtime libraries.

//

// Fuchsia specific implementation of offline markup symbolizer.

//===----------------------------------------------------------------------===//

// This is used by UBSan for type names, and by ASan for global variable names.

// It's expected to return a static buffer that will be reused on each call.

// This is used mostly for suppression matching.  Making it work

// would enable "interceptor_via_lib" suppressions.  It's also used

// once in UBSan to say "in module ..." in a message that also

// includes an address in the module, so post-processing can already

// pretty-print that so as to indicate the module.

// This is mainly used by hwasan for online symbolization. This isn't needed

// since hwasan can always just dump stack frames for offline symbolization.

// This is used in some places for suppression checking, which we

// don't really support for Fuchsia.  It's also used in UBSan to

// identify a PC location to a function name, so we always fill in

// the function member with a string containing markup around the PC

// value.

// TODO(mcgrathr): Under SANITIZER_GO, it's currently used by TSan

// to render stack frames, but that should be changed to use

// RenderStackFrame.

// Always claim we succeeded, so that RenderDataInfo will be called.

// Fuchsia only uses MarkupStackTracePrinter

// namespace __sanitizer

// SANITIZER_SYMBOLIZER_MARKUP


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp ===
SHA256: 70654818dee80af0a29bf2c27679d3077b72177ac8a1ae1fd0b1fdaddd241ff9
//===-- sanitizer_symbolizer_posix_libcdep.cpp ----------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.

// POSIX-specific implementation of symbolizer parts.

//===----------------------------------------------------------------------===//

// for dlsym()

// C++ demangling function, as required by Itanium C++ ABI. This is weak,

// because we do not require a C++ ABI library to be linked to a program

// using sanitizers; if it's not present, we'll just use the mangled name.

// Attempts to demangle the name via __cxa_demangle from __cxxabiv1.

// FIXME: __cxa_demangle aggressively insists on allocating memory.

// There's not much we can do about that, short of providing our

// own demangler (libc++abi's implementation could be adapted so that

// it does not allocate). For now, we just call it anyway, and we leak

// the returned value.

// As of now, there are no headers for the Swift runtime. Once they are

// present, we will weakly link since we do not require Swift runtime to be

// linked.

// This must not happen lazily at symbolication time, because dlsym uses

// malloc and thread-local storage, which is not a good thing to do during

// symbolication.

// Attempts to demangle a Swift name. The demangler will return nullptr if a

// non-Swift name is passed in.

// The client program may close its stdin and/or stdout and/or stderr

// thus allowing socketpair to reuse file descriptors 0, 1 or 2.

// In this case the communication between the forked processes may be

// broken if either the parent or the child tries to close or duplicate

// these descriptors. The loop below produces two pairs of file

// descriptors, each greater than 2 (stderr).

// Report how symbolizer is being launched for debugging purposes.

// Only use `Report` for first line so subsequent prints don't get prefixed

// with current PID.

// SANITIZER_APPLE

// SANITIZER_APPLE

/* stdin */

/* stdout */

// Check that symbolizer subprocess started successfully.

// Either waitpid failed, or child has already exited.

// We should cut out output_terminator_ at the end of given buffer,

// appended by addr2line to mark the end of its meaningful output.

// We cannot scan buffer from it's beginning, because it is legal for it

// to start with output_terminator_ in case given offset is invalid. So,

// scanning from second character.

// This should never be NULL since buffer must end up with

// output_terminator_.

// Trim the buffer.

// Owned, leaked.

// Skip, if we read just kTerminatorLen bytes, because Addr2Line output

// should consist at least of two pairs of lines:

// 1. First one, corresponding to given offset to be symbolized

// (may be equal to output_terminator_, if offset is not valid).

// 2. Second one for output_terminator_, itself to mark the end of output.

// Addr2Line output should end up with output_terminator_.

// extern "C"

// These one is the most used one, so we will use it to detect a presence of

// internal symbolizer.

// Add the base address.

// SANITIZER_SUPPORTS_WEAK_HOOKS

// SANITIZER_SUPPORTS_WEAK_HOOKS

// SANITIZER_APPLE

// SANITIZER_APPLE

// Otherwise symbolizer program is unknown, let's search $PATH

// SANITIZER_APPLE

// SANITIZER_DISABLE_SYMBOLIZER_PATH_SEARCH

// SANITIZER_APPLE

// namespace __sanitizer

// SANITIZER_POSIX


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp ===
SHA256: 25fd5c5529535d41559f2140196f266366d1e3932c2131d34bd9d4f18f6fefb8
//===-- sanitizer_symbolizer_report.cpp -----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

///

/// This file is shared between AddressSanitizer and other sanitizer run-time

/// libraries and implements symbolized reports related functions.

///

//===----------------------------------------------------------------------===//

// On Gentoo, the path is g++-*, so there's *not* a missing /.

// SANITIZER_FUCHSIA

// Fuchsia's logs always go through post-processing that handles colorization.

// SANITIZER_EMSCRIPTEN, !SANITIZER_FUCHSIA

// FIXME: Add proper Windows support to AnsiColorDecorator and re-enable color

// printing on Windows.

// Find first non-internal stack frame.

// Fallback to the top one.

// Fallback to a summary without location.

// Write the first message using fd=2, just in case.

// It may actually fail to write in case stderr is closed.

/*cache_enabled*/

// Avoid SEGVs in the unwinder when bp couldn't be determined.

// !SANITIZER_FUCHSIA && !SANITIZER_GO

// We've claimed reporting_thread so proceed.

// This is either asynch signal or nested error during error reporting.

// Fail simple to avoid deadlocks in Report().

// Can't use Report() here because of potential deadlocks in nested

// signal handlers.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report_fuchsia.cpp ===
SHA256: c9e92e02e70739e944454f3dee2bec69c043193f16b78ca4c5eb8b18e095904b
//===-- sanitizer_symbolizer_report_fuchsia.cpp

//-----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Implementation of the report functions for fuchsia.

//

//===----------------------------------------------------------------------===//

// namespace __sanitizer

// SANITIZER_SYMBOLIZER_MARKUP


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp ===
SHA256: 4488f4c47acb6af1f0484b78e9d4043a42e07fc822579cbf6156f3e2244c6aac
//===-- sanitizer_symbolizer_win.cpp --------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries.

// Windows-specific implementation of symbolizer parts.

//===----------------------------------------------------------------------===//

// The constructor is provided to avoid synthesized memsets.

// FIXME: We don't call SymCleanup() on exit yet - should we?

// namespace

// Initializes DbgHelp library, if it's not yet initialized. Calls to this

// function should be synchronized with respect to other calls to DbgHelp API

// (e.g. from WinSymbolizerTool).

// OK, maybe the client app has called SymInitialize already.

// That's a bit unfortunate for us as all the DbgHelp functions are

// single-threaded and we can't coordinate with the app.

// FIXME: Can we stop the other threads at this point?

// Anyways, we have to reconfigure stuff to make sure that SymInitialize

// has all the appropriate options set.

// Cross our fingers and reinitialize DbgHelp.

// When an executable is run from a location different from the one where it

// was originally built, we may not see the nearby PDB files.

// To work around this, let's append the directory of the main module

// to the symbol search path.  All the failures below are not fatal.

// Write the zero character in place of the last backslash to get the

// directory of the main module at the end of path_buffer.

// See https://docs.microsoft.com/en-us/windows/win32/debug/retrieving-symbol-information-by-address

// Only consider this a successful symbolization attempt if we got file info.

// Otherwise, try llvm-symbolizer.

// namespace

// Create inherited pipes for stdin and stdout.

// Don't inherit the writing end of stdin or the reading end of stdout.

// Compute the command line. Wrap double quotes around everything.

// Check that tool command lines are simple and that complete escaping is

// unnecessary.

// Launch llvm-symbolizer with stdin and stdout redirected.

// Executable

// Command line

// Process handle not inheritable

// Thread handle not inheritable

// Set handle inheritance to TRUE

// Creation flags

// Use parent's environment block

// Use parent's starting directory

// Process creation succeeded, so transfer handle ownership into the fields.

// The llvm-symbolizer process is responsible for quitting itself when the

// stdin pipe is closed, so we don't need these handles. Close them to prevent

// leaks. If we ever want to try to kill the symbolizer process from the

// parent, we'll want to hang on to these handles.

// Add llvm-symbolizer.

// Add the dbghelp based symbolizer.

// namespace __sanitizer

// _WIN32


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_syscall_generic.inc ===
SHA256: f2b32aba15db05696fdf585bb542839f22c3ee1edb7855e0384924b25bce4863
//===-- sanitizer_syscall_generic.inc ---------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Generic implementations of internal_syscall* and internal_iserror.

//

//===----------------------------------------------------------------------===//

// NetBSD and Emscripten uses libc calls directly


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_aarch64.inc ===
SHA256: 32bbada91dc0c6f58e3c431a5f4ff65bec753b225ab21ab6a7eaba71de0f4c83
//===-- sanitizer_syscall_linux_aarch64.inc --------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Implementations of internal_syscall and internal_iserror for Linux/aarch64.

//

//===----------------------------------------------------------------------===//

// Helper function used to avoid cobbler errno.


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_arm.inc ===
SHA256: 7d3922a18e7dd31e80b08c65115fa23f51c337a86e260d30a16f6ad81b7816eb
//===-- sanitizer_syscall_linux_arm.inc -------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Implementations of internal_syscall and internal_iserror for Linux/arm.

//

//===----------------------------------------------------------------------===//

// Helper function used to avoid cobbler errno.


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_hexagon.inc ===
SHA256: b281e5197ae325def5adcb86ce9a87da17a5785fabf2347989ea7d4b7b0b417f
//===-- sanitizer_syscall_linux_hexagon.inc ---------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Implementations of internal_syscall and internal_iserror for Linux/hexagon.

//

//===----------------------------------------------------------------------===//

// Helper function used to avoid clobbering of errno.


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_loongarch64.inc ===
SHA256: 359cd2f74caf4eb2491815d86d93d07b93cb924cfc6a3aeb8dd99bd54e552ce9
//===-- sanitizer_syscall_linux_loongarch64.inc -----------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Implementations of internal_syscall and internal_iserror for

// Linux/loongarch64.

//

//===----------------------------------------------------------------------===//

// About local register variables:

// https://gcc.gnu.org/onlinedocs/gcc/Local-Register-Variables.html#Local-Register-Variables

//

// Kernel ABI:

// https://lore.kernel.org/loongarch/1f353678-3398-e30b-1c87-6edb278f74db@xen0n.name/T/#m1613bc86c2d7bf5f6da92bd62984302bfd699a2f

//  syscall number is placed in a7

//  parameters, if present, are placed in a0-a6

//  upon return:

//    the return value is placed in a0

//    t0-t8 should be considered clobbered

//    all other registers are preserved

// Helper function used to avoid clobbering of errno.


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_riscv64.inc ===
SHA256: da29284672122d0f21bbfa8babb5a14454d3b7ba1cdbc46387eed5f17f49c4df
//===-- sanitizer_syscall_linux_riscv64.inc ---------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Implementations of internal_syscall and internal_iserror for Linux/riscv64.

//

//===----------------------------------------------------------------------===//

// About local register variables:

// https://gcc.gnu.org/onlinedocs/gcc/Local-Register-Variables.html#Local-Register-Variables

//

// Kernel ABI...

// To my surprise I haven't found much information regarding it.

// Kernel source and internet browsing shows that:

//  syscall number is passed in a7

//  (http://man7.org/linux/man-pages/man2/syscall.2.html) results are return in

//  a0 and a1 (http://man7.org/linux/man-pages/man2/syscall.2.html) arguments

//  are passed in: a0-a7 (see below)

//

//  Regarding the arguments. The only "documentation" I could find is

//  this comment (!!!) by Bruce Hold on google forums (!!!):

//    https://groups.google.com/a/groups.riscv.org/forum/#!topic/sw-dev/exbrzM3GZDQ

//    Confirmed by inspecting glibc sources.

//  Great way to document things.

// Helper function used to avoid clobbering of errno.


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_x86_64.inc ===
SHA256: 605459552e54e3499bbf317c04de14ab398153c150c115cba6d97b59735c69e2
//===-- sanitizer_syscall_linux_x86_64.inc ----------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Implementations of internal_syscall and internal_iserror for Linux/x86_64.

//

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_syscalls_netbsd.inc ===
SHA256: 4779a64dc71d2aa435d2a0acbe7f4f681ae39298ed32bf01b5999b7e4181da18
//===-- sanitizer_syscalls_netbsd.inc ---------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Common syscalls handlers for tools like AddressSanitizer,

// ThreadSanitizer, MemorySanitizer, etc.

//

// This file should be included into the tool's interceptor file,

// which has to define it's own macros:

//   COMMON_SYSCALL_PRE_READ_RANGE

//          Called in prehook for regions that will be read by the kernel and

//          must be initialized.

//   COMMON_SYSCALL_PRE_WRITE_RANGE

//          Called in prehook for regions that will be written to by the kernel

//          and must be addressable. The actual write range may be smaller than

//          reported in the prehook. See POST_WRITE_RANGE.

//   COMMON_SYSCALL_POST_READ_RANGE

//          Called in posthook for regions that were read by the kernel. Does

//          not make much sense.

//   COMMON_SYSCALL_POST_WRITE_RANGE

//          Called in posthook for regions that were written to by the kernel

//          and are now initialized.

//   COMMON_SYSCALL_ACQUIRE(addr)

//          Acquire memory visibility from addr.

//   COMMON_SYSCALL_RELEASE(addr)

//          Release memory visibility to addr.

//   COMMON_SYSCALL_FD_CLOSE(fd)

//          Called before closing file descriptor fd.

//   COMMON_SYSCALL_FD_ACQUIRE(fd)

//          Acquire memory visibility from fd.

//   COMMON_SYSCALL_FD_RELEASE(fd)

//          Release memory visibility to fd.

//   COMMON_SYSCALL_PRE_FORK()

//          Called before fork syscall.

//   COMMON_SYSCALL_POST_FORK(long long res)

//          Called after fork syscall.

//

// DO NOT EDIT! THIS FILE HAS BEEN GENERATED!

//

// Generated with: generate_netbsd_syscalls.awk

// Generated date: 2020-09-10

// Generated from: syscalls.master,v 1.306 2020/08/14 00:53:16 riastradh Exp

//

//===----------------------------------------------------------------------===//

// FIXME: do some kind of PRE_READ for all syscall arguments (int(s) and such).

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* syscall 11 has been skipped */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* pipe returns two descriptors through two returned values */

/* pipe returns two descriptors through two returned values */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* If we are here, something went wrong */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* syscall 67 has been skipped */

/* syscall 68 has been skipped */

/* syscall 69 has been skipped */

/* syscall 70 has been skipped */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* syscall 76 has been skipped */

/* syscall 77 has been skipped */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* syscall 94 has been skipped */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* syscall 107 has been skipped */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* syscall 115 has been skipped */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* syscall 119 has been skipped */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* syscall 139 has been skipped */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* syscall 151 has been skipped */

/* syscall 152 has been skipped */

/* syscall 153 has been skipped */

/* syscall 154 has been skipped */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* syscall 159 has been skipped */

/* syscall 160 has been skipped */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* syscall 169 has been skipped */

/* TODO */

/* TODO */

/* syscall 170 has been skipped */

/* TODO */

/* TODO */

/* syscall 171 has been skipped */

/* syscall 172 has been skipped */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* syscall 176 has been skipped */

/* syscall 177 has been skipped */

/* syscall 178 has been skipped */

/* syscall 179 has been skipped */

/* syscall 180 has been skipped */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* This call should never return */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* syscall 211 has been skipped */

/* syscall 212 has been skipped */

/* syscall 213 has been skipped */

/* syscall 214 has been skipped */

/* syscall 215 has been skipped */

/* syscall 216 has been skipped */

/* syscall 217 has been skipped */

/* syscall 218 has been skipped */

/* syscall 219 has been skipped */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* syscall 267 has been skipped */

/* syscall 268 has been skipped */

/* syscall 269 has been skipped */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* syscall 326 has been skipped */

/* syscall 327 has been skipped */

/* syscall 328 has been skipped */

/* syscall 329 has been skipped */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* syscall 336 has been skipped */

/* syscall 337 has been skipped */

/* syscall 338 has been skipped */

/* syscall 339 has been skipped */

/* syscall 341 has been skipped */

/* syscall 342 has been skipped */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* syscall 352 has been skipped */

/* syscall 353 has been skipped */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* syscall 407 has been skipped */

/* syscall 408 has been skipped */

/* syscall 409 has been skipped */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* syscall 448 has been skipped */

/* Nothing to do */

/* Nothing to do */

/* syscall 452 has been skipped */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* Nothing to do */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

/* TODO */

// extern "C"

// SANITIZER_NETBSD


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_termination.cpp ===
SHA256: 7ed073063b646b64b77beaf8b29200510fefd02a11ec4b9f7d4300d3a6120146
//===-- sanitizer_termination.cpp -------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

///

/// This file contains the Sanitizer termination functions CheckFailed and Die,

/// and the callback functionalities associated with them.

///

//===----------------------------------------------------------------------===//

// Recursing into CheckFailed.

// Another thread fails already, let it print the stack and terminate.

// namespace __sanitizer

// extern "C"


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_thread_arg_retval.cpp ===
SHA256: abe089a4fba5be8ecc6a7dc4a0c93df43d034f4c9fe2c80abf8e6402f4aa1705
//===-- sanitizer_thread_arg_retval.cpp -------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between sanitizer tools.

//

// Tracks thread arguments and return value for leak checking.

//===----------------------------------------------------------------------===//

// Retval of detached thread connot be retrieved.

// Thread was reused and erased by any other event, or we had an invalid

// join.

// We can't retrive retval after detached thread finished.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_thread_arg_retval.h ===
SHA256: d79ecf9fcf91747ca5aace91a7a8dda8d5ab83b6a953c35fc71521d9bc62a684
//===-- sanitizer_thread_arg_retval.h ---------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between sanitizer tools.

//

// Tracks thread arguments and return value for leak checking.

//===----------------------------------------------------------------------===//

// Primary goal of the class is to keep alive arg and retval pointer for leak

// checking. However it can be used to pass those pointer into wrappers used by

// interceptors. The difference from ThreadRegistry/ThreadList is that this

// class keeps data up to the detach or join, as exited thread still can be

// joined to retrive retval. ThreadRegistry/ThreadList can discard exited

// threads immediately.

// Either arg or retval.

// Wraps pthread_create or similar. We need to keep object locked, to

// prevent child thread from proceeding without thread handle.

/* returns thread id on success, or 0 */

// No need to track detached threads with no args, but we will to do as it's

// not expensive and less edge-cases.

// Returns thread arg and routine.

// Mark thread as done and stores retval or remove if detached. Should be

// called by the thread.

// Mark thread as detached or remove if done.

/* returns true on success */

// Lock to prevent re-use of the thread between fn() and DetachLocked()

// calls.

// Joins the thread.

/* returns true on success */

// Remember internal id of the thread to prevent re-use of the thread

// between fn() and AfterJoin() calls. Locking JoinFn, like in

// Detach(), implementation can cause deadlock.

// Returns all arg and retval which are considered alive.

// FIXME: Add fork support. Expected users of the class are sloppy with forks

// anyway. We likely should lock/unlock the object to avoid deadlocks, and

// erase all but the current threads, so we can detect leaked arg or retval in

// child process.

// FIXME: Add cancelation support. Now if a thread was canceled, the class

// will keep pointers alive forever, missing leaks caused by cancelation.

// Avoid collision if thread id re-used.

// namespace __sanitizer

// SANITIZER_THREAD_ARG_RETVAL_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_thread_history.cpp ===
SHA256: 0b761d9bbab706e3bec2320e6797b01df243cc5fe49dfd194e510b4dab8bbdf3
//===-- sanitizer_thread_history.cpp --------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Stack traces are largest part of printout and they often the same for

// multiple threads, so we will deduplicate them.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_thread_history.h ===
SHA256: 4117a8f481b38c2944d4e4c2a546c96ac64d0226bd8513a3c10bae376dd57589
//===-- sanitizer_thread_history.h ------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Utility to print thread histroy from ThreadRegistry.

//

//===----------------------------------------------------------------------===//

// namespace __sanitizer

// SANITIZER_THREAD_HISTORY_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.cpp ===
SHA256: 5bb4a362497c5a050bde448f494fc5f6e3b82b3b9a291b73ffbb03266a268737
//===-- sanitizer_thread_registry.cpp -------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between sanitizer tools.

//

// General thread bookkeeping functionality.

//===----------------------------------------------------------------------===//

// ThreadContextBase should never be deleted.

// FIXME(dvyukov): print message and continue (it's user error).

// ThreadRegistry::FinishThread calls here in ThreadStatusCreated state

// for a thread that never actually started.  In that case the thread

// should go to ThreadStatusFinished regardless of whether it was created

// as detached.

// Parent tid makes no sense for the main thread.

// ThreadRegistry implementation.

// Allocate new thread context and tid.

// Ensure that user_id is unique. If it's not the case we are screwed.

// Ignoring this situation may lead to very hard to debug false

// positives later (e.g. if we join a wrong thread).

// Normally this is called when the thread is about to exit.  If

// called in ThreadStatusCreated state, then this thread was never

// really started.  We just did CreateThread for a prospective new

// thread before trying to create it, and then failed to actually

// create it, and so never called StartThread.

// The thread never really existed.

// Don't reuse the main thread.  It's a special snowflake.

// We only purge user_id (pthread_t) of live threads because

// they cause CHECK failures if new threads with matching pthread_t

// created after fork.

// Potentially we could purge more info (ThreadContextBase themselves),

// but it's hard to test and easy to introduce new issues by doing this.

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.h ===
SHA256: 7292aacff5c4c6e718383989a9ee9448374036bbfb6b5abe5563774ef1f039a9
//===-- sanitizer_thread_registry.h -----------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between sanitizer tools.

//

// General thread bookkeeping functionality.

//===----------------------------------------------------------------------===//

// Non-existent thread, data is invalid.

// Created but not yet running.

// The thread is currently running.

// Joinable thread is finished but not yet joined.

// Joined, but some info is still available.

// Normal thread

// macOS Grand Central Dispatch (GCD) worker thread

// Fiber

// Generic thread context. Specific sanitizer tools may inherit from it.

// If thread is dead, context may optionally be reused for a new thread.

// Thread ID. Main thread should have tid = 0.

// Unique thread ID.

// Number of times this tid was reused.

// PID (used for reporting).

// Some opaque user thread id (e.g. pthread_t).

// As annotated by user.

// For storing thread contexts in a list.

// To address race of Joined vs Finished

// The following methods may be overriden by subclasses.

// Some of them take opaque arg that may be optionally be used

// by subclasses.

// Should be guarded by ThreadRegistryLock.

// Invokes callback with a specified arg for each thread context.

// Should be guarded by ThreadRegistryLock.

// Finds a thread using the provided callback. Returns kInvalidTid if no

// thread is found.

// Should be guarded by ThreadRegistryLock. Return 0 if no thread

// is found.

// Finishes thread and returns previous status.

// OnFork must be called in the child process after fork to purge old

// threads that don't exist anymore (except for the current thread tid).

// Returns number of alive threads before fork.

// Total number of created threads. May be greater than

// max_threads_ if contexts were reused.

// Created or running.

// namespace __sanitizer

// SANITIZER_THREAD_REGISTRY_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_thread_safety.h ===
SHA256: 2770d9c2573c8a8c40d16b7488c549dccbb1c1c213091566e07c7764125ec131
//===-- sanitizer_thread_safety.h -------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between sanitizer tools.

//

// Wrappers around thread safety annotations.

// https://clang.llvm.org/docs/ThreadSafetyAnalysis.html

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_tls_get_addr.cpp ===
SHA256: c77a78dd01a488f303e092240d189c0dd0c4642aa0f27058de33a281f17945fd
//===-- sanitizer_tls_get_addr.cpp ----------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Handle the __tls_get_addr call.

//

//===----------------------------------------------------------------------===//

// The actual parameter that comes to __tls_get_addr

// is a pointer to a struct with two words in it:

// This must be static TLS

// Make sure we properly destroy the DTLS objects:

// this counter should never get too large.

// This is glibc's TLS_DTV_OFFSET:

// "Dynamic thread vector pointers point 0x8000 past the start of each

//  TLS block." (sysdeps/<arch>/dl-tls.h)

// This is glibc's TLS_DTV_OFFSET:

// "Dynamic thread vector pointers point 0x800 past the start of each

// TLS block." (sysdeps/riscv/dl-tls.h)

// This is the static TLS block which was initialized / unpoisoned at thread

// creation.

// This may happen inside the DTOR a thread, or async signal handlers before

// thread initialization, so just ignore it.

//

// If the unknown block is dynamic TLS, unlikely we will be able to recognize

// it in future, mark it as done with '{tls_beg, 0}'.

//

// If the block is static TLS, possible reason of failed detection is nullptr

// in `static_tls_begin`. Regardless of reasons, the future handling of static

// TLS is still '{tls_beg, 0}'.

// SANITIZER_INTERCEPT_TLS_GET_ADDR

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_tls_get_addr.h ===
SHA256: 2bddd0acef6ed273dc317e048b322856f507d7c049c878073a450333fbbe6a57
//===-- sanitizer_tls_get_addr.h --------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Handle the __tls_get_addr call.

//

// All this magic is specific to glibc and is required to workaround

// the lack of interface that would tell us about the Dynamic TLS (DTLS).

// https://sourceware.org/bugzilla/show_bug.cgi?id=16291

//

// Before 2.25: every DTLS chunk is allocated with __libc_memalign,

// which we intercept and thus know where is the DTLS.

//

// Since 2.25: DTLS chunks are allocated with malloc. We could co-opt

// the malloc interceptor to keep track of the last allocation, similar

// to how we handle __libc_memalign; however, this adds some overhead

// (since malloc, unlike __libc_memalign, is commonly called), and

// requires care to avoid false negatives for LeakSanitizer.

// Instead, we rely on our internal allocators - which keep track of all

// its allocations - to determine if an address points to a malloc

// allocation.

//

// There exists a since-deprecated version of Google's internal glibc fork

// that used __signal_safe_memalign. DTLS_on_tls_get_addr relied on a

// heuristic check (is the allocation 16 bytes from the start of a page

// boundary?), which was sometimes erroneous:

//     https://bugs.chromium.org/p/chromium/issues/detail?id=1275223#c15

// Since that check has no practical use anymore, we have removed it.

//

//===----------------------------------------------------------------------===//

// Array of DTLS chunks for the current Thread.

// If beg == 0, the chunk is unused.

// Returns pointer and size of a linker-allocated TLS block.

// Each block is returned exactly once.

// Make sure to call this before the thread is destroyed.

// Returns true if DTLS of suspended thread is in destruction process.

// namespace __sanitizer

// SANITIZER_TLS_GET_ADDR_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_type_traits.cpp ===
SHA256: d0655d29e8c1113cad0aa221846540fe6448a7ba6fc45a17ddfc5527983ae8a7
//===-- sanitizer_type_traits.cpp -------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Implements a subset of C++ type traits. This is so we can avoid depending

// on system C++ headers.

//

//===----------------------------------------------------------------------===//

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_type_traits.h ===
SHA256: a6a65edf2d06a23607d8377bc9e8d1c8fc0c452a7f846a7b1e24583ba9a3598f
//===-- sanitizer_type_traits.h ---------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Implements a subset of C++ type traits. This is so we can avoid depending

// on system C++ headers.

//

//===----------------------------------------------------------------------===//

// is_same<T, U>

//

// Type trait to compare if types are the same.

// E.g.

//

// ```

// is_same<int,int>::value - True

// is_same<int,char>::value - False

// ```

// conditional<B, T, F>

//

// Defines type as T if B is true or as F otherwise.

// E.g. the following is true

//

// ```

// is_same<int, conditional<true, int, double>::type>::value

// is_same<double, conditional<false, int, double>::type>::value

// ```

/* less efficient fallback */

/* less efficient fallback */

// namespace __sanitizer


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_unwind_fuchsia.cpp ===
SHA256: 9954423066c77efc631c1c8a1be761ac98fc8ed0a93edbe611aff72908654872
//===------------------ sanitizer_unwind_fuchsia.cpp

//---------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

/// Sanitizer unwind Fuchsia specific functions.

//

//===----------------------------------------------------------------------===//

// We need to pop a few frames so that pc is on top.

// trace_buffer[0] belongs to the current function so we always pop it,

// unless there is only 1 frame in the stack trace (1 frame is always better

// than 0!).

//  SANITIZER_CAN_SLOW_UNWIND

// namespace __sanitizer

// SANITIZER_FUCHSIA


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cpp ===
SHA256: cc830df4c3eae0ef4592f0832b0418af3325bad08f47282a2de66424ffc28464
//===-- sanitizer_unwind_linux_libcdep.cpp --------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file contains the unwind.h-based (aka "slow") stack unwinding routines

// available to the tools on Linux, Android, NetBSD, FreeBSD, and Solaris.

//===----------------------------------------------------------------------===//

// for dlopen()

// to declare _Unwind_Backtrace() from <unwind.h>

//---------------------------- UnwindSlow --------------------------------------

// extern "C"

// NetBSD uses dwarf EH

/* r15 = PC */

// Clear the Thumb bit.

// Let's assume that any pointer in the 0th page (i.e. <0x1000 on i386 and

// x86_64) is invalid and stop unwinding here.  If we're adding support for

// a platform where this isn't true, we need to reconsider this check.

// namespace

// We need to pop a few frames so that pc is on top.

// trace_buffer[0] belongs to the current function so we always pop it,

// unless there is only 1 frame in the stack trace (1 frame is always better

// than 0!).

// 1-frame stacks don't normally happen, but this depends on the actual

// unwinder implementation (libgcc, libunwind, etc) which is outside of our

// control.

// siginfo argument appears to be unused.

/* siginfo */

/* ignore_depth */

// +2 compensate for libcorkscrew unwinder returning addresses of call

// instructions instead of raw return addresses.

// namespace __sanitizer

// SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD ||

// SANITIZER_SOLARIS || SANITIZER_HAIKU


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_unwind_win.cpp ===
SHA256: 09518162fd05982095f83d87718ca2b8ac009994f42a447a243436740f20c6e2
//===-- sanitizer_unwind_win.cpp ------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

/// Sanitizer unwind Windows specific functions.

//

//===----------------------------------------------------------------------===//

// for StackWalk64

// for InitializeDbgHelpIfNeeded

// FIXME: CaptureStackBackTrace might be too slow for us.

// FIXME: Compare with StackWalk64.

// FIXME: Look at LLVMUnhandledExceptionFilter in Signals.inc

// Skip the RTL frames by searching for the PC in the stacktrace.

// Replace the first frame with the PC because the frame in the

// stacktrace might be incorrect.

// #if !SANITIZER_GO

// SANITIZER_WINDOWS


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_vector.h ===
SHA256: f19875445bba182a0b3de3637ae5168b1b3dfcaadd11669f124106ffc2da785b
//===-- sanitizer_vector.h -------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between sanitizers run-time libraries.

//

//===----------------------------------------------------------------------===//

// Low-fat STL-like vector container.

// 25% growth

// namespace __sanitizer

// #ifndef SANITIZER_VECTOR_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_win.cpp ===
SHA256: b0b3b9360ec12431b3af764df6235bcac3f277cd24c1de51fd3eb757cfac3067
//===-- sanitizer_win.cpp -------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer and ThreadSanitizer

// run-time libraries and implements windows-specific functions from

// sanitizer_libc.h.

//===----------------------------------------------------------------------===//

//  Windows trace logging provider init

// GUID must be the same in utils/AddressSanitizerLoggingProvider.wprp

// For WaitOnAddress

// A macro to tell the compiler that this part of the code cannot be reached,

// if the compiler supports this feature. Since we're using this in

// code that is called when terminating the process, the expansion of the

// macro should not terminate the process to avoid infinite recursion.

// --------------------- sanitizer_common.h

// In contrast to POSIX, on Windows GetCurrentThreadId()

// returns a system-unique identifier.

/* on stack */

// FIXME: is it possible for the stack to not be a single allocation?

// Are these values what ASan expects to get (reserved, not committed;

// including stack guard page) ?

// #if !SANITIZER_GO

// TODO: This should check which `err`s correspond to OOM.

// MEM_RELEASE can only be used to unmap whole regions previously mapped with

// VirtualAlloc. So we first try MEM_RELEASE since it is better, and if that

// fails try MEM_DECOMMIT.

// Assumption: VirtualAlloc is the last system call that was invoked before

//   this method.

// VirtualAlloc emits one of 3 error codes when running out of memory

// 1. ERROR_NOT_ENOUGH_MEMORY:

//  There's not enough memory to execute the command

// 2. ERROR_INVALID_PARAMETER:

//  VirtualAlloc will return this if the request would allocate memory at an

//  address exceeding or being very close to the maximum application address

//  (the `lpMaximumApplicationAddress` field within the `SystemInfo` struct).

//  This does not seem to be officially documented, but is corroborated here:

//  https://stackoverflow.com/questions/45833674/why-does-virtualalloc-fail-for-lpaddress-greater-than-0x6ffffffffff

// 3. ERROR_COMMITMENT_LIMIT:

//  VirtualAlloc will return this if e.g. the pagefile is too small to commit

//  the requested amount of memory.

// We want to map a chunk of address space aligned to 'alignment'.

// Windows will align our allocations to at least 64K.

// If we got it right on the first try, return. Otherwise, unmap it and go to

// the slow path.

// If we didn't get an aligned address, overallocate, find an aligned address,

// unmap, and try to allocate at that aligned address.

// Overallocate size + alignment bytes.

// Find the aligned address.

// Free the overallocation.

// Attempt to allocate exactly the number of bytes we need at the aligned

// address. This may fail for a number of reasons, in which case we continue

// the loop.

// Fail if we can't make this work quickly.

// ZeroMmapFixedRegion zero's out a region of memory previously returned from a

// call to one of the MmapFixed* helpers. On non-windows systems this would be

// done with another mmap, but on windows remapping is not an option.

// VirtualFree(DECOMMIT)+VirtualAlloc(RECOMMIT) would also be a way to zero the

// memory, but we can't do this atomically, so instead we fall back to using

// internal_memset.

// FIXME: is this really "NoReserve"? On Win32 this does not matter much,

// but on Win64 it does.

// unsupported

// On asan/Windows64, use MEM_COMMIT would result in error

// 1455:ERROR_COMMITMENT_LIMIT.

// Asan uses exception handler to commit page on demand.

// FIXME: Windows support large pages too. Might be worth checking

// Memory space mapped by 'MmapFixedOrDie' must have been reserved by

// 'MmapFixedNoAccess'.

// Uses fixed_addr for now.

// Will use offset instead once we've implemented this function for real.

// Only unmap if it covers the entire range.

// We unmap the whole range, just null out the base.

// FIXME: make this really NoReserve?

// unsupported

// unsupported

// make sure the region is sane

// make sure we're freeing at least 1 page;

// FIXME: probably similar to ReleaseMemoryToOS.

// This is almost useless on 32-bits.

// FIXME: add madvise-analog when we move to 64-bits.

// Move to the next region.

// namespace

// Note: this implementation caches the values of the environment variables

// and limits their quantity.

// namespace

// Do nothing.

// Read the file to extract the ImageBase field from the PE header. If ASLR is

// disabled and this virtual address is available, the loader will typically

// load the image at this address. Therefore, we call it the preferred base. Any

// addresses in the DWARF typically assume that the object has been loaded at

// this address.

// Read just the DOS header.

// The file should start with the right signature.

// The layout at e_lfanew is:

// "PE\0\0"

// IMAGE_FILE_HEADER

// IMAGE_OPTIONAL_HEADER

// Seek to e_lfanew and read all that data.

// Check for "PE\0\0" before the PE header.

// Skip over IMAGE_FILE_HEADER. We could do more validation here if we wanted.

// Check for more magic in the PE header.

// Finally, return the ImageBase.

// Query the list of modules.  Start by assuming there are no more than 256

// modules and retry if that's not sufficient.

// Either there turned out to be more than 256 hmodules, or new hmodules

// could have loaded since the last try.  Retry.

// |num_modules| is the number of modules actually present,

// Get the UTF-16 path and convert to UTF-8.

// Adjust the base address of the module so that we get a VA instead of an

// RVA when computing the module offset. This helps llvm-symbolizer find the

// right DWARF CU. In the common case that the image is loaded at it's

// preferred address, we will now print normal virtual addresses.

// We add the whole module as one single address range.

/*executable*/

/*writable*/

// We can't use atexit() directly at __asan_init time as the CRT is not fully

// initialized at this point.  Place the functions into a vector and use

// atexit() as soon as it is ready for use (i.e. after .CRT$XIC initializers).

// If Atexit() is being called after RunAtexit() has already been run, it needs

// to be able to call atexit() directly. Here we use a function ponter to

// switch out its behaviour.

// An example of where this is needed is the asan_dynamic runtime on MinGW-w64.

// On this environment, __asan_init is called during global constructor phase,

// way after calling the .CRT$XID initializer.

// ------------------ sanitizer_libc.h

// FIXME: Use the wide variants to handle Unicode filenames.

// bytes_read can't be passed directly to ReadFile:

// uptr is unsigned long long on 64-bit Windows.

// FIXME: support colored output.

// Handle null optional parameters.

// Initialize output parameters in case we fail.

// Map the conventional Unix fds 1 and 2 to Windows handles. They might be

// closed, in which case this will fail.

// ExitProcess runs some finalizers, so use TerminateProcess to avoid that.

// The debugger doesn't stop on TerminateProcess like it does on ExitProcess,

// so add our own breakpoint here.

// stderr may be closed, but we may be able to print to the debugger

// instead.  This is the case when launching a program from Visual Studio,

// and the following routine should write to its console.

// FIXME: Decide what to do on Windows.

// FIXME: Decide what to do on Windows.

// FIXME: Decide what to do on Windows.

// FIXME: Decide what to do on Windows.

// Check based on flags if we should handle this exception.

// TODO: implement.

// The write flag is only available for access violation exceptions.

// The contents of this array are documented at

// https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-exception_record

// The first element indicates read as 0, write as 1, or execute as 8.  The

// second element is the faulting address.

// TODO

// Get the string description of the exception if this is a known deadly

// exception.

/*out*/

// Get the UTF-16 path and convert to UTF-8.

/*out*/

// Do nothing.

// Do nothing.

// Do nothing

// Do nothing

// FIXME: Actually implement this function.

// FIXME: Actually implement this function.

// FIXME: implement on this platform

// Should be implemented based on

// SymbolizerProcess::StarAtSymbolizerSubprocess

// from lib/sanitizer_common/sanitizer_symbolizer_win.cpp.

// FIXME: implement on this platform.

// FIXME implement on this platform.

// Do nothing.

// FIXME: implement on this platform.

// TODO(mcgov): Rename this project-wide to PlatformLogInit

// SANITIZER_WIN_TRACE

// namespace __sanitizer

// _WIN32


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_win.h ===
SHA256: 07dcd551224cc568cc68821db8559ec0c910f15c892d3c7bfc535a76ba394fc4
//===-- sanitizer_win.h -----------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Windows-specific declarations.

//

//===----------------------------------------------------------------------===//

// Check based on flags if we should handle the exception.

// namespace __sanitizer

// SANITIZER_WINDOWS

// SANITIZER_WIN_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_win_defs.h ===
SHA256: 170916b81ffbd86c559558782e418e2aea6a7981fac881c3a3f59e035d178a57
//===-- sanitizer_win_defs.h ------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Common definitions for Windows-specific code.

//

//===----------------------------------------------------------------------===//

// For MinGW, the /export: directives contain undecorated symbols, contrary to

// link/lld-link. The GNU linker doesn't support /alternatename and /include

// though, thus lld-link in MinGW mode interprets them in the same way as

// in the default mode.

// Intermediate macro to ensure the parameter is expanded before stringified.

// ----------------- A workaround for the absence of weak symbols --------------

// We don't have a direct equivalent of weak symbols when using MSVC, but we can

// use the /alternatename directive to tell the linker to default a specific

// symbol to a specific value.

// Take into account that this is a pragma directive for the linker, so it will

// be ignored by the compiler and the function will be marked as UNDEF in the

// symbol table of the resulting object file. The linker won't find the default

// implementation until it links with that object file.

// So, suppose we provide a default implementation "fundef" for "fun", and this

// is compiled into the object file "test.obj" including the pragma directive.

// If we have some code with references to "fun" and we link that code with

// "test.obj", it will work because the linker always link object files.

// But, if "test.obj" is included in a static library, like "test.lib", then the

// liker will only link to "test.obj" if necessary. If we only included the

// definition of "fun", it won't link to "test.obj" (from test.lib) because

// "fun" appears as UNDEF, so it doesn't resolve the symbol "fun", and will

// result in a link error (the linker doesn't find the pragma directive).

// So, a workaround is to force linkage with the modules that include weak

// definitions, with the following macro: WIN_FORCE_LINK()

// We cannot define weak functions on Windows, but we can use WIN_WEAK_ALIAS()

// which defines an alias to a default implementation, and only works when

// linking statically.

// So, to define a weak function "fun", we define a default implementation with

// a different name "fun__def" and we create a "weak alias" fun = fun__def.

// Then, users can override it just defining "fun".

// We impose "extern "C"" because otherwise WIN_WEAK_ALIAS() will fail because

// of name mangling.

// Dummy name for default implementation of weak function.

// Name for exported implementation of weak function.

// Use this macro when you need to define and export a weak function from a

// library. For example:

//   WIN_WEAK_EXPORT_DEF(bool, compare, int a, int b) { return a > b; }

// Use this macro when you need to import a weak function from a library. It

// defines a weak alias to the imported function from the dll. For example:

//   WIN_WEAK_IMPORT_DEF(compare)

// So, for Windows we provide something similar to weak symbols in Linux, with

// some differences:

// + A default implementation must always be provided.

//

// + When linking statically it works quite similarly. For example:

//

//   // libExample.cc

//   WIN_WEAK_EXPORT_DEF(bool, compare, int a, int b) { return a > b; }

//

//   // client.cc

//   // We can use the default implementation from the library:

//   compare(1, 2);

//   // Or we can override it:

//   extern "C" bool compare (int a, int b) { return a >= b; }

//

//  And it will work fine. If we don't override the function, we need to ensure

//  that the linker includes the object file with the default implementation.

//  We can do so with the linker option "-wholearchive:".

//

// + When linking dynamically with a library (dll), weak functions are exported

//  with "__dll" suffix. Clients can use the macro WIN_WEAK_IMPORT_DEF(fun)

//  which defines a "weak alias" fun = fun__dll.

//

//   // libExample.cc

//   WIN_WEAK_EXPORT_DEF(bool, compare, int a, int b) { return a > b; }

//

//   // client.cc

//   WIN_WEAK_IMPORT_DEF(compare)

//   // We can use the default implementation from the library:

//   compare(1, 2);

//   // Or we can override it:

//   extern "C" bool compare (int a, int b) { return a >= b; }

//

//  But if we override the function, the dlls don't have access to it (which

//  is different in linux). If that is desired, the strong definition must be

//  exported and interception can be used from the rest of the dlls.

//

//   // libExample.cc

//   WIN_WEAK_EXPORT_DEF(bool, compare, int a, int b) { return a > b; }

//   // When initialized, check if the main executable defined "compare".

//   int libExample_init() {

//     uptr fnptr = __interception::InternalGetProcAddress(

//         (void *)GetModuleHandleA(0), "compare");

//     if (fnptr && !__interception::OverrideFunction((uptr)compare, fnptr, 0))

//       abort();

//     return 0;

//   }

//

//   // client.cc

//   WIN_WEAK_IMPORT_DEF(compare)

//   // We override and export compare:

//   extern "C" __declspec(dllexport) bool compare (int a, int b) {

//     return a >= b;

//   }

//

// SANITIZER_GO

// Go neither needs nor wants weak references.

// The shenanigans above don't work for gcc.

// SANITIZER_GO

// SANITIZER_WINDOWS

// SANITIZER_WIN_DEFS_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_win_immortalize.h ===
SHA256: 49dbd9ab31cb074e9971fc3a2bb8c1568a8236060d32383be2044d90403afd9e
//===-- sanitizer_win_immortalize.h ---------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file is shared between AddressSanitizer, and interception.

//

// Windows-specific thread-safe and pre-CRT global initialization safe

// infrastructure to create an object whose destructor is never called.

//===----------------------------------------------------------------------===//

// Requires including sanitizer_placement_new.h (which is not allowed to be

// included in headers).

// These types are required to satisfy XFG which requires that the names of the

// types for indirect calls to be correct as well as the name of the original

// type for any typedefs.

// TODO: There must be a better way to do this

// Ty must provide a placement new operator

// Ty must provide a placement new operator

// return a reference to an object that will live forever

// return a reference to an object that will live forever

// namespace __sanitizer

// SANITIZER_WINDOWS


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_win_interception.cpp ===
SHA256: 3cc55fba4f7dc4f01840ad3473368e9008c841d56b87669858446c43f2bad361
//===-- sanitizer_win_interception.cpp --------------------    --*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Windows-specific export surface to provide interception for parts of the

// runtime that are always statically linked, both for overriding user-defined

// functions as well as registering weak functions that the ASAN runtime should

// use over defaults.

//

//===----------------------------------------------------------------------===//

// namespace __sanitizer

// Note that thread-safety of RunWeakFunctionCallbacks in InitializeFlags

// depends on __sanitizer_register_weak_functions being called during the

// loader lock.

// SANITIZER_WINDOWS


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_win_interception.h ===
SHA256: 7b47e66438bacbccf65baae33f3363241998bc6ebcd42bcb5b3256dd81141f17
//===-- sanitizer_win_interception.h ----------------------    --*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Windows-specific export surface to provide interception for parts of the

// runtime that are always statically linked, both for overriding user-defined

// functions as well as registering weak functions that the ASAN runtime should

// use over defaults.

//

//===----------------------------------------------------------------------===//

// namespace __sanitizer

// SANITIZER_WINDOWS

// SANITIZER_WIN_INTERCEPTION_H


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_win_thunk_interception.cpp ===
SHA256: 8592a17c06a137889c6f4bc6c7599714499b9a7a77def4c08093340a6ad790c7
//===-- sanitizer_win_thunk_interception.cpp -----------------------  -----===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file defines things that need to be present in the application modules

// to interact with sanitizer DLL correctly and cannot be implemented using the

// default "import library" generated when linking the DLL.

//

// This includes the common infrastructure required to intercept local functions

// that must be replaced with sanitizer-aware versions, as well as the

// registration of weak functions with the sanitizer DLL. With this in-place,

// other sanitizer components can simply write to the .INTR and .WEAK sections.

//

//===----------------------------------------------------------------------===//

// namespace __sanitizer

// intercept begin

// intercept end

// weak begin

// weak end

// __sanitizer_static_thunk_init is expected to be called by only one thread.

// In DLLs, the callbacks are expected to return 0,

// otherwise CRT initialization fails.

// We want to call dll_thunk_init before C/C++ initializers / constructors are

// executed, otherwise functions like memset might be invoked.

/*DLL_PROCESS_ATTACH=*/

// defined(SANITIZER_STATIC_RUNTIME_THUNK) ||

// defined(SANITIZER_DYNAMIC_RUNTIME_THUNK)


=== system/lib/compiler-rt/lib/sanitizer_common/sanitizer_win_thunk_interception.h ===
SHA256: 1eb47758acb9b807f25e206c05b142c763262c3142f16faf1fd9e58a391689af
//===-- sanitizer_win_thunk_interception.h -------------------------  -----===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// This header provide helper macros and functions to delegate calls to the

// shared runtime that lives in the sanitizer DLL.

//===----------------------------------------------------------------------===//

// namespace __sanitizer

// -------------------- Function interception macros ------------------------ //

// We can't define our own version of strlen etc. because that would lead to

// link-time or even type mismatch errors.  Instead, we can declare a function

// just to be able to get its address.  Me may miss the first few calls to the

// functions since it can be called before __dll_thunk_init, but that would lead

// to false negatives in the startup code before user's global initializers,

// which isn't a big deal.

// Use .INTR segment to register function pointers that are iterated over during

// startup that will replace local_function with sanitizer_export.

// ------------------ Weak symbol registration macros ---------------------- //

// Use .WEAK segment to register function pointers that are iterated over during

// startup that will replace sanitizer_export with local_function

// SANITIZER_WIN_STATIC_RUNTIME_THUNK_H


=== system/lib/compiler-rt/lib/ubsan/ubsan_checks.inc ===
SHA256: dd66aedd89731120d7db0aad7fc9eddd0edef97a372f63c7603ac424bbc7e39f
//===-- ubsan_checks.inc ----------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// List of checks handled by UBSan runtime.

//

//===----------------------------------------------------------------------===//

// UBSAN_CHECK(Name, SummaryKind, FSanitizeFlagName)

// SummaryKind and FSanitizeFlagName should be string literals.


=== system/lib/compiler-rt/lib/ubsan/ubsan_diag.cpp ===
SHA256: ab37eb19cb0d156cbbd82de0a790106a83a241d9bd68a81885059b42af59591a
//===-- ubsan_diag.cpp ----------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Diagnostic reporting for the UBSan runtime.

//

//===----------------------------------------------------------------------===//

// UBSan is combined with runtimes that already provide this functionality

// (e.g., ASan) as well as runtimes that lack it (e.g., scudo). Tried to use

// weak linkage to resolve this issue which is not portable and breaks on

// Windows.

// TODO(yln): This is a temporary workaround. GetStackTrace functions will be

// removed in the future.

// We assume that flags are already parsed, as UBSan runtime

// will definitely be called when we print the first diagnostics message.

/// Hexadecimal printing for numbers too large for Printf to handle directly.

// The Windows implementation demangles names early.

// 'long long' is guaranteed to be at least 64 bits wide.

// FIXME: Support floating-point formatting in sanitizer_common's

//        printf, and stop using snprintf here.

// On MSVC platforms, long doubles are equal to regular doubles.

// In MinGW environments on x86, long doubles are 80 bit, but here,

// we're calling an MS CRT provided printf function which considers

// long doubles to be 64 bit. Just cast the float value to a regular

// double to avoid the potential ambiguity in MinGW mode.

/// Find the earliest-starting range in Ranges which ends after Loc.

/// Render a snippet of the address space near a location.

// Show at least the 8 bytes surrounding Loc.

// If we have too many interesting bytes, prefer to show bytes after Loc.

// Emit data.

// Emit highlights.

// Go over the line again, and print names for the ranges.

// FIXME: We only support naming one range for now!

// FIXME: Print names for anything we can identify within the line:

//

//  * If we can identify the memory itself as belonging to a particular

//    global, stack variable, or dynamic allocation, then do so.

//

//  * If we have a pointer-size, pointer-aligned range highlighted,

//    determine whether the value of that range is a pointer to an

//    entity which we can name, and if so, print that name.

//

// This needs an external symbolizer, or (preferably) ASan instrumentation.

// All diagnostics should be printed under report mutex.

// Prepare a report that a monitor process can inspect.

// NOLINT

// Fast path: don't symbolize PC if there is no suppressions for given UB

// type.

// Suppress by file name known to runtime.

// Suppress by module name.

// Suppress by function or source file name from debug info.

// CAN_SANITIZE_UB


=== system/lib/compiler-rt/lib/ubsan/ubsan_diag.h ===
SHA256: e80169c293867628ca278127673e25bb20a191bac24154bbae09646781c5fe8c
//===-- ubsan_diag.h --------------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Diagnostics emission for Clang's undefined behavior sanitizer.

//

//===----------------------------------------------------------------------===//

/// A location of some data within the program's address space.

/// \brief Location at which a diagnostic can be emitted. Either a

/// SourceLocation, a MemoryLocation, or a SymbolizedStack.

// FIXME: In C++11, wrap these in an anonymous union.

// Not owned.

// SymbolizedStackHolder must outlive Location object.

/// A diagnostic severity level.

///< An error.

///< A note, attached to a prior diagnostic.

/// \brief Annotation for a range of locations in a diagnostic.

/// \brief A C++ type name. Really just a strong typedef for 'const char*'.

/// \brief Representation of an in-flight diagnostic.

///

/// Temporary \c Diag instances are created by the handler routines to

/// accumulate arguments for a diagnostic. The destructor emits the diagnostic

/// message.

/// The location at which the problem occurred.

/// The diagnostic level.

/// The error type.

/// The message which will be emitted, with %0, %1, ... placeholders for

/// arguments.

/// Kinds of arguments, corresponding to members of \c Arg's union.

///< A string argument, displayed as-is.

///< A C++ type name, possibly demangled before display.

///< An unsigned integer argument.

///< A signed integer argument.

///< A floating-point argument.

///< A pointer argument, displayed in hexadecimal.

/// An individual diagnostic message argument.

/// The arguments which have been added to this diagnostic so far.

/// The ranges which have been added to this diagnostic so far.

/// \c Diag objects are not copyable.

// NOT IMPLEMENTED

// If FromUnrecoverableHandler is specified, UBSan runtime handler is not

// expected to return.

/// pc/bp are used to unwind the stack trace.

/// \brief Instantiate this class before printing diagnostics in the error

/// report. This class ensures that reports from different threads and from

/// different sanitizers won't be mixed.

// Sometimes UBSan runtime can know filename from handlers arguments, even if

// debug info is missing.

// namespace __ubsan

// UBSAN_DIAG_H


=== system/lib/compiler-rt/lib/ubsan/ubsan_diag_standalone.cpp ===
SHA256: 25f67c1529729d0c7b1c90d846877b750fc08348bf5390872efe31335ab9e6f6
//===-- ubsan_diag_standalone.cpp -----------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Diagnostic reporting for the standalone UBSan runtime.

//

//===----------------------------------------------------------------------===//

// extern "C"

// CAN_SANITIZE_UB


=== system/lib/compiler-rt/lib/ubsan/ubsan_flags.cpp ===
SHA256: f3adaf4d1765d59d38e641f186afa648e56a982ada40e751fc755bda21b2d638
//===-- ubsan_flags.cpp ---------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Runtime flags for UndefinedBehaviorSanitizer.

//

//===----------------------------------------------------------------------===//

// We cannot call getenv() from inside a preinit array initializer

// getenv on emscripten uses malloc, which we can't when using some sanitizers.

// You can't run external symbolizers anyway.

// Override from user-specified string.

// Override from environment variable.

// SANITIZER_EMSCRIPTEN

// namespace __ubsan

// CAN_SANITIZE_UB


=== system/lib/compiler-rt/lib/ubsan/ubsan_flags.h ===
SHA256: 88cdd19d7482fd7a9d87ae311c6bec6e36f3efe9f49f9ca0bb5b0f78a27a62f4
//===-- ubsan_flags.h -------------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Runtime flags for UndefinedBehaviorSanitizer.

//

//===----------------------------------------------------------------------===//

// namespace __ubsan

// Users may provide their own implementation of __ubsan_default_options to

// override the default flag values.

// extern "C"

// UBSAN_FLAGS_H


=== system/lib/compiler-rt/lib/ubsan/ubsan_flags.inc ===
SHA256: 788ab586b2565a34b4975b394b1dbebf5daa84a9ec702407e24b2a1d410356f0
//===-- ubsan_flags.inc -----------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// UBSan runtime flags.

//

//===----------------------------------------------------------------------===//

// UBSAN_FLAG(Type, Name, DefaultValue, Description)

// See COMMON_FLAG in sanitizer_flags.inc for more details.


=== system/lib/compiler-rt/lib/ubsan/ubsan_handlers.cpp ===
SHA256: a598136e03b9bcdde47c216d57c144ef745f1f75c3e646f2c7770edc87c75caa
//===-- ubsan_handlers.cpp ------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Error logging entry points for the UBSan runtime.

//

//===----------------------------------------------------------------------===//

// We are not allowed to skip error report: if we are in unrecoverable

// handler, we have to terminate the program right now, and therefore

// have to print some diagnostic.

//

// Even if source location is disabled, it doesn't mean that we have

// already report an error to the user: some concurrently running

// thread could have acquired it, but not yet printed the report.

/// Situations in which we might emit a check for the suitability of a

/// pointer or glvalue. Needs to be kept in sync with CodeGenFunction.h in

/// clang.

/// Checking the operand of a load. Must be suitably sized and aligned.

/// Checking the destination of a store. Must be suitably sized and aligned.

/// Checking the bound value in a reference binding. Must be suitably sized

/// and aligned, but is not required to refer to an object (until the

/// reference is used), per core issue 453.

/// Checking the object expression in a non-static data member access. Must

/// be an object within its lifetime.

/// Checking the 'this' pointer for a call to a non-static member function.

/// Must be an object within its lifetime.

/// Checking the 'this' pointer for a constructor call.

/// Checking the operand of a static_cast to a derived pointer type. Must be

/// null or an object within its lifetime.

/// Checking the operand of a static_cast to a derived reference type. Must

/// be an object within its lifetime.

/// Checking the operand of a cast to a base object. Must be suitably sized

/// and aligned.

/// Checking the operand of a cast to a virtual base object. Must be an

/// object within its lifetime.

/// Checking the value assigned to a _Nonnull pointer. Must not be null.

/// Checking the operand of a dynamic_cast or a typeid expression.  Must be

/// null or an object within its lifetime.

// Use the SourceLocation from Data to track deduplication, even if it's

// invalid.

/// \brief Common diagnostic emission for various forms of integer overflow.

// If this is an unsigned overflow in non-fatal mode, potentially ignore it.

// FIXME: Pass more diagnostic info.

// First field is either a pointer to filename or a pointer to a

// TypeDescriptor.

// Heuristic: For float_cast_overflow, the TypeKind will be either TK_Integer

// (0x0), TK_Float (0x1) or TK_Unknown (0xff). If both types are known,

// adding both bytes will be 0 or 1 (for BE or LE). If it were a filename,

// adding two printable characters will not yield such a value. Otherwise,

// if one of them is 0xff, this is most likely TK_Unknown type descriptor.

// This check could be more precise if we used different handlers for

// -fsanitize=bool and -fsanitize=enum.

// Legacy, no longer used.

// Let's figure out what it should be as per the new types, and upgrade.

// If both types are unsigned, then it's an unsigned truncation.

// Else, it is a signed truncation.

// In the case we have a bitfield, we want to explicitly say so in the

// error message.

// FIXME: is it possible to dump the values as hex with fixed width?

// If the failure involved different DSOs for the check location and icall

// target, report the DSO names.

// namespace __ubsan

// CAN_SANITIZE_UB


=== system/lib/compiler-rt/lib/ubsan/ubsan_handlers.h ===
SHA256: 880aab603c0dc9773e47f4c4758cc7eb1d560484d5700db586017f293cf89420
//===-- ubsan_handlers.h ----------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Entry points to the runtime library for Clang's undefined behavior sanitizer.

//

//===----------------------------------------------------------------------===//

/// \brief Handle a runtime type check failure, caused by either a misaligned

/// pointer, a null pointer, or a pointer to insufficient storage for the

/// type.

/// \brief Handle a runtime alignment assumption check failure,

/// caused by a misaligned pointer.

/// \brief Handle an integer addition overflow.

/// \brief Handle an integer subtraction overflow.

/// \brief Handle an integer multiplication overflow.

/// \brief Handle a signed integer overflow for a unary negate operator.

/// \brief Handle an INT_MIN/-1 overflow or division by zero.

/// \brief Handle a shift where the RHS is out of bounds or a left shift where

/// the LHS is negative or overflows.

/// \brief Handle an array index out of bounds error.

/// \brief Handle an local object access out of bounds error.

/// \brief Handle a __builtin_unreachable which is reached.

/// \brief Handle reaching the end of a value-returning function.

/// \brief Handle a VLA with a non-positive bound.

// Keeping this around for binary compatibility with (sanitized) programs

// compiled with older compilers.

/// Handle overflow in a conversion to or from a floating-point type.

/// void *Data is one of FloatCastOverflowData* or FloatCastOverflowDataV2*

/// \brief Handle a load of an invalid value for the type.

/// Known implicit conversion check kinds.

/// Keep in sync with the enum of the same name in CGExprScalar.cpp

// Legacy, was only used by clang 7.

/* ImplicitConversionCheckKind */

/// \brief Implict conversion that changed the value.

/// Known builtin check kinds.

/// Keep in sync with the enum of the same name in CodeGenFunction.h

/// Handle a builtin called in an invalid way.

/// Handle an invalid ObjC cast.

/// \brief Handle returning null from function with the returns_nonnull

/// attribute, or a return type annotated with _Nonnull.

/// \brief Handle passing null pointer to a function parameter with the nonnull

/// attribute, or a _Nonnull type annotation.

/// \brief Known CFI check kinds.

/// Keep in sync with the enum of the same name in CodeGenFunction.h

/// \brief Handle control flow integrity failures.

// UBSAN_HANDLERS_H


=== system/lib/compiler-rt/lib/ubsan/ubsan_handlers_cxx.cpp ===
SHA256: 4afc726a24426cca1f88c0fbe28bebc2b69079d42a230b06060a6feba7786f16
//===-- ubsan_handlers_cxx.cpp --------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Error logging entry points for the UBSan runtime, which are only used for C++

// compilations. This file is permitted to use language features which require

// linking against a C++ ABI library.

//

//===----------------------------------------------------------------------===//

// Returns true if UBSan has printed an error report.

// Just a cache miss. The type matches after all.

// Check if error report should be suppressed.

// If possible, say what type it actually points to.

// FIXME: Find the type at the specified offset, and include that

//        in the note.

// Note: -fsanitize=vptr is always recoverable.

// If possible, say what type it actually points to.

// If the failure involved different DSOs for the check location and vtable,

// report the DSO names.

// namespace __ubsan

// CAN_SANITIZE_UB


=== system/lib/compiler-rt/lib/ubsan/ubsan_handlers_cxx.h ===
SHA256: 228dfeb20409a5982b3e841b205996a9d49022d70e02bcda60105a6b18b834f0
//===-- ubsan_handlers_cxx.h ------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Entry points to the runtime library for Clang's undefined behavior sanitizer,

// for C++-specific checks. This code is not linked into C binaries.

//

//===----------------------------------------------------------------------===//

/// \brief Handle a runtime type check failure, caused by an incorrect vptr.

/// When this handler is called, all we know is that the type was not in the

/// cache; this does not necessarily imply the existence of a bug.

// UBSAN_HANDLERS_CXX_H


=== system/lib/compiler-rt/lib/ubsan/ubsan_init.cpp ===
SHA256: a2def2699da4c76ebbaf3b06f4027169860c20bec0abdfaf9aa2d08ecef17407
//===-- ubsan_init.cpp ----------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Initialization of UBSan runtime.

//

//===----------------------------------------------------------------------===//

// Only add die callback when running in standalone mode to avoid printing

// the same information from multiple sanitizers' output

// CAN_SANITIZE_UB


=== system/lib/compiler-rt/lib/ubsan/ubsan_init.h ===
SHA256: b866ee075c96d4c3fa24948f00148f6c542f0a3fc8c4634c28be6da271d03106
//===-- ubsan_init.h --------------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Initialization function for UBSan runtime.

//

//===----------------------------------------------------------------------===//

// Get the full tool name for UBSan.

// Initialize UBSan as a standalone tool. Typically should be called early

// during initialization.

// Initialize UBSan as a standalone tool, if it hasn't been initialized before.

// Initializes UBSan as a plugin tool. This function should be called once

// from "parent tool" (e.g. ASan) initialization.

// namespace __ubsan

// UBSAN_INIT_H


=== system/lib/compiler-rt/lib/ubsan/ubsan_init_standalone.cpp ===
SHA256: 0d7f4cc6f8333eb1280019999f50b26618714c8f687b2846d40e1caa93f9ac82
//===-- ubsan_init_standalone.cpp -----------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Initialization of standalone UBSan runtime.

//

//===----------------------------------------------------------------------===//

// UBSan doesn't need to do anything else special in the startup hook.

// namespace __sanitizer

// SANITIZER_FUCHSIA

// namespace __ubsan


=== system/lib/compiler-rt/lib/ubsan/ubsan_init_standalone_preinit.cpp ===
SHA256: 609b769805be93dff8d564bd71cf5b5b0e19564426dbcfa628727740460369dd
//===-- ubsan_init_standalone_preinit.cpp --------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Initialization of standalone UBSan runtime.

//

//===----------------------------------------------------------------------===//

// namespace __ubsan

// SANITIZER_CAN_USE_PREINIT_ARRAY


=== system/lib/compiler-rt/lib/ubsan/ubsan_interface.inc ===
SHA256: 0392912014b9bf70ea667b0955c6b82a4bea31ca8893b7ea17b23db49d272b91
//===-- ubsan_interface.inc -----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Ubsan interface list.

//===----------------------------------------------------------------------===//


=== system/lib/compiler-rt/lib/ubsan/ubsan_monitor.cpp ===
SHA256: d31fee899287186b375554fe317965417b8b6a7cb5590478340fc365f857efa2
//===-- ubsan_monitor.cpp ---------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Hooks which allow a monitor process to inspect UBSan's diagnostics.

//

//===----------------------------------------------------------------------===//

// We have the common sanitizer reporting lock, so it's safe to register a

// new UB report.

// Make a copy of the diagnostic.

// Let the monitor know that a report is available.

// Ensure that the first character of the diagnostic text can't start with a

// lowercase letter.


=== system/lib/compiler-rt/lib/ubsan/ubsan_monitor.h ===
SHA256: 2b0c848d8c321ad8cd10f96dd53f4f07229f6c4fcf72600ff3be2cd3b067064a
//===-- ubsan_monitor.h -----------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Hooks which allow a monitor process to inspect UBSan's diagnostics.

//

//===----------------------------------------------------------------------===//

/// Called after a report is prepared. This serves to alert monitor processes

/// that a UB report is available.

/// Used by the monitor process to extract information from a UB report. The

/// data is only available until the next time __ubsan_on_report is called. The

/// caller is responsible for copying and preserving the data if needed.

// end namespace __ubsan

// UBSAN_MONITOR_H


=== system/lib/compiler-rt/lib/ubsan/ubsan_platform.h ===
SHA256: 8407834ae47f2e6d073a33c98742ff78fcb136796584186f0ebc981d9a21c4ed
//===-- ubsan_platform.h ----------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Defines the platforms which UBSan is supported at.

//

//===----------------------------------------------------------------------===//

// Other platforms should be easy to add, and probably work as-is.


=== system/lib/compiler-rt/lib/ubsan/ubsan_signals_standalone.cpp ===
SHA256: 75d707b3dc1626ba7972cd53b6980d383dab81df373f46b64b2b744b16a9106a
//=-- ubsan_signals_standalone.cpp ----------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Installs signal handlers and related interceptors for UBSan standalone.

//

//===----------------------------------------------------------------------===//

// Interception of signals breaks too many things on Android.

// * It requires that ubsan is the first dependency of the main executable for

// the interceptors to work correctly. This complicates deployment, as it

// prevents us from enabling ubsan on random platform modules independently.

// * For this to work with ART VM, ubsan signal handler has to be set after the

// debuggerd handler, but before the ART handler.

// * Interceptors don't work at all when ubsan runtime is loaded late, ex. when

// it is part of an APK that does not use wrap.sh method.

// namespace __ubsan

// TODO(yln): Temporary workaround. Will be removed.

// REAL(sigaction_symname) is nullptr in a static link. Bail out.

// namespace __ubsan

// CAN_SANITIZE_UB


=== system/lib/compiler-rt/lib/ubsan/ubsan_signals_standalone.h ===
SHA256: e6036281593b74d478c2d8a10a482fd11ed30306b17b842e3743bf517f01ba4e
//=-- ubsan_signals_standalone.h

//------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Installs signal handlers and related interceptors for UBSan standalone.

//

//===----------------------------------------------------------------------===//

// Initializes signal handlers and interceptors.

// namespace __ubsan

// UBSAN_SIGNALS_STANDALONE_H


=== system/lib/compiler-rt/lib/ubsan/ubsan_type_hash.cpp ===
SHA256: 0307ca38c21ff027b7a6e06c363afe9a58927cbe55c25609c72199dce6ca87e0
//===-- ubsan_type_hash.cpp -----------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Implementation of a hash table for fast checking of inheritance

// relationships. This file is only linked into C++ compilations, and is

// permitted to use language features which require a C++ ABI library.

//

// Most of the implementation lives in an ABI-specific source file

// (ubsan_type_hash_{itanium,win}.cpp).

//

//===----------------------------------------------------------------------===//

/// A cache of recently-checked hashes. Mini hash table with "random" evictions.

// CAN_SANITIZE_UB


=== system/lib/compiler-rt/lib/ubsan/ubsan_type_hash.h ===
SHA256: 6feee01548984ea2e76be2a06eeb004c68f2a4b628ac28b4bfd51a147689692d
//===-- ubsan_type_hash.h ---------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Hashing of types for Clang's undefined behavior checker.

//

//===----------------------------------------------------------------------===//

/// \brief Information about the dynamic type of an object (extracted from its

/// vptr).

/// Determine whether the object had a valid dynamic type.

/// Get the name of the most-derived type of the object.

/// Get the offset from the most-derived type to this base class.

/// Get the name of the most-derived type at the specified offset.

/// \brief Get information about the dynamic type of an object.

/// \brief Get information about the dynamic type of an object from its vtable.

/// \brief Check whether the dynamic type of \p Object has a \p Type subobject

/// at offset 0.

/// \return \c true if the type matches, \c false if not.

/// A sanity check for Vtable. Offsets to top must be reasonably small

/// numbers (by absolute value). It's a weak check for Vtable corruption.

/// \brief A cache of the results of checkDynamicType. \c checkDynamicType would

/// return \c true (modulo hash collisions) if

/// \code

///   __ubsan_vptr_type_cache[Hash % VptrTypeCacheSize] == Hash

/// \endcode

/// \brief Do whatever is required by the ABI to check for std::type_info

/// equivalence beyond simple pointer comparison.

// namespace __ubsan

// UBSAN_TYPE_HASH_H


=== system/lib/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cpp ===
SHA256: 60372cee55072198f1d756112e0d4ed21e727309a41bc576faa29b18ee18ff51
//===-- ubsan_type_hash_itanium.cpp ---------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Implementation of type hashing/lookup for Itanium C++ ABI.

//

//===----------------------------------------------------------------------===//

// The following are intended to be binary compatible with the definitions

// given in the Itanium ABI. We make no attempt to be ODR-compatible with

// those definitions, since existing ABI implementations aren't.

/// Type info for classes with no bases, and base class for type info for

/// classes with bases.

/// Type info for classes with simple single public inheritance.

/// Type info for classes with multiple, virtual, or non-public inheritance.

// We implement a simple two-level cache for type-checking results. For each

// (vptr,type) pair, a hash is computed. This hash is assumed to be globally

// unique; if it collides, we will get false negatives, but:

//  * such a collision would have to occur on the *first* bad access,

//  * the probability of such a collision is low (and for a 64-bit target, is

//    negligible), and

//  * the vptr, and thus the hash, can be affected by ASLR, so multiple runs

//    give better coverage.

//

// The first caching layer is a small hash table with no chaining; buckets are

// reused as needed. The second caching layer is a large hash table with open

// chaining. We can freely evict from either layer since this is just a cache.

//

// FIXME: Make these hash table accesses thread-safe. The races here are benign:

//        assuming the unsequenced loads and stores don't misbehave too badly,

//        the worst case is false negatives or poor cache behavior, not false

//        positives or crashes.

/// Find a bucket to store the given hash value in.

// FIXME: Pick a random entry from the probe sequence to evict rather than

//        just taking the first.

/// \brief Determine whether \p Derived has a \p Base base class subobject at

/// offset \p Offset.

// No base class subobjects.

// Look for a base class which is derived from \p Base at the right offset.

// FIXME: Curtail the recursion if this base can't possibly contain the

//        given offset.

// For now, just punt on virtual bases and say 'yes'.

// FIXME: OffsetHere is the offset in the vtable of the virtual base

//        offset. Read the vbase offset out of the vtable and use it.

/// \brief Find the derived-most dynamic base class of \p Derived at offset

/// \p Offset.

// No base class subobjects.

// FIXME: Can't handle virtual bases yet.

/// The offset from the vptr to the start of the most-derived object.

/// This will only be greater than zero in some virtual base class vtables

/// used during object con-/destruction, and will usually be exactly zero.

/// The type_info object describing the most-derived class type.

// This can't possibly be a valid vtable.

// A crash anywhere within this function probably means the vptr is corrupted.

// FIXME: Perform these checks more cautiously.

// Check whether this is something we've evicted from the cache.

// Too large or too small offset are signs of Vtable corruption.

// Check that this is actually a type_info object for a class type.

// Success. Cache this result.

// CAN_SANITIZE_UB && !SANITIZER_WINDOWS


=== system/lib/compiler-rt/lib/ubsan/ubsan_type_hash_win.cpp ===
SHA256: 080acb76703b14e181bde925dbf1b37e7c979304bcdee2bb60a8fe6f3b80684f
//===-- ubsan_type_hash_win.cpp -------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Implementation of type hashing/lookup for Microsoft C++ ABI.

//

//===----------------------------------------------------------------------===//

// FIXME: Implement.

// The virtual table may not have a complete object locator if the object

// was compiled without RTTI (i.e. we might be reading from some other global

// laid out before the virtual table), so we need to carefully validate each

// pointer dereference and perform sanity checks.

// Probably not a complete object locator.

// Okay, this is probably a std::type_info. Request its name.

// FIXME: Implement a base class search like we do for Itanium.

// CAN_SANITIZE_UB && SANITIZER_WINDOWS


=== system/lib/compiler-rt/lib/ubsan/ubsan_value.cpp ===
SHA256: 9e1d378843601e33904015298b882fb4a414202fdb6b6c7f47e59d0e8d82319a
//===-- ubsan_value.cpp ---------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Representation of a runtime value, as marshaled from the generated code to

// the ubsan runtime.

//

//===----------------------------------------------------------------------===//

// We need to query the ObjC runtime for some information, but do not want

// to introduce a static dependency from the ubsan runtime onto ObjC. Try to

// grab a handle to the ObjC runtime used by the process.

// Prevent threads from racing to dlopen().

// Only bind symbols when used.

// Only make symbols available via the handle.

// Do not load the dylib, just grab a handle if the

// image is already loaded.

// Only search the image pointed-to by the handle.

// Val was zero-extended to ValueHandle. Sign-extend from original width

// to SIntMax.

/// Get the floating-point value of this object, extended to a long double.

/// These are always passed by address (our calling convention doesn't allow

/// them to be passed in floating-point registers, so this has little cost).

// FIXME: OpenCL / NEON 'half' type. LLVM can't lower the conversion

//        from '__fp16' to 'long double'.

// For big endian the float value is in the last 4 bytes.

// On some targets we may only have 4 bytes so we count backwards from

// the end of Val to account for both the 32-bit and 64-bit cases.

// CAN_SANITIZE_UB


=== system/lib/compiler-rt/lib/ubsan/ubsan_value.h ===
SHA256: 73694e8be4f6d61be9c5eb384abce0fe65784e03abb48f7d799c592fa9f76de8
//===-- ubsan_value.h -------------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Representation of data which is passed from the compiler-generated calls into

// the ubsan runtime.

//

//===----------------------------------------------------------------------===//

// FIXME: Move this out to a config header.

/// \brief Largest integer types we support.

/// \brief Largest floating-point type we support.

/// \brief A description of a source location. This corresponds to Clang's

/// \c PresumedLoc type.

/// \brief Determine whether the source location is known.

/// \brief Atomically acquire a copy, disabling original in-place.

/// Exactly one call to acquire() returns a copy that isn't disabled.

/// \brief Determine if this Location has been disabled.

/// Disabled SourceLocations are invalid to use.

/// \brief Get the presumed filename for the source location.

/// \brief Get the presumed line number.

/// \brief Get the column within the presumed line.

/// \brief A description of a type.

/// A value from the \c Kind enumeration, specifying what flavor of type we

/// have.

/// A \c Type-specific value providing information which allows us to

/// interpret the meaning of a ValueHandle of this type.

/// The name of the type follows, in a format suitable for including in

/// diagnostics.

/// An integer type. Lowest bit is 1 for a signed value, 0 for an unsigned

/// value. Remaining bits are log_2(bit width). The value representation is

/// the integer itself if it fits into a ValueHandle, and a pointer to the

/// integer otherwise.

/// A floating-point type. Low 16 bits are bit width. The value

/// representation is that of bitcasting the floating-point value to an

/// integer type.

/// An _BitInt(N) type. Lowest bit is 1 for a signed value, 0 for an

/// unsigned value. Remaining bits are log_2(bit_width). The value

/// representation is the integer itself if it fits into a ValueHandle, and

/// a pointer to the integer otherwise. TypeName contains the true width

/// of the type for the signed _BitInt(N) type stored after zero bit after

/// TypeName as 32-bit unsigned integer.

/// Any other type. The value representation is unspecified.

// Scan Name for zero and return the next address

// Return the next address

/// \brief An opaque handle to a value.

/// Returns the class name of the given ObjC object, or null if the name

/// cannot be found.

/// \brief Representation of an operand value provided by the instrumented code.

///

/// This is a combination of a TypeDescriptor (which is emitted as constant data

/// as an operand to a handler function) and a ValueHandle (which is passed at

/// runtime when a check failure occurs).

/// The type of the value.

/// The encoded value itself.

/// Is \c Val a (zero-extended) integer?

/// Is \c Val a (zero-extended) integer representation of a float?

/// \brief Get this value as a signed integer.

/// \brief Get this value as an unsigned integer.

/// \brief Decode this value, which must be a positive or unsigned integer.

/// Is this an integer with value -1?

/// Is this a negative integer?

/// \brief Get this value as a floating-point quantity.

// namespace __ubsan

// UBSAN_VALUE_H


=== system/lib/compiler-rt/lib/ubsan/ubsan_win_runtime_thunk.cpp ===
SHA256: 5cc5c783722bada028978003d019fffd3de4085472cefffa7eebbaf254553bab
//===-- ubsan_win_runtime_thunk.cpp -----------------------------        --===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file defines things that need to be present in the application modules

// to interact with Ubsan, when it is included in a dll.

//

//===----------------------------------------------------------------------===//

// Define weak alias for all weak functions imported from ubsan.

// defined(SANITIZER_DYNAMIC_RUNTIME_THUNK) ||

// defined(SANITIZER_STATIC_RUNTIME_THUNK)


=== system/lib/compiler-rt/lib/ubsan_minimal/ubsan_minimal_handlers.cpp ===
SHA256: 4c6955677d77b734c16e2a59c068f7f983263e23c09ae10ca3da8a3220cb1a61
// Number of elements in caller_pcs. A special value of kMaxCallerPcs + 1 means

// that "too many errors" has already been reported.

// Print the address by nibbles.

// Make sure we don't cause a buffer overflow.

// early exit

// when sz==kMaxCallerPcs print "too many errors", but only when cmpxchg

// succeeds in order to not print it multiple times.

// Concurrent update.

// FIXME: yield?

// Concurrent update! Try again from the start.

// Use another handlers, in case it's already overriden.

// The DCHECK macro needs this symbol to be defined.

// FIXME: Show line number.

// namespace __sanitizer


=== system/lib/compiler-rt/stack_limits.S ===
SHA256: e6867a21e15ccf50b4526b1754a44df40f391c6249450b144c96a9ccd9e9a2a7
.globl emscripten_stack_init
.globl emscripten_stack_set_limits
.globl emscripten_stack_get_free
.globl emscripten_stack_get_base
.globl emscripten_stack_get_end

#ifdef __wasm64__
#define PTR i64
#define ALIGN 3
#define PTRSTORE .int64
#else
#define PTR i32
#define ALIGN 2
#define PTRSTORE .int32
#endif

.globaltype __stack_pointer, PTR

.section .globals,"",@

# TODO(sbc): It would be nice if these were initialized directly
# using PTR.const rather than using the `emscripten_stack_init`
.globaltype __stack_end, PTR
__stack_end:
.globaltype __stack_base, PTR
__stack_base:

.section .text,"",@

emscripten_stack_get_base:
  .functype emscripten_stack_get_base () -> (PTR)
  global.get __stack_base
  end_function

emscripten_stack_get_end:
  .functype emscripten_stack_get_end () -> (PTR)
  global.get __stack_end
  end_function

emscripten_stack_init:
  # Initialize __stack_end and __stack_base.
  # This must be called before emscripten_stack_get_end,
  # emscripten_stack_get_base, or emscripten_stack_get_free are called
  .functype emscripten_stack_init () -> ()

  # What llvm calls __stack_high is the high address from where it grows
  # downwards.  We call this the stack base here in emscripten.
#ifdef __PIC__
  global.get __stack_high@GOT
#else
  PTR.const __stack_high
#endif
  global.set __stack_base

  # What llvm calls __stack_low is that end of the stack
#ifdef __PIC__
  global.get __stack_low@GOT
#else
  PTR.const __stack_low
#endif
  # Align up to 16 bytes
  PTR.const 0xf
  PTR.add
  PTR.const -0x10
  PTR.and
  global.set __stack_end

  end_function

emscripten_stack_set_limits:
  .functype emscripten_stack_set_limits (PTR, PTR) -> ()
  local.get 0
  global.set __stack_base
  local.get 1
  global.set __stack_end
  end_function

emscripten_stack_get_free:
  .functype emscripten_stack_get_free () -> (PTR)
  global.get __stack_pointer
  global.get __stack_end
  PTR.sub
  end_function

# Add emscripten_stack_init to static ctors
.section .init_array.1,"",@
.p2align ALIGN
PTRSTORE emscripten_stack_init



=== system/lib/compiler-rt/stack_ops.S ===
SHA256: f99c53c18be77b978f2255c5ef9c1c31798fe17dea87ca87f34ae39a2f237045
.globl _emscripten_stack_restore
.globl _emscripten_stack_alloc
.globl emscripten_stack_get_current

#ifdef __wasm64__
#define PTR i64
#define MASK 0xfffffffffffffff0
#else
#define PTR i32
#define MASK 0xfffffff0
#endif

.globaltype __stack_pointer, PTR

_emscripten_stack_restore:
  .functype _emscripten_stack_restore(PTR) -> ()
  local.get 0
  global.set __stack_pointer
  end_function

_emscripten_stack_alloc:
  .functype _emscripten_stack_alloc(PTR) -> (PTR)
  .local PTR, PTR
  global.get __stack_pointer
  # Get arg 0 -> number of bytes to allocate
  local.get 0
  # Stack grows down.  Subtract arg0 from __stack_pointer
  PTR.sub
  # Align result by anding with ~15
  PTR.const MASK
  PTR.and
  local.tee 1
  global.set __stack_pointer
  local.get 1
  end_function

emscripten_stack_get_current:
  .functype emscripten_stack_get_current () -> (PTR)
  global.get __stack_pointer
  end_function



=== system/lib/dlmalloc.c ===
SHA256: c008dc3c2b005ba822efb1bf6187a9d7a6aecd096826c6f28c6f5ee62885053d
/* XXX Emscripten XXX */

// When building for wasm we export `malloc` and `emscripten_builtin_malloc` as

// weak alias of the internal `dlmalloc` which is static to this file.

/* mmap uses malloc, so malloc can't use mmap */

/* Emscripten's sbrk can interpret unsigned values greater than (MAX_SIZE_T / 2U) (2GB) correctly */

/* we can only grow the heap up anyhow, so don't try to trim */

/* dlmalloc has many checks, calls to abort() increase code size,
   leave them only in debug builds */

/* allow malloc stats only in debug builds, which brings in stdio code. */

/* XXX Emscripten Tracing API. This defines away the code if tracing is disabled. */

/* Make malloc() and free() threadsafe by securing the memory allocations with pthread mutexes. */

// Ensure we use pthread_mutex_t.

/* `malloc`ed pointers must be aligned at least as strictly as max_align_t. */

/*
  Emscripten aligns even float128 to 64-bits, to save size and increase speed.
  See https://github.com/emscripten-core/emscripten/issues/10072
*/

// __EMSCRIPTEN__

/*
 This is a version (aka dlmalloc) of malloc/free/realloc written by
 Doug Lea and released to the public domain, as explained at
 http://creativecommons.org/publicdomain/zero/1.0/ Send questions,
 comments, complaints, performance data, etc to dl@cs.oswego.edu
 
 * Version 2.8.6 Wed Aug 29 06:57:58 2012  Doug Lea
 Note: There may be an updated version of this malloc obtainable at
 ftp://gee.cs.oswego.edu/pub/misc/malloc.c
 Check before installing!
 
 * Quickstart
 
 This library is all in one file to simplify the most common usage:
 ftp it, compile it (-O3), and link it into another program. All of
 the compile-time options default to reasonable values for use on
 most platforms.  You might later want to step through various
 compile-time and dynamic tuning options.
 
 For convenience, an include file for code using this malloc is at:
 ftp://gee.cs.oswego.edu/pub/misc/malloc-2.8.6.h
 You don't really need this .h file unless you call functions not
 defined in your system include files.  The .h file contains only the
 excerpts from this file needed for using this malloc on ANSI C/C++
 systems, so long as you haven't changed compile-time options about
 naming and tuning parameters.  If you do, then you can create your
 own malloc.h that does include all settings by cutting at the point
 indicated below. Note that you may already by default be using a C
 library containing a malloc that is based on some version of this
 malloc (for example in linux). You might still want to use the one
 in this file to customize settings or to avoid overheads associated
 with library versions.
 
 * Vital statistics:
 
 Supported pointer/size_t representation:       4 or 8 bytes
 size_t MUST be an unsigned type of the same width as
 pointers. (If you are using an ancient system that declares
 size_t as a signed type, or need it to be a different width
 than pointers, you can use a previous release of this malloc
 (e.g. 2.7.2) supporting these.)
 
 Alignment:                                     8 bytes (minimum)
 This suffices for nearly all current machines and C compilers.
 However, you can define MALLOC_ALIGNMENT to be wider than this
 if necessary (up to 128bytes), at the expense of using more space.
 
 Minimum overhead per allocated chunk:   4 or  8 bytes (if 4byte sizes)
 8 or 16 bytes (if 8byte sizes)
 Each malloced chunk has a hidden word of overhead holding size
 and status information, and additional cross-check word
 if FOOTERS is defined.
 
 Minimum allocated size: 4-byte ptrs:  16 bytes    (including overhead)
 8-byte ptrs:  32 bytes    (including overhead)
 
 Even a request for zero bytes (i.e., malloc(0)) returns a
 pointer to something of the minimum allocatable size.
 The maximum overhead wastage (i.e., number of extra bytes
 allocated than were requested in malloc) is less than or equal
 to the minimum size, except for requests >= mmap_threshold that
 are serviced via mmap(), where the worst case wastage is about
 32 bytes plus the remainder from a system page (the minimal
 mmap unit); typically 4096 or 8192 bytes.
 
 Security: static-safe; optionally more or less
 The "security" of malloc refers to the ability of malicious
 code to accentuate the effects of errors (for example, freeing
 space that is not currently malloc'ed or overwriting past the
 ends of chunks) in code that calls malloc.  This malloc
 guarantees not to modify any memory locations below the base of
 heap, i.e., static variables, even in the presence of usage
 errors.  The routines additionally detect most improper frees
 and reallocs.  All this holds as long as the static bookkeeping
 for malloc itself is not corrupted by some other means.  This
 is only one aspect of security -- these checks do not, and
 cannot, detect all possible programming errors.
 
 If FOOTERS is defined nonzero, then each allocated chunk
 carries an additional check word to verify that it was malloced
 from its space.  These check words are the same within each
 execution of a program using malloc, but differ across
 executions, so externally crafted fake chunks cannot be
 freed. This improves security by rejecting frees/reallocs that
 could corrupt heap memory, in addition to the checks preventing
 writes to statics that are always on.  This may further improve
 security at the expense of time and space overhead.  (Note that
 FOOTERS may also be worth using with MSPACES.)
 
 By default detected errors cause the program to abort (calling
 "abort()"). You can override this to instead proceed past
 errors by defining PROCEED_ON_ERROR.  In this case, a bad free
 has no effect, and a malloc that encounters a bad address
 caused by user overwrites will ignore the bad address by
 dropping pointers and indices to all known memory. This may
 be appropriate for programs that should continue if at all
 possible in the face of programming errors, although they may
 run out of memory because dropped memory is never reclaimed.
 
 If you don't like either of these options, you can define
 CORRUPTION_ERROR_ACTION and USAGE_ERROR_ACTION to do anything
 else. And if if you are sure that your program using malloc has
 no errors or vulnerabilities, you can define INSECURE to 1,
 which might (or might not) provide a small performance improvement.
 
 It is also possible to limit the maximum total allocatable
 space, using malloc_set_footprint_limit. This is not
 designed as a security feature in itself (calls to set limits
 are not screened or privileged), but may be useful as one
 aspect of a secure implementation.
 
 Thread-safety: NOT thread-safe unless USE_LOCKS defined non-zero
 When USE_LOCKS is defined, each public call to malloc, free,
 etc is surrounded with a lock. By default, this uses a plain
 pthread mutex, win32 critical section, or a spin-lock if if
 available for the platform and not disabled by setting
 USE_SPIN_LOCKS=0.  However, if USE_RECURSIVE_LOCKS is defined,
 recursive versions are used instead (which are not required for
 base functionality but may be needed in layered extensions).
 Using a global lock is not especially fast, and can be a major
 bottleneck.  It is designed only to provide minimal protection
 in concurrent environments, and to provide a basis for
 extensions.  If you are using malloc in a concurrent program,
 consider instead using nedmalloc
 (http://www.nedprod.com/programs/portable/nedmalloc/) or
 ptmalloc (See http://www.malloc.de), which are derived from
 versions of this malloc.
 
 System requirements: Any combination of MORECORE and/or MMAP/MUNMAP
 This malloc can use unix sbrk or any emulation (invoked using
 the CALL_MORECORE macro) and/or mmap/munmap or any emulation
 (invoked using CALL_MMAP/CALL_MUNMAP) to get and release system
 memory.  On most unix systems, it tends to work best if both
 MORECORE and MMAP are enabled.  On Win32, it uses emulations
 based on VirtualAlloc. It also uses common C library functions
 like memset.
 
 Compliance: I believe it is compliant with the Single Unix Specification
 (See http://www.unix.org). Also SVID/XPG, ANSI C, and probably
 others as well.
 
 * Overview of algorithms
 
 This is not the fastest, most space-conserving, most portable, or
 most tunable malloc ever written. However it is among the fastest
 while also being among the most space-conserving, portable and
 tunable.  Consistent balance across these factors results in a good
 general-purpose allocator for malloc-intensive programs.
 
 In most ways, this malloc is a best-fit allocator. Generally, it
 chooses the best-fitting existing chunk for a request, with ties
 broken in approximately least-recently-used order. (This strategy
 normally maintains low fragmentation.) However, for requests less
 than 256bytes, it deviates from best-fit when there is not an
 exactly fitting available chunk by preferring to use space adjacent
 to that used for the previous small request, as well as by breaking
 ties in approximately most-recently-used order. (These enhance
 locality of series of small allocations.)  And for very large requests
 (>= 256Kb by default), it relies on system memory mapping
 facilities, if supported.  (This helps avoid carrying around and
 possibly fragmenting memory used only for large chunks.)
 
 All operations (except malloc_stats and mallinfo) have execution
 times that are bounded by a constant factor of the number of bits in
 a size_t, not counting any clearing in calloc or copying in realloc,
 or actions surrounding MORECORE and MMAP that have times
 proportional to the number of non-contiguous regions returned by
 system allocation routines, which is often just 1. In real-time
 applications, you can optionally suppress segment traversals using
 NO_SEGMENT_TRAVERSAL, which assures bounded execution even when
 system allocators return non-contiguous spaces, at the typical
 expense of carrying around more memory and increased fragmentation.
 
 The implementation is not very modular and seriously overuses
 macros. Perhaps someday all C compilers will do as good a job
 inlining modular code as can now be done by brute-force expansion,
 but now, enough of them seem not to.
 
 Some compilers issue a lot of warnings about code that is
 dead/unreachable only on some platforms, and also about intentional
 uses of negation on unsigned types. All known cases of each can be
 ignored.
 
 For a longer but out of date high-level description, see
 http://gee.cs.oswego.edu/dl/html/malloc.html
 
 * MSPACES
 If MSPACES is defined, then in addition to malloc, free, etc.,
 this file also defines mspace_malloc, mspace_free, etc. These
 are versions of malloc routines that take an "mspace" argument
 obtained using create_mspace, to control all internal bookkeeping.
 If ONLY_MSPACES is defined, only these versions are compiled.
 So if you would like to use this allocator for only some allocations,
 and your system malloc for others, you can compile with
 ONLY_MSPACES and then do something like...
 static mspace mymspace = create_mspace(0,0); // for example
 #define mymalloc(bytes)  mspace_malloc(mymspace, bytes)
 
 (Note: If you only need one instance of an mspace, you can instead
 use "USE_DL_PREFIX" to relabel the global malloc.)
 
 You can similarly create thread-local allocators by storing
 mspaces as thread-locals. For example:
 static __thread mspace tlms = 0;
 void*  tlmalloc(size_t bytes) {
 if (tlms == 0) tlms = create_mspace(0, 0);
 return mspace_malloc(tlms, bytes);
 }
 void  tlfree(void* mem) { mspace_free(tlms, mem); }
 
 Unless FOOTERS is defined, each mspace is completely independent.
 You cannot allocate from one and free to another (although
 conformance is only weakly checked, so usage errors are not always
 caught). If FOOTERS is defined, then each chunk carries around a tag
 indicating its originating mspace, and frees are directed to their
 originating spaces. Normally, this requires use of locks.
 
 -------------------------  Compile-time options ---------------------------
 
 Be careful in setting #define values for numerical constants of type
 size_t. On some systems, literal values are not automatically extended
 to size_t precision unless they are explicitly casted. You can also
 use the symbolic values MAX_SIZE_T, SIZE_T_ONE, etc below.
 
 WIN32                    default: defined if _WIN32 defined
 Defining WIN32 sets up defaults for MS environment and compilers.
 Otherwise defaults are for unix. Beware that there seem to be some
 cases where this malloc might not be a pure drop-in replacement for
 Win32 malloc: Random-looking failures from Win32 GDI API's (eg;
 SetDIBits()) may be due to bugs in some video driver implementations
 when pixel buffers are malloc()ed, and the region spans more than
 one VirtualAlloc()ed region. Because dlmalloc uses a small (64Kb)
 default granularity, pixel buffers may straddle virtual allocation
 regions more often than when using the Microsoft allocator.  You can
 avoid this by using VirtualAlloc() and VirtualFree() for all pixel
 buffers rather than using malloc().  If this is not possible,
 recompile this malloc with a larger DEFAULT_GRANULARITY. Note:
 in cases where MSC and gcc (cygwin) are known to differ on WIN32,
 conditions use _MSC_VER to distinguish them.
 
 DLMALLOC_EXPORT       default: extern
 Defines how public APIs are declared. If you want to export via a
 Windows DLL, you might define this as
 #define DLMALLOC_EXPORT extern  __declspec(dllexport)
 If you want a POSIX ELF shared object, you might use
 #define DLMALLOC_EXPORT extern __attribute__((visibility("default")))
 
 MALLOC_ALIGNMENT         default: (size_t)(2 * sizeof(void *))
 Controls the minimum alignment for malloc'ed chunks.  It must be a
 power of two and at least 8, even on machines for which smaller
 alignments would suffice. It may be defined as larger than this
 though. Note however that code and data structures are optimized for
 the case of 8-byte alignment.
 
 MSPACES                  default: 0 (false)
 If true, compile in support for independent allocation spaces.
 This is only supported if HAVE_MMAP is true.
 
 ONLY_MSPACES             default: 0 (false)
 If true, only compile in mspace versions, not regular versions.
 
 USE_LOCKS                default: 0 (false)
 Causes each call to each public routine to be surrounded with
 pthread or WIN32 mutex lock/unlock. (If set true, this can be
 overridden on a per-mspace basis for mspace versions.) If set to a
 non-zero value other than 1, locks are used, but their
 implementation is left out, so lock functions must be supplied manually,
 as described below.
 
 USE_SPIN_LOCKS           default: 1 iff USE_LOCKS and spin locks available
 If true, uses custom spin locks for locking. This is currently
 supported only gcc >= 4.1, older gccs on x86 platforms, and recent
 MS compilers.  Otherwise, posix locks or win32 critical sections are
 used.
 
 USE_RECURSIVE_LOCKS      default: not defined
 If defined nonzero, uses recursive (aka reentrant) locks, otherwise
 uses plain mutexes. This is not required for malloc proper, but may
 be needed for layered allocators such as nedmalloc.
 
 LOCK_AT_FORK            default: not defined
 If defined nonzero, performs pthread_atfork upon initialization
 to initialize child lock while holding parent lock. The implementation
 assumes that pthread locks (not custom locks) are being used. In other
 cases, you may need to customize the implementation.
 
 FOOTERS                  default: 0
 If true, provide extra checking and dispatching by placing
 information in the footers of allocated chunks. This adds
 space and time overhead.
 
 INSECURE                 default: 0
 If true, omit checks for usage errors and heap space overwrites.
 
 USE_DL_PREFIX            default: NOT defined
 Causes compiler to prefix all public routines with the string 'dl'.
 This can be useful when you only want to use this malloc in one part
 of a program, using your regular system malloc elsewhere.
 
 MALLOC_INSPECT_ALL       default: NOT defined
 If defined, compiles malloc_inspect_all and mspace_inspect_all, that
 perform traversal of all heap space.  Unless access to these
 functions is otherwise restricted, you probably do not want to
 include them in secure implementations.
 
 ABORT                    default: defined as abort()
 Defines how to abort on failed checks.  On most systems, a failed
 check cannot die with an "assert" or even print an informative
 message, because the underlying print routines in turn call malloc,
 which will fail again.  Generally, the best policy is to simply call
 abort(). It's not very useful to do more than this because many
 errors due to overwriting will show up as address faults (null, odd
 addresses etc) rather than malloc-triggered checks, so will also
 abort.  Also, most compilers know that abort() does not return, so
 can better optimize code conditionally calling it.
 
 PROCEED_ON_ERROR           default: defined as 0 (false)
 Controls whether detected bad addresses cause them to bypassed
 rather than aborting. If set, detected bad arguments to free and
 realloc are ignored. And all bookkeeping information is zeroed out
 upon a detected overwrite of freed heap space, thus losing the
 ability to ever return it from malloc again, but enabling the
 application to proceed. If PROCEED_ON_ERROR is defined, the
 static variable malloc_corruption_error_count is compiled in
 and can be examined to see if errors have occurred. This option
 generates slower code than the default abort policy.
 
 DEBUG                    default: NOT defined
 The DEBUG setting is mainly intended for people trying to modify
 this code or diagnose problems when porting to new platforms.
 However, it may also be able to better isolate user errors than just
 using runtime checks.  The assertions in the check routines spell
 out in more detail the assumptions and invariants underlying the
 algorithms.  The checking is fairly extensive, and will slow down
 execution noticeably. Calling malloc_stats or mallinfo with DEBUG
 set will attempt to check every non-mmapped allocated and free chunk
 in the course of computing the summaries.
 
 ABORT_ON_ASSERT_FAILURE   default: defined as 1 (true)
 Debugging assertion failures can be nearly impossible if your
 version of the assert macro causes malloc to be called, which will
 lead to a cascade of further failures, blowing the runtime stack.
 ABORT_ON_ASSERT_FAILURE cause assertions failures to call abort(),
 which will usually make debugging easier.
 
 MALLOC_FAILURE_ACTION     default: sets errno to ENOMEM, or no-op on win32
 The action to take before "return 0" when malloc fails to be able to
 return memory because there is none available.
 
 HAVE_MORECORE             default: 1 (true) unless win32 or ONLY_MSPACES
 True if this system supports sbrk or an emulation of it.
 
 MORECORE                  default: sbrk
 The name of the sbrk-style system routine to call to obtain more
 memory.  See below for guidance on writing custom MORECORE
 functions. The type of the argument to sbrk/MORECORE varies across
 systems.  It cannot be size_t, because it supports negative
 arguments, so it is normally the signed type of the same width as
 size_t (sometimes declared as "intptr_t").  It doesn't much matter
 though. Internally, we only call it with arguments less than half
 the max value of a size_t, which should work across all reasonable
 possibilities, although sometimes generating compiler warnings.
 
 MORECORE_CONTIGUOUS       default: 1 (true) if HAVE_MORECORE
 If true, take advantage of fact that consecutive calls to MORECORE
 with positive arguments always return contiguous increasing
 addresses.  This is true of unix sbrk. It does not hurt too much to
 set it true anyway, since malloc copes with non-contiguities.
 Setting it false when definitely non-contiguous saves time
 and possibly wasted space it would take to discover this though.
 
 UNSIGNED_MORECORE         default: 0 (false)
 True if MORECORE can only handle unsigned arguments. This sets
 MORECORE_CANNOT_TRIM to 1 (true).

 MORECORE_CANNOT_TRIM      default: NOT defined
 True if MORECORE cannot release space back to the system when given
 negative arguments. This is generally necessary only if you are
 using a hand-crafted MORECORE function that cannot handle negative
 arguments.
 
 NO_SEGMENT_TRAVERSAL       default: 0
 If non-zero, suppresses traversals of memory segments
 returned by either MORECORE or CALL_MMAP. This disables
 merging of segments that are contiguous, and selectively
 releasing them to the OS if unused, but bounds execution times.
 
 HAVE_MMAP                 default: 1 (true)
 True if this system supports mmap or an emulation of it.  If so, and
 HAVE_MORECORE is not true, MMAP is used for all system
 allocation. If set and HAVE_MORECORE is true as well, MMAP is
 primarily used to directly allocate very large blocks. It is also
 used as a backup strategy in cases where MORECORE fails to provide
 space from system. Note: A single call to MUNMAP is assumed to be
 able to unmap memory that may have be allocated using multiple calls
 to MMAP, so long as they are adjacent.
 
 HAVE_MREMAP               default: 1 on linux, else 0
 If true realloc() uses mremap() to re-allocate large blocks and
 extend or shrink allocation spaces.
 
 MMAP_CLEARS               default: 1 except on WINCE.
 True if mmap clears memory so calloc doesn't need to. This is true
 for standard unix mmap using /dev/zero and on WIN32 except for WINCE.
 
 USE_BUILTIN_FFS            default: 0 (i.e., not used)
 Causes malloc to use the builtin ffs() function to compute indices.
 Some compilers may recognize and intrinsify ffs to be faster than the
 supplied C version. Also, the case of x86 using gcc is special-cased
 to an asm instruction, so is already as fast as it can be, and so
 this setting has no effect. Similarly for Win32 under recent MS compilers.
 (On most x86s, the asm version is only slightly faster than the C version.)
 
 malloc_getpagesize         default: derive from system includes, or 4096.
 The system page size. To the extent possible, this malloc manages
 memory from the system in page-size units.  This may be (and
 usually is) a function rather than a constant. This is ignored
 if WIN32, where page size is determined using getSystemInfo during
 initialization.
 
 USE_DEV_RANDOM             default: 0 (i.e., not used)
 Causes malloc to use /dev/random to initialize secure magic seed for
 stamping footers. Otherwise, the current time is used.
 
 NO_MALLINFO                default: 0
 If defined, don't compile "mallinfo". This can be a simple way
 of dealing with mismatches between system declarations and
 those in this file.
 
 MALLINFO_FIELD_TYPE        default: size_t
 The type of the fields in the mallinfo struct. This was originally
 defined as "int" in SVID etc, but is more usefully defined as
 size_t. The value is used only if  HAVE_USR_INCLUDE_MALLOC_H is not set
 
 NO_MALLOC_STATS            default: 0
 If defined, don't compile "malloc_stats". This avoids calls to
 fprintf and bringing in stdio dependencies you might not want.
 
 REALLOC_ZERO_BYTES_FREES    default: not defined
 This should be set if a call to realloc with zero bytes should
 be the same as a call to free. Some people think it should. Otherwise,
 since this malloc returns a unique pointer for malloc(0), so does
 realloc(p, 0).
 
 LACKS_UNISTD_H, LACKS_FCNTL_H, LACKS_SYS_PARAM_H, LACKS_SYS_MMAN_H
 LACKS_STRINGS_H, LACKS_STRING_H, LACKS_SYS_TYPES_H,  LACKS_ERRNO_H
 LACKS_STDLIB_H LACKS_SCHED_H LACKS_TIME_H  default: NOT defined unless on WIN32
 Define these if your system does not have these header files.
 You might need to manually insert some of the declarations they provide.
 
 DEFAULT_GRANULARITY        default: page size if MORECORE_CONTIGUOUS,
 system_info.dwAllocationGranularity in WIN32,
 otherwise 64K.
 Also settable using mallopt(M_GRANULARITY, x)
 The unit for allocating and deallocating memory from the system.  On
 most systems with contiguous MORECORE, there is no reason to
 make this more than a page. However, systems with MMAP tend to
 either require or encourage larger granularities.  You can increase
 this value to prevent system allocation functions to be called so
 often, especially if they are slow.  The value must be at least one
 page and must be a power of two.  Setting to 0 causes initialization
 to either page size or win32 region size.  (Note: In previous
 versions of malloc, the equivalent of this option was called
 "TOP_PAD")
 
 DEFAULT_TRIM_THRESHOLD    default: 2MB
 Also settable using mallopt(M_TRIM_THRESHOLD, x)
 The maximum amount of unused top-most memory to keep before
 releasing via malloc_trim in free().  Automatic trimming is mainly
 useful in long-lived programs using contiguous MORECORE.  Because
 trimming via sbrk can be slow on some systems, and can sometimes be
 wasteful (in cases where programs immediately afterward allocate
 more large chunks) the value should be high enough so that your
 overall system performance would improve by releasing this much
 memory.  As a rough guide, you might set to a value close to the
 average size of a process (program) running on your system.
 Releasing this much memory would allow such a process to run in
 memory.  Generally, it is worth tuning trim thresholds when a
 program undergoes phases where several large chunks are allocated
 and released in ways that can reuse each other's storage, perhaps
 mixed with phases where there are no such chunks at all. The trim
 value must be greater than page size to have any useful effect.  To
 disable trimming completely, you can set to MAX_SIZE_T. Note that the trick
 some people use of mallocing a huge space and then freeing it at
 program startup, in an attempt to reserve system memory, doesn't
 have the intended effect under automatic trimming, since that memory
 will immediately be returned to the system.
 
 DEFAULT_MMAP_THRESHOLD       default: 256K
 Also settable using mallopt(M_MMAP_THRESHOLD, x)
 The request size threshold for using MMAP to directly service a
 request. Requests of at least this size that cannot be allocated
 using already-existing space will be serviced via mmap.  (If enough
 normal freed space already exists it is used instead.)  Using mmap
 segregates relatively large chunks of memory so that they can be
 individually obtained and released from the host system. A request
 serviced through mmap is never reused by any other request (at least
 not directly; the system may just so happen to remap successive
 requests to the same locations).  Segregating space in this way has
 the benefits that: Mmapped space can always be individually released
 back to the system, which helps keep the system level memory demands
 of a long-lived program low.  Also, mapped memory doesn't become
 `locked' between other chunks, as can happen with normally allocated
 chunks, which means that even trimming via malloc_trim would not
 release them.  However, it has the disadvantage that the space
 cannot be reclaimed, consolidated, and then used to service later
 requests, as happens with normal chunks.  The advantages of mmap
 nearly always outweigh disadvantages for "large" chunks, but the
 value of "large" may vary across systems.  The default is an
 empirically derived value that works well in most systems. You can
 disable mmap by setting to MAX_SIZE_T.
 
 MAX_RELEASE_CHECK_RATE   default: 4095 unless not HAVE_MMAP
 The number of consolidated frees between checks to release
 unused segments when freeing. When using non-contiguous segments,
 especially with multiple mspaces, checking only for topmost space
 doesn't always suffice to trigger trimming. To compensate for this,
 free() will, with a period of MAX_RELEASE_CHECK_RATE (or the
 current number of segments, if greater) try to release unused
 segments to the OS when freeing chunks that result in
 consolidation. The best value for this parameter is a compromise
 between slowing down frees with relatively costly checks that
 rarely trigger versus holding on to unused memory. To effectively
 disable, set to MAX_SIZE_T. This may lead to a very slight speed
 improvement at the expense of carrying around more memory.
 */

/* Version identifier to allow people to support multiple versions */

/* DLMALLOC_VERSION */

/* _WIN32 */

/* _WIN32_WCE */

/* WIN32 */

/* MALLOC_FAILURE_ACTION */

/* WINCE reportedly does not clear */

/* _WIN32_WCE */

/*MMAP_CLEARS */

/* WIN32 */

/* Mac OSX docs advise not to use sbrk; it seems better to use mmap */

/* OSX allocators provide 16 byte alignment */

/* HAVE_MORECORE */

/* DARWIN */

/* For size_t */

/* LACKS_SYS_TYPES_H */

/* The maximum possible size_t value has all bits set */

/* ensure true if spin or recursive locks set */

/* XXX: The following block adapted locally to avoid
        clean up new Clang -Wexpansion-to-defined warnings.
        http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160118/147239.html */

/* USE_LOCKS */

/* Spin locks for gcc >= 4.1, older gcc on x86, MSC >= 1310 */

/* USE_SPIN_LOCKS */

/* ... locks available... */

/* USE_LOCKS */

/* ONLY_MSPACES */

/* ONLY_MSPACES */

/* ONLY_MSPACES */

/* MSPACES */

/* MALLOC_ALIGNMENT */

/* FOOTERS */

/* ABORT */

/* ABORT_ON_ASSERT_FAILURE */

/* PROCEED_ON_ERROR */

/* INSECURE */

/* MALLOC_INSPECT_ALL */

/* HAVE_MMAP */

/* MMAP_CLEARS */

/* Turns on mremap() definition */

/* linux */

/* linux */

/* HAVE_MREMAP */

/* MALLOC_FAILURE_ACTION */

/* ONLY_MSPACES */

/* ONLY_MSPACES */

/* HAVE_MORECORE */

/* UNSIGNED_MORECORE */

/* UNSIGNED_MORECORE */

/* !HAVE_MORECORE */

/* MORECORE_CONTIGUOUS */

/* HAVE_MORECORE */

/* 0 means to compute in init_mparams */

/* MORECORE_CONTIGUOUS */

/* MORECORE_CONTIGUOUS */

/* DEFAULT_GRANULARITY */

/* MORECORE_CANNOT_TRIM */

/* MORECORE_CANNOT_TRIM */

/* DEFAULT_TRIM_THRESHOLD */

/* HAVE_MMAP */

/* HAVE_MMAP */

/* DEFAULT_MMAP_THRESHOLD */

/* HAVE_MMAP */

/* MAX_RELEASE_CHECK_RATE */

/* USE_BUILTIN_FFS */

/* USE_DEV_RANDOM */

/* NO_MALLINFO */

/* MALLINFO_FIELD_TYPE */

/* NO_MALLOC_STATS */

/* NO_SEGMENT_TRAVERSAL */

/*
 mallopt tuning options.  SVID/XPG defines four standard parameter
 numbers for mallopt, normally defined in malloc.h.  None of these
 are used in this malloc, so setting them has no effect. But this
 malloc does support the following options.
 */

/* ------------------------ Mallinfo declarations ------------------------ */

/*
 This version of malloc supports the standard SVID/XPG mallinfo
 routine that returns a struct containing usage properties and
 statistics. It should work on any system that has a
 /usr/include/malloc.h defining struct mallinfo.  The main
 declaration needed is the mallinfo struct that is returned (by-copy)
 by mallinfo().  The malloinfo struct contains a bunch of fields that
 are not even meaningful in this version of malloc.  These fields are
 are instead filled by mallinfo() with other numbers that might be of
 interest.
 
 HAVE_USR_INCLUDE_MALLOC_H should be set if you have a
 /usr/include/malloc.h file that includes a declaration of struct
 mallinfo.  If so, it is included; else a compliant version is
 declared below.  These must be precisely the same for mallinfo() to
 work.  The original SVID version of this struct, defined on most
 systems with mallinfo, declares all fields as ints. But some others
 define as unsigned long. If your system defines the fields using a
 type of different width than listed here, you MUST #include your
 system version and #define HAVE_USR_INCLUDE_MALLOC_H.
 */

/* #define HAVE_USR_INCLUDE_MALLOC_H */

/* HAVE_USR_INCLUDE_MALLOC_H */

/* HP-UX (and others?) redefines mallinfo unless _STRUCT_MALLINFO is defined */

/* non-mmapped space allocated from system */

/* number of free chunks */

/* always 0 */

/* always 0 */

/* space in mmapped regions */

/* maximum total allocated space */

/* always 0 */

/* total allocated space */

/* total free space */

/* releasable (via malloc_trim) space */

/* STRUCT_MALLINFO_DECLARED */

/* HAVE_USR_INCLUDE_MALLOC_H */

/* NO_MALLINFO */

/*
 Try to persuade compilers to inline. The most critical functions for
 inlining are defined as macros, so these aren't used for them.
 */

/* __cplusplus */

/* ------------------- Declarations of public routines ------------------- */

// XXX Emscripten XXX

/*__EMSCRIPTEN__*/

/* USE_DL_PREFIX */

/*
     malloc(size_t n)
     Returns a pointer to a newly allocated chunk of at least n bytes, or
     null if no space is available, in which case errno is set to ENOMEM
     on ANSI C systems.
     
     If n is zero, malloc returns a minimum-sized chunk. (The minimum
     size is 16 bytes on most 32bit systems, and 32 bytes on 64bit
     systems.)  Note that size_t is an unsigned type, so calls with
     arguments that would be negative if signed are interpreted as
     requests for huge amounts of space, which will often fail. The
     maximum supported value of n differs across systems, but is in all
     cases less than the maximum representable value of a size_t.
     */

/*
     free(void* p)
     Releases the chunk of memory pointed to by p, that had been previously
     allocated using malloc or a related routine such as realloc.
     It has no effect if p is null. If p was not malloced or already
     freed, free(p) will by default cause the current program to abort.
     */

/*
     calloc(size_t n_elements, size_t element_size);
     Returns a pointer to n_elements * element_size bytes, with all locations
     set to zero.
     */

/*
     realloc(void* p, size_t n)
     Returns a pointer to a chunk of size n that contains the same data
     as does chunk p up to the minimum of (n, p's size) bytes, or null
     if no space is available.
     
     The returned pointer may or may not be the same as p. The algorithm
     prefers extending p in most cases when possible, otherwise it
     employs the equivalent of a malloc-copy-free sequence.
     
     If p is null, realloc is equivalent to malloc.
     
     If space is not available, realloc returns null, errno is set (if on
     ANSI) and p is NOT freed.
     
     if n is for fewer bytes than already held by p, the newly unused
     space is lopped off and freed if possible.  realloc with a size
     argument of zero (re)allocates a minimum-sized chunk.
     
     The old unix realloc convention of allowing the last-free'd chunk
     to be used as an argument to realloc is not supported.
     */

/*
     realloc_in_place(void* p, size_t n)
     Resizes the space allocated for p to size n, only if this can be
     done without moving p (i.e., only if there is adjacent space
     available if n is greater than p's current allocated size, or n is
     less than or equal to p's size). This may be used instead of plain
     realloc if an alternative allocation strategy is needed upon failure
     to expand space; for example, reallocation of a buffer that must be
     memory-aligned or cleared. You can use realloc_in_place to trigger
     these alternatives only when needed.
     
     Returns p if successful; otherwise null.
     */

/*
     memalign(size_t alignment, size_t n);
     Returns a pointer to a newly allocated chunk of n bytes, aligned
     in accord with the alignment argument.
     
     The alignment argument should be a power of two. If the argument is
     not a power of two, the nearest greater power is used.
     8-byte alignment is guaranteed by normal malloc calls, so don't
     bother calling memalign with an argument of 8 or less.
     
     Overreliance on memalign is a sure way to fragment space.
     */

/*
     int posix_memalign(void** pp, size_t alignment, size_t n);
     Allocates a chunk of n bytes, aligned in accord with the alignment
     argument. Differs from memalign only in that it (1) assigns the
     allocated memory to *pp rather than returning it, (2) fails and
     returns EINVAL if the alignment is not a power of two (3) fails and
     returns ENOMEM if memory cannot be allocated.
     */

/*
     valloc(size_t n);
     Equivalent to memalign(pagesize, n), where pagesize is the page
     size of the system. If the pagesize is unknown, 4096 is used.
     */

/*
     mallopt(int parameter_number, int parameter_value)
     Sets tunable parameters The format is to provide a
     (parameter-number, parameter-value) pair.  mallopt then sets the
     corresponding parameter to the argument value if it can (i.e., so
     long as the value is meaningful), and returns 1 if successful else
     0.  To workaround the fact that mallopt is specified to use int,
     not size_t parameters, the value -1 is specially treated as the
     maximum unsigned size_t value.
     
     SVID/XPG/ANSI defines four standard param numbers for mallopt,
     normally defined in malloc.h.  None of these are use in this malloc,
     so setting them has no effect. But this malloc also supports other
     options in mallopt. See below for details.  Briefly, supported
     parameters are as follows (listed defaults are for "typical"
     configurations).
     
     Symbol            param #  default    allowed param values
     M_TRIM_THRESHOLD     -1   2*1024*1024   any   (-1 disables)
     M_GRANULARITY        -2     page size   any power of 2 >= page size
     M_MMAP_THRESHOLD     -3      256*1024   any   (or 0 if no MMAP support)
     */

/*
     malloc_footprint();
     Returns the number of bytes obtained from the system.  The total
     number of bytes allocated by malloc, realloc etc., is less than this
     value. Unlike mallinfo, this function returns only a precomputed
     result, so can be called frequently to monitor memory consumption.
     Even if locks are otherwise defined, this function does not use them,
     so results might not be up to date.
     */

/*
     malloc_max_footprint();
     Returns the maximum number of bytes obtained from the system. This
     value will be greater than current footprint if deallocated space
     has been reclaimed by the system. The peak number of bytes allocated
     by malloc, realloc etc., is less than this value. Unlike mallinfo,
     this function returns only a precomputed result, so can be called
     frequently to monitor memory consumption.  Even if locks are
     otherwise defined, this function does not use them, so results might
     not be up to date.
     */

/*
     malloc_footprint_limit();
     Returns the number of bytes that the heap is allowed to obtain from
     the system, returning the last value returned by
     malloc_set_footprint_limit, or the maximum size_t value if
     never set. The returned value reflects a permission. There is no
     guarantee that this number of bytes can actually be obtained from
     the system.
     */

/*
     malloc_set_footprint_limit();
     Sets the maximum number of bytes to obtain from the system, causing
     failure returns from malloc and related functions upon attempts to
     exceed this value. The argument value may be subject to page
     rounding to an enforceable limit; this actual value is returned.
     Using an argument of the maximum possible size_t effectively
     disables checks. If the argument is less than or equal to the
     current malloc_footprint, then all future allocations that require
     additional system memory will fail. However, invocation cannot
     retroactively deallocate existing used memory.
     */

/*
     malloc_inspect_all(void(*handler)(void *start,
     void *end,
     size_t used_bytes,
     void* callback_arg),
     void* arg);
     Traverses the heap and calls the given handler for each managed
     region, skipping all bytes that are (or may be) used for bookkeeping
     purposes.  Traversal does not include include chunks that have been
     directly memory mapped. Each reported region begins at the start
     address, and continues up to but not including the end address.  The
     first used_bytes of the region contain allocated data. If
     used_bytes is zero, the region is unallocated. The handler is
     invoked with the given callback argument. If locks are defined, they
     are held during the entire traversal. It is a bad idea to invoke
     other malloc functions from within the handler.
     
     For example, to count the number of in-use chunks with size greater
     than 1000, you could write:
     static int count = 0;
     void count_chunks(void* start, void* end, size_t used, void* arg) {
     if (used >= 1000) ++count;
     }
     then:
     malloc_inspect_all(count_chunks, NULL);
     
     malloc_inspect_all is compiled only if MALLOC_INSPECT_ALL is defined.
     */

/* MALLOC_INSPECT_ALL */

/*
     mallinfo()
     Returns (by copy) a struct containing various summary statistics:
     
     arena:     current total non-mmapped bytes allocated from system
     ordblks:   the number of free chunks
     smblks:    always zero.
     hblks:     current number of mmapped regions
     hblkhd:    total bytes held in mmapped regions
     usmblks:   the maximum total allocated space. This will be greater
     than current total if trimming has occurred.
     fsmblks:   always zero
     uordblks:  current total allocated space (normal or mmapped)
     fordblks:  total free space
     keepcost:  the maximum number of bytes that could ideally be released
     back to system via malloc_trim. ("ideally" means that
     it ignores page restrictions etc.)
     
     Because these fields are ints, but internal bookkeeping may
     be kept as longs, the reported values may wrap around zero and
     thus be inaccurate.
     */

/* NO_MALLINFO */

/*
     independent_calloc(size_t n_elements, size_t element_size, void* chunks[]);
     
     independent_calloc is similar to calloc, but instead of returning a
     single cleared space, it returns an array of pointers to n_elements
     independent elements that can hold contents of size elem_size, each
     of which starts out cleared, and can be independently freed,
     realloc'ed etc. The elements are guaranteed to be adjacently
     allocated (this is not guaranteed to occur with multiple callocs or
     mallocs), which may also improve cache locality in some
     applications.
     
     The "chunks" argument is optional (i.e., may be null, which is
     probably the most typical usage). If it is null, the returned array
     is itself dynamically allocated and should also be freed when it is
     no longer needed. Otherwise, the chunks array must be of at least
     n_elements in length. It is filled in with the pointers to the
     chunks.
     
     In either case, independent_calloc returns this pointer array, or
     null if the allocation failed.  If n_elements is zero and "chunks"
     is null, it returns a chunk representing an array with zero elements
     (which should be freed if not wanted).
     
     Each element must be freed when it is no longer needed. This can be
     done all at once using bulk_free.
     
     independent_calloc simplifies and speeds up implementations of many
     kinds of pools.  It may also be useful when constructing large data
     structures that initially have a fixed number of fixed-sized nodes,
     but the number is not known at compile time, and some of the nodes
     may later need to be freed. For example:
     
     struct Node { int item; struct Node* next; };
     
     struct Node* build_list() {
     struct Node** pool;
     int n = read_number_of_nodes_needed();
     if (n <= 0) return 0;
     pool = (struct Node**)(independent_calloc(n, sizeof(struct Node), 0);
     if (pool == 0) die();
     // organize into a linked list...
     struct Node* first = pool[0];
     for (i = 0; i < n-1; ++i)
     pool[i]->next = pool[i+1];
     free(pool);     // Can now free the array (or not, if it is needed later)
     return first;
     }
     */

/*
     independent_comalloc(size_t n_elements, size_t sizes[], void* chunks[]);
     
     independent_comalloc allocates, all at once, a set of n_elements
     chunks with sizes indicated in the "sizes" array.    It returns
     an array of pointers to these elements, each of which can be
     independently freed, realloc'ed etc. The elements are guaranteed to
     be adjacently allocated (this is not guaranteed to occur with
     multiple callocs or mallocs), which may also improve cache locality
     in some applications.
     
     The "chunks" argument is optional (i.e., may be null). If it is null
     the returned array is itself dynamically allocated and should also
     be freed when it is no longer needed. Otherwise, the chunks array
     must be of at least n_elements in length. It is filled in with the
     pointers to the chunks.
     
     In either case, independent_comalloc returns this pointer array, or
     null if the allocation failed.  If n_elements is zero and chunks is
     null, it returns a chunk representing an array with zero elements
     (which should be freed if not wanted).
     
     Each element must be freed when it is no longer needed. This can be
     done all at once using bulk_free.
     
     independent_comallac differs from independent_calloc in that each
     element may have a different size, and also that it does not
     automatically clear elements.
     
     independent_comalloc can be used to speed up allocation in cases
     where several structs or objects must always be allocated at the
     same time.  For example:
     
     struct Head { ... }
     struct Foot { ... }
     
     void send_message(char* msg) {
     int msglen = strlen(msg);
     size_t sizes[3] = { sizeof(struct Head), msglen, sizeof(struct Foot) };
     void* chunks[3];
     if (independent_comalloc(3, sizes, chunks) == 0)
     die();
     struct Head* head = (struct Head*)(chunks[0]);
     char*        body = (char*)(chunks[1]);
     struct Foot* foot = (struct Foot*)(chunks[2]);
     // ...
     }
     
     In general though, independent_comalloc is worth using only for
     larger values of n_elements. For small values, you probably won't
     detect enough difference from series of malloc calls to bother.
     
     Overuse of independent_comalloc can increase overall memory usage,
     since it cannot reuse existing noncontiguous small chunks that
     might be available for some of the elements.
     */

/*
     bulk_free(void* array[], size_t n_elements)
     Frees and clears (sets to null) each non-null pointer in the given
     array.  This is likely to be faster than freeing them one-by-one.
     If footers are used, pointers that have been allocated in different
     mspaces are not freed or cleared, and the count of all such pointers
     is returned.  For large arrays of pointers with poor locality, it
     may be worthwhile to sort this array before calling bulk_free.
     */

/*
     pvalloc(size_t n);
     Equivalent to valloc(minimum-page-that-holds(n)), that is,
     round up n to nearest pagesize.
     */

/*
     malloc_trim(size_t pad);
     
     If possible, gives memory back to the system (via negative arguments
     to sbrk) if there is unused memory at the `high' end of the malloc
     pool or in unused MMAP segments. You can call this after freeing
     large blocks of memory to potentially reduce the system-level memory
     requirements of a program. However, it cannot guarantee to reduce
     memory. Under some allocation patterns, some large free blocks of
     memory will be locked between two used chunks, so they cannot be
     given back to the system.
     
     The `pad' argument to malloc_trim represents the amount of free
     trailing space to leave untrimmed. If this argument is zero, only
     the minimum amount of memory to maintain internal data structures
     will be left. Non-zero arguments can be supplied to maintain enough
     trailing space to service future expected allocations without having
     to re-obtain memory from the system.
     
     Malloc_trim returns 1 if it actually released any memory, else 0.
     */

/*
     malloc_stats();
     Prints on stderr the amount of space obtained from the system (both
     via sbrk and mmap), the maximum amount (which may be more than
     current if malloc_trim and/or munmap got called), and the current
     number of bytes allocated via malloc (or realloc, etc) but not yet
     freed. Note that this is the number of bytes allocated, not the
     number requested. It will be larger than the number requested
     because of alignment and bookkeeping overhead. Because it includes
     alignment wastage as being in use, this figure may be greater than
     zero even when no user-level chunks are allocated.
     
     The reported current and maximum system memory can be inaccurate if
     a program makes other calls to system memory allocation functions
     (normally sbrk) outside of malloc.
     
     malloc_stats prints only the most commonly interesting statistics.
     More information can be obtained by calling mallinfo.
     */

/*
     malloc_usable_size(void* p);
     
     Returns the number of bytes you can actually use in
     an allocated chunk, which may be more than you requested (although
     often not) due to alignment and minimum size constraints.
     You can use this many bytes without worrying about
     overwriting other allocated objects. This is not a particularly great
     programming practice. malloc_usable_size can be more useful in
     debugging and assertions, for example:
     
     p = malloc(n);
     assert(malloc_usable_size(p) >= 256);
     */

/* XXX EMSCRIPTEN: mark for export (and therefore weak) */

/* ONLY_MSPACES */

/*
     mspace is an opaque type representing an independent
     region of space that supports mspace_malloc, etc.
     */

/*
     create_mspace creates and returns a new independent space with the
     given initial capacity, or, if 0, the default granularity size.  It
     returns null if there is no system memory available to create the
     space.  If argument locked is non-zero, the space uses a separate
     lock to control access. The capacity of the space will grow
     dynamically as needed to service mspace_malloc requests.  You can
     control the sizes of incremental increases of this space by
     compiling with a different DEFAULT_GRANULARITY or dynamically
     setting with mallopt(M_GRANULARITY, value).
     */

/*
     destroy_mspace destroys the given space, and attempts to return all
     of its memory back to the system, returning the total number of
     bytes freed. After destruction, the results of access to all memory
     used by the space become undefined.
     */

/*
     create_mspace_with_base uses the memory supplied as the initial base
     of a new mspace. Part (less than 128*sizeof(size_t) bytes) of this
     space is used for bookkeeping, so the capacity must be at least this
     large. (Otherwise 0 is returned.) When this initial space is
     exhausted, additional memory will be obtained from the system.
     Destroying this space will deallocate all additionally allocated
     space (if possible) but not the initial base.
     */

/*
     mspace_track_large_chunks controls whether requests for large chunks
     are allocated in their own untracked mmapped regions, separate from
     others in this mspace. By default large chunks are not tracked,
     which reduces fragmentation. However, such chunks are not
     necessarily released to the system upon destroy_mspace.  Enabling
     tracking by setting to true may increase fragmentation, but avoids
     leakage when relying on destroy_mspace to release all memory
     allocated using this space.  The function returns the previous
     setting.
     */

/*
     mspace_malloc behaves as malloc, but operates within
     the given space.
     */

/*
     mspace_free behaves as free, but operates within
     the given space.
     
     If compiled with FOOTERS==1, mspace_free is not actually needed.
     free may be called instead of mspace_free because freed chunks from
     any space are handled by their originating spaces.
     */

/*
     mspace_realloc behaves as realloc, but operates within
     the given space.
     
     If compiled with FOOTERS==1, mspace_realloc is not actually
     needed.  realloc may be called instead of mspace_realloc because
     realloced chunks from any space are handled by their originating
     spaces.
     */

/*
     mspace_calloc behaves as calloc, but operates within
     the given space.
     */

/*
     mspace_memalign behaves as memalign, but operates within
     the given space.
     */

/*
     mspace_independent_calloc behaves as independent_calloc, but
     operates within the given space.
     */

/*
     mspace_independent_comalloc behaves as independent_comalloc, but
     operates within the given space.
     */

/*
     mspace_footprint() returns the number of bytes obtained from the
     system for this space.
     */

/*
     mspace_max_footprint() returns the peak number of bytes obtained from the
     system for this space.
     */

/*
     mspace_mallinfo behaves as mallinfo, but reports properties of
     the given space.
     */

/* NO_MALLINFO */

/*
     malloc_usable_size(void* p) behaves the same as malloc_usable_size;
     */

/*
     mspace_malloc_stats behaves as malloc_stats, but reports
     properties of the given space.
     */

/*
     mspace_trim behaves as malloc_trim, but
     operates within the given space.
     */

/*
     An alias for mallopt.
     */

/* MSPACES */

/* end of extern "C" */

/* __cplusplus */

/*
 ========================================================================
 To make a fully customizable malloc.h header file, cut everything
 above this line, put into file malloc.h, edit to suit, and #include it
 on the next line, as well as in programs that use this malloc.
 ========================================================================
 */

/* #include "malloc.h" */

/*------------------------------ internal #includes ---------------------- */

/* no "unsigned" warnings */

/* _MSC_VER */

/* for printing in malloc_stats */

/* NO_MALLOC_STATS */

/* for MALLOC_FAILURE_ACTION */

/* LACKS_ERRNO_H */

/* ABORT_ON_ASSERT_FAILURE */

/* ABORT_ON_ASSERT_FAILURE */

/* DEBUG */

/* DEBUG */

/* for magic initialization */

/* WIN32 */

/* for abort() */

/* LACKS_STDLIB_H */

/* for memset etc */

/* LACKS_STRING_H */

/* for ffs */

/* LACKS_STRINGS_H */

/* USE_BUILTIN_FFS */

/* On some versions of linux, mremap decl in mman.h needs __USE_GNU set */

/* for mmap */

/* for mmap */

/* linux */

/* LACKS_SYS_MMAN_H */

/* LACKS_FCNTL_H */

/* HAVE_MMAP */

/* for sbrk, sysconf */

/* LACKS_UNISTD_H */

/* FreeBSD etc */

/* LACKS_UNISTD_H */

/* Declarations for locking */

/* solaris */

/* solaris or LACKS_SCHED_H */

/* USE_RECURSIVE_LOCKS ... */

/* These are already defined on AMD64 builds */

/* __cplusplus */

/* __cplusplus */

/* _M_AMD64 */

/* Win32 */

/* USE_LOCKS */

/* USE_LOCKS */

/* Declarations for bit scanning on win32 */

/* Try to avoid pulling in WinNT.h */

/* __cplusplus */

/* __cplusplus */

/* BitScanForward */

/* defined(_MSC_VER) && _MSC_VER>=1300 */

/* some SVR4 systems omit an underscore */

/* avoid sysconf calls during startup */

/* use supplied emulation of getpagesize */

/* just guess */

/* ------------------- size_t and alignment properties -------------------- */

/* The byte and bit size of a size_t */

/* Some constants coerced to size_t */

/* Annoying but necessary to avoid errors on some platforms */

/* The bit mask value corresponding to MALLOC_ALIGNMENT */

/* True if address a has acceptable alignment */

/* the number of bytes to offset an address to align it */

/* -------------------------- MMAP preliminaries ------------------------- */

/*
 If HAVE_MORECORE or HAVE_MMAP are false, we just define calls and
 checks to fail so compiler optimizer can delete code rather than
 using so many "#if"s.
 */

/* MORECORE and MMAP must return MFAIL on failure */

/* defined for convenience */

/* MAP_ANON */

/* MAP_ANONYMOUS */

/*
 Nearly all versions of mmap support MAP_ANONYMOUS, so the following
 is unlikely to be needed, but is supplied just in case.
 */

/* Cached file descriptor for /dev/zero. */

/* MAP_ANONYMOUS */

/* WIN32 */

/* Win32 MMAP via VirtualAlloc */

/* For direct MMAP, use MEM_TOP_DOWN to minimize interference */

/* This function supports releasing coalesed segments */

/* WIN32 */

/* HAVE_MMAP */

/* WIN32 */

/* HAVE_MREMAP */

/**
 * Define CALL_MORECORE
 */

/* MORECORE */

/* MORECORE */

/* HAVE_MORECORE */

/* HAVE_MORECORE */

/**
 * Define CALL_MMAP/CALL_MUNMAP/CALL_DIRECT_MMAP
 */

/* MMAP */

/* MMAP */

/* MUNMAP */

/* MUNMAP */

/* DIRECT_MMAP */

/* DIRECT_MMAP */

/* HAVE_MMAP */

/* HAVE_MMAP */

/**
 * Define CALL_MREMAP
 */

/* MREMAP */

/* MREMAP */

/* HAVE_MMAP && HAVE_MREMAP */

/* HAVE_MMAP && HAVE_MREMAP */

/* mstate bit set if continguous morecore disabled or failed */

/* segment bit set in create_mspace_with_base */

/* --------------------------- Lock preliminaries ------------------------ */

/*
 When locks are defined, there is one global lock, plus
 one per-mspace lock.
 
 The global lock_ensures that mparams.magic and other unique
 mparams values are initialized only once. It also protects
 sequences of calls to MORECORE.  In many cases sys_alloc requires
 two calls, that should not be interleaved with calls by other
 threads.  This does not protect against direct calls to MORECORE
 by other threads not using this lock, so there is still code to
 cope the best we can on interference.
 
 Per-mspace locks surround calls to malloc, free, etc.
 By default, locks are simple non-reentrant mutexes.
 
 Because lock-protected regions generally have bounded times, it is
 OK to use the supplied simple spinlocks. Spinlocks are likely to
 improve performance for lightly contended applications, but worsen
 performance under heavy contention.
 
 If USE_LOCKS is > 1, the definitions of lock routines here are
 bypassed, in which case you will need to define the type MLOCK_T,
 and at least INITIAL_LOCK, DESTROY_LOCK, ACQUIRE_LOCK, RELEASE_LOCK
 and TRY_LOCK.  You must also declare a
 static MLOCK_T malloc_global_mutex = { initialization values };.
 
 */

/* -----------------------  User-defined locks ------------------------ */

/* Define your own lock implementation here */

/* #define INITIAL_LOCK(lk)  ... */

/* #define DESTROY_LOCK(lk)  ... */

/* #define ACQUIRE_LOCK(lk)  ... */

/* #define RELEASE_LOCK(lk)  ... */

/* #define TRY_LOCK(lk) ... */

/* static MLOCK_T malloc_global_mutex = ... */

/* First, define CAS_LOCK and CLEAR_LOCK on ints */

/* Note CAS_LOCK defined to return 0 on success */

/* Custom spin locks for older gcc on x86 */

/* Win32 MSC */

/* ... gcc spins locks ... */

/* How to yield for a spin lock */

/* delay for yield/sleep */

/* solaris */

/* ... yield ... */

/* Plain spin locks use single word (embedded in malloc_states) */

/* USE_RECURSIVE_LOCKS */

/* types for lock owners */

/*
 Note: the following assume that pthread_t is a type that can be
 initialized to (casted) zero. If this is not the case, you will need to
 somehow redefine these or not use spin locks.
 */

/* USE_RECURSIVE_LOCKS */

/* Win32 critical sections */

/* Use spin loop to initialize global lock */

/* transition to < 0 while initializing, then to > 0) */

/* pthreads-based locks */

/* Cope with old-style linux recursive lock initialization by adding */

/* skipped internal declaration from pthread.h */

/* USE_RECURSIVE_LOCKS ... */

/* ... lock types ... */

/* Common code for all lock types */

/* USE_LOCKS */

/* -----------------------  Chunk representations ------------------------ */

/*
 (The following includes lightly edited explanations by Colin Plumb.)
 
 The malloc_chunk declaration below is misleading (but accurate and
 necessary).  It declares a "view" into memory allowing access to
 necessary fields at known offsets from a given base.
 
 Chunks of memory are maintained using a `boundary tag' method as
 originally described by Knuth.  (See the paper by Paul Wilson
 ftp://ftp.cs.utexas.edu/pub/garbage/allocsrv.ps for a survey of such
 techniques.)  Sizes of free chunks are stored both in the front of
 each chunk and at the end.  This makes consolidating fragmented
 chunks into bigger chunks fast.  The head fields also hold bits
 representing whether chunks are free or in use.
 
 Here are some pictures to make it clearer.  They are "exploded" to
 show that the state of a chunk can be thought of as extending from
 the high 31 bits of the head field of its header through the
 prev_foot and PINUSE_BIT bit of the following chunk header.
 
 A chunk that's in use looks like:
 
 chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | Size of previous chunk (if P = 0)                             |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P|
 | Size of this chunk                                         1| +-+
 mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                                                               |
 +-                                                             -+
 |                                                               |
 +-                                                             -+
 |                                                               :
 +-      size - sizeof(size_t) available payload bytes          -+
 :                                                               |
 chunk-> +-                                                             -+
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |1|
 | Size of next chunk (may or may not be in use)               | +-+
 mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 
 And if it's free, it looks like this:
 
 chunk-> +-                                                             -+
 | User payload (must be in use, or we would have merged!)       |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P|
 | Size of this chunk                                         0| +-+
 mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | Next pointer                                                  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | Prev pointer                                                  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                                                               :
 +-      size - sizeof(struct chunk) unused bytes               -+
 :                                                               |
 chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | Size of this chunk                                            |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0|
 | Size of next chunk (must be in use, or we would have merged)| +-+
 mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                                                               :
 +- User payload                                                -+
 :                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |0|
 +-+
 Note that since we always merge adjacent free chunks, the chunks
 adjacent to a free chunk must be in use.
 
 Given a pointer to a chunk (which can be derived trivially from the
 payload pointer) we can, in O(1) time, find out whether the adjacent
 chunks are free, and if so, unlink them from the lists that they
 are on and merge them with the current chunk.
 
 Chunks always begin on even word boundaries, so the mem portion
 (which is returned to the user) is also on an even word boundary, and
 thus at least double-word aligned.
 
 The P (PINUSE_BIT) bit, stored in the unused low-order bit of the
 chunk size (which is always a multiple of two words), is an in-use
 bit for the *previous* chunk.  If that bit is *clear*, then the
 word before the current chunk size contains the previous chunk
 size, and can be used to find the front of the previous chunk.
 The very first chunk allocated always has this bit set, preventing
 access to non-existent (or non-owned) memory. If pinuse is set for
 any given chunk, then you CANNOT determine the size of the
 previous chunk, and might even get a memory addressing fault when
 trying to do so.
 
 The C (CINUSE_BIT) bit, stored in the unused second-lowest bit of
 the chunk size redundantly records whether the current chunk is
 inuse (unless the chunk is mmapped). This redundancy enables usage
 checks within free and realloc, and reduces indirection when freeing
 and consolidating chunks.
 
 Each freshly allocated chunk must have both cinuse and pinuse set.
 That is, each allocated chunk borders either a previously allocated
 and still in-use chunk, or the base of its memory arena. This is
 ensured by making all allocations from the `lowest' part of any
 found chunk.  Further, no free chunk physically borders another one,
 so each free chunk is known to be preceded and followed by either
 inuse chunks or the ends of memory.
 
 Note that the `foot' of the current chunk is actually represented
 as the prev_foot of the NEXT chunk. This makes it easier to
 deal with alignments etc but can be very confusing when trying
 to extend or adapt this code.
 
 The exceptions to all this are
 
 1. The special chunk `top' is the top-most available chunk (i.e.,
 the one bordering the end of available memory). It is treated
 specially.  Top is never included in any bin, is used only if
 no other chunk is available, and is released back to the
 system if it is very large (see M_TRIM_THRESHOLD).  In effect,
 the top chunk is treated as larger (and thus less well
 fitting) than any other available chunk.  The top chunk
 doesn't update its trailing size field since there is no next
 contiguous chunk that would have to index off it. However,
 space is still allocated for it (TOP_FOOT_SIZE) to enable
 separation or merging when space is extended.
 
 3. Chunks allocated via mmap, have both cinuse and pinuse bits
 cleared in their head fields.  Because they are allocated
 one-by-one, each must carry its own prev_foot field, which is
 also used to hold the offset this chunk has within its mmapped
 region, which is needed to preserve alignment. Each mmapped
 chunk is trailed by the first two fields of a fake next-chunk
 for sake of usage checks.
 
 */

/* Size of previous chunk (if free).  */

/* Size and inuse bits. */

/* double links -- used only if free. */

/* The type of bins of chunks */

/* Described below */

/* Described below */

/* The type of various bit flag sets */

/* ------------------- Chunks sizes and alignments ----------------------- */

/* FOOTERS */

/* FOOTERS */

/* MMapped chunks need a second word of overhead ... */

/* ... and additional padding for fake next-chunk at foot */

/* The smallest size we can malloc is an aligned minimal chunk */

/* conversion from malloc headers to user pointers, and back */

/* chunk associated with aligned address A */

/* Bounds on request (not chunk) sizes. */

/* pad request bytes into a usable size */

/* pad request, checking for minimum (but not maximum) */

/* ------------------ Operations on head and foot fields ----------------- */

/*
 The head field of a chunk is or'ed with PINUSE_BIT when previous
 adjacent chunk in use, and or'ed with CINUSE_BIT if this chunk is in
 use, unless mmapped, in which case both bits are cleared.
 
 FLAG4_BIT is not used by this malloc, but might be useful in extensions.
 */

/* Head value for fenceposts */

/* extraction of fields from head words */

/* Treat space at ptr +/- offset as a chunk */

/* Ptr to next or previous physical malloc_chunk. */

/* extract next chunk's pinuse bit */

/* Get/set size at footer */

/* Set size, pinuse bit, and foot */

/* Set size, pinuse bit, foot, and clear next pinuse */

/* Get the internal overhead associated with chunk p */

/* Return true if malloced space is not necessarily cleared */

/* MMAP_CLEARS */

/* MMAP_CLEARS */

/* ---------------------- Overlaid data structures ----------------------- */

/*
 When chunks are not in use, they are treated as nodes of either
 lists or trees.
 
 "Small"  chunks are stored in circular doubly-linked lists, and look
 like this:
 
 chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |             Size of previous chunk                            |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 `head:' |             Size of chunk, in bytes                         |P|
 mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |             Forward pointer to next chunk in list             |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |             Back pointer to previous chunk in list            |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |             Unused space (may be 0 bytes long)                .
 .                                                               .
 .                                                               |
 nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 `foot:' |             Size of chunk, in bytes                           |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 
 Larger chunks are kept in a form of bitwise digital trees (aka
 tries) keyed on chunksizes.  Because malloc_tree_chunks are only for
 free chunks greater than 256 bytes, their size doesn't impose any
 constraints on user chunk sizes.  Each node looks like:
 
 chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |             Size of previous chunk                            |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 `head:' |             Size of chunk, in bytes                         |P|
 mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |             Forward pointer to next chunk of same size        |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |             Back pointer to previous chunk of same size       |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |             Pointer to left child (child[0])                  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |             Pointer to right child (child[1])                 |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |             Pointer to parent                                 |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |             bin index of this chunk                           |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |             Unused space                                      .
 .                                                               |
 nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 `foot:' |             Size of chunk, in bytes                           |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 
 Each tree holding treenodes is a tree of unique chunk sizes.  Chunks
 of the same size are arranged in a circularly-linked list, with only
 the oldest chunk (the next to be used, in our FIFO ordering)
 actually in the tree.  (Tree members are distinguished by a non-null
 parent pointer.)  If a chunk with the same size an an existing node
 is inserted, it is linked off the existing node using pointers that
 work in the same way as fd/bk pointers of small chunks.
 
 Each tree contains a power of 2 sized range of chunk sizes (the
 smallest is 0x100 <= x < 0x180), which is is divided in half at each
 tree level, with the chunks in the smaller half of the range (0x100
 <= x < 0x140 for the top nose) in the left subtree and the larger
 half (0x140 <= x < 0x180) in the right subtree.  This is, of course,
 done by inspecting individual bits.
 
 Using these rules, each node's left subtree contains all smaller
 sizes than its right subtree.  However, the node at the root of each
 subtree has no particular ordering relationship to either.  (The
 dividing line between the subtree sizes is based on trie relation.)
 If we remove the last chunk of a given size from the interior of the
 tree, we need to replace it with a leaf node.  The tree ordering
 rules permit a node to be replaced by any leaf below it.
 
 The smallest chunk in a tree (a common operation in a best-fit
 allocator) can be found by walking a path to the leftmost leaf in
 the tree.  Unlike a usual binary tree, where we follow left child
 pointers until we reach a null, here we follow the right child
 pointer any time the left one is null, until we reach a leaf with
 both child pointers null. The smallest chunk in the tree will be
 somewhere along that path.
 
 The worst case number of steps to add, find, or remove a node is
 bounded by the number of bits differentiating chunks within
 bins. Under current bin calculations, this ranges from 6 up to 21
 (for 32 bit sizes) or up to 53 (for 64 bit sizes). The typical case
 is of course much better.
 */

/* The first four fields must be compatible with malloc_chunk */

/* The type of bins of trees */

/* A little helper macro for trees */

/* ----------------------------- Segments -------------------------------- */

/*
 Each malloc space may include non-contiguous segments, held in a
 list headed by an embedded malloc_segment record representing the
 top-most space. Segments also include flags holding properties of
 the space. Large chunks that are directly allocated by mmap are not
 included in this list. They are instead independently created and
 destroyed without otherwise keeping track of them.
 
 Segment management mainly comes into play for spaces allocated by
 MMAP.  Any call to MMAP might or might not return memory that is
 adjacent to an existing segment.  MORECORE normally contiguously
 extends the current space, so this space is almost always adjacent,
 which is simpler and faster to deal with. (This is why MORECORE is
 used preferentially to MMAP when both are available -- see
 sys_alloc.)  When allocating using MMAP, we don't use any of the
 hinting mechanisms (inconsistently) supported in various
 implementations of unix mmap, or distinguish reserving from
 committing memory. Instead, we just ask for space, and exploit
 contiguity when we get it.  It is probably possible to do
 better than this on some systems, but no general scheme seems
 to be significantly better.
 
 Management entails a simpler variant of the consolidation scheme
 used for chunks to reduce fragmentation -- new adjacent memory is
 normally prepended or appended to an existing segment. However,
 there are limitations compared to chunk consolidation that mostly
 reflect the fact that segment processing is relatively infrequent
 (occurring only when getting memory from system) and that we
 don't expect to have huge numbers of segments:
 
 * Segments are not indexed, so traversal requires linear scans.  (It
 would be possible to index these, but is not worth the extra
 overhead and complexity for most programs on most platforms.)
 * New segments are only appended to old ones when holding top-most
 memory; if they cannot be prepended to others, they are held in
 different segments.
 
 Except for the top-most segment of an mstate, each segment record
 is kept at the tail of its segment. Segments are added by pushing
 segment records onto the list headed by &mstate.seg for the
 containing mstate.
 
 Segment flags control allocation/merge/deallocation policies:
 * If EXTERN_BIT set, then we did not allocate this segment,
 and so should not try to deallocate or merge with others.
 (This currently holds only for the initial segment passed
 into create_mspace_with_base.)
 * If USE_MMAP_BIT set, the segment may be merged with
 other surrounding mmapped segments and trimmed/de-allocated
 using munmap.
 * If neither bit is set, then the segment was obtained using
 MORECORE so can be merged with surrounding MORECORE'd segments
 and deallocated/trimmed using MORECORE with negative arguments.
 */

/* base address */

/* allocated size */

/* ptr to next segment */

/* mmap and extern flag */

/* ---------------------------- malloc_state ----------------------------- */

/*
 A malloc_state holds all of the bookkeeping for a space.
 The main fields are:
 
 Top
 The topmost chunk of the currently active segment. Its size is
 cached in topsize.  The actual size of topmost space is
 topsize+TOP_FOOT_SIZE, which includes space reserved for adding
 fenceposts and segment records if necessary when getting more
 space from the system.  The size at which to autotrim top is
 cached from mparams in trim_check, except that it is disabled if
 an autotrim fails.
 
 Designated victim (dv)
 This is the preferred chunk for servicing small requests that
 don't have exact fits.  It is normally the chunk split off most
 recently to service another small request.  Its size is cached in
 dvsize. The link fields of this chunk are not maintained since it
 is not kept in a bin.
 
 SmallBins
 An array of bin headers for free chunks.  These bins hold chunks
 with sizes less than MIN_LARGE_SIZE bytes. Each bin contains
 chunks of all the same size, spaced 8 bytes apart.  To simplify
 use in double-linked lists, each bin header acts as a malloc_chunk
 pointing to the real first node, if it exists (else pointing to
 itself).  This avoids special-casing for headers.  But to avoid
 waste, we allocate only the fd/bk pointers of bins, and then use
 repositioning tricks to treat these as the fields of a chunk.
 
 TreeBins
 Treebins are pointers to the roots of trees holding a range of
 sizes. There are 2 equally spaced treebins for each power of two
 from TREE_SHIFT to TREE_SHIFT+16. The last bin holds anything
 larger.
 
 Bin maps
 There is one bit map for small bins ("smallmap") and one for
 treebins ("treemap).  Each bin sets its bit when non-empty, and
 clears the bit when empty.  Bit operations are then used to avoid
 bin-by-bin searching -- nearly all "search" is done without ever
 looking at bins that won't be selected.  The bit maps
 conservatively use 32 bits per map word, even if on 64bit system.
 For a good description of some of the bit-based techniques used
 here, see Henry S. Warren Jr's book "Hacker's Delight" (and
 supplement at http://hackersdelight.org/). Many of these are
 intended to reduce the branchiness of paths through malloc etc, as
 well as to reduce the number of memory locations read or written.
 
 Segments
 A list of segments headed by an embedded malloc_segment record
 representing the initial space.
 
 Address check support
 The least_addr field is the least address ever obtained from
 MORECORE or MMAP. Attempted frees and reallocs of any address less
 than this are trapped (unless INSECURE is defined).
 
 Magic tag
 A cross-check field that should always hold same value as mparams.magic.
 
 Max allowed footprint
 The maximum allowed bytes to allocate from system (zero means no limit)
 
 Flags
 Bits recording whether to use MMAP, locks, or contiguous MORECORE
 
 Statistics
 Each space keeps track of current and maximum system memory
 obtained via MORECORE or MMAP.
 
 Trim support
 Fields holding the amount of unused topmost memory that should trigger
 trimming, and a counter to force periodic scanning to release unused
 non-topmost segments.
 
 Locking
 If USE_LOCKS is defined, the "mutex" lock is acquired and released
 around every public call using this mspace.
 
 Extension support
 A void* pointer and a size_t field that can be used to help implement
 extensions to this malloc.
 */

/* Bin types, widths and sizes */

/* zero means no limit */

/* locate lock among fields that rarely change */

/* USE_LOCKS */

/* Unused but available for extensions */

/* ------------- Global malloc_state and malloc_params ------------------- */

/*
 malloc_params holds global properties, including those that can be
 dynamically set using mallopt. There is a single instance, mparams,
 initialized in init_mparams. Note that the non-zeroness of "magic"
 also serves as an initialization flag.
 */

/* Ensure mparams initialized */

/* The global malloc_state used for all non-"mspace" calls */

/* !ONLY_MSPACES */

/* -------------------------- system alloc setup ------------------------- */

/* Operations on mflags */

/* page-align a size */

/* granularity-align a size */

/* For mmap, use granularity alignment on windows, else page-align */

/* For sys_alloc, enough padding to ensure can malloc request on success */

/*  True if segment S holds address A */

/* Return segment holding given address */

/* Return true if segment contains a segment link */

/* MORECORE_CANNOT_TRIM */

/* MORECORE_CANNOT_TRIM */

/*
 TOP_FOOT_SIZE is padding at the end of a segment, including space
 that may be needed to place segment records and fenceposts when new
 noncontiguous segments are added.
 */

/* -------------------------------  Hooks -------------------------------- */

/*
 PREACTION should be defined to return 0 on success, and nonzero on
 failure. If you are not using locking, you can redefine these to do
 anything you like.
 */

/* USE_LOCKS */

/* PREACTION */

/* POSTACTION */

/* USE_LOCKS */

/*
 CORRUPTION_ERROR_ACTION is triggered upon detected bad addresses.
 USAGE_ERROR_ACTION is triggered on detected bad frees and
 reallocs. The argument p is an address that might have triggered the
 fault. It is ignored by the two predefined actions, but might be
 useful in custom actions that try to help diagnose errors.
 */

/* A count of the number of corruption errors causing resets */

/* default corruption action */

/* PROCEED_ON_ERROR */

/* CORRUPTION_ERROR_ACTION */

/* USAGE_ERROR_ACTION */

/* PROCEED_ON_ERROR */

/* -------------------------- Debugging setup ---------------------------- */

/* DEBUG */

/* DEBUG */

/* ---------------------------- Indexing Bins ---------------------------- */

/* addressing by index. See above about smallbin repositioning */

/* assign tree index for size S to variable I. Use x86 asm if possible  */

/* GNUC */

/* GNUC */

/* Bit representing maximum resolved size in a treebin at i */

/* Shift placing maximum resolved bit in a treebin at i as sign bit */

/* The size of the smallest chunk held in bin with index i */

/* ------------------------ Operations on bin maps ----------------------- */

/* bit corresponding to given index */

/* Mark/Clear bits with given index */

/* isolate the least set bit of a bitmap */

/* mask with all bits to left of least bit of x on */

/* mask with all bits to left of or equal to least bit of x on */

/* index corresponding to given bit. Use x86 asm if possible */

/* GNUC */

/* ----------------------- Runtime Check Support ------------------------- */

/*
 For security, the main invariant is that malloc/free/etc never
 writes to a static address other than malloc_state, unless static
 malloc_state itself has been corrupted, which cannot occur via
 malloc (because of these checks). In essence this means that we
 believe all pointers, sizes, maps etc held in malloc_state, but
 check all of those linked or offsetted from other embedded data
 structures.  These checks are interspersed with main code in a way
 that tends to minimize their run-time cost.
 
 When FOOTERS is defined, in addition to range checking, we also
 verify footer fields of inuse chunks, which can be used guarantee
 that the mstate controlling malloc/free is intact.  This is a
 streamlined version of the approach described by William Robertson
 et al in "Run-time Detection of Heap-based Overflows" LISA'03
 http://www.usenix.org/events/lisa03/tech/robertson.html The footer
 of an inuse chunk holds the xor of its mstate and a random seed,
 that is checked upon calls to free() and realloc().  This is
 (probabalistically) unguessable from outside the program, but can be
 computed by any code successfully malloc'ing any chunk, so does not
 itself provide protection against code that has already broken
 security through some other means.  Unlike Robertson et al, we
 always dynamically check addresses of all offset chunks (previous,
 next, etc). This turns out to be cheaper than relying on hashes.
 */

/* Check if address a is at least as high as any from MORECORE or MMAP */

/* Check if address of next chunk n is higher than base chunk p */

/* Check if p has inuse status */

/* Check if p has its pinuse bit on */

/* !INSECURE */

/* !INSECURE */

/* Check if (alleged) mstate m has expected magic field */

/* (FOOTERS && !INSECURE) */

/* (FOOTERS && !INSECURE) */

/* In gcc, use __builtin_expect to minimize impact of checks */

/* GNUC */

/* GNUC */

/* !INSECURE */

/* !INSECURE */

/* macros to set up inuse chunks with or without footers */

/* Macros for setting head/foot of non-mmapped chunks */

/* Set cinuse bit and pinuse bit of next chunk */

/* Set cinuse and pinuse of this chunk and pinuse of next chunk */

/* Set size, cinuse and pinuse bit of this chunk */

/* FOOTERS */

/* Set foot of inuse chunk to be xor of mstate and seed */

/* !FOOTERS */

/* ---------------------------- setting mparams -------------------------- */

/* LOCK_AT_FORK */

/* Initialize mparams */

/* WIN32 */

/* WIN32 */

/* Sanity-check configuration:
         size_t must be unsigned and as wide as pointer type.
         ints must be at least 4 bytes.
         alignment must be at least 8.
         Alignment, min chunk size, and page size must all be powers of 2.
         */

/* MORECORE_CONTIGUOUS */

/* MORECORE_CONTIGUOUS */

/* Set up lock for main malloc area */

/* Try to use /dev/urandom, else fall back on using time */

/* USE_DEV_RANDOM */

/* ensure nonzero */

/* improve chances of fault for bad values */

/* Until memory modes commonly available, use volatile-write */

/* support for mallopt */

/* ------------------------- Debugging Support --------------------------- */

/* Check properties of any chunk, whether free, inuse, mmapped etc  */

/* Check properties of top chunk */

/* third-lowest bit can be set! */

/* Check properties of (inuse) mmapped chunks */

/* Check properties of inuse chunks */

/* If not pinuse and not mmapped, previous chunk has OK offset */

/* Check properties of free chunks */

/* markers are always of size SIZE_T_SIZE */

/* Check properties of malloced chunks at the point they are malloced */

/* unless mmapped, size is less than MIN_CHUNK_SIZE more than request */

/* Check a tree and its subtrees.  */

/* traverse through chain of same-sized nodes */

/* only one node on chain has parent */

/*  Check all the chunks in a treebin.  */

/*  Check all the chunks in a smallbin.  */

/* each chunk claims to be free */

/* chunk belongs in bin */

/* chunk is followed by an inuse chunk */

/* Find x in a bin. Used in other check functions. */

/* Traverse each chunk and check it; return total */

/* Not 2 consecutive free */

/* Check all properties of malloc_state. */

/* check bins */

/* check dv chunk */

/* check top chunk */

/*assert(m->topsize == chunksize(m->top)); redundant */

/* DEBUG */

/* ----------------------------- statistics ------------------------------ */

/* top always free */

/* !NO_MALLINFO */

/* drop lock */

/* NO_MALLOC_STATS */

/* ----------------------- Operations on smallbins ----------------------- */

/*
 Various forms of linking and unlinking are defined as macros.  Even
 the ones for trees, which are very long but have very short typical
 paths.  This is ugly but reduces reliance on inlining support of
 compilers.
 */

/* Link a free chunk into a smallbin  */

/* Unlink a chunk from a smallbin  */

/* Unlink the first chunk from a smallbin */

/* Replace dv node, binning the old one */

/* Used only when dvsize known to be small */

/* ------------------------- Operations on trees ------------------------- */

/* Insert chunk into tree */

/*
 Unlink steps:
 
 1. If x is a chained node, unlink it from its same-sized fd/bk links
 and choose its bk node as its replacement.
 2. If x was the last node of its size, but not a leaf node, it must
 be replaced with a leaf node (not merely one with an open left or
 right), to make sure that lefts and rights of descendents
 correspond properly to bit masks.  We use the rightmost descendent
 of x.  We could use any other leaf, but this is easy to locate and
 tends to counteract removal of leftmosts elsewhere, and so keeps
 paths shorter than minimally guaranteed.  This doesn't loop much
 because on average a node in a tree is near the bottom.
 3. If x is the base of a chain (i.e., has parent links) relink
 x's parent and children to x's replacement (or null if none).
 */

/* Relays to large vs small bin operations */

/* Relays to internal calls to malloc/free from realloc, memalign etc */

/* ONLY_MSPACES */

/* MSPACES */

/* MSPACES */

/* ONLY_MSPACES */

/* -----------------------  Direct-mmapping chunks ----------------------- */

/*
 Directly mmapped chunks are set up with an offset to the start of
 the mmapped region stored in the prev_foot field of the chunk. This
 allows reconstruction of the required argument to MUNMAP when freed,
 and also allows adjustment of the returned chunk to meet alignment
 requirements (especially in memalign).
 */

/* Malloc using mmap */

/* Check for wrap around 0 */

/* Realloc using mmap */

/* placate people compiling -Wunused */

/* Can't shrink mmap regions below small size */

/* Keep old chunk if big enough but not too big */

/* -------------------------- mspace management -------------------------- */

/* Initialize top chunk and its size */

/* Ensure alignment */

/* set size of fake trailing chunk holding overhead space only once */

/* reset on each update */

/* Initialize bins for a new mstate that is otherwise zeroed out */

/* Establish circular links for smallbins */

/* default corruption action */

/* Reinitialize fields to forget about all memory */

/* PROCEED_ON_ERROR */

/* Allocate chunk and prepend remainder with chunk in successor base. */

/* consolidate remainder with first chunk of old base */

/* Add a segment to hold a new noncontiguous region */

/* Determine locations and sizes of segment, fenceposts, old top */

/* reset top to new space */

/* Set up segment record */

/* Push current record */

/* Insert trailing fenceposts */

/* Insert the rest of old top into a bin as an ordinary free chunk */

/* -------------------------- System allocation -------------------------- */

/* Get memory from system using MORECORE or MMAP */

/* allocation size */

/* Directly map large chunks, but only if already initialized */

/* wraparound */

/*
     Try getting memory in any of three ways (in most-preferred to
     least-preferred order):
     1. A call to MORECORE that can normally contiguously extend memory.
     (disabled if not MORECORE_CONTIGUOUS or not HAVE_MORECORE or
     or main space is mmapped or a previous contiguous call failed)
     2. A call to MMAP new space (disabled if not HAVE_MMAP).
     Note that under the default settings, if MORECORE is unable to
     fulfill a request, and HAVE_MMAP is true, then mmap is
     used as a noncontiguous system allocator. This is a useful backup
     strategy for systems with holes in address spaces -- in this case
     sbrk cannot contiguously expand the heap, but mmap may be able to
     find space.
     3. A call to MORECORE that cannot usually contiguously extend memory.
     (disabled if not HAVE_MORECORE)
     
     In all cases, we need to request enough bytes from system to ensure
     we can malloc nb bytes upon success, so pad with enough space for
     top_foot, plus alignment-pad to make sure we don't lose bytes if
     not on boundary, and round this up to a granularity unit.
     */

/* sbrk call size */

/* First time through or recovery */

/* Adjust to end on a page boundary */

/* recheck limits */

/* Subtract out existing available top space from MORECORE request. */

/* Use mem here only if it did continuously extend old space */

/* Cope with partial failure */

/* Try to use/extend the space we did get */

/* Can't use; try to release */

/* Use the space we did get */

/* Don't try contiguous path in the future */

/* Try MMAP */

/* Try noncontiguous MORECORE */

/* first-time initialization */

/* Offset top by embedded malloc_state */

/* Try to merge with an existing segment */

/* Only consider most recent segment if traversal suppressed */

/* append */

/* Allocate from new or extended top space */

/* -----------------------  system deallocation -------------------------- */

/* Unmap and unlink any mmapped segments that don't contain used chunks */

/* Can unmap if first chunk holds entire segment and not pinned */

/* unlink obsoleted record */

/* back out if cannot unmap */

/* scan only first segment */

/* Reset check counter */

/* ensure enough room for segment overhead */

/* Shrink top space in granularity-size units, keeping at least one */

/* can't shrink if pinned */

/* placate people compiling -Wunused-variable */

/* Prefer mremap, fall back to munmap */

/* Avoid wrapping negative */

/* Make sure end of memory is where we last set it. */

/* Unmap any unused mmapped segments */

/* On failure, disable autotrim to avoid repeated failed future calls */

/* Consolidate and bin a chunk. Differs from exported versions
 of free mainly in that the chunk need not be marked as inuse.
 */

/* consolidate backward */

/* consolidate forward */

/* ---------------------------- malloc --------------------------- */

/* allocate a large request from the best fitting chunk in a treebin */

/* Unsigned negation */

/* Traverse tree for this bin looking for node with size == nb */

/* The deepest untaken right subtree */

/* set t to least subtree holding sizes > nb */

/* set t to root of next non-empty treebin */

/* find smallest of tree or subtree */

/*  If dv is a better fit, return 0 so malloc will use it */

/* split */

/* allocate a small request from the best fitting chunk in a treebin */

/*
     Basic algorithm:
     If a small request (< 256 bytes minus per-chunk overhead):
     1. If one exists, use a remainderless chunk in associated smallbin.
     (Remainderless means that there are too few excess bytes to
     represent as a chunk.)
     2. If it is big enough, use the dv chunk, which is normally the
     chunk adjacent to the one used for the most recent small request.
     3. If one exists, split the smallest available chunk in a bin,
     saving remainder in dv.
     4. If it is big enough, use the top chunk.
     5. If available, get memory from system and use it
     Otherwise, for a large request:
     1. Find the smallest available binned chunk that fits, and use it
     if it is better fitting than dv chunk, splitting if necessary.
     2. If better fitting than any binned chunk, use the dv chunk.
     3. If it is big enough, use the top chunk.
     4. If request size >= mmap threshold, try to directly mmap this chunk.
     5. If available, get memory from system and use it
     
     The ugly goto's here ensure that postaction occurs along all paths.
     */

/* initialize in sys_alloc if not using locks */

/* Remainderless fit to a smallbin. */

/* Uses next bin if idx empty */

/* Use chunk in next nonempty smallbin */

/* Fit here cannot be remainderless if 4byte sizes */

/* Too big to allocate. Force failure (in sys alloc) */

/* split dv */

/* exhaust dv */

/* Split top */

/* XXX Emscripten Tracing API. */

/* ---------------------------- free --------------------------- */

/*
     Consolidate freed chunks with preceeding or succeeding bordering
     free chunks, if they exist, and then place in a bin.  Intermixed
     with special cases for top, dv, mmapped chunks, and usage errors.
     */

/* XXX Emscripten Tracing API. */

/* FOOTERS */

/* FOOTERS */

/* consolidate backward */

/* consolidate forward */

/* FOOTERS */

/* force downstream failure on overflow */

/* !ONLY_MSPACES */

/* ------------ Internal support for realloc, memalign, etc -------------- */

/* Try to realloc; only in-place unless can_move true */

/* already big enough */

/* split off remainder */

/* extend into top */

/* extend into dv */

/* exhaust dv */

/* extend into next free chunk */

/* must be at least a minimum chunk size */

/* Ensure a power of 2 */

/* Test isn't needed but avoids compiler warning */

/* misaligned */

/*
                 Find an aligned spot inside chunk.  Since we need to give
                 back leading space in a chunk of at least MIN_CHUNK_SIZE, if
                 the first calculation places us at a spot with less than
                 MIN_CHUNK_SIZE leader, we can move to the next aligned spot.
                 We've allocated enough total room so that this is always
                 possible.
                 */

/* For mmapped chunks, just adjust offset */

/* Otherwise, give back leader, use the rest */

/* Give back spare room at the end */

/*
 Common support for independent_X routines, handling
 all of the combinations that can result.
 The opts arg has:
 bit 0 set if all elements are same size (using sizes[0])
 bit 1 set if elements should be zeroed
 */

/* chunksize of each element, if all same */

/* total size of elements */

/* request size of pointer array */

/* malloced aggregate space */

/* corresponding chunk */

/* remaining bytes while splitting */

/* either "chunks" or malloced ptr array */

/* chunk for malloced ptr array */

/* to disable mmap */

/* compute array length, if needed */

/* nothing to do */

/* if empty req, must still return chunk representing empty array */

/* compute total element size */

/* all-same-size */

/* add up all the sizes */

/*
     Allocate the aggregate chunk.  First disable direct-mmapping so
     malloc won't use it, since we would not be able to later
     free/realloc space internal to a segregated mmap region.
     */

/* optionally clear the elements */

/* If not provided, allocate the pointer array as final part of chunk */

/* split out elements */

/* the final element absorbs any overallocation slop */

/* final element must have exactly exhausted chunk */

/* DEBUG */

/* Try to free all pointers in the given array.
 Note: this could be made faster, by delaying consolidation,
 at the price of disabling some user integrity checks, We
 still optimize some consolidations by combining adjacent
 chunks before freeing, which will occur often if allocated
 with ialloc or the array is sorted.
 */

/* try to merge with next chunk */

/* Traversal */

/* must not be mmapped */

/* offset by possible bookkeeping */

/* skip if all space is bookkeeping */

/* MALLOC_INSPECT_ALL */

/* ------------------ Exported realloc, memalign, etc -------------------- */

/* REALLOC_ZERO_BYTES_FREES */

/* FOOTERS */

/* FOOTERS */

/* XXX Emscripten Tracing API. */

/* FOOTERS */

/* FOOTERS */

/* XXX Emscripten Tracing API. */

/* serves as 1-element array */

/* MALLOC_INSPECT_ALL */

/* invert sense of 0 */

/* Use minimal size */

/* disable */

/* NO_MALLINFO */

/* NO_MALLOC_STATS */

/* !ONLY_MSPACES */

/* ----------------------------- user mspaces ---------------------------- */

/* destroy before unmapped */

/* placate people compiling -Wunused-variable */

/*
 mspace versions of routines are near-clones of the global
 versions. This is not so nice but better than the alternatives.
 */

/* Remainderless fit to a smallbin. */

/* Uses next bin if idx empty */

/* Use chunk in next nonempty smallbin */

/* Fit here cannot be remainderless if 4byte sizes */

/* Too big to allocate. Force failure (in sys alloc) */

/* split dv */

/* exhaust dv */

/* Split top */

/* placate people compiling -Wunused */

/* FOOTERS */

/* FOOTERS */

/* consolidate backward */

/* consolidate forward */

/* force downstream failure on overflow */

/* REALLOC_ZERO_BYTES_FREES */

/* FOOTERS */

/* FOOTERS */

/* FOOTERS */

/* placate people compiling -Wunused */

/* FOOTERS */

/* serves as 1-element array */

/* MALLOC_INSPECT_ALL */

/* NO_MALLOC_STATS */

/* Use minimal size */

/* disable */

/* NO_MALLINFO */

/* MSPACES */

// Export malloc and free as duplicate names emscripten_builtin_malloc and

// emscripten_builtin_free so that applications can replace malloc and free

// in their code, and make those replacements refer to the original dlmalloc

// and dlfree from this file.

// This allows an easy mechanism for hooking into memory allocation.

/* -------------------- Alternative MORECORE functions ------------------- */

/*
 Guidelines for creating a custom version of MORECORE:
 
 * For best performance, MORECORE should allocate in multiples of pagesize.
 * MORECORE may allocate more memory than requested. (Or even less,
 but this will usually result in a malloc failure.)
 * MORECORE must not allocate memory when given argument zero, but
 instead return one past the end address of memory from previous
 nonzero call.
 * For best performance, consecutive calls to MORECORE with positive
 arguments should return increasing addresses, indicating that
 space has been contiguously extended.
 * Even though consecutive calls to MORECORE need not return contiguous
 addresses, it must be OK for malloc'ed chunks to span multiple
 regions in those cases where they do happen to be contiguous.
 * MORECORE need not handle negative arguments -- it may instead
 just return MFAIL when given negative arguments.
 Negative arguments are always multiples of pagesize. MORECORE
 must not misinterpret negative args as large positive unsigned
 args unless UNSIGNED_MORECORE is defined. You can suppress all such calls
 from even occurring by defining MORECORE_CANNOT_TRIM,
 
 As an example alternative MORECORE, here is a custom allocator
 kindly contributed for pre-OSX macOS.  It uses virtually but not
 necessarily physically contiguous non-paged memory (locked in,
 present and won't get swapped out).  You can use it by uncommenting
 this section, adding some #includes, and setting up the appropriate
 defines above:
 
 #define MORECORE osMoreCore
 
 There is also a shutdown routine that should somehow be called for
 cleanup upon program exit.
 
 #define MAX_POOL_ENTRIES 100
 #define MINIMUM_MORECORE_SIZE  (64 * 1024U)
 static int next_os_pool;
 void *our_os_pools[MAX_POOL_ENTRIES];
 
 void *osMoreCore(int size)
 {
 void *ptr = 0;
 static void *sbrk_top = 0;
 
 if (size > 0)
 {
 if (size < MINIMUM_MORECORE_SIZE)
 size = MINIMUM_MORECORE_SIZE;
 if (CurrentExecutionLevel() == kTaskLevel)
 ptr = PoolAllocateResident(size + RM_PAGE_SIZE, 0);
 if (ptr == 0)
 {
 return (void *) MFAIL;
 }
 // save ptrs so they can be freed during cleanup
 our_os_pools[next_os_pool] = ptr;
 next_os_pool++;
 ptr = (void *) ((((size_t) ptr) + RM_PAGE_MASK) & ~RM_PAGE_MASK);
 sbrk_top = (char *) ptr + size;
 return ptr;
 }
 else if (size < 0)
 {
 // we don't currently support shrink behavior
 return (void *) MFAIL;
 }
 else
 {
 return sbrk_top;
 }
 }
 
 // cleanup any allocated memory pools
 // called as last thing before shutting down driver
 
 void osCleanupMem(void)
 {
 void **ptr;
 
 for (ptr = our_os_pools; ptr < &our_os_pools[MAX_POOL_ENTRIES]; ptr++)
 if (*ptr)
 {
 PoolDeallocate(*ptr);
 *ptr = 0;
 }
 }
 
 */

/* -----------------------------------------------------------------------
 History:
 v2.8.6 Wed Aug 29 06:57:58 2012  Doug Lea
 * fix bad comparison in dlposix_memalign
 * don't reuse adjusted asize in sys_alloc
 * add LOCK_AT_FORK -- thanks to Kirill Artamonov for the suggestion
 * reduce compiler warnings -- thanks to all who reported/suggested these
 
 v2.8.5 Sun May 22 10:26:02 2011  Doug Lea  (dl at gee)
 * Always perform unlink checks unless INSECURE
 * Add posix_memalign.
 * Improve realloc to expand in more cases; expose realloc_in_place.
 Thanks to Peter Buhr for the suggestion.
 * Add footprint_limit, inspect_all, bulk_free. Thanks
 to Barry Hayes and others for the suggestions.
 * Internal refactorings to avoid calls while holding locks
 * Use non-reentrant locks by default. Thanks to Roland McGrath
 for the suggestion.
 * Small fixes to mspace_destroy, reset_on_error.
 * Various configuration extensions/changes. Thanks
 to all who contributed these.
 
 V2.8.4a Thu Apr 28 14:39:43 2011 (dl at gee.cs.oswego.edu)
 * Update Creative Commons URL
 
 V2.8.4 Wed May 27 09:56:23 2009  Doug Lea  (dl at gee)
 * Use zeros instead of prev foot for is_mmapped
 * Add mspace_track_large_chunks; thanks to Jean Brouwers
 * Fix set_inuse in internal_realloc; thanks to Jean Brouwers
 * Fix insufficient sys_alloc padding when using 16byte alignment
 * Fix bad error check in mspace_footprint
 * Adaptations for ptmalloc; thanks to Wolfram Gloger.
 * Reentrant spin locks; thanks to Earl Chew and others
 * Win32 improvements; thanks to Niall Douglas and Earl Chew
 * Add NO_SEGMENT_TRAVERSAL and MAX_RELEASE_CHECK_RATE options
 * Extension hook in malloc_state
 * Various small adjustments to reduce warnings on some compilers
 * Various configuration extensions/changes for more platforms. Thanks
 to all who contributed these.
 
 V2.8.3 Thu Sep 22 11:16:32 2005  Doug Lea  (dl at gee)
 * Add max_footprint functions
 * Ensure all appropriate literals are size_t
 * Fix conditional compilation problem for some #define settings
 * Avoid concatenating segments with the one provided
 in create_mspace_with_base
 * Rename some variables to avoid compiler shadowing warnings
 * Use explicit lock initialization.
 * Better handling of sbrk interference.
 * Simplify and fix segment insertion, trimming and mspace_destroy
 * Reinstate REALLOC_ZERO_BYTES_FREES option from 2.7.x
 * Thanks especially to Dennis Flanagan for help on these.
 
 V2.8.2 Sun Jun 12 16:01:10 2005  Doug Lea  (dl at gee)
 * Fix memalign brace error.
 
 V2.8.1 Wed Jun  8 16:11:46 2005  Doug Lea  (dl at gee)
 * Fix improper #endif nesting in C++
 * Add explicit casts needed for C++
 
 V2.8.0 Mon May 30 14:09:02 2005  Doug Lea  (dl at gee)
 * Use trees for large bins
 * Support mspaces
 * Use segments to unify sbrk-based and mmap-based system allocation,
 removing need for emulation on most platforms without sbrk.
 * Default safety checks
 * Optional footer checks. Thanks to William Robertson for the idea.
 * Internal code refactoring
 * Incorporate suggestions and platform-specific changes.
 Thanks to Dennis Flanagan, Colin Plumb, Niall Douglas,
 Aaron Bachmann,  Emery Berger, and others.
 * Speed up non-fastbin processing enough to remove fastbins.
 * Remove useless cfree() to avoid conflicts with other apps.
 * Remove internal memcpy, memset. Compilers handle builtins better.
 * Remove some options that no one ever used and rename others.
 
 V2.7.2 Sat Aug 17 09:07:30 2002  Doug Lea  (dl at gee)
 * Fix malloc_state bitmap array misdeclaration
 
 V2.7.1 Thu Jul 25 10:58:03 2002  Doug Lea  (dl at gee)
 * Allow tuning of FIRST_SORTED_BIN_SIZE
 * Use PTR_UINT as type for all ptr->int casts. Thanks to John Belmonte.
 * Better detection and support for non-contiguousness of MORECORE.
 Thanks to Andreas Mueller, Conal Walsh, and Wolfram Gloger
 * Bypass most of malloc if no frees. Thanks To Emery Berger.
 * Fix freeing of old top non-contiguous chunk im sysmalloc.
 * Raised default trim and map thresholds to 256K.
 * Fix mmap-related #defines. Thanks to Lubos Lunak.
 * Fix copy macros; added LACKS_FCNTL_H. Thanks to Neal Walfield.
 * Branch-free bin calculation
 * Default trim and mmap thresholds now 256K.
 
 V2.7.0 Sun Mar 11 14:14:06 2001  Doug Lea  (dl at gee)
 * Introduce independent_comalloc and independent_calloc.
 Thanks to Michael Pachos for motivation and help.
 * Make optional .h file available
 * Allow > 2GB requests on 32bit systems.
 * new WIN32 sbrk, mmap, munmap, lock code from <Walter@GeNeSys-e.de>.
 Thanks also to Andreas Mueller <a.mueller at paradatec.de>,
 and Anonymous.
 * Allow override of MALLOC_ALIGNMENT (Thanks to Ruud Waij for
 helping test this.)
 * memalign: check alignment arg
 * realloc: don't try to shift chunks backwards, since this
 leads to  more fragmentation in some programs and doesn't
 seem to help in any others.
 * Collect all cases in malloc requiring system memory into sysmalloc
 * Use mmap as backup to sbrk
 * Place all internal state in malloc_state
 * Introduce fastbins (although similar to 2.5.1)
 * Many minor tunings and cosmetic improvements
 * Introduce USE_PUBLIC_MALLOC_WRAPPERS, USE_MALLOC_LOCK
 * Introduce MALLOC_FAILURE_ACTION, MORECORE_CONTIGUOUS
 Thanks to Tony E. Bennett <tbennett@nvidia.com> and others.
 * Include errno.h to support default failure action.
 
 V2.6.6 Sun Dec  5 07:42:19 1999  Doug Lea  (dl at gee)
 * return null for negative arguments
 * Added Several WIN32 cleanups from Martin C. Fong <mcfong at yahoo.com>
 * Add 'LACKS_SYS_PARAM_H' for those systems without 'sys/param.h'
 (e.g. WIN32 platforms)
 * Cleanup header file inclusion for WIN32 platforms
 * Cleanup code to avoid Microsoft Visual C++ compiler complaints
 * Add 'USE_DL_PREFIX' to quickly allow co-existence with existing
 memory allocation routines
 * Set 'malloc_getpagesize' for WIN32 platforms (needs more work)
 * Use 'assert' rather than 'ASSERT' in WIN32 code to conform to
 usage of 'assert' in non-WIN32 code
 * Improve WIN32 'sbrk()' emulation's 'findRegion()' routine to
 avoid infinite loop
 * Always call 'fREe()' rather than 'free()'
 
 V2.6.5 Wed Jun 17 15:57:31 1998  Doug Lea  (dl at gee)
 * Fixed ordering problem with boundary-stamping
 
 V2.6.3 Sun May 19 08:17:58 1996  Doug Lea  (dl at gee)
 * Added pvalloc, as recommended by H.J. Liu
 * Added 64bit pointer support mainly from Wolfram Gloger
 * Added anonymously donated WIN32 sbrk emulation
 * Malloc, calloc, getpagesize: add optimizations from Raymond Nijssen
 * malloc_extend_top: fix mask error that caused wastage after
 foreign sbrks
 * Add linux mremap support code from HJ Liu
 
 V2.6.2 Tue Dec  5 06:52:55 1995  Doug Lea  (dl at gee)
 * Integrated most documentation with the code.
 * Add support for mmap, with help from
 Wolfram Gloger (Gloger@lrz.uni-muenchen.de).
 * Use last_remainder in more cases.
 * Pack bins using idea from  colin@nyx10.cs.du.edu
 * Use ordered bins instead of best-fit threshhold
 * Eliminate block-local decls to simplify tracing and debugging.
 * Support another case of realloc via move into top
 * Fix error occuring when initial sbrk_base not word-aligned.
 * Rely on page size for units instead of SBRK_UNIT to
 avoid surprises about sbrk alignment conventions.
 * Add mallinfo, mallopt. Thanks to Raymond Nijssen
 (raymond@es.ele.tue.nl) for the suggestion.
 * Add `pad' argument to malloc_trim and top_pad mallopt parameter.
 * More precautions for cases where other routines call sbrk,
 courtesy of Wolfram Gloger (Gloger@lrz.uni-muenchen.de).
 * Added macros etc., allowing use in linux libc from
 H.J. Lu (hjl@gnu.ai.mit.edu)
 * Inverted this history list
 
 V2.6.1 Sat Dec  2 14:10:57 1995  Doug Lea  (dl at gee)
 * Re-tuned and fixed to behave more nicely with V2.6.0 changes.
 * Removed all preallocation code since under current scheme
 the work required to undo bad preallocations exceeds
 the work saved in good cases for most test programs.
 * No longer use return list or unconsolidated bins since
 no scheme using them consistently outperforms those that don't
 given above changes.
 * Use best fit for very large chunks to prevent some worst-cases.
 * Added some support for debugging
 
 V2.6.0 Sat Nov  4 07:05:23 1995  Doug Lea  (dl at gee)
 * Removed footers when chunks are in use. Thanks to
 Paul Wilson (wilson@cs.texas.edu) for the suggestion.
 
 V2.5.4 Wed Nov  1 07:54:51 1995  Doug Lea  (dl at gee)
 * Added malloc_trim, with help from Wolfram Gloger
 (wmglo@Dent.MED.Uni-Muenchen.DE).
 
 V2.5.3 Tue Apr 26 10:16:01 1994  Doug Lea  (dl at g)
 
 V2.5.2 Tue Apr  5 16:20:40 1994  Doug Lea  (dl at g)
 * realloc: try to expand in both directions
 * malloc: swap order of clean-bin strategy;
 * realloc: only conditionally expand backwards
 * Try not to scavenge used bins
 * Use bin counts as a guide to preallocation
 * Occasionally bin return list chunks in first scan
 * Add a few optimizations from colin@nyx10.cs.du.edu
 
 V2.5.1 Sat Aug 14 15:40:43 1993  Doug Lea  (dl at g)
 * faster bin computation & slightly different binning
 * merged all consolidations to one part of malloc proper
 (eliminating old malloc_find_space & malloc_clean_bin)
 * Scan 2 returns chunks (not just 1)
 * Propagate failure in realloc if malloc returns 0
 * Add stuff to allow compilation on non-ANSI compilers
 from kpv@research.att.com
 
 V2.5 Sat Aug  7 07:41:59 1993  Doug Lea  (dl at g.oswego.edu)
 * removed potential for odd address access in prev_chunk
 * removed dependency on getpagesize.h
 * misc cosmetics and a bit more internal documentation
 * anticosmetics: mangled names in macros to evade debugger strangeness
 * tested on sparc, hp-700, dec-mips, rs6000
 with gcc & native cc (hp, dec only) allowing
 Detlefs & Zorn comparison study (in SIGPLAN Notices.)
 
 Trial version Fri Aug 28 13:14:29 1992  Doug Lea  (dl at g.oswego.edu)
 * Based loosely on libg++-1.2X malloc. (It retains some of the overall
 structure of old version,  but most details differ.)
 
 */


=== system/lib/embind/bind.cpp ===
SHA256: 884b4fa9f3be4de510830bcb3d8e4ca7b86c52c233e975cacaea3f50976fe65b
// Copyright 2012 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// matches typeMapping in embind.js

// Only available if WASM_BIGINT

// namespace

// Some of these types are aliases for each other. Luckily,

// embind.js's _embind_register_memory_view ignores duplicate

// registrations rather than asserting, so the first

// register_memory_view call for a particular type will take

// precedence.


=== system/lib/emmalloc.c ===
SHA256: 33e4f77ea1d7bcb85f164f0fd269bb24513789c958023f095285807f84f7ef7c
/*
 * Copyright 2018 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 *
 * Simple minimalistic but efficient sbrk()-based malloc/free that works in
 * singlethreaded and multithreaded builds.
 *
 * Assumptions:
 *
 *  - sbrk() is used to claim new memory (sbrk handles geometric/linear
 *  - overallocation growth)
 *  - sbrk() can also be called by other code, not reserved to emmalloc only.
 *  - sbrk() is very fast in most cases (internal wasm call).
 *  - sbrk() returns pointers with an alignment of alignof(max_align_t)
 *
 * Invariants:
 *
 *  - Per-allocation header overhead is 8 bytes, smallest allocated payload
 *    amount is 8 bytes, and a multiple of 4 bytes.
 *  - Acquired memory blocks are subdivided into disjoint regions that lie
 *    next to each other.
 *  - A region is either in use or free.
 *    Used regions may be adjacent, and a used and unused region
 *    may be adjacent, but not two unused ones - they would be
 *    merged.
 *  - Memory allocation takes constant time, unless the alloc needs to sbrk()
 *    or memory is very close to being exhausted.
 *  - Free and used regions are managed inside "root regions", which are slabs
 *    of memory acquired via calls to sbrk().
 *
 * Debugging:
 *
 *  - If not NDEBUG, runtime assert()s are in use.
 *  - If EMMALLOC_MEMVALIDATE is defined, a large amount of extra checks are done.
 *  - If EMMALLOC_VERBOSE is defined, a lot of operations are logged using
 *    `out`, in addition to EMMALLOC_MEMVALIDATE.
 *  - Debugging and logging directly uses `out` and `err` via EM_ASM, not
 *    printf etc., to minimize any risk of debugging or logging depending on
 *    malloc.
 *
 * Exporting:
 *
 *  - By default we declare not only emmalloc_malloc, emmalloc_free, etc. but
 *    also the standard library methods like malloc, free, and some aliases.
 *    You can override this by defining EMMALLOC_NO_STD_EXPORTS, in which case
 *    we only declare the emalloc_* ones but not the standard ones.
 */

// Behavior of right shifting a signed integer is compiler implementation defined.

// Configuration: specifies the minimum alignment that malloc()ed memory outputs. Allocation requests with smaller alignment

// than this will yield an allocation with this much alignment.

// Dynamic memory is subdivided into regions, in the format

// <size:uint32_t> ..... <size:uint32_t> | <size:uint32_t> ..... <size:uint32_t> | <size:uint32_t> ..... <size:uint32_t> | .....

// That is, at the bottom and top end of each memory region, the size of that region is stored. That allows traversing the

// memory regions backwards and forwards. Because each allocation must be at least a multiple of 4 bytes, the lowest two bits of

// each size field is unused. Free regions are distinguished from used regions by having the FREE_REGION_FLAG bit present

// in the size field. I.e. for free regions, the size field is odd, and for used regions, the size field reads even.

// Attempts to malloc() more than this many bytes would cause an overflow when calculating the size of a region,

// therefore allocations larger than this are short-circuited immediately on entry.

// A free region has the following structure:

// <size:size_t> <prevptr> <nextptr> ... <size:size_t>

// Use a circular doubly linked list to represent free region data.

// ... N bytes of free data

// do not dereference, this is present for convenient struct sizeof() computation only

// Each memory block starts with a RootRegion at the beginning.

// The RootRegion specifies the size of the region block, and forms a linked

// list of all RootRegions in the program, starting with `listOfAllRegions`

// below.

// In multithreaded builds, use a simple global spinlock strategy to acquire/release access to the memory allocator.

/*nop*/

// Test code to ensure we have tight malloc acquire/release guards in place.

// In singlethreaded builds, no need for locking.

// A region that contains as payload a single forward linked list of pointers to

// root regions of each disjoint region blocks.

// For each of the buckets, maintain a linked list head node. The head node for each

// free region is a sentinel node that does not actually represent any free space, but

// the sentinel is used to avoid awkward testing against (if node == freeRegionHeadNode)

// when adding and removing elements from the linked list, i.e. we are guaranteed that

// the sentinel node is always fixed and there, and the actual free region list elements

// start at freeRegionBuckets[i].next each.

// A bitmask that tracks the population status for each of the 64 distinct memory regions:

// a zero at bit position i means that the free list bucket i is empty. This bitmask is

// used to avoid redundant scanning of the 64 different free region buckets: instead by

// looking at the bitmask we can find in constant time an index to a free region bucket

// that contains free memory of desired size.

// Amount of bytes taken up by allocation header data

// Smallest allocation size that is possible is 2*pointer size, since payload of each region must at least contain space

// to store the free region linked list prev and next pointers. An allocation size smaller than this will be rounded up

// to this size.

/* Subdivide regions of free space into distinct circular doubly linked lists, where each linked list
represents a range of free space blocks. The following function compute_free_list_bucket() converts
an allocation size to the bucket index that should be looked at. The buckets are grouped as follows:

  Bucket 0: [8, 15], range size=8
  Bucket 1: [16, 23], range size=8
  Bucket 2: [24, 31], range size=8
  Bucket 3: [32, 39], range size=8
  Bucket 4: [40, 47], range size=8
  Bucket 5: [48, 55], range size=8
  Bucket 6: [56, 63], range size=8
  Bucket 7: [64, 71], range size=8
  Bucket 8: [72, 79], range size=8
  Bucket 9: [80, 87], range size=8
  Bucket 10: [88, 95], range size=8
  Bucket 11: [96, 103], range size=8
  Bucket 12: [104, 111], range size=8
  Bucket 13: [112, 119], range size=8
  Bucket 14: [120, 159], range size=40
  Bucket 15: [160, 191], range size=32
  Bucket 16: [192, 223], range size=32
  Bucket 17: [224, 255], range size=32
  Bucket 18: [256, 319], range size=64
  Bucket 19: [320, 383], range size=64
  Bucket 20: [384, 447], range size=64
  Bucket 21: [448, 511], range size=64
  Bucket 22: [512, 639], range size=128
  Bucket 23: [640, 767], range size=128
  Bucket 24: [768, 895], range size=128
  Bucket 25: [896, 1023], range size=128
  Bucket 26: [1024, 1279], range size=256
  Bucket 27: [1280, 1535], range size=256
  Bucket 28: [1536, 1791], range size=256
  Bucket 29: [1792, 2047], range size=256
  Bucket 30: [2048, 2559], range size=512
  Bucket 31: [2560, 3071], range size=512
  Bucket 32: [3072, 3583], range size=512
  Bucket 33: [3584, 6143], range size=2560
  Bucket 34: [6144, 8191], range size=2048
  Bucket 35: [8192, 12287], range size=4096
  Bucket 36: [12288, 16383], range size=4096
  Bucket 37: [16384, 24575], range size=8192
  Bucket 38: [24576, 32767], range size=8192
  Bucket 39: [32768, 49151], range size=16384
  Bucket 40: [49152, 65535], range size=16384
  Bucket 41: [65536, 98303], range size=32768
  Bucket 42: [98304, 131071], range size=32768
  Bucket 43: [131072, 196607], range size=65536
  Bucket 44: [196608, 262143], range size=65536
  Bucket 45: [262144, 393215], range size=131072
  Bucket 46: [393216, 524287], range size=131072
  Bucket 47: [524288, 786431], range size=262144
  Bucket 48: [786432, 1048575], range size=262144
  Bucket 49: [1048576, 1572863], range size=524288
  Bucket 50: [1572864, 2097151], range size=524288
  Bucket 51: [2097152, 3145727], range size=1048576
  Bucket 52: [3145728, 4194303], range size=1048576
  Bucket 53: [4194304, 6291455], range size=2097152
  Bucket 54: [6291456, 8388607], range size=2097152
  Bucket 55: [8388608, 12582911], range size=4194304
  Bucket 56: [12582912, 16777215], range size=4194304
  Bucket 57: [16777216, 25165823], range size=8388608
  Bucket 58: [25165824, 33554431], range size=8388608
  Bucket 59: [33554432, 50331647], range size=16777216
  Bucket 60: [50331648, 67108863], range size=16777216
  Bucket 61: [67108864, 100663295], range size=33554432
  Bucket 62: [100663296, 134217727], range size=33554432
  Bucket 63: 134217728 bytes and larger. */

// N.b. the region we are prepending to is always the sentinel node,

// which represents a dummy node that is technically not a free node, so

// region_is_free(prependTo) does not hold.

// Make sure we always send sbrk requests with the same alignment that sbrk()

// allocates memory at. Otherwise we will not properly interpret returned memory

// to form a seamlessly contiguous region with earlier root regions, which would

// lead to inefficiently treating the sbrk()ed region to be a new disjoint root

// region.

// Claim memory via sbrk

// Create a sentinel region at the end of the new heap block

// If we are the sole user of sbrk(), it will feed us continuous/consecutive memory addresses - take advantage

// of that if so: instead of creating two disjoint memory regions blocks, expand the previous one to a larger size.

// Two scenarios, either the last region of the previous block was in use, in which case we need to create

// a new free region in the newly allocated space; or it was free, in which case we can extend that region

// to cover a larger size.

// else: last region of the previous block was in use. Since we are joining two consecutive sbrk() blocks,

// we can swallow the end sentinel of the previous block away.

// Unfortunately some other user has sbrk()ed to acquire a slab of memory for themselves, and now the sbrk()ed

// memory we got is not contiguous with our previous managed root regions.

// So create a new root region at the start of the sbrk()ed heap block.

// Dynamic heap start region:

// Pointer to next region block head

// Pointer to the end address of this region block

// Create a new memory region for the new claimed free space.

// Initialize emmalloc during static initialization.

// See system/lib/README.md for static constructor ordering.

// Initialize circular doubly linked lists representing free space

// Never useful to unroll this for loop, just takes up code size.

// Start with a tiny dynamic region.

// Look at the next potential free region to allocate into.

// First, we should check if the free region has enough of payload bytes contained

// in it to accommodate the new allocation. This check needs to take into account the

// requested allocation alignment, so the payload memory area needs to be rounded

// upwards to the desired alignment.

// Do we have enough free space, taking into account alignment?

// We have enough free space, so the memory allocation will be made into this region. Remove this free region

// from the list of free regions: whatever slop remains will be later added back to the free region pool.

// Before we proceed further, fix up the boundary between this and the preceding region,

// so that the boundary between the two regions happens at a right spot for the payload to be aligned.

// We never have two free regions adjacent to each other, so the region before this free

// region should be in use.

// Next, we need to decide whether this region is so large that it should be split into two regions,

// one representing the newly used memory area, and at the high end a remaining leftover free area.

// This splitting to two is done always if there is enough space for the high end to fit a region.

// Carve 'size' bytes of payload off this region. So,

// [sz prev next sz]

// becomes

// [sz payload sz] [sz prev next sz]

// There is enough space to keep a free region at the end of the carved out block

// -> construct the new block

// Recreate the resized Region under its new size.

// There is not enough space to split the free memory region into used+free parts, so consume the whole

// region as used memory, not leaving a free memory region behind.

// Initialize the free region as used by resetting the ceiling size to the same value as the size at bottom.

// Cannot perform allocations that are less than our minimal alignment, because

// the Region control structures need to be aligned themselves.

// Allocation sizes must be a multiple of pointer sizes, and at least 2*sizeof(pointer).

// 32-bit wraparound should not occur, too large sizes should be stopped before

// Attempt to allocate memory starting from smallest bucket that can contain the required amount of memory.

// Under normal alignment conditions this should always be the first or second bucket we look at, but if

// performing an allocation with complex alignment, we may need to look at multiple buckets.

// Loop through each bucket that has free regions in it, based on bits set in freeRegionBucketsUsed bitmap.

// We were not able to allocate from the first region found in this bucket, so penalize

// the region by cycling it to the end of the doubly circular linked list. (constant time)

// This provides a randomized guarantee that when performing allocations of size k to a

// bucket of [k-something, k+something] range, we will not always attempt to satisfy the

// allocation from the same available region at the front of the list, but we try each

// region in turn.

// But do not stick around to attempt to look at other regions in this bucket - move

// to search the next populated bucket index if this did not fit. This gives a practical

// "allocation in constant time" guarantee, since the next higher bucket will only have

// regions that are all of strictly larger size than the requested allocation. Only if

// there is a difficult alignment requirement we may fail to perform the allocation from

// a region in the next bucket, and if so, we keep trying higher buckets until one of them

// works.

// This bucket was not populated after all with any regions,

// but we just had a stale bit set to mark a populated bucket.

// Reset the bit to update latest status so that we do not

// redundantly look at this bucket again.

// Instead of recomputing bucketMask from scratch at the end of each loop, it is updated as we go,

// to avoid undefined behavior with (x >> 32)/(x >> 64) when bucketIndex reaches 32/64, (the shift would come out as a no-op instead of 0).

// None of the buckets were able to accommodate an allocation. If this happens we are almost out of memory.

// The largest bucket might contain some suitable regions, but we only looked at one region in that bucket, so

// as a last resort, loop through more free regions in the bucket that represents the largest allocations available.

// But only if the bucket representing largest allocations available is not any of the first thirty buckets,

// these represent allocatable areas less than <1024 bytes - which could be a lot of scrap.

// In such case, prefer to sbrk() in more memory right away.

// freeRegion will be null if there is absolutely no memory left. (all buckets are 100% used)

// The 30 first free region buckets cover memory blocks < 2048 bytes, so skip looking at those here (too small)

// Look only at a constant number of regions in this bucket max, to avoid bad worst case behavior.

// If this many regions cannot find free space, we give up and prefer to sbrk() more instead.

// We were unable to find a free memory region. Must sbrk() in more memory!

// Take into account the alignment as well. For typical alignment we don't

// need to add anything here (so we do nothing if the alignment is equal to

// MALLOC_ALIGNMENT), but it can matter if the alignment is very high. In that

// case, not adding the alignment can lead to this sbrk not giving us enough

// (in which case, the next attempt fails and will sbrk the same amount again,

// potentially allocating a lot more memory than necessary).

//

// Note that this is not necessarily optimal, as the extra allocation size for

// the alignment might not be needed (if we are lucky and already aligned),

// and even if it helps us allocate it will not immediately be ready for reuse

// (as it will be added to the currently-in-use region before us, so it is not

// in a free list). As a compromise however it seems reasonable in practice as

// a way to handle large aligned regions to avoid even worse waste.

// 32-bit wraparound should not happen here, allocation size has been validated above!

// Recurse back to itself to try again

// also sbrk() failed, we are really really constrained :( As a last resort, go back to looking at the

// bucket we already looked at above, continuing where the above search left off - perhaps there are

// regions we overlooked the first time that might be able to satisfy the allocation.

// LLVM wasm backend bug: cannot use MAIN_THREAD_ASYNC_EM_ASM() here, that generates internal compiler error

// Reproducible by running e.g. other.test_alloc_3GB

// Check merging with left side

// Previous region is free?

// Check merging with right side

// Can be called to attempt to increase or decrease the size of the given region

// to a new size (in-place). Returns 1 if resize succeeds, and 0 on failure.

// First attempt to resize this region, if the next region that follows this one

// is a free region.

// Next region is free?

// Next region does not shrink to too small size?

// If we remove the next region altogether, allocation is satisfied?

// Next region is a used region - we cannot change its starting address. However if we are shrinking the

// size of this region, we can create a new free region between this and the next used region.

// Caller was asking to shrink the size, but due to not being able to fit a full Region in the shrunk

// area, we cannot actually do anything. This occurs if the shrink amount is really small. In such case,

// just call it success without doing any work.

// aligned_realloc() cannot be used to ask to change the alignment of a pointer.

// Calculate the region start address of the original allocation

// First attempt to resize the given region to avoid having to copy memory around

// If resize failed, we must allocate a new region, copy the data over, and then

// free the old region.

// N.B. If there is not enough memory, the old memory block should not be freed and

// null pointer is returned.

// realloc_try() is like realloc(), but only attempts to try to resize the existing memory

// area. If resizing the existing memory area fails, then realloc_try() will return 0

// (the original memory block is not freed or modified). If resizing succeeds, previous

// memory contents will be valid up to min(old length, new length) bytes.

// Calculate the region start address of the original allocation

// Attempt to resize the given region to avoid having to copy memory around

// emmalloc_aligned_realloc_uninitialized() is like aligned_realloc(), but old memory contents

// will be undefined after reallocation. (old memory is not preserved in any case)

// Calculate the region start address of the original allocation

// First attempt to resize the given region to avoid having to copy memory around

// If resize failed, drop the old region and allocate a new region. Memory is not

// copied over

// realloc_uninitialized() is like realloc(), but old memory contents

// will be undefined after reallocation. (old memory is not preserved in any case)

// Non-mmapped space allocated (bytes): For emmalloc,

// let's define this as the difference between heap size and dynamic top end.

// Number of "ordinary" blocks. Let's define this as the number of highest

// size blocks. (subtract one from each, since there is a sentinel node in each list)

// Number of free "fastbin" blocks. For emmalloc, define this as the number

// of blocks that are not in the largest pristine block.

// The total number of bytes in free "fastbin" blocks.

// Number of mmapped regions: always 0. (no mmap support)

// Amount of bytes in mmapped regions: always 0. (no mmap support)

// Walk through all the heap blocks to report the following data:

// The "highwater mark" for allocated space—that is, the maximum amount of

// space that was ever allocated. Emmalloc does not want to pay code to

// track this, so this is only reported from current allocation data, and

// may not be accurate.

// The total number of bytes used by in-use allocations.

// The total number of bytes in free blocks.

// The total amount of releasable free space at the top of the heap.

// This is the maximum number of bytes that could ideally be released by malloc_trim(3).

// Count only the payload of the free block towards free memory.

// But the header data of the free block goes towards used memory.

// Update approximate watermark data

// Note! This function is not fully multithreading safe: while this function is running, other threads should not be

// allowed to call sbrk()!

// emmalloc is not controlling any dynamic memory at all - cannot release memory.

// Sanitize odd alignments for padding values - this is the minimum alignment

// that emmalloc could handle. Align up to be conservative towards caller.

// Calculate how many bytes we can shrink the sbrk() reservation by.

// Is the last free region smaller than what was requested to be left behind?

// If so, then there is nothing we can trim.

// Subtract region size members off to calculate the excess bytes in payload.

// sbrk() alignment is multiple of __alignof__(max_align_t), so round the

// trimming down to ensure that alignment is preserved.

// Nothing left to trim?

// If we can't fit a free Region in the shrunk space, we should delete the 

// last free region altogether.

// Call sbrk() to shrink the memory area.

// Shrinking with sbrk() should never fail.

// Ask where sbrk got us at.

// Recreate the sentinel region at the end of the last free region.

// And update the size field of the whole region block.

// All successful, and we actually trimmed memory!

// Loop through each bucket that has free regions in it, based on bits set in freeRegionBucketsUsed bitmap.

// Loop through each bucket that has free regions in it, based on bits set in freeRegionBucketsUsed bitmap.


=== system/lib/fetch/emscripten_fetch.c ===
SHA256: c5e4a1a660427b7bd15776e1bd1f65531197510749ee5d57c6be35f21c1a319c
// Copyright 2016 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// From https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState

// Client has been created. open() not called yet.

// open() has been called.

// send() has been called, and headers and status are available.

// Downloading; responseText holds partial data.

// The operation is complete.

// Uncomment the following and clear the cache with emcc --clear-cache to rebuild this file to

// enable internal debugging. #define FETCH_DEBUG

// TODO: mutex lock

// TODO handle case when queue->numQueuedItems >= queue->queueSize

// TODO: mutex unlock

// responseUrl is not set until STATE_HEADERS_RECEIVED

// Closing null pointer is ok, same as with free().

// This function frees the fetch pointer so that it is invalid to access it anymore.

// Use a few key fields as an integrity check that we are being passed a good pointer to a valid

// fetch structure, which has not been yet closed. (double close is an error)

// This fetch is aborted. Call the error handler if the fetch was still in progress and was

// canceled in flight.

// Get size of output array and allocate.

// Allocate each header.


=== system/lib/gl/gl.c ===
SHA256: 047fb5594313660a5af014453b1f37da8ea7e5fe7b73c78c72b5d699f27423df
/*
 * Copyright 2014 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// GL proc address retrieval

// main list, autogenerated from the earlier part of the file using

/*
for line in open('a').readlines():
  if "emscripten" not in line: continue
  line = line.replace(' * ', ' ').replace('const ', '').replace('(', ' ')
  func = line.split(' ')[3].strip().replace('(', '')
  short = func.replace('EXT', '').replace('ARB', '').replace('OES', '').replace('ANGLE', '').replace('emscripten_', '')
  print '  if (!strcmp(name, "%s")) return %s;' % (short, func);
  */

// The following list contains only exactly those functions that library_glemu.js currently implements.

// Others will return a null pointer.

// misc renamings

//RETURN_GL_EMU_FN(glVertex2d);

//RETURN_GL_EMU_FN(glVertex2s);

//RETURN_GL_EMU_FN(glVertex3d);

//RETURN_GL_EMU_FN(glVertex3s);

//RETURN_GL_EMU_FN(glVertex4d);

//RETURN_GL_EMU_FN(glVertex4s);

//RETURN_GL_EMU_FN(glVertex2dv);

//RETURN_GL_EMU_FN(glVertex2iv);

//RETURN_GL_EMU_FN(glVertex2sv);

//RETURN_GL_EMU_FN(glVertex3dv);

//RETURN_GL_EMU_FN(glVertex3iv);

//RETURN_GL_EMU_FN(glVertex3sv);

//RETURN_GL_EMU_FN(glVertex4dv);

//RETURN_GL_EMU_FN(glVertex4iv);

//RETURN_GL_EMU_FN(glVertex4sv);

//RETURN_GL_EMU_FN(glColor3b);

//RETURN_GL_EMU_FN(glColor3i);

//RETURN_GL_EMU_FN(glColor3s);

//RETURN_GL_EMU_FN(glColor4b);

//RETURN_GL_EMU_FN(glColor4i);

//RETURN_GL_EMU_FN(glColor4s);

//RETURN_GL_EMU_FN(glColor3bv);

//RETURN_GL_EMU_FN(glColor3dv);

//RETURN_GL_EMU_FN(glColor3iv);

//RETURN_GL_EMU_FN(glColor3sv);

//RETURN_GL_EMU_FN(glColor4bv);

//RETURN_GL_EMU_FN(glColor4dv);

//RETURN_GL_EMU_FN(glColor4iv);

//RETURN_GL_EMU_FN(glColor4sv);

//RETURN_GL_EMU_FN(glColor4uiv);

//RETURN_GL_EMU_FN(glColor4usv);

//RETURN_GL_EMU_FN(glFogCoordf);

//RETURN_GL_EMU_FN(glFogCoordfv);

//RETURN_GL_EMU_FN(glFogCoordd);

//RETURN_GL_EMU_FN(glFogCoorddv);

//RETURN_GL_EMU_FN(glFogCoordPointer);

//RETURN_GL_EMU_FN(glNormal3b);

//RETURN_GL_EMU_FN(glNormal3d);

//RETURN_GL_EMU_FN(glNormal3i);

//RETURN_GL_EMU_FN(glNormal3s);

//RETURN_GL_EMU_FN(glNormal3bv);

//RETURN_GL_EMU_FN(glNormal3dv);

//RETURN_GL_EMU_FN(glNormal3fv);

//RETURN_GL_EMU_FN(glNormal3iv);

//RETURN_GL_EMU_FN(glNormal3sv);

//RETURN_GL_EMU_FN(glLightf);

//RETURN_GL_EMU_FN(glLighti);

//RETURN_GL_EMU_FN(glLightiv);

//RETURN_GL_EMU_FN(glLightModeli);

//RETURN_GL_EMU_FN(glLightModeliv);

//RETURN_GL_EMU_FN(glMaterialf);

//RETURN_GL_EMU_FN(glMateriali);

//RETURN_GL_EMU_FN(glMaterialiv);

//RETURN_GL_EMU_FN(glTexGend);

//RETURN_GL_EMU_FN(glTexGenf);

//RETURN_GL_EMU_FN(glTexGendv);

//RETURN_GL_EMU_FN(glTexGeniv);

//RETURN_GL_EMU_FN(glTexCoord1d);

//RETURN_GL_EMU_FN(glTexCoord1f);

//RETURN_GL_EMU_FN(glTexCoord1i);

//RETURN_GL_EMU_FN(glTexCoord1s);

//RETURN_GL_EMU_FN(glTexCoord2d);

//RETURN_GL_EMU_FN(glTexCoord2s);

//RETURN_GL_EMU_FN(glTexCoord3d);

//RETURN_GL_EMU_FN(glTexCoord3i);

//RETURN_GL_EMU_FN(glTexCoord3s);

//RETURN_GL_EMU_FN(glTexCoord4d);

//RETURN_GL_EMU_FN(glTexCoord4i);

//RETURN_GL_EMU_FN(glTexCoord4s);

//RETURN_GL_EMU_FN(glTexCoord1dv);

//RETURN_GL_EMU_FN(glTexCoord1fv);

//RETURN_GL_EMU_FN(glTexCoord1iv);

//RETURN_GL_EMU_FN(glTexCoord1sv);

//RETURN_GL_EMU_FN(glTexCoord2dv);

//RETURN_GL_EMU_FN(glTexCoord2iv);

//RETURN_GL_EMU_FN(glTexCoord2sv);

//RETURN_GL_EMU_FN(glTexCoord3dv);

//RETURN_GL_EMU_FN(glTexCoord3fv);

//RETURN_GL_EMU_FN(glTexCoord3iv);

//RETURN_GL_EMU_FN(glTexCoord3sv);

//RETURN_GL_EMU_FN(glTexCoord4dv);

//RETURN_GL_EMU_FN(glTexCoord4fv);

//RETURN_GL_EMU_FN(glTexCoord4iv);

//RETURN_GL_EMU_FN(glTexCoord4sv);

//RETURN_GL_EMU_FN(glGetTexLevelParameterfv);

// GL emulation library "sloppy" lookup:

// WebGL 1 extensions are offered without their EXT suffixes.

// "Sloppy" desktop OpenGL/mobile GLES emulating

// behavior: different functionality is available under

// different vendor suffixes. In emscripten_GetProcAddress()

// function, all these suffixes will be ignored when performing

// the function pointer lookup.

// remove EXT|ARB|OES|ANGLE suffixes


=== system/lib/gl/libprocaddr.c ===
SHA256: 1a2f9b76cd6a43e45d1b6721ace003f042792f1ab8e6595804562d4cb35fe9bb
/*
 * Copyright 2021 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// GL proc address library integration

// SDL2 will link in its own version of this


=== system/lib/gl/webgl1.c ===
SHA256: 7bb72e5f0fc6c56b2c07475b385f45699109ebc836ef390d76f910fbdcb4aa96
/*
 * Copyright 2018 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Default context initialization state (user can override):

// - if main thread is creating the context, default to the context not being

//   shared between threads - enabling sharing has performance overhead,

//   because it forces the context to be OffscreenCanvas or

//   OffscreenFramebuffer.

// - if a web worker is creating the context, default to using OffscreenCanvas

//   if available, or proxying via Offscreen Framebuffer if not

// When OFFSCREEN_FRAMEBUFFER is enabled the EMSCRIPTEN_WEBGL_CONTEXT_HANDLE

// is a pointer to a struct with two fields.  See registerContext in

// library_webgl.js

// run small buffer sizes asynchronously by copying - large buffers run synchronously

// glBufferData(data=0) can always be handled asynchronously

// Fall through on allocation failure and run synchronously.

// run small buffer sizes asynchronously by copying - large buffers run synchronously

// Fall through on allocation failure and run synchronously.

// TODO: The following #define FULL_ES2 does not yet exist, we'll need to compile this file twice, for FULL_ES2 mode and without

// TODO: THIS COULD POTENTIALLY BE ASYNC

/*GL_SRGB_EXT*/

/*GL_SRGB_ALPHA_EXT*/

/*GL_HALF_FLOAT_OES*/

// run small buffer sizes asynchronously by copying - large buffers run synchronously

// Fall through on allocation failure and run synchronously.

// run small buffer sizes asynchronously by copying - large buffers run synchronously

// Fall through on allocation failure and run synchronously.

// run small buffer sizes asynchronously by copying - large buffers run synchronously

// Fall through on allocation failure and run synchronously.

// run small buffer sizes asynchronously by copying - large buffers run synchronously

// Fall through on allocation failure and run synchronously.

// run small buffer sizes asynchronously by copying - large buffers run synchronously

// Fall through on allocation failure and run synchronously.

// run small buffer sizes asynchronously by copying - large buffers run synchronously

// Fall through on allocation failure and run synchronously.

// run small buffer sizes asynchronously by copying - large buffers run synchronously

// Fall through on allocation failure and run synchronously.

// run small buffer sizes asynchronously by copying - large buffers run synchronously

// Fall through on allocation failure and run synchronously.

// run small buffer sizes asynchronously by copying - large buffers run synchronously

// Fall through on allocation failure and run synchronously.

// run small buffer sizes asynchronously by copying - large buffers run synchronously

// Fall through on allocation failure and run synchronously.

// run small buffer sizes asynchronously by copying - large buffers run synchronously

// Fall through on allocation failure and run synchronously.

// run small buffer sizes asynchronously by copying - large buffers run synchronously

// Fall through on allocation failure and run synchronously.

// run small buffer sizes asynchronously by copying - large buffers run synchronously

// Fall through on allocation failure and run synchronously.

// TODO: The following #define FULL_ES2 does not yet exist, we'll need to compile this file twice, for FULL_ES2 mode and without

// ~(__EMSCRIPTEN_PTHREADS__ && __EMSCRIPTEN_OFFSCREEN_FRAMEBUFFER__)

// Returns a function pointer to the given WebGL 1 extension function, when queried without

// a GL extension suffix such as "EXT", "OES", or "ANGLE". This function is used by

// emscripten_GetProcAddress() to implement legacy GL emulation semantics for portability.

// WebGL 1 , Extensions

// WebGL 1 Extensions


=== system/lib/gl/webgl2.c ===
SHA256: 8fbf382f4b0217929335a5b35d0df40d4fe8efe85bff2870c6aec4e5c851ddc1
/*
 * Copyright 2018 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// TODO: Not async if rendering from client side memory

// TODO: Not async if not rendering from client side memory

// TODO: Not async if rendering from client side memory

// Extensions that are aliases for the proxying functions defined above.

// Normally these aliases get defined in library_webgl.js but when building with

// __EMSCRIPTEN_OFFSCREEN_FRAMEBUFFER__ we want to intercept them in native

// code and redirect them to their proxying counterparts.

// ~__EMSCRIPTEN_PTHREADS__) && __EMSCRIPTEN_OFFSCREEN_FRAMEBUFFER__

// Returns a function pointer to the given WebGL 2 extension function, when queried without

// a GL extension suffix such as "EXT", "OES", or "ANGLE". This function is used by

// emscripten_GetProcAddress() to implement legacy GL emulation semantics for portability.

// WebGL 2 extensions:

// (currently none)

// GL_ENABLE_GET_PROC_ADDRESS

// defined(__EMSCRIPTEN_FULL_ES3__) || MAX_WEBGL_VERSION >= 2


=== system/lib/gl/webgl_internal.h ===
SHA256: c3f0bb0d3fe94eeedd9ca00fcc0ad0b5eba69d3bad31e4075ca1ced35de280a1
/*
 * Copyright 2018 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// When building with multithreading, return pointers to C functions that can perform proxying.

// When building with singlethreading, return pointers to JS library layer so that C code (Regal library)

// can override them.


=== system/lib/gl/webgl_internal_funcs.h ===
SHA256: c4dfaae6639bceb9537926631a006199fdfb4f539626385295f5fa0a2340ecb3
// Functions declared here are just the ones that we don't declare in our webgl

// headers.  These are used by emscripten_legacy_gl_emulation_GetProcAddress

// but not declared in the public webgl headers.

/*
 * Miscellaneous
 */

/* 1.1 */

/* 1.1 */

/* 1.1 */

/* 1.1 */

/*
 * Depth Buffer
 */

/*
 * Accumulation Buffer
 */

/*
 * Transformation
 */

/*
 * Display Lists
 */

/*
 * Drawing Functions
 */

/* 1.1 */

/* 1.1 */

/*
 * Vertex Arrays  (1.1)
 */

/*
 * Lighting
 */

/*
 * Raster functions
 */

/*
 * Stenciling
 */

/*
 * Texture mapping
 */

/* 1.1 functions */

/*
 * Evaluators
 */

/*
 * Fog
 */

/*
 * Selection and Feedback
 */


=== system/lib/html5/callback.c ===
SHA256: b8010be3421dc658468941eb5825867a10d5d29ed15fc0d86faea58ba29353f9
/*
 * Copyright 2023 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */


=== system/lib/html5/dom_pk_codes.c ===
SHA256: 4b0c3b392b5da0ba300df4c9747cf3bf9fafabd7cbb846649b0b3ca09ec2b9a0
/*
 * This file was automatically generated from script
 * tools/maint/create_dom_pk_codes.py. Edit that file to make changes here.
 * Then run:
 *
 *  tools/maint/create_dom_pk_codes.py
 *
 * in Emscripten root directory to regenerate this file.
 */

/* Compute the collision free hash. */

/*
   * Don't expose the hash values out to the application, but map to fixed IDs.
   * This is useful for mapping back codes to MDN documentation page at
   *
   *   https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code
   */

/* Unidentified       */

/* 0x0000 */

/* Escape             */

/* 0x0001 */

/* Digit0             */

/* 0x0002 */

/* Digit1             */

/* 0x0003 */

/* Digit2             */

/* 0x0004 */

/* Digit3             */

/* 0x0005 */

/* Digit4             */

/* 0x0006 */

/* Digit5             */

/* 0x0007 */

/* Digit6             */

/* 0x0008 */

/* Digit7             */

/* 0x0009 */

/* Digit8             */

/* 0x000A */

/* Digit9             */

/* 0x000B */

/* Minus              */

/* 0x000C */

/* Equal              */

/* 0x000D */

/* Backspace          */

/* 0x000E */

/* Tab                */

/* 0x000F */

/* KeyQ               */

/* 0x0010 */

/* KeyW               */

/* 0x0011 */

/* KeyE               */

/* 0x0012 */

/* KeyR               */

/* 0x0013 */

/* KeyT               */

/* 0x0014 */

/* KeyY               */

/* 0x0015 */

/* KeyU               */

/* 0x0016 */

/* KeyI               */

/* 0x0017 */

/* KeyO               */

/* 0x0018 */

/* KeyP               */

/* 0x0019 */

/* BracketLeft        */

/* 0x001A */

/* BracketRight       */

/* 0x001B */

/* Enter              */

/* 0x001C */

/* ControlLeft        */

/* 0x001D */

/* KeyA               */

/* 0x001E */

/* KeyS               */

/* 0x001F */

/* KeyD               */

/* 0x0020 */

/* KeyF               */

/* 0x0021 */

/* KeyG               */

/* 0x0022 */

/* KeyH               */

/* 0x0023 */

/* KeyJ               */

/* 0x0024 */

/* KeyK               */

/* 0x0025 */

/* KeyL               */

/* 0x0026 */

/* Semicolon          */

/* 0x0027 */

/* Quote              */

/* 0x0028 */

/* Backquote          */

/* 0x0029 */

/* ShiftLeft          */

/* 0x002A */

/* Backslash          */

/* 0x002B */

/* KeyZ               */

/* 0x002C */

/* KeyX               */

/* 0x002D */

/* KeyC               */

/* 0x002E */

/* KeyV               */

/* 0x002F */

/* KeyB               */

/* 0x0030 */

/* KeyN               */

/* 0x0031 */

/* KeyM               */

/* 0x0032 */

/* Comma              */

/* 0x0033 */

/* Period             */

/* 0x0034 */

/* Slash              */

/* 0x0035 */

/* ShiftRight         */

/* 0x0036 */

/* NumpadMultiply     */

/* 0x0037 */

/* AltLeft            */

/* 0x0038 */

/* Space              */

/* 0x0039 */

/* CapsLock           */

/* 0x003A */

/* F1                 */

/* 0x003B */

/* F2                 */

/* 0x003C */

/* F3                 */

/* 0x003D */

/* F4                 */

/* 0x003E */

/* F5                 */

/* 0x003F */

/* F6                 */

/* 0x0040 */

/* F7                 */

/* 0x0041 */

/* F8                 */

/* 0x0042 */

/* F9                 */

/* 0x0043 */

/* F10                */

/* 0x0044 */

/* Pause              */

/* 0x0045 */

/* ScrollLock         */

/* 0x0046 */

/* Numpad7            */

/* 0x0047 */

/* Numpad8            */

/* 0x0048 */

/* Numpad9            */

/* 0x0049 */

/* NumpadSubtract     */

/* 0x004A */

/* Numpad4            */

/* 0x004B */

/* Numpad5            */

/* 0x004C */

/* Numpad6            */

/* 0x004D */

/* NumpadAdd          */

/* 0x004E */

/* Numpad1            */

/* 0x004F */

/* Numpad2            */

/* 0x0050 */

/* Numpad3            */

/* 0x0051 */

/* Numpad0            */

/* 0x0052 */

/* NumpadDecimal      */

/* 0x0053 */

/* PrintScreen        */

/* 0x0054 */

/* IntlBackslash      */

/* 0x0056 */

/* F11                */

/* 0x0057 */

/* F12                */

/* 0x0058 */

/* NumpadEqual        */

/* 0x0059 */

/* F13                */

/* 0x0064 */

/* F14                */

/* 0x0065 */

/* F15                */

/* 0x0066 */

/* F16                */

/* 0x0067 */

/* F17                */

/* 0x0068 */

/* F18                */

/* 0x0069 */

/* F19                */

/* 0x006A */

/* F20                */

/* 0x006B */

/* F21                */

/* 0x006C */

/* F22                */

/* 0x006D */

/* F23                */

/* 0x006E */

/* KanaMode           */

/* 0x0070 */

/* Lang2              */

/* 0x0071 */

/* Lang1              */

/* 0x0072 */

/* IntlRo             */

/* 0x0073 */

/* F24                */

/* 0x0076 */

/* Convert            */

/* 0x0079 */

/* NonConvert         */

/* 0x007B */

/* IntlYen            */

/* 0x007D */

/* NumpadComma        */

/* 0x007E */

/* Paste              */

/* 0xE00A */

/* MediaTrackPrevious */

/* 0xE010 */

/* Cut                */

/* 0xE017 */

/* Copy               */

/* 0xE018 */

/* MediaTrackNext     */

/* 0xE019 */

/* NumpadEnter        */

/* 0xE01C */

/* ControlRight       */

/* 0xE01D */

/* AudioVolumeMute    */

/* 0xE020 */

/* VolumeMute         */

/* 0xE020 */

/* LaunchApp2         */

/* 0xE021 */

/* MediaPlayPause     */

/* 0xE022 */

/* MediaStop          */

/* 0xE024 */

/* Eject              */

/* 0xE02C */

/* AudioVolumeDown    */

/* 0xE02E */

/* VolumeDown         */

/* 0xE02E */

/* AudioVolumeUp      */

/* 0xE030 */

/* VolumeUp           */

/* 0xE030 */

/* BrowserHome        */

/* 0xE032 */

/* NumpadDivide       */

/* 0xE035 */

/* AltRight           */

/* 0xE038 */

/* Help               */

/* 0xE03B */

/* NumLock            */

/* 0xE045 */

/* Home               */

/* 0xE047 */

/* ArrowUp            */

/* 0xE048 */

/* PageUp             */

/* 0xE049 */

/* ArrowLeft          */

/* 0xE04B */

/* ArrowRight         */

/* 0xE04D */

/* End                */

/* 0xE04F */

/* ArrowDown          */

/* 0xE050 */

/* PageDown           */

/* 0xE051 */

/* Insert             */

/* 0xE052 */

/* Delete             */

/* 0xE053 */

/* MetaLeft           */

/* 0xE05B */

/* OSLeft             */

/* 0xE05B */

/* MetaRight          */

/* 0xE05C */

/* OSRight            */

/* 0xE05C */

/* ContextMenu        */

/* 0xE05D */

/* Power              */

/* 0xE05E */

/* BrowserSearch      */

/* 0xE065 */

/* BrowserFavorites   */

/* 0xE066 */

/* BrowserRefresh     */

/* 0xE067 */

/* BrowserStop        */

/* 0xE068 */

/* BrowserForward     */

/* 0xE069 */

/* BrowserBack        */

/* 0xE06A */

/* LaunchApp1         */

/* 0xE06B */

/* LaunchMail         */

/* 0xE06C */

/* LaunchMediaPlayer  */

/* 0xE06D */

/* MediaSelect        */

/* 0xE06D */


=== system/lib/html5/emscripten_wget.c ===
SHA256: 4b41ca4cb83860364e559c1446186cb74631e177809aa3c712caeb34e144e96a
// Creates all ancestor directories of a given file, if they do not already

// exist. Returns 0 on success or 1 on error.

// Create any non-trivial (not the root "/") directory.

// Continue while we succeed in creating directories or while we see that

// they already exist.

// Create the ancestor directories.

// Fetch the data.

// Write the data.


=== system/lib/html5/key_codes.c ===
SHA256: e66af76d72f7ea538fd5c7d9ed0f3cc719dec39c2a9abbd57391a96faa0c8a5d
/*
 * Copyright 2017 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

/* case DOM_VK_KANA:              DOM_VK_KANA == DOM_VK_HANGUL */

/* case DOM_VK_HANJA:             DOM_VK_HANJA == DOM_VK_KANJI */

/* case DOM_VK_DOUBLE_QUOTE:      DOM_VK_DOUBLE_QUOTE == DOM_VK_HASH */


=== system/lib/html5/offscreencanvas.c ===
SHA256: 31e4abc707bea883375da3cf8d9dc5310821fb3510fc24f000e1f1564db25cdb
// This function takes ownership of the "target" string.

// taking ownership: will be freed in do_set_size

// Note: If we are also a pthread, the call below could theoretically be

// done synchronously. However if the target pthread is waiting for a

// mutex from us, then these two threads will deadlock. At the moment,

// we'd like to consider that this kind of deadlock would be an Emscripten

// runtime bug, although if emscripten_set_canvas_element_size() was

// documented to require running an event in the queue of thread that owns

// the OffscreenCanvas, then that might be ok.  (safer this way however)


=== system/lib/jsmath.c ===
SHA256: d2af8370c646f50f569d668f08957435c7782d03e76b7e744737c353754cb570
//

// See JS_MATH setting in settings.js for details.

//


=== system/lib/libc/atexit_dummy.c ===
SHA256: 7d085afbb2951dad60c4567319ae5299b669dc261767ea11f8760981c3324fb9
/*
 * Copyright 2022 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Stub implementations of atexit function.  These will be included

// in favor of the regular ones in system/lib/libc/musl/src/exit/atexit.c

// when EXIT_RUNTIME == 0.


=== system/lib/libc/crt1.c ===
SHA256: 3b5fc6e4a8f6d915ce01e0eb30f19e377022dd5e3d3d5d560726fdebcb12b81a
/*
 * Copyright 2019 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

/*
   * Will either end up calling the user's original zero argument main directly
   * or our __original_main fallback in __original_main.c which handles
   * populating argv.
   */


=== system/lib/libc/crt1_proxy_main.c ===
SHA256: 536a42b22d03c82e50905c783d836fb3e91305bd5ed049d3ee7d7a82ffb09eb5
/*
 * Copyright 2021 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// This is the main runtime thread for the application.

// Will either call user's __main_void or weak version above.

// Use the size of the current stack, which is the normal size of the stack

// that main() would have without PROXY_TO_PTHREAD.

// Pass special ID -1 to the list of transferred canvases to denote that the

// thread creation should instead take a list of canvases that are specified

// from the command line with -sOFFSCREENCANVASES_TO_PTHREAD linker flag.

// Mark the thread as strongly referenced, so that Node.js doesn't exit

// while the pthread is running.


=== system/lib/libc/crt1_reactor.c ===
SHA256: 8bcd3a6521ab827d17302b51333990b7f2fe7816a53a404afdc5926f5d41e6f6
/*
 * Copyright 2020 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */


=== system/lib/libc/emscripten_internal.h ===
SHA256: e5b60245851d8426f54704b1c1a0fed4eaed7951027e1fee7e0b63654f3ec247
/*
 * Copyright 2023 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 *
 * Declarations for internal-only JS library functions.
 *
 * All JS library functions must be declares in one header or anther in order
 * for `tools/gen_sig_info.py` to work.   This file contains declarations for
 * functions that are not declared in any other public or private header.
 */

// for `sighandler_t`

// for `bool`

// for `intptr_t`

// for `off_t`

// for `struct tm`

// Not defined in musl, but defined in library.js.  Included here for

// the benefit of gen_sig_info.py

// Synchronize loaded modules across threads.

// Runs _emscripten_dlsync_self on each of the threads that are running at

// the time of the call.

// Internal fetch API

// Internal implementation function in JavaScript side that emscripten_create_wasm_worker() calls to

// to perform the wasm worker creation.


=== system/lib/libc/emscripten_libc_stubs.c ===
SHA256: c4e4a71fbe0d36e200cae5587b9b89c4e3e4635eb6bb1c089d1d80c62e58fbbc
/*
 * Copyright 2021 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 *
 * Fake/stub implementations of libc functions.
 * See emscripten_syscall_stubs.c for fake/stub implementations of syscalls.
 */

// ==========================================================================

// sys/wait.h

// ==========================================================================

// ==========================================================================

// sys/times.h

// ==========================================================================

// clock_t times(struct tms *buffer);

// http://pubs.opengroup.org/onlinepubs/009695399/functions/times.html

// NOTE: This is fake, since we can't calculate real CPU time usage in JS.

// struct tm *getdate(const char *string);

// http://pubs.opengroup.org/onlinepubs/009695399/functions/getdate.html

// TODO: Implement.

// ==========================================================================

// pwd.h

// ==========================================================================

// ==========================================================================

// grp.h

// ==========================================================================

// ==========================================================================

// sys/file.h

// ==========================================================================

// Pretend that the locking is successful. These are process-level locks,

// and Emscripten programs are a single process. If we supported linking a

// filesystem between programs, we'd need to do more here.

// See https://github.com/emscripten-core/emscripten/issues/23697

// int chroot(const char *path);

// http://pubs.opengroup.org/onlinepubs/7908799/xsh/chroot.html

// int execve(const char *pathname, char *const argv[],

//            char *const envp[]);

// http://pubs.opengroup.org/onlinepubs/009695399/functions/exec.html

// We don't support executing external code.

// pid_t fork(void);

// http://pubs.opengroup.org/onlinepubs/000095399/functions/fork.html

// We don't support multiple processes.

// ==========================================================================

// stdio.h

// ==========================================================================

// int setgroups(int ngroups, const gid_t *gidset);

// https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man2/setgroups.2.html

// We have just one process/user/group, so it makes no sense to set groups.

// ==========================================================================

// dlfcn.h

// ==========================================================================

// ==========================================================================

// stdlib.h

// ==========================================================================

// http://linux.die.net/man/3/getloadavg


=== system/lib/libc/emscripten_syscall_stubs.c ===
SHA256: 2cd03d35c0fffce857f5e9a5cf59019536906f106b913baae7cd290947b55cda
/*
 * Copyright 2021 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 *
 * Unimplemented/dummy syscall implementations. These fall into 3 categories.
 *
 * 1. Fake it, use dummy/placeholder values and return success.
 * 2. Fake it, as above but warn at runtime if called.
 * 3. Return ENOSYS and warn at runtime if called.
 */

// no hardlinks for us

// no-op

// we can't pause

// advice is welcome, but ignored

// let's not and say we did

// never succeed

// See FS.MAX_OPEN_FDS in src/lib/libfs.js

// we can not change the stack size, so the maximum is the same as the current

// Just report no limits

// The option is unknown at the level indicated.


=== system/lib/libc/sbrk.c ===
SHA256: 5ce6f1fea1faf61a6687331e2178d318b8c6025a83812a0007ba15c9f95269d1
/*
 * Copyright 2019 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 *
*/

// libc files are compiled as -std=c99 which doesn't normally declare

// max_align_t.

// for error handling, see below

// In relocatable code we may call emscripten_get_sbrk_ptr() during startup,

// potentially *before* the setup of the dynamically-linked __heap_base, when

// using SAFE_HEAP. (SAFE_HEAP instruments *all* memory accesses, so even the

// code doing dynamic linking itself ends up instrumented, which is why we can

// get such an instrumented call before sbrk_val has its proper value.)

// Enforce preserving a minimal alignof(maxalign_t) alignment for sbrk.

// To make sbrk thread-safe, implement a CAS loop to update the

// value of sbrk_ptr.

// Check for a) an over/underflow, which would indicate that we are

// allocating over maximum addressable memory. and b) if necessary,

// increase the WebAssembly Memory size, and abort if that fails.

// Attempt to update the dynamic top to new value. Another thread may have

// beat this one to the update, in which case we will need to start over

// by iterating the loop body again.

// CAS failed, another thread raced in between.

// TODO || !defined(wasm2gb)

// In the correct https://linux.die.net/man/2/sbrk spec, sbrk() parameter is

// intended to be treated as signed, meaning that it is not possible in a

// 32-bit program to sbrk alloc (or dealloc) more than 2GB of memory at once.

// Treat sbrk() parameter as signed.

// BUG: Currently the Emscripten test suite codifies expectations that sbrk()

// values passed to this function are to be treated as unsigned, which means

// that in 2GB and 4GB build modes, it is not possible to shrink memory.

// To satisfy that mode, treat sbrk() parameters in 32-bit builds as unsigned.

// https://github.com/emscripten-core/emscripten/issues/25138

// Treat sbrk() parameter as unsigned.

// FIXME


=== system/lib/libcxx/include/__algorithm/adjacent_find.h ===
SHA256: f5fc344590f11611d4555137273987b18b60a578819f69879a10256392128ef9
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_ADJACENT_FIND_H


=== system/lib/libcxx/include/__algorithm/all_of.h ===
SHA256: ec7594ff2fc227896692afa809c6ed97130f9f75caf19a75e3f55b52896dc035
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_ALL_OF_H


=== system/lib/libcxx/include/__algorithm/any_of.h ===
SHA256: 60aa19da63aed61d887d89f32d43e2ffd8db37d9b8a3d161395e9d207b7c778d
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_ANY_OF_H


=== system/lib/libcxx/include/__algorithm/binary_search.h ===
SHA256: 11f21722bdfc7d292b6b1ce14b22ef9a41ebe686a579ff0d1f62e31312667eae
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_BINARY_SEARCH_H


=== system/lib/libcxx/include/__algorithm/clamp.h ===
SHA256: 0d6080febe4cdbe09b1f66af0ed862c217ff33951c10d46f43c85965b0e0e373
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_CLAMP_H


=== system/lib/libcxx/include/__algorithm/comp.h ===
SHA256: 83025b2b66ba0a3aa3abc8e414ca96274218b08a2b53f7d6f800f4264c13a101
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// The definition is required because __less is part of the ABI, but it's empty

// because all comparisons should be transparent.

// _LIBCPP___ALGORITHM_COMP_H


=== system/lib/libcxx/include/__algorithm/comp_ref_type.h ===
SHA256: 28e248bee0ac242eb3f18b33456d027c09eafd2812db2c13be700663e9f502b5
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Pass the comparator by lvalue reference. Or in the debug mode, using a debugging wrapper that stores a reference.

// _LIBCPP___ALGORITHM_COMP_REF_TYPE_H


=== system/lib/libcxx/include/__algorithm/copy.h ===
SHA256: 135ee6b4041726fec9a12caddc037fd7191e73cf7e1718e83a2698b702bb21a2
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// do first word

// __first.__ctz_ = 0;

// __first.__ctz_ == 0;

// do middle words

// do last word

// do first word

// __first.__ctz_ = 0;

// __first.__ctz_ == 0;

// do middle words

// do last word

// At this point, the iterators have been unwrapped so any `contiguous_iterator` has been unwrapped to a pointer.

// _LIBCPP___ALGORITHM_COPY_H


=== system/lib/libcxx/include/__algorithm/copy_backward.h ===
SHA256: 40bd08d065e6e8bb226471adfa3bbfe008d586668813dd18db6d55ad603f09ab
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// do first word

// __last.__ctz_ = 0

// __last.__ctz_ == 0 || __n == 0

// __result.__ctz_ == 0 || __n == 0

// do middle words

// do last word

// do first word

// __result.__ctz_ == 0

// __last.__ctz_ = 0

// __last.__ctz_ == 0 || __n == 0

// __result.__ctz_ != 0 || __n == 0

// do middle words

// do last word

// __result.__ctz_ == 0

// When the range contains no elements, __result might not be a valid iterator

// At this point, the iterators have been unwrapped so any `contiguous_iterator` has been unwrapped to a pointer.

// _LIBCPP___ALGORITHM_COPY_BACKWARD_H


=== system/lib/libcxx/include/__algorithm/copy_if.h ===
SHA256: 5072902ab2eb08cbe92478f631de47ac46d8366ecfdc96083f64645d9009bc65
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_COPY_IF_H


=== system/lib/libcxx/include/__algorithm/copy_move_common.h ===
SHA256: 42e625eef508b9e889a2dabfbfd9390ef83af67489a22835920489f89e1140b0
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Type traits.

// If the types are always bitcastable, it's valid to do a bitwise copy between them.

// Reject conversions that wouldn't be performed by the regular built-in assignment (e.g. between arrays).

// `memmove` doesn't accept `volatile` pointers, make sure the optimization SFINAEs away in that case.

// `memmove` algorithms implementation.

// Iterator unwrapping and dispatching to the correct overload.

// _LIBCPP___ALGORITHM_COPY_MOVE_COMMON_H


=== system/lib/libcxx/include/__algorithm/copy_n.h ===
SHA256: a2f9ffec32bbbec8a7812c9bd15d7bf403d032ea07133c17777ad6578ab656e6
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_COPY_N_H


=== system/lib/libcxx/include/__algorithm/count.h ===
SHA256: 1dc18117aec50db9d2434fc9334379dc497b2b6a007114eb196eacd53235b345
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// generic implementation

// __bit_iterator implementation

// do first partial word

// do middle whole words

// do last partial word

// _LIBCPP___ALGORITHM_COUNT_H


=== system/lib/libcxx/include/__algorithm/count_if.h ===
SHA256: 3d1077ee930326bf9ef5d41d04bb1b1ce3bb0860b93ea93d5cc36561751a2e21
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_COUNT_IF_H


=== system/lib/libcxx/include/__algorithm/equal.h ===
SHA256: 6aaeec3f296738e6eff49632009e1eee41b0c2bdcbd16799c687457a6e1ccdf1
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// do first word

// __first1.__ctz_ = 0;

// __first1.__ctz_ == 0;

// do middle words

// do last word

// do first word

// __first1.__ctz_ = 0;

// __first2.__ctz_ = 0;

// __first1.__ctz_ == 0;

// __first2.__ctz_ == 0;

// do middle words

// do last word

// _LIBCPP_STD_VER >= 14

// _LIBCPP___ALGORITHM_EQUAL_H


=== system/lib/libcxx/include/__algorithm/equal_range.h ===
SHA256: 4d3f95e39edf8c23c354b558a2736bb932d227f3267bc6ad7a4863f3b652dd2a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_EQUAL_RANGE_H


=== system/lib/libcxx/include/__algorithm/fill.h ===
SHA256: 6d072cb630d74ab192c9297d92c8f7b94bad5692fd66cf29876d5fbd36ec6665
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// fill isn't specialized for std::memset, because the compiler already optimizes the loop to a call to std::memset.

// _LIBCPP___ALGORITHM_FILL_H


=== system/lib/libcxx/include/__algorithm/fill_n.h ===
SHA256: 630eba11128ce184fbddd62e9e299382621a84392f9a10a4b0f6b79c9f1569cf
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// fill_n isn't specialized for std::memset, because the compiler already optimizes the loop to a call to std::memset.

// do first partial word

// do middle whole words

// do last partial word

// _LIBCPP___ALGORITHM_FILL_N_H


=== system/lib/libcxx/include/__algorithm/find.h ===
SHA256: 01f70eb8b1b2bbb828079375a8ce166d7f8b5583109e90b08ab2b0bfd363fdca
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// generic implementation

// trivially equality comparable implementations

// _LIBCPP_HAS_WIDE_CHARACTERS

// TODO: This should also be possible to get right with different signedness

// cast integral types to allow vectorization

// __bit_iterator implementation

// do first partial word

// do middle whole words

// do last partial word

// segmented iterator implementation

// public API

// _LIBCPP___ALGORITHM_FIND_H


=== system/lib/libcxx/include/__algorithm/find_end.h ===
SHA256: 88deab2bad66fbc4973b07e8fe5815eb9a7ad2971faeec63440246a57eb32121
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// modeled after search algorithm

// __last1 is the "default" answer

// if source exhausted return last correct answer (or __last1 if never found)

// *__first1 matches *__first2, now match elements after here

// Pattern exhaused, record answer and search for another one

// Source exhausted, return last answer

// mismatch, restart with a new __first

// else there is a match, check next elements

// _LIBCPP___ALGORITHM_FIND_END_OF_H


=== system/lib/libcxx/include/__algorithm/find_first_of.h ===
SHA256: 9a37a73044111bc088202731d52a252f872f0dc668e5e73afb4094736f1320b4
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_FIND_FIRST_OF_H


=== system/lib/libcxx/include/__algorithm/find_if.h ===
SHA256: 422768572c655839423b9128e8a5ba51271a96450b713c28f08e7c9394fe826b
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_FIND_IF_H


=== system/lib/libcxx/include/__algorithm/find_if_not.h ===
SHA256: dbbab2ea2b0451ee8fc189a2d4c197829971b7ef2b0a203649523aca5d02d9b9
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_FIND_IF_NOT_H


=== system/lib/libcxx/include/__algorithm/find_segment_if.h ===
SHA256: ffddcc6f767efd655594e2feff2ebc84454c180680c2541214c304fd59620091
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __find_segment_if is a utility function for optimizing iteration over segmented iterators linearly.

// [__first, __last) has to be a segmented range. __pred is expected to take a range of local iterators and the __proj.

// It returns an iterator to the first element that satisfies the predicate, or a one-past-the-end iterator if there was

// no match. __proj may be anything that should be passed to __pred, but is expected to be a projection to support

// ranges algorithms, or __identity for classic algorithms.

// We are in a single segment, so we might not be at the beginning or end

// We have more than one segment. Iterate over the first segment, since we might not start at the beginning

// Iterate over the segments which are guaranteed to be completely in the range

// Iterate over the last segment

// _LIBCPP___ALGORITHM_FIND_SEGMENT_IF_H


=== system/lib/libcxx/include/__algorithm/for_each.h ===
SHA256: 30f4e1273e114503a19e665da62ffbddccb14f649eb7bbfaeb1758c224f8dbd3
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// !_LIBCPP_CXX03_LANG

// _LIBCPP___ALGORITHM_FOR_EACH_H


=== system/lib/libcxx/include/__algorithm/for_each_n.h ===
SHA256: fcb5d56ae372cfead012ef78c57a1877f35a5445374a88d4cc45e73f63f12d06
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// !_LIBCPP_CXX03_LANG

// _LIBCPP_STD_VER >= 17

// _LIBCPP___ALGORITHM_FOR_EACH_N_H


=== system/lib/libcxx/include/__algorithm/for_each_n_segment.h ===
SHA256: 8736749bb51bf594477d80075e00f1464746d9b11a98841d9a0c084799241340
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __for_each_n_segment optimizes linear iteration over segmented iterators. It processes a segmented

// input range [__first, __first + __n) by applying the functor __func to each element within the segment.

// The return value of __func is ignored, and the function returns an iterator pointing to one past the

// last processed element in the input range.

// _LIBCPP___ALGORITHM_FOR_EACH_N_SEGMENT_H


=== system/lib/libcxx/include/__algorithm/for_each_segment.h ===
SHA256: 3538977bd3f5318c59086b6001a6046eb019772426e1f70fb0b7f1e27ba5bc48
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __for_each_segment is a utility function for optimizing iterating over segmented iterators linearly.

// __first and __last are expected to be a segmented range. __func is expected to take a range of local iterators.

// Anything that is returned from __func is ignored.

// We are in a single segment, so we might not be at the beginning or end

// We have more than one segment. Iterate over the first segment, since we might not start at the beginning

// iterate over the segments which are guaranteed to be completely in the range

// iterate over the last segment

// _LIBCPP___ALGORITHM_FOR_EACH_SEGMENT_H


=== system/lib/libcxx/include/__algorithm/generate.h ===
SHA256: b171ff43815b25aa106994e643715c9816b42077d5f3d54d23f000cdb46b1e11
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_GENERATE_H


=== system/lib/libcxx/include/__algorithm/generate_n.h ===
SHA256: ee6d41151393be53c8c8ce00313e178dcdb2fc7c509b0763b7c42486580e396c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_GENERATE_N_H


=== system/lib/libcxx/include/__algorithm/half_positive.h ===
SHA256: f1492d7a43e994f4d61f66cd41f28d91686351415382fe92fb4c5f70d2dc4e8f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Perform division by two quickly for positive integers (llvm.org/PR39129)

// _LIBCPP___ALGORITHM_HALF_POSITIVE_H


=== system/lib/libcxx/include/__algorithm/in_found_result.h ===
SHA256: 20d16bfde1500da427e47cb42c1ebcd1dc0af6936ad70acfedbd43ffa54101dc
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_IN_FOUND_RESULT_H


=== system/lib/libcxx/include/__algorithm/in_fun_result.h ===
SHA256: b5852335524085221b7100b93599c6a3cdcd3878e518729fa5e5d46f2feffb2a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_IN_FUN_RESULT_H


=== system/lib/libcxx/include/__algorithm/in_in_out_result.h ===
SHA256: a6963fe5b1f76973881fddc93405cb7c519a5125725759dc50aeb840c7465779
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_IN_IN_OUT_RESULT_H


=== system/lib/libcxx/include/__algorithm/in_in_result.h ===
SHA256: 5f669fc3c50d578f4405ee4563b6e179e424dd526fadcf87cca647d1b7d5fdc0
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_IN_IN_RESULT_H


=== system/lib/libcxx/include/__algorithm/in_out_out_result.h ===
SHA256: 8315269ae375934a62cce118c5e88b2bc4929ecc193b253f84615f4af20a9d24
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_IN_OUT_OUT_RESULT_H


=== system/lib/libcxx/include/__algorithm/in_out_result.h ===
SHA256: dac26981ded3f0d0dae643f4b902c2832bab2cf2939e0df66ba3153b61bd3be2
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_IN_OUT_RESULT_H


=== system/lib/libcxx/include/__algorithm/includes.h ===
SHA256: de1d7c44504e974707024a155ce56a84325880d6800823ecea213be413adb108
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_INCLUDES_H


=== system/lib/libcxx/include/__algorithm/inplace_merge.h ===
SHA256: dc05689e97e9aee41ad65fad72d6937fe3c791081e3b0a20a83ebbfc82491474
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// invert the sense of a comparison

// __first2 through __last2 are already in the right spot.

// if __middle == __last, we're done

// shrink [__first, __middle) as much as possible (with no moves), returning if it shrinks to 0

// __first < __middle < __last

// *__first > *__middle

// partition [__first, __m1) [__m1, __middle) [__middle, __m2) [__m2, __last) such that

//     all elements in:

//         [__first, __m1)  <= [__middle, __m2)

//         [__middle, __m2) <  [__m1, __middle)

//         [__m1, __middle) <= [__m2, __last)

//     and __m1 or __m2 is in the middle of its range

// "median" of [__first, __middle)

// "median" of [__middle, __last)

// distance(__first, __m1)

// distance(__middle, __m2)

// binary search smaller range

// __len >= 1, __len2 >= 2

// __len1 >= __len2 && __len2 > 0, therefore __len2 == 1

// It is known *__first > *__middle

// __len1 >= 2, __len2 >= 1

// distance(__m1, __middle)

// distance(__m2, __last)

// [__first, __m1) [__m1, __middle) [__middle, __m2) [__m2, __last)

// swap middle two partitions

// __len12 and __len21 now have swapped meanings

// merge smaller range with recursive call and larger with tail recursion elimination

// _LIBCPP___ALGORITHM_INPLACE_MERGE_H


=== system/lib/libcxx/include/__algorithm/is_heap.h ===
SHA256: 68f728a22e4d3fb17aa8ca23b33daae406d74071728381b1e6ee471d13ac98d4
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_IS_HEAP_H


=== system/lib/libcxx/include/__algorithm/is_heap_until.h ===
SHA256: 58b7c1b2cedfafca19b4366d1c23e08951073f96140e2d462a852e7dd70cb238
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_IS_HEAP_UNTIL_H


=== system/lib/libcxx/include/__algorithm/is_partitioned.h ===
SHA256: 1c7b6c3bff18d5d7a7bca45ec0f163a4b3811b37a201d8aa26ff3d769ef5ffe8
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_IS_PARTITIONED_H


=== system/lib/libcxx/include/__algorithm/is_permutation.h ===
SHA256: ae4be84949133d215c5253cf1eb3ba38ed059cf1c14e558711657f4fc2d1ad12
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// Internal functions

// For each element in [f1, l1) see if there are the same number of equal elements in [f2, l2)

//  Have we already counted the number of *__i in [f1, l1)?

// Count number of *__i in [f2, l2)

// Count number of *__i in [__i, l1) (we can start with 1)

// 2+1 iterators, predicate. Not used by range algorithms.

// Shorten sequences as much as possible by lopping of any equal prefix.

//  __first1 != __last1 && *__first1 != *__first2

// 2+2 iterators, predicate, non-constant time `distance`.

/*_ConstTimeDistance=*/

// Shorten sequences as much as possible by lopping of any equal prefix.

// Second range is shorter

// 2+2 iterators, predicate, specialization for constant-time `distance` call.

/*_ConstTimeDistance=*/

/*_ConstTimeDistance=*/

// 2+2 iterators, predicate

// Public interface

// 2+1 iterators, predicate

// 2+1 iterators

// 2+2 iterators

// 2+2 iterators, predicate

// _LIBCPP_STD_VER >= 14

// _LIBCPP___ALGORITHM_IS_PERMUTATION_H


=== system/lib/libcxx/include/__algorithm/is_sorted.h ===
SHA256: e8fd2dafe9b03e3e4acf59ddb0eb374a66bd92629a4150317ffdf4e92e963511
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_IS_SORTED_H


=== system/lib/libcxx/include/__algorithm/is_sorted_until.h ===
SHA256: e910f24b5f26133406f660e5c6a75e8dfb1a57b27f59218585740b69f1d12518
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_IS_SORTED_UNTIL_H


=== system/lib/libcxx/include/__algorithm/iter_swap.h ===
SHA256: e3c5d079bb836c67b9b1042fba2d63e3690a945fc823189722f4f51634df2a76
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//                                  _NOEXCEPT_(_NOEXCEPT_(swap(*__a, *__b)))

// _LIBCPP___ALGORITHM_ITER_SWAP_H


=== system/lib/libcxx/include/__algorithm/iterator_operations.h ===
SHA256: 613175b17766d9357c2cabfa0162293c6147f367a0ff7a65ea6fb38ada554e6c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// advance

// distance

// iter_move

// If the result of dereferencing `_Iter` is a reference type, deduce the result of calling `std::move` on it.

// Note that the C++03 mode doesn't support `decltype(auto)` as the return type.

// If the result of dereferencing `_Iter` is a value type, deduce the return value of this function to also be a

// value -- otherwise, after `operator*` returns a temporary, this function would return a dangling reference to

// that temporary. Note that the C++03 mode doesn't support `auto` as the return type.

// iter_swap

// next

// prev

// advance with sentinel, a la std::ranges::advance

// advance with sentinel, a la std::ranges::advance -- InputIterator specialization

// advance with sentinel, a la std::ranges::advance -- BidirectionalIterator specialization

// advance with sentinel, a la std::ranges::advance -- RandomIterator specialization

// _LIBCPP___ALGORITHM_ITERATOR_OPERATIONS_H


=== system/lib/libcxx/include/__algorithm/lexicographical_compare.h ===
SHA256: be070ec4a2c52cefc4590c059bb7446ffad0a3db5b90febbb59cb57d9e211066
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// If the comparison operation is equivalent to < and that is a total order, we know that we can use equality comparison

// on that type instead to extract some information. Furthermore, if equality comparison on that type is trivial, the

// user can't observe that we're calling it. So instead of using the user-provided total order, we use std::mismatch,

// which uses equality comparison (and is vertorized). Additionally, if the type is trivially lexicographically

// comparable, we can go one step further and use std::memcmp directly instead of calling std::mismatch.

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP_STD_VER >= 14

// _LIBCPP___ALGORITHM_LEXICOGRAPHICAL_COMPARE_H


=== system/lib/libcxx/include/__algorithm/lexicographical_compare_three_way.h ===
SHA256: ccac127aed3c29d3115395bfce126512ab2b8d384f17b7fff805fe8d6196d4ae
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Fast path for random access iterators which computes the number of loop iterations up-front and

// then skips the iterator comparisons inside the loop.

// Unoptimized implementation which compares the iterators against the end in every loop iteration

// Unoptimized implementation which compares the iterators against the end in every loop iteration

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_LEXICOGRAPHICAL_COMPARE_THREE_WAY_H


=== system/lib/libcxx/include/__algorithm/lower_bound.h ===
SHA256: 877c078130d29936bc80ae4d6a9d56acd8e16f6c7901f910cd4a955e6f3f30ce
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// One-sided binary search, aka meta binary search, has been in the public domain for decades, and has the general

// advantage of being \Omega(1) rather than the classic algorithm's \Omega(log(n)), with the downside of executing at

// most 2*log(n) comparisons vs the classic algorithm's exact log(n). There are two scenarios in which it really shines:

// the first one is when operating over non-random-access iterators, because the classic algorithm requires knowing the

// container's size upfront, which adds \Omega(n) iterator increments to the complexity. The second one is when you're

// traversing the container in order, trying to fast-forward to the next value: in that case, the classic algorithm

// would yield \Omega(n*log(n)) comparisons and, for non-random-access iterators, \Omega(n^2) iterator increments,

// whereas the one-sided version will yield O(n) operations on both counts, with a \Omega(log(n)) bound on the number of

// comparisons.

// step = 0, ensuring we can always short-circuit when distance is 1 later on

// once we reach the last range where needle can be we must start

// looking inwards, bisecting that range

// we've already checked the previous value and it was less, we can save

// one comparison by skipping bisection

// range not found, move forward!

// _LIBCPP___ALGORITHM_LOWER_BOUND_H


=== system/lib/libcxx/include/__algorithm/make_heap.h ===
SHA256: 2bd10216f89b2e595314b80639789d96aa8055b15f5820b60293cded57efda84
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// start from the first parent, there is no need to consider children

// _LIBCPP___ALGORITHM_MAKE_HEAP_H


=== system/lib/libcxx/include/__algorithm/make_projected.h ===
SHA256: f74afb9b28aa6dd33995cd2c9f57da7ba9f34797cbdb6199d0c6e068b81a4ce1
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Can be a unary or a binary predicate.

// Avoid creating the functor and just use the pristine comparator -- for certain algorithms, this would enable

// optimizations that rely on the type of the comparator. Additionally, this results in less layers of indirection in

// the call stack when the comparator is invoked, even in an unoptimized build.

// Avoid creating the lambda and just use the pristine comparator -- for certain algorithms, this would enable

// optimizations that rely on the type of the comparator.

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_MAKE_PROJECTED_H


=== system/lib/libcxx/include/__algorithm/max.h ===
SHA256: 729c30a992827fa98b64632dd800481f8a0b2afcddd1eb9d7e8be062e7f6a5e7
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_CXX03_LANG

// _LIBCPP___ALGORITHM_MAX_H


=== system/lib/libcxx/include/__algorithm/max_element.h ===
SHA256: b5e24ecead2d4ec2f42cf6fb8a2d16efe7881ab8e10607bfd973986dfb4092dd
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_MAX_ELEMENT_H


=== system/lib/libcxx/include/__algorithm/merge.h ===
SHA256: 4310df48f0f1ae1f9d2d48e27afd226548a53cacf3ada092841da20b70c751f1
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_MERGE_H


=== system/lib/libcxx/include/__algorithm/min.h ===
SHA256: be17c3bb1b83c587bf46f58f28e0361ad6ffef008960eb774064e20f2b36a437
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_CXX03_LANG

// _LIBCPP___ALGORITHM_MIN_H


=== system/lib/libcxx/include/__algorithm/min_element.h ===
SHA256: 7adee13a09b4c17d36092831b9e6667e82b395512de93f0c886d3e5327bd1c9c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_MIN_ELEMENT_H


=== system/lib/libcxx/include/__algorithm/min_max_result.h ===
SHA256: 45ad58f249444d5c6df7c013c8a22abdff632ab9be7d24c3725ac171a40d87dc
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_MIN_MAX_RESULT_H


=== system/lib/libcxx/include/__algorithm/minmax.h ===
SHA256: cf82158db498309e14e447b0be374efa029cd46078a40220e4ff5b920bcf88f3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_CXX03_LANG

// _LIBCPP___ALGORITHM_MINMAX_H


=== system/lib/libcxx/include/__algorithm/minmax_element.h ===
SHA256: b5fad9ab386baa455ffb4b58a5cd0bdd35dfabfb600df024dd119a4fe1a0b446
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_MINMAX_ELEMENT_H


=== system/lib/libcxx/include/__algorithm/mismatch.h ===
SHA256: 49aa66ae206efe0387ffd38428711ed39384af3987dff21246526774f2196535
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// check the remaining 0-3 vectors

// Check if we can load elements in front of the current pointer. If that's the case load a vector at

// (last - vector_size) to check the remaining elements

// else loop over the elements individually

// _LIBCPP_VECTORIZE_ALGORITHMS

// _LIBCPP___ALGORITHM_MISMATCH_H


=== system/lib/libcxx/include/__algorithm/move.h ===
SHA256: 2b9978c37e5bdc60e26591ce1396fb440e972313cfd89adfe801b24c0f7f85dc
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// At this point, the iterators have been unwrapped so any `contiguous_iterator` has been unwrapped to a pointer.

// _LIBCPP___ALGORITHM_MOVE_H


=== system/lib/libcxx/include/__algorithm/move_backward.h ===
SHA256: 213037ceaafb8c646170d8079def3cb719d7010955b5f65a281909ff366d6fa8
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// When the range contains no elements, __result might not be a valid iterator

// At this point, the iterators have been unwrapped so any `contiguous_iterator` has been unwrapped to a pointer.

// _LIBCPP___ALGORITHM_MOVE_BACKWARD_H


=== system/lib/libcxx/include/__algorithm/next_permutation.h ===
SHA256: 97197b3dc58dbbb4fdc6d0887f557342762d96c7296006ec53a8d9a0566e52f9
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_NEXT_PERMUTATION_H


=== system/lib/libcxx/include/__algorithm/none_of.h ===
SHA256: 34edfdc4c0226b40966eea844859e69e71bf20bd89f1b76de5dab09be2ab81ed
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_NONE_OF_H


=== system/lib/libcxx/include/__algorithm/nth_element.h ===
SHA256: 521550aa2c37e40ff717a076c13f660f350ec2fbdf64add747499469986efe51
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// manually guard downward moving __j against __i

// found guard for downward moving __j, now use unguarded partition

// NOLINTNEXTLINE(readability-function-cognitive-complexity)

// _Compare is known to be a reference type

// __len > __limit >= 3

// *__m is median

// partition [__first, __m) < *__m and *__m <= [__m, __last)

// (this inhibits tossing elements equivalent to __m around unnecessarily)

// j points beyond range to be tested, *__lm1 is known to be <= *__m

// The search going up is known to be guarded but the search coming down isn't.

// Prime the downward search with a guard.

// if *__first == *__m

// *__first == *__m, *__first doesn't go in first part

// *__first == *__m, *__m <= all other elements

// Partition instead into [__first, __i) == *__first and *__first < [__i, __last)

// __first + 1

// we need a guard if *__first == *(__last-1)

// [__first, __last) all equivalent elements

// [__first, __i) == *__first and *__first < [__j, __last) and __j == __last - 1

// [__first, __i) == *__first and *__first < [__i, __last)

// The first part is sorted,

// __nth_element the second part

// std::__nth_element<_Compare>(__i, __nth, __last, __comp);

// j points beyond range to be tested, *__lm1 is known to be <= *__m

// if not yet partitioned...

// known that *(__i - 1) < *__m

// __m still guards upward moving __i

// It is now known that a guard exists for downward moving __j

// It is known that __m != __j

// If __m just moved, follow it

// [__first, __i) < *__m and *__m <= [__i, __last)

// [__first, __i) < *__i and *__i <= [__i+1, __last)

// We were given a perfectly partitioned sequence.  Coincidence?

// Check for [__first, __i) already sorted

// [__first, __i) sorted

// not yet sorted, so sort

// Check for [__i, __last) already sorted

// [__i, __last) sorted

// not yet sorted, so sort

// __nth_element on range containing __nth

// std::__nth_element<_Compare>(__first, __nth, __i, __comp);

// std::__nth_element<_Compare>(__i+1, __nth, __last, __comp);

// _LIBCPP___ALGORITHM_NTH_ELEMENT_H


=== system/lib/libcxx/include/__algorithm/out_value_result.h ===
SHA256: 6167f7b0b4ca4ee859d95e6506f405e29a9e1a1e7486eb744018edf2ad98c86e
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace ranges

// _LIBCPP_STD_VER >= 23

// _LIBCPP___ALGORITHM_OUT_VALUE_RESULT_H


=== system/lib/libcxx/include/__algorithm/partial_sort.h ===
SHA256: 3a0d67bcee62eb3729058d3e90e138c921ead050f104c2da3fda0c8bd5a62b45
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_PARTIAL_SORT_H


=== system/lib/libcxx/include/__algorithm/partial_sort_copy.h ===
SHA256: ba64e22f1e78c9bcda6a9c662883815bbbd04f8dc89ef7abfb011fdc2c98ce48
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_PARTIAL_SORT_COPY_H


=== system/lib/libcxx/include/__algorithm/partition.h ===
SHA256: 6870824a583901fa1beb19d11537bb2ea80386afe519087b4f090feb1237a460
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_PARTITION_H


=== system/lib/libcxx/include/__algorithm/partition_copy.h ===
SHA256: 921060f3ab957bb63d043cf989507d29dd3a8b5e3b210d4eab620ba61a2a25ee
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_PARTITION_COPY_H


=== system/lib/libcxx/include/__algorithm/partition_point.h ===
SHA256: 94b2cd082810c5bcda27dc3c1d87dc68c19209ce645cf1384a880a304ffc478d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_PARTITION_POINT_H


=== system/lib/libcxx/include/__algorithm/pop_heap.h ===
SHA256: 029b6ccb3f1111118825615131564ecddf5ed1504f6d72276087d49ec03def33
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Calling `pop_heap` on an empty range is undefined behavior, but in practice it will be a no-op.

// create a hole at __first

// _LIBCPP___ALGORITHM_POP_HEAP_H


=== system/lib/libcxx/include/__algorithm/prev_permutation.h ===
SHA256: f8c0290f459d7ae7620a902a51324de2845514112f6d61c2ae3851b9b68edbf6
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_PREV_PERMUTATION_H


=== system/lib/libcxx/include/__algorithm/pstl.h ===
SHA256: a9071662706eb095131727e735cf9be84e08b1fcbf8162ffd4fbfe01ed7b8079
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_HAS_EXPERIMENTAL_PSTL && _LIBCPP_STD_VER >= 17

// _LIBCPP___ALGORITHM_PSTL_H


=== system/lib/libcxx/include/__algorithm/push_heap.h ===
SHA256: e0c6e2d27018c570c1e97450d5035cb5b337149ef73d0744c27e62a49c618ace
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_PUSH_HEAP_H


=== system/lib/libcxx/include/__algorithm/radix_sort.h ===
SHA256: 162daa807f5047e6bfcdcb77d90312240f4aceda5de0b6c4992a3c38d9e7a017
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// This is an implementation of classic LSD radix sort algorithm, running in linear time and using `O(max(N, M))`

// additional memory, where `N` is size of an input range, `M` - maximum value of

// a radix of the sorted integer type. Type of the radix and its maximum value are determined at compile time

// based on type returned by function `__radix`. The default radix is uint8.

// The algorithm is equivalent to several consecutive calls of counting sort for each

// radix of the sorted numbers from low to high byte.

// The algorithm uses a temporary buffer of size equal to size of the input range. Each `i`-th pass

// of the algorithm sorts values by `i`-th radix and moves values to the temporary buffer (for each even `i`, counted

// from zero), or moves them back to the initial range (for each odd `i`). If there is only one radix in sorted integers

// (e.g. int8), the sorted values are placed to the buffer, and then moved back to the initial range.

// The implementation also has several optimizations:

// - the counters for the counting sort are calculated in one pass for all radices;

// - if all values of a radix are the same, we do not sort that radix, and just move items to the buffer;

// - if two consecutive radices satisfies condition above, we do nothing for these two radices.

// The function `__to_ordered_integral` is defined for integers and IEEE 754 floating-point numbers.

// Returns an integer representation such that for any `x` and `y` such that `x < y`, the expression

// `__to_ordered_integral(x) < __to_ordered_integral(y)` is true, where `x`, `y` are integers or IEEE 754 floats.

// An overload for IEEE 754 floating-point numbers

// For the floats conforming to IEEE 754 (IEC 559) standard, we know that:

// 1. The bit representation of positive floats directly reflects their order:

//    When comparing floats by magnitude, the number with the larger exponent is greater, and if the exponents are

//    equal, the one with the larger mantissa is greater.

// 2. The bit representation of negative floats reflects their reverse order (for the same reasons).

// 3. The most significant bit (sign bit) is zero for positive floats and one for negative floats. Therefore, in the raw

//    bit representation, any negative number will be greater than any positive number.

// The only exception from this rule is `NaN`, which is unordered by definition.

// Based on the above, to obtain correctly ordered integral representation of floating-point numbers, we need to:

// 1. Invert the bit representation (including the sign bit) of negative floats to switch from reverse order to direct

//    order;

// 2. Invert the sign bit for positive floats.

// Thus, in final integral representation, we have reversed the order for negative floats and made all negative floats

// smaller than all positive numbers (by inverting the sign bit).

// There may exist user-defined comparison for enum, so we cannot compare enums just like integers.

// `long double` varies significantly across platforms and compilers, making it practically

// impossible to determine its actual bit width for conversion to an ordered integer.

// _LIBCPP_STD_VER >= 14

// _LIBCPP___ALGORITHM_RADIX_SORT_H


=== system/lib/libcxx/include/__algorithm/ranges_adjacent_find.h ===
SHA256: 9d59b181c5831b32a91126a6258e420cc2974994052f89973ae94e040c68aa87
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_ADJACENT_FIND_H


=== system/lib/libcxx/include/__algorithm/ranges_all_of.h ===
SHA256: 8ba9c83d3472a9b04fd6b239d1b27d2c6d8c6782baee8ee0bacca894d54b011d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_ALL_OF_H


=== system/lib/libcxx/include/__algorithm/ranges_any_of.h ===
SHA256: 599a5cc9273e32fadf52da6c06ea78f35fdb60ca50040281f2d72af1f05ef997
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_ANY_OF_H


=== system/lib/libcxx/include/__algorithm/ranges_binary_search.h ===
SHA256: 7c48661bb9dea8536425a09f2a50414dd7ceee55d3dfc1cc06cbdb250a05342f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_BINARY_SEARCH_H


=== system/lib/libcxx/include/__algorithm/ranges_clamp.h ===
SHA256: 669148ce8766f2fbc3567e00c862325dc3001c41892fde019492645017c67427
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_CLAMP_H


=== system/lib/libcxx/include/__algorithm/ranges_contains.h ===
SHA256: c61b9b17d2b081efb4de81a06a22bbb3af50ebeff056d41fc369444a47390931
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 23

// _LIBCPP___ALGORITHM_RANGES_CONTAINS_H


=== system/lib/libcxx/include/__algorithm/ranges_contains_subrange.h ===
SHA256: 0ba1887fe51c2c1eb7b0fd9da36142c0bdb6b67ff41402296e2ccb554b6dd0d4
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 23

// _LIBCPP___ALGORITHM_RANGES_CONTAINS_SUBRANGE_H


=== system/lib/libcxx/include/__algorithm/ranges_copy.h ===
SHA256: a5eec3253b9f4133ec367327aad922c1ed38bd3efceb3110b0fa97a480ea00b9
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_COPY_H


=== system/lib/libcxx/include/__algorithm/ranges_copy_backward.h ===
SHA256: 9c0739ef98e82138144f1a9f0e2fb79106cc9084d7ad8fa1eed13f2b95232638
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_COPY_BACKWARD_H


=== system/lib/libcxx/include/__algorithm/ranges_copy_if.h ===
SHA256: 5b0ec9b78e3600f2a2d780facf483b3b4a491a6146edcec9227ad9f6d5d8550a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_COPY_IF_H


=== system/lib/libcxx/include/__algorithm/ranges_copy_n.h ===
SHA256: 0210016a0b92a7b4fcbe119308f8bcf3ae9dce8aeb8b81509efe21eb3a3d8dfc
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// TODO: Merge this with copy_n

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_COPY_N_H


=== system/lib/libcxx/include/__algorithm/ranges_count.h ===
SHA256: 5c479dc50545a895bf0214359e775bd35f41d12c342566bec9f039c895c332c7
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_COUNT_H


=== system/lib/libcxx/include/__algorithm/ranges_count_if.h ===
SHA256: 0aded625d8cd0b6d9ceb48329dd4911181debe248ca9b06829e5cd76d9164e77
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_COUNT_IF_H


=== system/lib/libcxx/include/__algorithm/ranges_ends_with.h ===
SHA256: 23e1b722e80390fa79bee0cd1c8d0f46d0b5ebb480d237f930c14db4753b7e1d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 23

// _LIBCPP___ALGORITHM_RANGES_ENDS_WITH_H


=== system/lib/libcxx/include/__algorithm/ranges_equal.h ===
SHA256: bcd7713c62cd60e76ebc5cfc9ae5c346f8031b6aae7dc35de334773178b1f131
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_EQUAL_H


=== system/lib/libcxx/include/__algorithm/ranges_equal_range.h ===
SHA256: eec15fb95311a958de36d663614321c20cd23f5feef5a60e321478f03b375188
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_EQUAL_RANGE_H


=== system/lib/libcxx/include/__algorithm/ranges_fill.h ===
SHA256: f45696c1927247498eca3ba8b3f3f30bc7c35939fd6780ea1b868a121a0dd7b0
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_FILL_H


=== system/lib/libcxx/include/__algorithm/ranges_fill_n.h ===
SHA256: ce2584b2cd15e776f7737131897a7d4cdb9a12993ef8f7aaa3cf5c421548814e
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_FILL_N_H


=== system/lib/libcxx/include/__algorithm/ranges_find.h ===
SHA256: 50534e2ceaf7d73d3511e419fbab54511c56be65f8849b6036c8da63ae7a6640
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_FIND_H


=== system/lib/libcxx/include/__algorithm/ranges_find_end.h ===
SHA256: 5d62293c46238dfcb25bd07b86137d882d0d08e29c94dc61869836da820abddd
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_FIND_END_H


=== system/lib/libcxx/include/__algorithm/ranges_find_first_of.h ===
SHA256: 407a2bb7ea6cbdf75d0ba1ae3df3559bc2e81316f15310b67dcc4af8984a2ce8
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_FIND_FIRST_OF_H


=== system/lib/libcxx/include/__algorithm/ranges_find_if.h ===
SHA256: 68995cbaedd51141058c972574e56ccf5d127b8c76ffc75f01b6bb85bad36204
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_FIND_IF_H


=== system/lib/libcxx/include/__algorithm/ranges_find_if_not.h ===
SHA256: f078471cc5340f0301c49f72b3745f287198ea88313ddc295fcb45d5f686ddda
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_FIND_IF_NOT_H


=== system/lib/libcxx/include/__algorithm/ranges_find_last.h ===
SHA256: ff9346bd0f1bd8a81c3bd078b27ffa44734e40f469513826b68be1d98d44b5bc
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 23

// _LIBCPP___ALGORITHM_RANGES_FIND_LAST_H


=== system/lib/libcxx/include/__algorithm/ranges_fold.h ===
SHA256: 87ef10131bdb9c2bfabc1ee857a0354db2494c52719b47b133a124d1d033aff6
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

//

//

//

//

//

//

// namespace ranges

// _LIBCPP_STD_VER >= 23

// _LIBCPP___ALGORITHM_RANGES_FOLD_H


=== system/lib/libcxx/include/__algorithm/ranges_for_each.h ===
SHA256: 833875277058dd17f62137467da9adc74d3e0e6063c1b225c90d503210baf79b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// In the case where we have different iterator and sentinel types, the segmented iterator optimization

// in std::for_each will not kick in. Therefore, we prefer std::for_each_n in that case (whenever we can

// obtain the `n`).

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_FOR_EACH_H


=== system/lib/libcxx/include/__algorithm/ranges_for_each_n.h ===
SHA256: 056c6d13d8c247fa1d16fc9826031223c62d1378a6cd067ea9a17978d148c120
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_FOR_EACH_N_H


=== system/lib/libcxx/include/__algorithm/ranges_generate.h ===
SHA256: 5f85d9c02f7356ce65e7b13738f39979ec92a598d4e0c0ef77e865be98a646e8
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_GENERATE_H


=== system/lib/libcxx/include/__algorithm/ranges_generate_n.h ===
SHA256: 4c209dc21022a9a31d29ca68ee0c996abaea5032cf54defd93d77c49cd71f354
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_GENERATE_N_H


=== system/lib/libcxx/include/__algorithm/ranges_includes.h ===
SHA256: 1b940167678ec8e377656389e489ada81012cb7f21baba9aca4d860aa1538ee7
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_INCLUDES_H


=== system/lib/libcxx/include/__algorithm/ranges_inplace_merge.h ===
SHA256: 74f923e73351e9ad38b1139ffcdd08ede7e59752de7cd7b0a2b5a2e9ea8bdca3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_INPLACE_MERGE_H


=== system/lib/libcxx/include/__algorithm/ranges_is_heap.h ===
SHA256: 668100d5c22c8ca270bf6ee6d663dc7eafebfc66efec65b261396a614906fe4b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_IS_HEAP_H


=== system/lib/libcxx/include/__algorithm/ranges_is_heap_until.h ===
SHA256: 4804a017e2ef634803d65d7b504a13deb6ba11ad94454ea9ca7f1e6aa49c21ce
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_IS_HEAP_UNTIL_H


=== system/lib/libcxx/include/__algorithm/ranges_is_partitioned.h ===
SHA256: 4939b9c80215b4d3046077fc647ec7b9f7ecbc2ccd41f32d07e047ac0ea92c84
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_IS_PARTITIONED_H


=== system/lib/libcxx/include/__algorithm/ranges_is_permutation.h ===
SHA256: 88571bc116ba3cadb16e6a5368b17a2f789174dcd6072d0ced5f73269eb90838
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_IS_PERMUTATION_H


=== system/lib/libcxx/include/__algorithm/ranges_is_sorted.h ===
SHA256: a05ee97dc047f3805efea23f4b1008343c1b3b5f25afa74ef8289a1981bb4727
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP__ALGORITHM_RANGES_IS_SORTED_H


=== system/lib/libcxx/include/__algorithm/ranges_is_sorted_until.h ===
SHA256: 26197f3b80e7a5dc551455cae0294d84196f4a51ddba3c131640692079912e49
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP__ALGORITHM_RANGES_IS_SORTED_UNTIL_H


=== system/lib/libcxx/include/__algorithm/ranges_iterator_concept.h ===
SHA256: 07b4bfd79ae9347e57b661c4ad6dc99e710e8adcd7fd54cbe03fbfc7ffa76460
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_ITERATOR_CONCEPT_H


=== system/lib/libcxx/include/__algorithm/ranges_lexicographical_compare.h ===
SHA256: ba94800f32c468807ac2d500680daac8532481f51ddedc831194639f2a899b58
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_LEXICOGRAPHICAL_COMPARE_H


=== system/lib/libcxx/include/__algorithm/ranges_lower_bound.h ===
SHA256: 154db8c8aaf29de90dd7afd7cbffa8a40c7edb1ba454ad8882f3f7679d5c1be0
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_LOWER_BOUND_H


=== system/lib/libcxx/include/__algorithm/ranges_make_heap.h ===
SHA256: 3fa134763f6fe1514d2161bd3bbdac026cf8258f473a03efc91be9b9682c886b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_MAKE_HEAP_H


=== system/lib/libcxx/include/__algorithm/ranges_max.h ===
SHA256: 05169dd5b06d184ecb34bd6c85b1928658a4823df753ca3891890004735f20c8
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_MAX_H


=== system/lib/libcxx/include/__algorithm/ranges_max_element.h ===
SHA256: 980c9209bd25bfe67e510b90b7900f68b8a6b50c647cb8bc23fdd6a10d0c068e
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_MAX_ELEMENT_H


=== system/lib/libcxx/include/__algorithm/ranges_merge.h ===
SHA256: def25e7c1c0a1fd09055641ced235bef2aceda6dd1c2d28c3ecb6bd2fe6397f1
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_MERGE_H


=== system/lib/libcxx/include/__algorithm/ranges_min.h ===
SHA256: c23d05d812d652d2f89e7deaa27e47b2d72a0d1877e0564f4044cb9ebdd14074
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_MIN_H


=== system/lib/libcxx/include/__algorithm/ranges_min_element.h ===
SHA256: f6ad46380218f2687279902b6748cdc8dfb4fdca429a03fd7f62087ca1b0037d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_MIN_ELEMENT_H


=== system/lib/libcxx/include/__algorithm/ranges_minmax.h ===
SHA256: 71cdc9fac7373fdccd371aef7493c5abb87058b8c6c919852f521ba6a236d26b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// This optimiation is not in minmax_element because clang doesn't see through the pointers and as a result doesn't

// vectorize the code.

// Special-case the one element case. Avoid repeatedly initializing objects from the result of an iterator

// dereference when doing so might not be idempotent. The `if constexpr` avoids the extra branch in cases where

// it's not needed.

// During initialization, members are allowed to refer to already initialized members

// (see http://eel.is/c++draft/dcl.init.aggr#6)

// input_iterators can't be copied, so the implementation for input_iterators has to store

// the values instead of a pointer to the correct values

// During initialization, members are allowed to refer to already initialized members

// (see http://eel.is/c++draft/dcl.init.aggr#6)

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_MINMAX_H


=== system/lib/libcxx/include/__algorithm/ranges_minmax_element.h ===
SHA256: 7743ab99f79a661d064908bfb2a7f540a3a216d73eba262e7c76fe3085678e5e
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_MINMAX_H


=== system/lib/libcxx/include/__algorithm/ranges_mismatch.h ===
SHA256: e4e82c79ad57d5fa7677f33c55fe92000ce7e9ea9538192d6dfbc9f6df786163
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_MISMATCH_H


=== system/lib/libcxx/include/__algorithm/ranges_move.h ===
SHA256: 243a443ed05ed71ff8a6b9a2076067acba118beee09b5f3553dd7a221de2997a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_MOVE_H


=== system/lib/libcxx/include/__algorithm/ranges_move_backward.h ===
SHA256: 15e22e83c0fd58b36b9e393bfcdca44d9cb618d99448d84d79297211f0786887
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_MOVE_BACKWARD_H


=== system/lib/libcxx/include/__algorithm/ranges_next_permutation.h ===
SHA256: 256ccfc9781dd01b8919cac5d7dfa3e89ac1e220b591abba938191bee927af3d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_NEXT_PERMUTATION_H


=== system/lib/libcxx/include/__algorithm/ranges_none_of.h ===
SHA256: 96578be72986b392767131aabb2c8c1de88b458ae6c5186bf8178fedbedb5de7
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_NONE_OF_H


=== system/lib/libcxx/include/__algorithm/ranges_nth_element.h ===
SHA256: 8e528263f7c7b26aa0fb21b2c85e5a75a2e4dc9584990ace4134fbd30d2600f5
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_NTH_ELEMENT_H


=== system/lib/libcxx/include/__algorithm/ranges_partial_sort.h ===
SHA256: 7d7700fc3a2531006f0d1f5c27fc6afaa75e75863d10fdd1f5edc1f1b035e6e0
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_PARTIAL_SORT_H


=== system/lib/libcxx/include/__algorithm/ranges_partial_sort_copy.h ===
SHA256: 01ddff6fcc995741240af4d8e196ef30d750360179aad018a9021e86892e883d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_PARTIAL_SORT_COPY_H


=== system/lib/libcxx/include/__algorithm/ranges_partition.h ===
SHA256: 16be2d93626facbe978d2346b2b58ec2f3b18ad44343c62f1df888bbe2384fa9
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_PARTITION_H


=== system/lib/libcxx/include/__algorithm/ranges_partition_copy.h ===
SHA256: 6461703580ace1c687eaea7380a4c64c199f4ed125ebfad1aaf970c75e2169be
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// TODO(ranges): delegate to the classic algorithm.

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_PARTITION_COPY_H


=== system/lib/libcxx/include/__algorithm/ranges_partition_point.h ===
SHA256: ccb9b55af1fb6633f0756f99e63d5072934fbc78f1ef0573ad545871b4b193b1
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// TODO(ranges): delegate to the classic algorithm.

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_PARTITION_POINT_H


=== system/lib/libcxx/include/__algorithm/ranges_pop_heap.h ===
SHA256: d36c6b34ae2d48bd5e47451a7394ff98e1abc59641e80edb03524b0201a91be9
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_POP_HEAP_H


=== system/lib/libcxx/include/__algorithm/ranges_prev_permutation.h ===
SHA256: 4c17236dc9fbf9b2945246f5871cc655f2fc5bce91fb14dd858a137eb0bba3fa
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_PREV_PERMUTATION_H


=== system/lib/libcxx/include/__algorithm/ranges_push_heap.h ===
SHA256: 7ebf303d4377c68084ca1e58806e9f816d71d969b7021ce7d88a127ec13fd4c1
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_PUSH_HEAP_H


=== system/lib/libcxx/include/__algorithm/ranges_remove.h ===
SHA256: 007d52cdbee30ed6611d326b275933ec207e775d140ec797c5c732b0a690ce50
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_REMOVE_H


=== system/lib/libcxx/include/__algorithm/ranges_remove_copy.h ===
SHA256: 3ea774517e526652472222509811489794c8ce7f57c75ff831282561143ba976
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_REMOVE_COPY_H


=== system/lib/libcxx/include/__algorithm/ranges_remove_copy_if.h ===
SHA256: 53a519dae242642658f21c443fa31e68810eb2ac309d7692a68a18c389ca1008
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_REMOVE_COPY_IF_H


=== system/lib/libcxx/include/__algorithm/ranges_remove_if.h ===
SHA256: e10f81a03e8ea966eb1fb963a1a226cef45d99a06eadb4b96bb5b1695a5a7a5f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_REMOVE_IF_H


=== system/lib/libcxx/include/__algorithm/ranges_replace.h ===
SHA256: b8a753dc03e64a7a25eb16d9d88aa3065520b4ace7b60ca7584be4156c4e5bb2
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_REPLACE_H


=== system/lib/libcxx/include/__algorithm/ranges_replace_copy.h ===
SHA256: d42db348d62679735999285e9a1b9a55706f3cad231d266956cefc7d29c40017
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_REPLACE_COPY_H


=== system/lib/libcxx/include/__algorithm/ranges_replace_copy_if.h ===
SHA256: c09beca497ebc0256bbbe457c99b7c66eff9431083728ea4d23331155ef383d3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_REPLACE_COPY_IF_H


=== system/lib/libcxx/include/__algorithm/ranges_replace_if.h ===
SHA256: df31b37b8ae7ab47afd1d933748c87dc82c1d8beb11595b3a8b5d326596df670
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_REPLACE_IF_H


=== system/lib/libcxx/include/__algorithm/ranges_reverse.h ===
SHA256: 54d983f72c8712483d1e7b7b964c2078eca6786069b44957a23c62f5e5b0e40d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_REVERSE_H


=== system/lib/libcxx/include/__algorithm/ranges_reverse_copy.h ===
SHA256: e2b28b92ac3fdd27366974f896b77d1b65b9b0d22ea63401eafe4dfc00e506b8
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_REVERSE_COPY_H


=== system/lib/libcxx/include/__algorithm/ranges_rotate.h ===
SHA256: 5d99293f947c77fdf7fb6df0c1b94bc1e7acefbd07f35e9e5c43bd6974c65156
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_ROTATE_H


=== system/lib/libcxx/include/__algorithm/ranges_rotate_copy.h ===
SHA256: 73e0e997d22ac49b894097086a600d15f939dfaa4446f378263772ae162e5a54
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_ROTATE_COPY_H


=== system/lib/libcxx/include/__algorithm/ranges_sample.h ===
SHA256: dbfe001e8993aa7d6ebb64164412e1a3207b8804cd9a483788f6c644f57d9296
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_SAMPLE_H


=== system/lib/libcxx/include/__algorithm/ranges_search.h ===
SHA256: 2571d7ae1410ed04e0903f1150ec914ce7d21a042a152203e60bcebff890f4aa
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_SEARCH_H


=== system/lib/libcxx/include/__algorithm/ranges_search_n.h ===
SHA256: 7cbf7026299243ae532b96ba1856485b4492e32022447dfd4d450fe74bb0a473
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_SEARCH_N_H


=== system/lib/libcxx/include/__algorithm/ranges_set_difference.h ===
SHA256: 28b60865f096cc6acdaa21dcfd0853a666707b846fd5921d3cbad4bbd0409829
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_SET_DIFFERENCE_H


=== system/lib/libcxx/include/__algorithm/ranges_set_intersection.h ===
SHA256: 34e29752b47a8ff05fbe4014685116ec89e8bb5d23679b73831a18d5a7b59caf
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_SET_INTERSECTION_H


=== system/lib/libcxx/include/__algorithm/ranges_set_symmetric_difference.h ===
SHA256: 833db25c6b6b9c7adcb0861a58b8d9235567f1a62d9ae91dbf5b5841a206840c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_SET_SYMMETRIC_DIFFERENCE_H


=== system/lib/libcxx/include/__algorithm/ranges_set_union.h ===
SHA256: 3fd62509ddc184920a4c0a2e6364528ef99f67b95af44759609bde66a4c9234c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_SET_UNION_H


=== system/lib/libcxx/include/__algorithm/ranges_shuffle.h ===
SHA256: 0d022dbe87ad18d6dde6aaac76c3c4211beffc26153cc32e357e8619bf978c71
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_SHUFFLE_H


=== system/lib/libcxx/include/__algorithm/ranges_sort.h ===
SHA256: ba2145dd818b26165dc91fe814256c3b2989152cdf0a7b841c911984c3c1c792
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_SORT_H


=== system/lib/libcxx/include/__algorithm/ranges_sort_heap.h ===
SHA256: 55eea6d30bfd97a283580f5557bee5ea1a0da90c6bd657ce194567158149b656
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_SORT_HEAP_H


=== system/lib/libcxx/include/__algorithm/ranges_stable_partition.h ===
SHA256: c6bc2d61258feb7ed47f2f898ae735fc1dbd0034d34987137c4bcae19600de40
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_STABLE_PARTITION_H


=== system/lib/libcxx/include/__algorithm/ranges_stable_sort.h ===
SHA256: e428f6f492d84666c389085717fe675492c86a0cc9e1421511279aa81631468b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_STABLE_SORT_H


=== system/lib/libcxx/include/__algorithm/ranges_starts_with.h ===
SHA256: 9b360c6372639335b2e5a88ec566f9fcb65ea2e748ead94c9c86152c68cedac7
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 23

// _LIBCPP___ALGORITHM_RANGES_STARTS_WITH_H


=== system/lib/libcxx/include/__algorithm/ranges_swap_ranges.h ===
SHA256: d457970d4f0bf59f6ecf10c904ee033d179b253188593c375fb0276016a6ac2a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_SWAP_RANGES_H


=== system/lib/libcxx/include/__algorithm/ranges_transform.h ===
SHA256: e590ac0f507f0e6d4db34a1eb92a8b65b8b8f516755a48ffc4673f9cc59abb8f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_TRANSFORM_H


=== system/lib/libcxx/include/__algorithm/ranges_unique.h ===
SHA256: ba6c9efbd3347e0e3cc94d3b5ef8f9993f95e829f4ab51a3df975918888e0fc1
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_UNIQUE_H


=== system/lib/libcxx/include/__algorithm/ranges_unique_copy.h ===
SHA256: da73fb759a06d0ed108454c5d47e9abe68a1450eb328149c9c9981bec4c92f09
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_UNIQUE_COPY_H


=== system/lib/libcxx/include/__algorithm/ranges_upper_bound.h ===
SHA256: 98ae2ce86d4428e789d591120b90fb2d26563fd7a168e60e9ed2f360532ee6fc
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_UPPER_BOUND_H


=== system/lib/libcxx/include/__algorithm/remove.h ===
SHA256: bb08140611835431e496b43b445ae1237cc36680472b3c795b569c81dfad8961
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_REMOVE_H


=== system/lib/libcxx/include/__algorithm/remove_copy.h ===
SHA256: f8016ece8398c80bac2680cc8b2fcf849c90e2a3c5d285348eaa719cfe28acd3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_REMOVE_COPY_H


=== system/lib/libcxx/include/__algorithm/remove_copy_if.h ===
SHA256: 6d6d0cc1d07f453dfeb297b4002f57e1fd7be020247907f7568755e78b4e5e46
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_REMOVE_COPY_IF_H


=== system/lib/libcxx/include/__algorithm/remove_if.h ===
SHA256: 5ecae42dd7c274fc1e2dcadd01f93680c2b7b980919e522474f2fbc5a5100606
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_REMOVE_IF_H


=== system/lib/libcxx/include/__algorithm/replace.h ===
SHA256: 6ad1946331f5e28c0455528c49a93dc5b5844c897df15348eb7a0c5e2e4bb225
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_REPLACE_H


=== system/lib/libcxx/include/__algorithm/replace_copy.h ===
SHA256: 757181c7dafbe8938c5590e0a33a57a1d171db90acc19cf7252cadf5ae5e373a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_REPLACE_COPY_H


=== system/lib/libcxx/include/__algorithm/replace_copy_if.h ===
SHA256: abacf024cc9869f63b3032ff66d442b9646a0b4deceea74f263dee17cc1b0d39
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_REPLACE_COPY_IF_H


=== system/lib/libcxx/include/__algorithm/replace_if.h ===
SHA256: 0e891ffd96b84fdbbbf5e15e483c5ed149d21c7ce1ef56c0d2414b29712b473e
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_REPLACE_IF_H


=== system/lib/libcxx/include/__algorithm/reverse.h ===
SHA256: 5ca3f05ee497c14eacd7e64433a91a6da214269c2424742963ae708059a98d5e
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_REVERSE_H


=== system/lib/libcxx/include/__algorithm/reverse_copy.h ===
SHA256: 4c003858b0d4b48d745a34aa0b5e1b71ee4b920aae387810c83a73e9b0bda301
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_REVERSE_COPY_H


=== system/lib/libcxx/include/__algorithm/rotate.h ===
SHA256: 033192745945aa29c8349110fe5485cff9bfa4ff82567693a40900ce0a55b2d5
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_ROTATE_H


=== system/lib/libcxx/include/__algorithm/rotate_copy.h ===
SHA256: d49c29cb1c29b0f22b198e0e7de00ce58c80da8fe6691fd3e1e4200391657b74
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_ROTATE_COPY_H


=== system/lib/libcxx/include/__algorithm/sample.h ===
SHA256: 6db42f2f6e0eef273549943629971b9eac34f2f43a4395cd42f3a43eb339b57e
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___ALGORITHM_SAMPLE_H


=== system/lib/libcxx/include/__algorithm/search.h ===
SHA256: edbb62d0631e3407b85d8454b10a4ffc7ed581bf2760c4ac4688878856957abb
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Everything matches an empty sequence

// Find first element in sequence 1 that matchs *__first2, with a mininum of loop checks

// return __last1 if no element matches *__first2

// *__first1 matches *__first2, now match elements after here

// If pattern exhausted, __first1 is the answer (works for 1 element pattern)

// Otherwise if source exhaused, pattern not found

// if there is a mismatch, restart with a new __first1

// else there is a match, check next elements

// Start of pattern match can't go beyond here

// no need to check range on __m1 because __s guarantees we have enough source

// _LIBCPP___ALGORITHM_SEARCH_H


=== system/lib/libcxx/include/__algorithm/search_n.h ===
SHA256: c84f7c990dbe47788704b10ee1aa4b21a2036c343608e9b5b4d862403b8cff59
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Find first element in sequence that matchs __value, with a mininum of loop checks

// return __last if no element matches __value

// *__first matches __value, now match elements after here

// If pattern exhausted, __first is the answer (works for 1 element pattern)

// Otherwise if source exhaused, pattern not found

// if there is a mismatch, restart with a new __first

// else there is a match, check next elements

// Start of pattern match can't go beyond here

// Find first element in sequence that matchs __value, with a mininum of loop checks

// return __last if no element matches __value

// *__first matches __value_, now match elements after here

// If pattern exhausted, __first is the answer (works for 1 element pattern)

// no need to check range on __m because __s guarantees we have enough source

// if there is a mismatch, restart with a new __first

// else there is a match, check next elements

// _LIBCPP___ALGORITHM_SEARCH_N_H


=== system/lib/libcxx/include/__algorithm/set_difference.h ===
SHA256: 16aa97e5f8ab633552d17376c72132f42ce906a79fe961b8d7d9e9f6bda39dc2
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_SET_DIFFERENCE_H


=== system/lib/libcxx/include/__algorithm/set_intersection.h ===
SHA256: 03ad73600e127db1fd6207ffb92c221029c017f057425b194e063edf077aa897
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// need a constructor as C++03 aggregate init is hard

// Helper for __set_intersection() with one-sided binary search: populate result and advance input iterators if they

// are found to potentially contain the same value in two consecutive calls. This function is very intimately related to

// the way it is used and doesn't attempt to abstract that, it's not appropriate for general usage outside of its

// context.

// With forward iterators we can make multiple passes over the data, allowing the use of one-sided binary search to

// reduce best-case complexity to log(N). Understanding how we can use binary search and still respect complexity

// guarantees is _not_ straightforward: the guarantee is "at most 2*(N+M)-1 comparisons", and one-sided binary search

// will necessarily overshoot depending on the position of the needle in the haystack -- for instance, if we're

// searching for 3 in (1, 2, 3, 4), we'll check if 3<1, then 3<2, then 3<4, and, finally, 3<3, for a total of 4

// comparisons, when linear search would have yielded 3. However, because we won't need to perform the intervening

// reciprocal comparisons (ie 1<3, 2<3, 4<3), that extra comparison doesn't run afoul of the guarantee. Additionally,

// this type of scenario can only happen for match distances of up to 5 elements, because 2*log2(8) is 6, and we'll

// still be worse-off at position 5 of an 8-element set. From then onwards these scenarios can't happen. TL;DR: we'll be

// 1 comparison worse-off compared to the classic linear-searching algorithm if matching position 3 of a set with 4

// elements, or position 5 if the set has 7 or 8 elements, but we'll never exceed the complexity guarantees from the

// standard.

// keeping in mind that a==b iff !(a<b) && !(b<a):

// if we can't advance __first1, that means !(*__first1 < *_first2), therefore __may_be_equal==true

// input iterators are not suitable for multipass algorithms, so we stick to the classic single-pass version

// _LIBCPP___ALGORITHM_SET_INTERSECTION_H


=== system/lib/libcxx/include/__algorithm/set_symmetric_difference.h ===
SHA256: ca717adaffee907cec3dfcc6ee0b8082cfc50f753e1db03029c8797ae96aed69
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// need a constructor as C++03 aggregate init is hard

// _LIBCPP___ALGORITHM_SET_SYMMETRIC_DIFFERENCE_H


=== system/lib/libcxx/include/__algorithm/set_union.h ===
SHA256: a4886eed1a411e25371b427ca354d9d4e8f315187881459320efd245a9cbc3bd
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// need a constructor as C++03 aggregate init is hard

// _LIBCPP___ALGORITHM_SET_UNION_H


=== system/lib/libcxx/include/__algorithm/shift_left.h ===
SHA256: cfed3e3dafad588dc635feb580840b03dc9de72616c60b95bce3ea798f48b8cd
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_SHIFT_LEFT_H


=== system/lib/libcxx/include/__algorithm/shift_right.h ===
SHA256: 7129b23e0a4bd1174dc079cbc8b6e52298ad7c97cfc023b824a0dca6ac103b96
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// We have an __n-element scratch space from __first to __ret.

// Slide an __n-element window [__trail, __lead) from left to right.

// We're essentially doing swap_ranges(__first, __ret, __trail, __lead)

// over and over; but once __lead reaches __last we needn't bother

// to save the values of elements [__trail, __last).

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_SHIFT_RIGHT_H


=== system/lib/libcxx/include/__algorithm/shuffle.h ===
SHA256: 121c3cbdd9acc064251f2573fa902f4c49ad0962610500ed22c110bcff4c991a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_SHUFFLE_H


=== system/lib/libcxx/include/__algorithm/sift_down.h ===
SHA256: 3ecb05c593283f3c06e004ce3225839c3d4e45feaab899191b472a89a6f8db77
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// left-child of __start is at 2 * __start + 1

// right-child of __start is at 2 * __start + 2

// right-child exists and is greater than left-child

// check if we are in heap-order

// we are, __start is larger than its largest child

// we are not in heap-order, swap the parent with its largest child

// recompute the child based off of the updated parent

// right-child exists and is greater than left-child

// check if we are in heap-order

// right-child exists and is greater than left-child

// swap __hole with its largest child

// if __hole is now a leaf, we're done

// _LIBCPP___ALGORITHM_SIFT_DOWN_H


=== system/lib/libcxx/include/__algorithm/simd_utils.h ===
SHA256: 8b7dadb36053b82d5add34794767b14312655fd491956098e172fff44bfa36d7
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// TODO: Find out how altivec changes things and allow vectorizations there too.

// TODO: Simplify this condition once we stop building with AppleClang 15 in the CI.

// This isn't specialized for 64 byte vectors on purpose. They have the potential to significantly reduce performance

// in mixed simd/non-simd workloads and don't provide any performance improvement for currently vectorized algorithms

// as far as benchmarks are concerned.

// This isn't inlined without always_inline when loading chars.

// This has MSan disabled du to https://github.com/llvm/llvm-project/issues/85876

// _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS

// _LIBCPP___ALGORITHM_SIMD_UTILS_H


=== system/lib/libcxx/include/__algorithm/sort.h ===
SHA256: b644503828e13c3c90b5d343684eb993add9330762c5a7957001876be653e014
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Size in bits for the bitset in use.

// namespace __detail

// Ensures that __c(*__x, *__y) is true by swapping *__x and *__y if necessary.

// Note: this function behaves correctly even with proxy iterators (because it relies on `value_type`).

// Ensures that *__x, *__y and *__z are ordered according to the comparator __c,

// under the assumption that *__y and *__z are already ordered.

// Note: this function behaves correctly even with proxy iterators (because it relies on `value_type`).

// stable, 2-3 compares, 0-2 swaps

// if x <= y

// if y <= z

// x <= y && y <= z

// x <= y && y > z

// x <= z && y < z

// if x > y

// x < y && y <= z

// x <= y && y < z

// x > y, if y > z

// x < y && y < z

// x > y && y <= z

// x < y && x <= z

// if y > z

// x <= y && y < z

// x <= y && y <= z

// stable, 3-6 compares, 0-5 swaps

// stable, 4-10 compares, 0-9 swaps

// Assumes size > 0

// Sort the iterator range [__first, __last) using the comparator __comp using

// the insertion sort algorithm.

// Sort the iterator range [__first, __last) using the comparator __comp using

// the insertion sort algorithm.  Insertion sort has two loops, outer and inner.

// The implementation below has no bounds check (unguarded) for the inner loop.

// Assumes that there is an element in the position (__first - 1) and that each

// element in the input range is greater or equal to the element at __first - 1.

// can be unused when assertions are disabled

// No need for bounds check due to the assumption stated above.

// Swap one pair on each iteration as long as both bitsets have at least one

// element for swapping.

// Possible vectorization. With a proper "-march" flag, the following loop

// will be compiled into a set of SIMD instructions.

// Possible vectorization. With a proper "-march" flag, the following loop

// will be compiled into a set of SIMD instructions.

// We know at least one side is a full block.

// if (__right_bitset == 0)

// Record the comparison outcomes for the elements currently on the left side.

// Record the comparison outcomes for the elements currently on the right

// side.

// Swap within the left side.  Need to find set positions in the reverse

// order.

// Swap within the right side.  Need to find set positions in the reverse

// order.

// Partition [__first, __last) using the comparator __comp.  *__first has the

// chosen pivot.  Elements that are equivalent are kept to the left of the

// pivot.  Returns the iterator for the pivot and a bool value which is true if

// the provided range is already sorted, false otherwise.  We assume that the

// length of the range is at least three elements.

//

// __bitset_partition uses bitsets for storing outcomes of the comparisons

// between the pivot and other elements.

// used for bounds checking, those are not moved around

//

// Find the first element greater than the pivot.

// Not guarded since we know the last element is greater than the pivot.

// Find the last element less than or equal to the pivot.

// It will be always guarded because __introsort will do the median-of-three

// before calling this.

// If the first element greater than the pivot is at or after the

// last element less than or equal to the pivot, then we have covered the

// entire range without swapping elements.  This implies the range is already

// partitioned.

// In [__first, __last) __last is not inclusive. From now on, it uses last

// minus one to be inclusive on both sides.

// Reminder: length = __lm1 - __first + 1.

// Record the comparison outcomes for the elements currently on the left

// side.

// Record the comparison outcomes for the elements currently on the right

// side.

// Swap the elements recorded to be the candidates for swapping in the

// bitsets.

// Only advance the iterator if all the elements that need to be moved to

// other side were moved.

// Now, we have a less-than a block worth of elements on at least one of the

// sides.

// At least one the bitsets would be empty.  For the non-empty one, we need to

// properly partition the elements that appear within that bitset.

// Move the pivot to its correct position.

// Partition [__first, __last) using the comparator __comp.  *__first has the

// chosen pivot.  Elements that are equivalent are kept to the right of the

// pivot.  Returns the iterator for the pivot and a bool value which is true if

// the provided range is already sorted, false otherwise.  We assume that the

// length of the range is at least three elements.

// used for bounds checking, those are not moved around

//

// Find the first element greater or equal to the pivot.  It will be always

// guarded because __introsort will do the median-of-three before calling

// this.

// Find the last element less than the pivot.

// Guarded.

// If the first element greater than or equal to the pivot is at or after the

// last element less than the pivot, then we have covered the entire range

// without swapping elements.  This implies the range is already partitioned.

// Go through the remaining elements.  Swap pairs of elements (one to the

// right of the pivot and the other to left of the pivot) that are not on the

// correct side of the pivot.

// Move the pivot to its correct position.

// Similar to the above function.  Elements equivalent to the pivot are put to

// the left of the pivot.  Returns the iterator to the pivot element.

// used for bounds checking, those are not moved around

//

// Guarded.

// It will be always guarded because __introsort will do the

// median-of-three before calling this.

// The main sorting function.  Implements introsort combined with other ideas:

//  - option of using block quick sort for partitioning,

//  - guarded and unguarded insertion sort for small lengths,

//  - Tuckey's ninther technique for computing the pivot,

//  - check on whether partition was not required.

// The implementation is partly based on Orson Peters' pattern-defeating

// quicksort, published at: <https://github.com/orlp/pdqsort>.

// Upper bound for using insertion sort for sorting.

// Lower bound for using Tuckey's ninther technique for median computation.

// Use insertion sort if the length of the range is below the specified limit.

// Fallback to heap sort as Introsort suggests.

// Use Tuckey's ninther technique or median of 3 for pivot selection

// depending on the length of the range being sorted.

// The elements to the left of the current iterator range are already

// sorted.  If the current iterator range to be sorted is not the

// leftmost part of the entire iterator range and the pivot is same as

// the highest element in the range to the left, then we know that all

// the elements in the range [first, pivot] would be equal to the pivot,

// assuming the equal elements are put on the left side when

// partitioned.  This also means that we do not need to sort the left

// side of the partition.

// Use bitset partition only if asked for.

// [__first, __i) < *__i and *__i <= [__i+1, __last)

// If we were given a perfect partition, see if insertion sort is quick...

// Sort the left partiton recursively and the right partition with tail recursion elimination.

// log(0) is undefined, so don't try computing the depth

// Only use bitset partitioning for arithmetic types.  We should also check

// that the default comparator is in use so that we are sure that there are no

// branches in the comparator.

// _LIBCPP___ALGORITHM_SORT_H


=== system/lib/libcxx/include/__algorithm/sort_heap.h ===
SHA256: 9e6f491404587d7008813a6ba261686be81be4dddab95a483232fd53eb78d014
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_SORT_HEAP_H


=== system/lib/libcxx/include/__algorithm/stable_partition.h ===
SHA256: e22089bbb19aa8b11000e4d042fc9f4508de6f239c20e960a7a368abc5b9779e
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// *__first is known to be false

// __len >= 1

// The buffer is big enough to use

// Move the falses into the temporary buffer, and the trues to the front of the line

// Update __first to always point to the end of the trues

// All trues now at start of range, all falses in buffer

// Move falses back into range, but don't mess up __first which points to first false

// __h destructs moved-from values out of the temp buffer, but doesn't deallocate buffer

// Else not enough buffer, do in place

// __len >= 3

// __len2 >= 2

// recurse on [__first, __m), *__first know to be false

// F?????????????????

// f       m         l

// TTTFFFFF??????????

// f  ff   m         l

// recurse on [__m, __last], except increase __m until *(__m) is false, *__last know to be true

// TTTFFFFFTTTF??????

// f  ff   m  m1     l

// TTTFFFFFTTTTTFFFFF

// f  ff   m    sf   l

// TTTTTTTTFFFFFFFFFF

//         |

// might want to make this a function of trivial assignment

// Either prove all true and return __first or point to first false

// We now have a reduced range [__first, __last)

// *__first is known to be false

// *__first is known to be false

// *__last is known to be true

// __len >= 2

// The buffer is big enough to use

// Move the falses into the temporary buffer, and the trues to the front of the line

// Update __first to always point to the end of the trues

// move *__last, known to be true

// All trues now at start of range, all falses in buffer

// Move falses back into range, but don't mess up __first which points to first false

// __h destructs moved-from values out of the temp buffer, but doesn't deallocate buffer

// Else not enough buffer, do in place

// __len >= 4

// __len2 >= 2

// recurse on [__first, __m-1], except reduce __m-1 until *(__m-1) is true, *__first know to be false

// F????????????????T

// f       m        l

// F???TFFF?????????T

// f   m1  m        l

// TTTFFFFF?????????T

// f  ff   m        l

// recurse on [__m, __last], except increase __m until *(__m) is false, *__last know to be true

// TTTFFFFFTTTF?????T

// f  ff   m  m1    l

// TTTFFFFFTTTTTFFFFF

// f  ff   m    sf  l

// TTTTTTTTFFFFFFFFFF

//         |

// might want to make this a function of trivial assignment

// Either prove all true and return __first or point to first false

// __first points to first false, everything prior to __first is already set.

// Either prove [__first, __last) is all false and return __first, or point __last to last true

// We now have a reduced range [__first, __last]

// *__first is known to be false

// *__last is known to be true

// __len >= 2

// _LIBCPP___ALGORITHM_STABLE_PARTITION_H


=== system/lib/libcxx/include/__algorithm/stable_sort.h ===
SHA256: df192252f9ae3e19d7268d29e3060fd0999b7be52e3de462b65620006526f5b7
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP_STD_VER >= 17

//         std::__merge<_Compare>(move_iterator<value_type*>(__buff),

//                                  move_iterator<value_type*>(__buff + __l2),

//                                  move_iterator<_RandomAccessIterator>(__buff + __l2),

//                                  move_iterator<_RandomAccessIterator>(__buff + __len),

//                                  __first, __comp);

// _LIBCPP___ALGORITHM_STABLE_SORT_H


=== system/lib/libcxx/include/__algorithm/swap_ranges.h ===
SHA256: ab723bacc5301536016bbc411f1d8b17730dea003eb38cea27b7b9bce340cd27
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// do first word

// __first.__ctz_ = 0;

// __first.__ctz_ == 0;

// do middle words

// do last word

// do first word

// __first.__ctz_ = 0;

// __first.__ctz_ == 0;

// do middle words

// do last word

// 2+1 iterators: size2 >= size1; used by std::swap_ranges.

// 2+2 iterators: used by std::ranges::swap_ranges.

// 2+2 iterators: the shorter size will be used.

// 2+1 iterators: size2 >= size1.

// _LIBCPP___ALGORITHM_SWAP_RANGES_H


=== system/lib/libcxx/include/__algorithm/three_way_comp_ref_type.h ===
SHA256: e2dbc1fc570a1ff501d999baf200a7f383cb529839bf59ad3f0264397a7d6446
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Pass the comparator by lvalue reference. Or in the debug mode, using a debugging wrapper that stores a reference.

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_THREE_WAY_COMP_REF_TYPE_H


=== system/lib/libcxx/include/__algorithm/transform.h ===
SHA256: 82a69b8f4b399b49ac6f475b1fa3a5623e4445b57c09c9f0d23bd35e4114e4ae
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_TRANSFORM_H


=== system/lib/libcxx/include/__algorithm/uniform_random_bit_generator_adaptor.h ===
SHA256: 7973e698f98e9396eaeda0e6e2a532ba2c416cd197972fa135d79a721f5ee6b4
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Range versions of random algorithms (e.g. `std::shuffle`) are less constrained than their classic counterparts.

// Range algorithms only require the given generator to satisfy the `std::uniform_random_bit_generator` concept.

// Classic algorithms require the given generator to meet the uniform random bit generator requirements; these

// requirements include satisfying `std::uniform_random_bit_generator` and add a requirement for the generator to

// provide a nested `result_type` typedef (see `[rand.req.urng]`).

//

// To be able to reuse classic implementations, make the given generator meet the classic requirements by wrapping

// it into an adaptor type that forwards all of its interface and adds the required typedef.

// The generator is not required to be copyable or movable, so it has to be stored as a reference.

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_RANGES_UNIFORM_RANDOM_BIT_GENERATOR_ADAPTOR_H


=== system/lib/libcxx/include/__algorithm/unique.h ===
SHA256: 632c1ea1945f7618760f94211ad9912f770d4b8fc66b74c7066110c4a377ac74
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// unique

// ...  a  a  ?  ...

//      f     i

// _LIBCPP___ALGORITHM_UNIQUE_H


=== system/lib/libcxx/include/__algorithm/unique_copy.h ===
SHA256: c7d9fc1f8b490ed5322d9fd9e01a4eda93bd799d06c320fc3dac14b1514a4d34
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __unique_copy_tags

// _LIBCPP___ALGORITHM_UNIQUE_COPY_H


=== system/lib/libcxx/include/__algorithm/unwrap_iter.h ===
SHA256: a3d462ed7f2ab860fcffe6d85a8738882495f58ec3bc69223563ba853ab8ef6b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// TODO: Change the name of __unwrap_iter_impl to something more appropriate

// The job of __unwrap_iter is to remove iterator wrappers (like reverse_iterator or __wrap_iter),

// to reduce the number of template instantiations and to enable pointer-based optimizations e.g. in std::copy.

//

// Some algorithms (e.g. std::copy, but not std::sort) need to convert an

// "unwrapped" result back into the original iterator type. Doing that is the job of __rewrap_iter.

// Default case - we can't unwrap anything

// TODO(hardening): make sure that the following unwrapping doesn't unexpectedly turn hardened iterators into raw

// pointers.

// It's a contiguous iterator, so we can use a raw pointer instead

// Allow input_iterators to be passed to __unwrap_iter (but not __rewrap_iter)

// _LIBCPP___ALGORITHM_UNWRAP_ITER_H


=== system/lib/libcxx/include/__algorithm/unwrap_range.h ===
SHA256: f8d22d0b22a0666548e9a7dff09a98e1541b1bb0aeba84a5f03b5d867ebfd30a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __unwrap_range and __rewrap_range are used to unwrap ranges which may have different iterator and sentinel types.

// __unwrap_iter and __rewrap_iter don't work for this, because they assume that the iterator and sentinel have

// the same type. __unwrap_range tries to get two iterators and then forward to __unwrap_iter.

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ALGORITHM_UNWRAP_RANGE_H


=== system/lib/libcxx/include/__algorithm/upper_bound.h ===
SHA256: 69394bc840b717b69102e9a099e51eaa0b06d40a117a8298e1abee16e649cc76
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ALGORITHM_UPPER_BOUND_H


=== system/lib/libcxx/include/__atomic/aliases.h ===
SHA256: 0323105a45abc6abbc6c24b5a887008ba962a306943637749c0a2355f0292c52
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// C++20 atomic_{signed,unsigned}_lock_free: prefer the contention type most highly, then the largest lock-free type

// There are no lockfree types (this can happen on unusual platforms)

// !_LIBCPP_NO_LOCK_FREE_TYPES

// C++20

// _LIBCPP___ATOMIC_ALIASES_H


=== system/lib/libcxx/include/__atomic/atomic.h ===
SHA256: fadb37ebcdef254482d6c5b708c2bd4b415a3c4e792f858bd61f015e4e05501a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// false

//  _LIBCPP_STD_VER >= 20

// atomic<Integral>

// Here we need _IsIntegral because the default template argument is not enough

// e.g  __atomic_base<int> is __atomic_base<int, true>, which inherits from

// __atomic_base<int, false> and the caller of the wait function is

// __atomic_base<int, false>. So specializing __atomic_base<_Tp> does not work

// atomic<T*>

// __atomic_fetch_add accepts function pointers, guard against them.

// __atomic_fetch_add accepts function pointers, guard against them.

// __atomic_fetch_add accepts function pointers, guard against them.

// __atomic_fetch_add accepts function pointers, guard against them.

// Only x87-fp80 long double has 64-bit mantissa

// The builtin __cxx_atomic_fetch_add errors during compilation for

// long double on platforms with fp80 format.

// For more details, see

// lib/Sema/SemaChecking.cpp function IsAllowedValueType

// LLVM Parser does not allow atomicrmw with x86_fp80 type.

// if (ValType->isSpecificBuiltinType(BuiltinType::LongDouble) &&

//    &Context.getTargetInfo().getLongDoubleFormat() ==

//        &llvm::APFloat::x87DoubleExtended())

// For more info

// https://github.com/llvm/llvm-project/issues/68602

// https://reviews.llvm.org/D53965

// https://github.com/llvm/llvm-project/issues/47978

// clang bug: __old is not updated on failure for atomic<long double>::compare_exchange_weak

// Note __old = __self.load(memory_order_relaxed) will not work

// _LIBCPP_STD_VER >= 20

// atomic_is_lock_free

// atomic_init

// atomic_store

// atomic_store_explicit

// atomic_load

// atomic_load_explicit

// atomic_exchange

// atomic_exchange_explicit

// atomic_compare_exchange_weak

// atomic_compare_exchange_strong

// atomic_compare_exchange_weak_explicit

// atomic_compare_exchange_strong_explicit

// atomic_wait

// atomic_wait_explicit

// atomic_notify_one

// atomic_notify_all

// _LIBCPP_STD_VER >= 20

// atomic_fetch_add

// atomic_fetch_add_explicit

// atomic_fetch_sub

// atomic_fetch_sub_explicit

// atomic_fetch_and

// atomic_fetch_and_explicit

// atomic_fetch_or

// atomic_fetch_or_explicit

// atomic_fetch_xor

// atomic_fetch_xor_explicit

// _LIBCPP___ATOMIC_ATOMIC_H


=== system/lib/libcxx/include/__atomic/atomic_flag.h ===
SHA256: 4245d56f7dcd8c49ba67bd5322a6939e64453b65b158334cd03e250bd04428f9
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// EXTENSION

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ATOMIC_ATOMIC_FLAG_H


=== system/lib/libcxx/include/__atomic/atomic_init.h ===
SHA256: 9cd8489afceeaabc199a0f82ddf9d0e9835474988e968b36153c7fb66e056a8f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ATOMIC_ATOMIC_INIT_H


=== system/lib/libcxx/include/__atomic/atomic_lock_free.h ===
SHA256: 6e0aad3cd2804dd05b01a8498bdeba709c6804b985710951624666b9417784c3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ATOMIC_ATOMIC_LOCK_FREE_H


=== system/lib/libcxx/include/__atomic/atomic_ref.h ===
SHA256: b92de5a866f025508d45cc5f04ee9b17fe2d4ee35b9b20c688d8b53b983c7284
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//                        Kokkos v. 4.0

//       Copyright (2022) National Technology & Engineering

//               Solutions of Sandia, LLC (NTESS).

//

// Under the terms of Contract DE-NA0003525 with NTESS,

// the U.S. Government retains certain rights in this software.

//

//===---------------------------------------------------------------------===//

// These types are required to make __atomic_is_always_lock_free work across GCC and Clang.

// The purpose of this trick is to make sure that we provide an object with the correct alignment

// to __atomic_is_always_lock_free, since that answer depends on the alignment.

// NOLINT(readability-simplify-boolean-expr)

// _Tp has padding bits and __builtin_clear_padding is available

// The algorithm we use here is basically to perform `__atomic_compare_exchange` on the

// values until it has either succeeded, or failed because the value representation of the

// objects involved was different. This is why we loop around __atomic_compare_exchange:

// we basically loop until its failure is caused by the value representation of the objects

// being different, not only their object representation.

// Value representation without padding bits do not compare equal ->

// write the current content of *ptr into *expected

// require types that are 1, 2, 4, 8, or 16 bytes in length to be aligned to at least their size to be potentially

// used lock-free

// The __atomic_always_lock_free builtin takes into account the alignment of the pointer if provided,

// so we create a fake pointer with a suitable alignment when querying it. Note that we are guaranteed

// that the pointer is going to be aligned properly at runtime because that is a (checked) precondition

// of atomic_ref's constructor.

// _LIBCPP_STD_VER >= 20

// _LIBCPP__ATOMIC_ATOMIC_REF_H


=== system/lib/libcxx/include/__atomic/atomic_sync.h ===
SHA256: c53fd962072791dc86b5e384094ff4cac3b78b2e151f8dc609f7e8be1c0fb720
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// The customisation points to enable the following functions:

// - __atomic_wait

// - __atomic_wait_unless

// - __atomic_notify_one

// - __atomic_notify_all

// Note that std::atomic<T>::wait was back-ported to C++03

// The below implementations look ugly to support C++03

// In case the contention type happens to be __cxx_atomic_contention_t, i.e. __cxx_atomic_impl<int64_t>,

// the platform wait is directly monitoring the atomic value itself.

// `__poll_` takes the current value of the atomic as an in-out argument

// to potentially modify it. After it returns, `__monitor` has a value

// which can be safely waited on by `std::__libcpp_atomic_wait` without any

// ABA style issues.

// In case the contention type is anything else, platform wait is monitoring a __cxx_atomic_contention_t

// from the global pool, the monitor comes from __libcpp_atomic_monitor

// poll

// The semantics of this function are similar to `atomic`'s

// `.wait(T old, std::memory_order order)`, but instead of having a hardcoded

// predicate (is the loaded value unequal to `old`?), the predicate function is

// specified as an argument. The loaded value is given as an in-out argument to

// the predicate. If the predicate function returns `true`,

// `__atomic_wait_unless` will return. If the predicate function returns

// `false`, it must set the argument to its current understanding of the atomic

// value. The predicate function must not return `false` spuriously.

/* poll */

/* backoff */

// _LIBCPP_HAS_THREADS

/* poll */

/* backoff */

// _LIBCPP_HAS_THREADS

// C++20

// _LIBCPP___ATOMIC_ATOMIC_SYNC_H


=== system/lib/libcxx/include/__atomic/check_memory_order.h ===
SHA256: 886187d3279f09462ab859243e0f1305da2d2ab05d022f1f2bf7c9da44eae565
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ATOMIC_CHECK_MEMORY_ORDER_H


=== system/lib/libcxx/include/__atomic/contention_t.h ===
SHA256: 0e4ea603645b15a0a5364ba98809cbfa708eae5c7730374ccff5b146b652765a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __linux__ || (_AIX && !__64BIT__)

// _LIBCPP___ATOMIC_CONTENTION_T_H


=== system/lib/libcxx/include/__atomic/fence.h ===
SHA256: dde997dbbc169ae46770f9e63ee569d796c27803b41c38b90c3c6375a9b3fe30
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ATOMIC_FENCE_H


=== system/lib/libcxx/include/__atomic/is_always_lock_free.h ===
SHA256: aaba8199679e9dd9171785407c03d45413b661eeba63e8f9294cf0a0d72591ee
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __atomic_always_lock_free is available in all Standard modes

// _LIBCPP___ATOMIC_IS_ALWAYS_LOCK_FREE_H


=== system/lib/libcxx/include/__atomic/kill_dependency.h ===
SHA256: fa4df0d9780085450aa6abb0b818ede2ee32d063ece6a69013fd03b2061d8023
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ATOMIC_KILL_DEPENDENCY_H


=== system/lib/libcxx/include/__atomic/memory_order.h ===
SHA256: d0afae09cd0a72d4cfcfdb765c34982999771bee019d35936a1a010859e55a92
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Figure out what the underlying type for `memory_order` would be if it were

// declared as an unscoped enum (accounting for -fshort-enums). Use this result

// to pin the underlying type in C++20.

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ATOMIC_MEMORY_ORDER_H


=== system/lib/libcxx/include/__atomic/support.h ===
SHA256: f60f22684672d0fa1b9b533fcc5904292b8164deb624bc6ceff8dece4f05e2db
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements base support for atomics on the platform.

//

// The following operations and types must be implemented (where _Atmc

// is __cxx_atomic_base_impl for readability):

//

// clang-format off

//

// template <class _Tp>

// struct __cxx_atomic_base_impl;

//

// #define __cxx_atomic_is_lock_free(__size)

//

// void __cxx_atomic_thread_fence(memory_order __order) noexcept;

// void __cxx_atomic_signal_fence(memory_order __order) noexcept;

//

// template <class _Tp>

// void __cxx_atomic_init(_Atmc<_Tp> volatile* __a, _Tp __val) noexcept;

// template <class _Tp>

// void __cxx_atomic_init(_Atmc<_Tp>* __a, _Tp __val) noexcept;

//

// template <class _Tp>

// void __cxx_atomic_store(_Atmc<_Tp> volatile* __a, _Tp __val, memory_order __order) noexcept;

// template <class _Tp>

// void __cxx_atomic_store(_Atmc<_Tp>* __a, _Tp __val, memory_order __order) noexcept;

//

// template <class _Tp>

// _Tp __cxx_atomic_load(_Atmc<_Tp> const volatile* __a, memory_order __order) noexcept;

// template <class _Tp>

// _Tp __cxx_atomic_load(_Atmc<_Tp> const* __a, memory_order __order) noexcept;

//

// template <class _Tp>

// void __cxx_atomic_load_inplace(_Atmc<_Tp> const volatile* __a, _Tp* __dst, memory_order __order) noexcept;

// template <class _Tp>

// void __cxx_atomic_load_inplace(_Atmc<_Tp> const* __a, _Tp* __dst, memory_order __order) noexcept;

//

// template <class _Tp>

// _Tp __cxx_atomic_exchange(_Atmc<_Tp> volatile* __a, _Tp __value, memory_order __order) noexcept;

// template <class _Tp>

// _Tp __cxx_atomic_exchange(_Atmc<_Tp>* __a, _Tp __value, memory_order __order) noexcept;

//

// template <class _Tp>

// bool __cxx_atomic_compare_exchange_strong(_Atmc<_Tp> volatile* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) noexcept;

// template <class _Tp>

// bool __cxx_atomic_compare_exchange_strong(_Atmc<_Tp>* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) noexcept;

//

// template <class _Tp>

// bool __cxx_atomic_compare_exchange_weak(_Atmc<_Tp> volatile* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) noexcept;

// template <class _Tp>

// bool __cxx_atomic_compare_exchange_weak(_Atmc<_Tp>* __a, _Tp* __expected, _Tp __value, memory_order __success, memory_order __failure) noexcept;

//

// template <class _Tp>

// _Tp __cxx_atomic_fetch_add(_Atmc<_Tp> volatile* __a, _Tp __delta, memory_order __order) noexcept;

// template <class _Tp>

// _Tp __cxx_atomic_fetch_add(_Atmc<_Tp>* __a, _Tp __delta, memory_order __order) noexcept;

//

// template <class _Tp>

// _Tp* __cxx_atomic_fetch_add(_Atmc<_Tp*> volatile* __a, ptrdiff_t __delta, memory_order __order) noexcept;

// template <class _Tp>

// _Tp* __cxx_atomic_fetch_add(_Atmc<_Tp*>* __a, ptrdiff_t __delta, memory_order __order) noexcept;

//

// template <class _Tp>

// _Tp __cxx_atomic_fetch_sub(_Atmc<_Tp> volatile* __a, _Tp __delta, memory_order __order) noexcept;

// template <class _Tp>

// _Tp __cxx_atomic_fetch_sub(_Atmc<_Tp>* __a, _Tp __delta, memory_order __order) noexcept;

// template <class _Tp>

// _Tp* __cxx_atomic_fetch_sub(_Atmc<_Tp*> volatile* __a, ptrdiff_t __delta, memory_order __order) noexcept;

// template <class _Tp>

// _Tp* __cxx_atomic_fetch_sub(_Atmc<_Tp*>* __a, ptrdiff_t __delta, memory_order __order) noexcept;

//

// template <class _Tp>

// _Tp __cxx_atomic_fetch_and(_Atmc<_Tp> volatile* __a, _Tp __pattern, memory_order __order) noexcept;

// template <class _Tp>

// _Tp __cxx_atomic_fetch_and(_Atmc<_Tp>* __a, _Tp __pattern, memory_order __order) noexcept;

//

// template <class _Tp>

// _Tp __cxx_atomic_fetch_or(_Atmc<_Tp> volatile* __a, _Tp __pattern, memory_order __order) noexcept;

// template <class _Tp>

// _Tp __cxx_atomic_fetch_or(_Atmc<_Tp>* __a, _Tp __pattern, memory_order __order) noexcept;

// template <class _Tp>

// _Tp __cxx_atomic_fetch_xor(_Atmc<_Tp> volatile* __a, _Tp __pattern, memory_order __order) noexcept;

// template <class _Tp>

// _Tp __cxx_atomic_fetch_xor(_Atmc<_Tp>* __a, _Tp __pattern, memory_order __order) noexcept;

//

// clang-format on

//

// _LIBCPP___ATOMIC_SUPPORT_H


=== system/lib/libcxx/include/__atomic/support/c11.h ===
SHA256: 2c42185cca12a8e85e96e1c6044e1c95c1ae790f896d424980a02a0e7a7652b6
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements support for C11-style atomics

//

// _LIBCPP_CXX03_LANG

// Avoid switch statement to make this a constexpr.

// _LIBCPP___ATOMIC_SUPPORT_C11_H


=== system/lib/libcxx/include/__atomic/support/gcc.h ===
SHA256: 51331e4cdff7fc9df0a2e44fe1511f85146480a238794bd19b0bab3cfdaf81ea
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file implements support for GCC-style atomics

//

// [atomics.types.generic]p1 guarantees _Tp is trivially copyable. Because

// the default operator= in an object is not volatile, a byte-by-byte copy

// is required.

// _LIBCPP_CXX03_LANG

// FIXME: Haven't figured out what the spec says about using arrays with

// atomic_fetch_add. Force a failure rather than creating bad behavior.

// _LIBCPP___ATOMIC_SUPPORT_GCC_H


=== system/lib/libcxx/include/__atomic/to_gcc_order.h ===
SHA256: 64c2fb5747853cf82306d58f00c2de88614ed14f0df0043255b966a450dc8e42
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Avoid switch statement to make this a constexpr.

// Avoid switch statement to make this a constexpr.

// _LIBCPP___ATOMIC_TO_GCC_ORDER_H


=== system/lib/libcxx/include/__bit/bit_cast.h ===
SHA256: 2cfae78277c8ce25a7b3845dd542984cbae45ef9a2c8fbb9a0ca7a7cdb3f7392
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_CXX03_LANG

// _LIBCPP_STD_VER >= 20

// _LIBCPP___BIT_BIT_CAST_H


=== system/lib/libcxx/include/__bit/bit_ceil.h ===
SHA256: 621dcb8c10efbb4a3737517a844eb1f5cf2561e1bb8757c8e880a069bd5d8b08
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 17

// _LIBCPP___BIT_BIT_CEIL_H


=== system/lib/libcxx/include/__bit/bit_floor.h ===
SHA256: d1b528ddbc4c28a7b37fb2d702de5a94448cb7d5127275010165aea41414f716
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___BIT_BIT_FLOOR_H


=== system/lib/libcxx/include/__bit/bit_log2.h ===
SHA256: eeb0d7e1873b98eb84395bb7899ae3f9bb11871ccdb4dbf69be7fbbc29c5766c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___BIT_BIT_LOG2_H


=== system/lib/libcxx/include/__bit/bit_width.h ===
SHA256: 383c496510c68da764907e167f83203bd74d7388ca00c079254c88d36800a9a7
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___BIT_BIT_WIDTH_H


=== system/lib/libcxx/include/__bit/blsr.h ===
SHA256: 651cc6eb75d4af07c242689ddc1396cd53e2cb541102e6d9aa0926f7c72ffc40
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___BIT_BLSR_H


=== system/lib/libcxx/include/__bit/byteswap.h ===
SHA256: 66264b4e9b4edfe0640cd940369e21539bcf9bd67ca265b4e5c165c6ccebf9a5
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __has_builtin(__builtin_bswap128)

// _LIBCPP_HAS_INT128

// _LIBCPP_STD_VER >= 23

// _LIBCPP___BIT_BYTESWAP_H


=== system/lib/libcxx/include/__bit/countl.h ===
SHA256: 39f4aa4fad09525cd7771010c6f3f6424e43944d8c0ac19d1f3d7a9817e79fa5
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___BIT_COUNTL_H


=== system/lib/libcxx/include/__bit/countr.h ===
SHA256: 75a532b89807c8cf3793dcd3e5b0797e11e65800e4420c10ebbd71aab398e106
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___BIT_COUNTR_H


=== system/lib/libcxx/include/__bit/endian.h ===
SHA256: 7951789b2a2fdaacd7ca371531bdb6b9775119387107522bf428482989507a67
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___BIT_ENDIAN_H


=== system/lib/libcxx/include/__bit/has_single_bit.h ===
SHA256: d02b3bb7486d9b17311b8f07956a53ab48af7dcb204768fac85680fa9462e741
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___BIT_HAS_SINGLE_BIT_H


=== system/lib/libcxx/include/__bit/invert_if.h ===
SHA256: 585527cd8118a3f0bdc7ae33e89b39220054cbc3cbfe537d8b261fe0655c92af
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___BIT_INVERT_IF_H


=== system/lib/libcxx/include/__bit/popcount.h ===
SHA256: 71416190606c07ec97307f2eb6af24552f51a7c1ad134e8ef709458812e12ddb
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___BIT_POPCOUNT_H


=== system/lib/libcxx/include/__bit/rotate.h ===
SHA256: 30fe43e5a45b06d26b61fda05478d88884f2e72ef5dedd4db215fd3711ea0806
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Writing two full functions for rotl and rotr makes it easier for the compiler

// to optimize the code. On x86 this function becomes the ROL instruction and

// the rotr function becomes the ROR instruction.

// _LIBCPP_STD_VER >= 20

// _LIBCPP___BIT_ROTATE_H


=== system/lib/libcxx/include/__charconv/chars_format.h ===
SHA256: 49bfc8887035370ab4b6017ae98bb23f1b4fe82a064536bc5b5c6f6173cb0ed7
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___CHARCONV_CHARS_FORMAT_H


=== system/lib/libcxx/include/__charconv/from_chars_floating_point.h ===
SHA256: ce9115e6577321fade6fb17c90a106432815ea7d68b4188d88394f76e1dc109c
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___CHARCONV_FROM_CHARS_FLOATING_POINT_H


=== system/lib/libcxx/include/__charconv/from_chars_integral.h ===
SHA256: 9187a3d91a4872ed5dcf1ab6f4c4c647f19dc103251f936cb18fc8fb088a13dc
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*
// Code used to generate __from_chars_log2f_lut.
#include <cmath>
#include <format>
#include <iostream>

int main() {
  for (int i = 2; i <= 36; ++i)
    std::cout << std::format("{},\n", log2f(i));
}
*/

/// log2f table for bases [2, 36].

// __base is always between 2 and 36 inclusive.

// _LIBCPP_STD_VER >= 17

// _LIBCPP___CHARCONV_FROM_CHARS_INTEGRAL_H


=== system/lib/libcxx/include/__charconv/from_chars_result.h ===
SHA256: 786fea7350aa3315fe2e08537a289ccedb7b2c778e08e4c8a97d2571523c2139
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___CHARCONV_FROM_CHARS_RESULT_H


=== system/lib/libcxx/include/__charconv/tables.h ===
SHA256: 1e470bc468366136bb31b3d5a1be08fde7940293033e9289fef7042ac0012227
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// clang-format off

// clang-format on

// namespace __itoa

// _LIBCPP___CHARCONV_TABLES


=== system/lib/libcxx/include/__charconv/to_chars.h ===
SHA256: 7ac3da6f741b23270cb6c3e51d526aab040d1d5a5d9af7b2cb76c7c23ca8e986
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___CHARCONV_TO_CHARS


=== system/lib/libcxx/include/__charconv/to_chars_base_10.h ===
SHA256: 055b21ec13a56e3b2b652e4046c9f9e94c2e374cce7bf51ba708a88c3c00a7cd
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// 0 <= __value < 100

// 100 <= __value < 10'000

// 10'000 <= __value < 1'000'000

// __value => 1'000'000

// 1'000'000 <= __value < 100'000'000

// 100'000'000 <= __value < max

// Numbers in the range UINT32_MAX <= val < 10'000'000'000 always contain 10

// digits and are outputted after this if statement.

// This function properly deterimines the first non-zero leading digit.

/// \returns 10^\a exp

///

/// \pre \a exp [19, 39]

///

/// \note The lookup table contains a partial set of exponents limiting the

/// range that can be used. However the range is sufficient for

/// \ref __base_10_u128.

// Unlike the 64 to 32 bit case the 128 bit case the "upper half" can't be

// stored in the "lower half". Instead we first need to handle the top most

// digits separately.

//

// Maximum unsigned values

// 64  bit                             18'446'744'073'709'551'615 (20 digits)

// 128 bit    340'282'366'920'938'463'463'374'607'431'768'211'455 (39 digits)

// step 1     ^                                                   ([0-1] digits)

// step 2      ^^^^^^^^^^^^^^^^^^^^^^^^^                          ([0-19] digits)

// step 3                               ^^^^^^^^^^^^^^^^^^^^^^^^^ (19 digits)

// step 1

// step 2 always 19 digits.

// They are handled here since leading zeros need to be appended to the buffer,

// step 2

// This version needs to determine the position of the leading non-zero digit.

// Step 3

// namespace __itoa

// _LIBCPP___CHARCONV_TO_CHARS_BASE_10_H


=== system/lib/libcxx/include/__charconv/to_chars_floating_point.h ===
SHA256: 19e2f18eaab40eb11bcbabcb7ecf570443688942c647eaf801e066cfe0fc0acf
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___CHARCONV_TO_CHARS_FLOATING_POINT_H


=== system/lib/libcxx/include/__charconv/to_chars_integral.h ===
SHA256: e849a31a9ccc6817a5b8962d4d5b16b4373fec292f2f220919db3bd35eb05290
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// When the value fits in 64-bits use the 64-bit code path. This reduces

// the number of expensive calculations on 128-bit values.

//

// NOTE the 128-bit code path requires this optimization.

// If value == 0 still need one digit. If the value != this has no

// effect since the code scans for the most significant bit set.

// If value == 0 still need one digit. If the value != this has no

// effect since the code scans for the most significat bit set.

// If value == 0 still need one digit. If the value != this has no

// effect since the code scans for the most significat bit set.

// namespace __itoa

// _LIBCPP_STD_VER >= 17

// _LIBCPP___CHARCONV_TO_CHARS_INTEGRAL_H


=== system/lib/libcxx/include/__charconv/to_chars_result.h ===
SHA256: 87320ea0f260cd62d53e5bd0c27d5c0fb3cedc64ffb098f3b5d49153f0c1df55
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___CHARCONV_TO_CHARS_RESULT_H


=== system/lib/libcxx/include/__charconv/traits.h ===
SHA256: e4e23d153411ffa8f2bdd19201d1528f50f7d4374b0fd84ead5cc34649c66fb7
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/// The width estimation using a log10 algorithm.

///

/// The algorithm is based on

/// http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10

/// Instead of using IntegerLogBase2 it uses __countl_zero.

/// The width estimation using a log10 algorithm.

///

/// The algorithm is based on

/// http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10

/// Instead of using IntegerLogBase2 it uses __countl_zero.

/// The width estimation using a log10 algorithm.

///

/// The algorithm is based on

/// http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10

/// Instead of using IntegerLogBase2 it uses __countl_zero.

// There's always a bit set in the upper 64-bits.

// __t is adjusted since the lookup table misses the lower entries.

// TODO FMT This pow function should get an index.

// By moving this to its own header it can be reused by the pow function in to_chars_base_10.

// precondition: at least one non-zero character available

// namespace __itoa

// _LIBCPP___CHARCONV_TRAITS


=== system/lib/libcxx/include/__chrono/calendar.h ===
SHA256: 3fa1360f8ea62172a550a7fd96ffc60ed9b60881082a84d32c1d5ae0c51e6cc5
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace chrono

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CHRONO_CALENDAR_H


=== system/lib/libcxx/include/__chrono/concepts.h ===
SHA256: caadab3a2377b93e9e90d9281945baa8b1595cb795218c15744fa1826f7d7682
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CHRONO_CONCEPTS_H


=== system/lib/libcxx/include/__chrono/convert_to_timespec.h ===
SHA256: 5355457b09a689ad3c9bbb47ea6babe7b2fe6110515fc3a5c230bebd94cdec13
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Convert a nanoseconds duration to the given TimeSpec type, which must have

// the same properties as std::timespec.

// (10^9 - 1)

// _LIBCPP___CHRONO_CONVERT_TO_TIMESPEC_H


=== system/lib/libcxx/include/__chrono/convert_to_tm.h ===
SHA256: a539d1a00e24317b2bb318d262e4b676e3888f45a102fa75e83b031f88866628
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Conerts a chrono date and weekday to a given _Tm type.

//

// This is an implementation detail for the function

//   template <class _Tm, class _ChronoT>

//   _Tm __convert_to_tm(const _ChronoT& __value)

//

// This manually converts the two values to the proper type. It is possible to

// convert from sys_days to time_t and then to _Tm. But this leads to the Y2K

// bug when time_t is a 32-bit signed integer. Chrono considers years beyond

// the year 2038 valid, so instead do the transformation manually.

// The time between the TAI epoch (1958-01-01) and UNIX epoch (1970-01-01).

// This avoids leap second conversion when going from TAI to UTC.

// (It also avoids issues when the date is before the UTC epoch.)

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION

// Convert a chrono (calendar) time point, or dururation to the given _Tm type,

// which must have the same properties as std::tm.

// Note that some clocks have specializations __convert_to_tm for their

// time_point. These don't need to be added here. They do not trigger

// this assert.

// [time.format]/6

//   ...  However, if a flag refers to a "time of day" (e.g. %H, %I, %p,

//   etc.), then a specialization of duration is interpreted as the time of

//   day elapsed since midnight.

// Not all values can be converted to hours, it may run into ratio

// conversion errors. In that case the conversion to seconds works.

// In libc++ hours is stored as a long. The type in std::tm is an int. So

// the overflow can only occur when hour uses more bits than an int

// provides.

// Has no time information.

// Has no time information.

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// if _LIBCPP_STD_VER >= 20

// _LIBCPP___CHRONO_CONVERT_TO_TM_H


=== system/lib/libcxx/include/__chrono/day.h ===
SHA256: a48001a6ee79483f16ddd4cccbdc513fc0d25ef984850027487183a7e5d4bf6a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace chrono

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CHRONO_DAY_H


=== system/lib/libcxx/include/__chrono/duration.h ===
SHA256: 4cf684bb839157d2629ef24050ad9203f29753cc4f31cfbfe03eb3b0f276e4bf
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace chrono

// duration_cast

// duration

// __overflow == false

// conversions

// observer

// arithmetic

// special values

// Duration ==

// Duration !=

// _LIBCPP_STD_VER <= 17

// Duration <

// Duration >

// Duration <=

// Duration >=

// _LIBCPP_STD_VER >= 20

// Duration +

// Duration -

// Duration *

// Duration /

// Duration %

// namespace chrono

// Suffixes for duration literals [time.duration.literals]

// namespace chrono_literals

// namespace literals

// hoist the literals into namespace std::chrono

// namespace chrono

// _LIBCPP_STD_VER >= 14

// _LIBCPP___CHRONO_DURATION_H


=== system/lib/libcxx/include/__chrono/exception.h ===
SHA256: d1a13fc45862cd303bef0beeb0592c33d8c7e70f65b998408fbecbbf08f6a9c4
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html

// Enable the contents of the header only when libc++ was built with experimental features enabled.

// [time.zone.exception.nonexist]/2

//   Preconditions: i.result == local_info::nonexistent is true.

// The value of __info.result is not used.

// exported as key function

// [time.zone.exception.ambig]/2

//   Preconditions: i.result == local_info::ambiguous is true.

// The value of __info.result is not used.

// exported as key function

// There are two spaces after the full-stop; this has been verified

// in the sources of the Standard.

// namespace chrono

// _LIBCPP_STD_VER >= 20

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// _LIBCPP___CHRONO_EXCEPTION_H


=== system/lib/libcxx/include/__chrono/file_clock.h ===
SHA256: 272514f38837049ea22593ac94e7a8b9889515049287cbfee3b8ad050bb1bc93
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// !_LIBCPP_CXX03_LANG

// [time.clock.file], type file_clock

// namespace chrono

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// !_LIBCPP_CXX03_LANG

// _LIBCPP___CHRONO_FILE_CLOCK_H


=== system/lib/libcxx/include/__chrono/formatter.h ===
SHA256: 3d0edefc2b28bad96b50fe423b1a9e154100015c73b4c9550379ef54e4ee8620
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/// Formats a time based on a tm struct.

///

/// This formatter passes the formatting to time_put which uses strftime. When

/// the value is outside the valid range it's unspecified what strftime will

/// output. For example weekday 8 can print 1 when the day is processed modulo

/// 7 since that handles the Sunday for 0-based weekday. It can also print 8 if

/// 7 is handled as a special case.

///

/// The Standard doesn't specify what to do in this case so the result depends

/// on the result of the underlying code.

///

/// \pre When the (abbreviated) weekday or month name are used, the caller

///      validates whether the value is valid. So the caller handles that

///      requirement of Table 97: Meaning of conversion specifiers

///      [tab:time.format.spec].

///

/// When no chrono-specs are provided it uses the stream formatter.

// For tiny ratios it's not possible to convert a duration to a hh_mm_ss. This

// fails compile-time due to the limited precision of the ratio (64-bit is too

// small). Therefore a duration uses its own conversion.

// Converts a negative fraction to its positive value.

// When the floating-point value has digits itself they are ignored based

// on the wording in [tab:time.format.spec]

//   If the precision of the input cannot be exactly represented with

//   seconds, then the format is a decimal floating-point number with a

//   fixed format and a precision matching that of the precision of the

//   input (or to a microseconds precision if the conversion to

//   floating-point decimal seconds cannot be made within 18 fractional

//   digits).

//

// This matches the behaviour of MSVC STL, fmtlib interprets this

// differently and uses 3 decimals.

// https://godbolt.org/z/6dsbnW8ba

// TODO FMT Write an issue

//   If the result has less than four digits it is zero-padded with 0 to two digits.

// is less -> has less

// left-padded -> zero-padded, otherwise the proper value would be 000-0.

// Note according to the wording it should be left padded, which is odd.

// TODO FMT Write an issue

// [tab:time.format.spec]

//   %C The year divided by 100 using floored division. If the result is a

//   single decimal digit, it is prefixed with 0.

// floored division

// Implements the %z format specifier according to [tab:time.format.spec], where

// '__modifier' signals %Oz or %Ez were used. (Both modifiers behave the same,

// so there is no need to distinguish between them.)

// Note HMS does not allow formatting hours > 23, but the offset is not limited to 24H.

// Helper to store the time zone information needed for formatting.

// Typically these abbreviations are short and fit in the string's internal

// buffer.

// _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// We only handle the types that can't be directly handled by time_put.

// (as an optimization n, t, and % are also handled directly.)

// strftime's output is only defined in the range [00, 99].

// Converting a duration where the period has a small ratio to days

// may fail to compile. This due to loss of precision in the

// conversion. In order to avoid that issue convert to seconds as

// an intemediate step.

// TODO FMT Determine the proper ideas

// - Should it honour the precision?

// - Shoult it honour the locale setting for the separators?

// The wording for Q doesn't use the word locale and the effect of

// precision is unspecified.

//

// MSVC STL ignores precision but uses separator

// FMT honours precision and has a bug for separator

// https://godbolt.org/z/78b7sMxns

// Unlike time_put and strftime the formatting library requires %Y

//

// [tab:time.format.spec]

//   The year as a decimal number. If the result is less than four digits

//   it is left-padded with 0 to four digits.

//

// This means years in the range (-1000, 1000) need manual formatting.

// It's unclear whether %EY needs the same treatment. For example the

// Japanese EY contains the era name and year. This is zero-padded to 2

// digits in time_put (note that older glibc versions didn't do

// padding.) However most eras won't reach 100 years, let alone 1000.

// So padding to 4 digits seems unwanted for Japanese.

//

// The same applies to %Ex since that too depends on the era.

//

// %x the locale's date representation is currently doesn't handle the

// zero-padding too.

//

// The 4 digits can be implemented better at a later time. On POSIX

// systems the required information can be extracted by nl_langinfo

// https://man7.org/linux/man-pages/man3/nl_langinfo.3.html

//

// Note since year < -1000 is expected to be rare it uses the more

// expensive year routine.

//

// TODO FMT evaluate the comment above.

// Glibc fails for negative values, AIX for positive values too.

// defined(__GLIBC__) || defined(_AIX) || defined(_WIN32)

// Depending on the platform's libc the range of supported years is

// limited. Instead of of testing all conditions use the internal

// implementation unconditionally.

// Depending on the platform's libc the range of supported years is

// limited. Instead of testing all conditions use the internal

// implementation unconditionally.

// __abbrev is always a char so the copy may convert.

// Handle OS using the normal representation for the non-fractional

// part. There seems to be no locale information regarding how the

// fractional part should be formatted.

// Oz produces the same output as Ez below.

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// [time.format]/2

// 2.1 - the "C" locale if the L option is not present in chrono-format-spec, otherwise

// 2.2 - the locale passed to the formatting function if any, otherwise

// 2.3 - the global locale.

// Note that the __ctx's locale() call does 2.2 and 2.3.

// A duration can be a user defined arithmetic type. Users may specialize

// numeric_limits, but they may not specialize is_signed.

// TODO FMT When keeping the precision it will truncate the string.

// Note that the behaviour what the precision does isn't specified.

// Test __weekday_name_ before __weekday_ to give a better error.

// Note this is a pedantic intepretation of the Standard. A hh_mm_ss

// is no longer a time_of_day and can store an arbitrary number of

// hours. A number of hours in a 12 or 24 hour clock can't represent

// 24 hours or more. The functions std::chrono::make12 and

// std::chrono::make24 reaffirm this view point.

//

// Interestingly this will be the only output stream function that

// throws.

//

// TODO FMT The wording probably needs to be adapted to

// - The displayed hours is hh_mm_ss.hours() % 24

// - It should probably allow %j in the same fashion as duration.

// - The stream formatter should change its output when hours >= 24

//   - Write it as not valid,

//   - or write the number of days.

// namespace __formatter

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM

// The flags are not __clock since there is no associated time-zone.

// [time.format]/1

// Giving a precision specification in the chrono-format-spec is valid only

// for std::chrono::duration types where the representation type Rep is a

// floating-point type. For all other Rep types, an exception of type

// format_error is thrown if the chrono-format-spec contains a precision

// specification.

//

// Note this doesn't refer to chrono::treat_as_floating_point_v<_Rep>.

// Note due to how libc++'s formatters are implemented there is no need to add

// the exposition only local-time-format-t abstraction.

// _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// if _LIBCPP_STD_VER >= 20

// _LIBCPP_HAS_LOCALIZATION

//  _LIBCPP___CHRONO_FORMATTER_H


=== system/lib/libcxx/include/__chrono/gps_clock.h ===
SHA256: d99d73137bb3420c4b32ad924bbf58df622b08349282d00a96a1d5b7b3b1e902
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Enable the contents of the header only when libc++ was built with experimental features enabled.

// The utc_clock is not steady.

// The static difference between UTC and GPS time as specified in the Standard.

// namespace chrono

// _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// _LIBCPP___CHRONO_GPS_CLOCK_H


=== system/lib/libcxx/include/__chrono/hh_mm_ss.h ===
SHA256: 85c64f6c520d84bf81c303b7cefeb34e2eb1b14e57ceb8317e324928ab6d09f4
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace chrono

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CHRONO_HH_MM_SS_H


=== system/lib/libcxx/include/__chrono/high_resolution_clock.h ===
SHA256: 6b1633af4d37bfa1eb150eb2e86eb3410172945d01c36b77391976ab816f4ec9
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace chrono

// _LIBCPP___CHRONO_HIGH_RESOLUTION_CLOCK_H


=== system/lib/libcxx/include/__chrono/leap_second.h ===
SHA256: 34bd455ea87744c648198e2484ce75ceb82669a7aa0515a1d8f41e33385cd1a9
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html

// Enable the contents of the header only when libc++ was built with experimental features enabled.

// The function

//   template<class Duration>

//    requires three_way_comparable_with<sys_seconds, sys_time<Duration>>

//    constexpr auto operator<=>(const leap_second& x, const sys_time<Duration>& y) noexcept;

//

// Has constraints that are recursive (LWG4139). The proposed resolution is

// to make the funcion a hidden friend. For consistency make this change for

// all comparison functions.

// namespace chrono

// _LIBCPP_STD_VER >= 20

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// _LIBCPP___CHRONO_LEAP_SECOND_H


=== system/lib/libcxx/include/__chrono/literals.h ===
SHA256: c1f8959ca87f7f0362cbbf1d34021d36b4dafe2ff70532735cecbe9251dbd347
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace chrono_literals

// namespace literals

// hoist the literals into namespace std::chrono

// namespace chrono

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CHRONO_LITERALS_H


=== system/lib/libcxx/include/__chrono/local_info.h ===
SHA256: 522a2f7d241175b4985d3ff81f55912f49822a9243f734f512605e5ffe8f3293
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html

// Enable the contents of the header only when libc++ was built with experimental features enabled.

// namespace chrono

// _LIBCPP_STD_VER >= 20

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// _LIBCPP___CHRONO_LOCAL_INFO_H


=== system/lib/libcxx/include/__chrono/month.h ===
SHA256: 4c8677cc521fe8a101089830d9ed5c5baf81855a81bc6ac1017ac8df6485ec3e
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace chrono

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CHRONO_MONTH_H


=== system/lib/libcxx/include/__chrono/month_weekday.h ===
SHA256: 9770c5e802c22976b3d743ee16c98b781b9511512f825a64fab5839059cb28f6
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace chrono

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CHRONO_MONTH_WEEKDAY_H


=== system/lib/libcxx/include/__chrono/monthday.h ===
SHA256: c2397a3e9ab18b90e2d387ec39a97d93889f20f95f0dab22032822c443c8eb9f
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//  Now we've got either 30 or 31

// namespace chrono

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CHRONO_MONTHDAY_H


=== system/lib/libcxx/include/__chrono/ostream.h ===
SHA256: b27b8ff6b2fcde2caed87943bc37d0c9def0e2b7fe20264becf8764044a52fce
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM

// Depending on the type the return is a const _CharT* or a basic_string<_CharT>

// TODO FMT LWG issue the suffixes are always char and not STATICALLY-WIDEN'ed.

// Note this error differs from the wording of the Standard. The

// Standard wording doesn't work well on AIX or Windows. There

// the formatted day seems to be either modulo 100 or completely

// omitted. Judging by the wording this is valid.

// TODO FMT Write a paper of file an LWG issue.

// TODO FMT Standard mandated locale isn't used.

// TODO FMT Standard mandated locale isn't used.

// TODO FMT The Standard allows 30th of February to be printed.

// It would be nice to show an error message instead.

// __info.abbrev is always std::basic_string<char>.

// Since these strings typically are short the conversion should be cheap.

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// namespace chrono

// if _LIBCPP_STD_VER >= 20

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP___CHRONO_OSTREAM_H


=== system/lib/libcxx/include/__chrono/parser_std_format_spec.h ===
SHA256: 17a9ab74b8150dc98bdea2549e747bf4e23013ba5f7d20ade3328a57a1628944
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// By not placing this constant in the formatter class it's not duplicated for char and wchar_t

/// Flags available or required in a chrono type.

///

/// The caller of the chrono formatter lists the types it has available and the

/// validation tests whether the requested type spec (e.g. %M) is available in

/// the formatter.

/// When the type in the chrono-format-spec isn't present in the data a

/// \ref format_error is thrown.

// All other literals

/// \pre *__begin == '%'

/// \post __begin points at the end parsed conversion-spec

// TODO FMT does the formater require an hour or a time?

// Currently there's no time zone information. However some clocks have a

// hard-coded "time zone", for these clocks the information can be used.

// TODO FMT implement time zones.

// unknown type;

/// \pre *__begin == 'E'

/// \post __begin is incremented by one.

// Currently there's no time zone information. However some clocks have a

// hard-coded "time zone", for these clocks the information can be used.

// TODO FMT implement time zones.

/// \pre *__begin == 'O'

/// \post __begin is incremented by one.

// Currently there's no time zone information. However some clocks have a

// hard-coded "time zone", for these clocks the information can be used.

// TODO FMT implement time zones.

// namespace __format_spec

// _LIBCPP_STD_VER >= 20

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP___CHRONO_PARSER_STD_FORMAT_SPEC_H


=== system/lib/libcxx/include/__chrono/statically_widen.h ===
SHA256: b3b06e412647628bf3463913cad9fd63f0233479ae3849f37dd0d621fda1156c
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Implements the STATICALLY-WIDEN exposition-only function. ([time.general]/2)

// _LIBCPP_HAS_WIDE_CHARACTERS

// Without this indirection the unit test test/libcxx/modules_include.sh.cpp

// fails for the CI build "No wide characters". This seems like a bug.

// TODO FMT investigate why this is needed.

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CHRONO_STATICALLY_WIDEN_H


=== system/lib/libcxx/include/__chrono/steady_clock.h ===
SHA256: 1d2935ef4b9dd44e6d91d4c9987eca64461945bfb717981a3fe919d0f04db6d2
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace chrono

// _LIBCPP___CHRONO_STEADY_CLOCK_H


=== system/lib/libcxx/include/__chrono/sys_info.h ===
SHA256: 228b03f1bd8ae0fe04289b4f5f966f90109399b84750d9e9b2221ddab416b7f1
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html

// Enable the contents of the header only when libc++ was built with experimental features enabled.

// namespace chrono

// _LIBCPP_STD_VER >= 20

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// _LIBCPP___CHRONO_SYS_INFO_H


=== system/lib/libcxx/include/__chrono/system_clock.h ===
SHA256: d8960a860dba8847e24964a218ee520352cd7d5c162f2b50e48db987ab0bfa8b
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace chrono

// _LIBCPP___CHRONO_SYSTEM_CLOCK_H


=== system/lib/libcxx/include/__chrono/tai_clock.h ===
SHA256: 8ae7209089208bb98af238583297b5d118cdf1ce546ea42b4af4f389547a3f1c
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Enable the contents of the header only when libc++ was built with experimental features enabled.

// [time.clock.tai.overview]/1

//    The clock tai_clock measures seconds since 1958-01-01 00:00:00 and is

//    offset 10s ahead of UTC at this date. That is, 1958-01-01 00:00:00 TAI is

//    equivalent to 1957-12-31 23:59:50 UTC. Leap seconds are not inserted into

//    TAI. Therefore every time a leap second is inserted into UTC, UTC shifts

//    another second with respect to TAI. For example by 2000-01-01 there had

//    been 22 positive and 0 negative leap seconds inserted so 2000-01-01

//    00:00:00 UTC is equivalent to 2000-01-01 00:00:32 TAI (22s plus the

//    initial 10s offset).

//

// Note this does not specify what the UTC offset before 1958-01-01 00:00:00

// TAI is, nor does it follow the "real" TAI clock between 1958-01-01 and the

// start of the UTC epoch. So while the member functions are fully specified in

// the standard, they do not technically follow the "real-world" TAI clock with

// 100% accuracy.

//

// https://koka-lang.github.io/koka/doc/std_time_utc.html contains more

// information and references.

// The utc_clock is not steady.

// The static difference between UTC and TAI time.

// namespace chrono

// _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// _LIBCPP___CHRONO_TAI_CLOCK_H


=== system/lib/libcxx/include/__chrono/time_point.h ===
SHA256: c925efc2ec4e85ed4152dacbddeccf6adfe356ac126b0cfa2c40ef3a4a4ff0d7
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// conversions

// observer

// arithmetic

// _LIBCPP_STD_VER >= 20

// special values

// namespace chrono

// _LIBCPP_STD_VER >= 17

// time_point ==

// time_point !=

// _LIBCPP_STD_VER <= 17

// time_point <

// time_point >

// time_point <=

// time_point >=

// _LIBCPP_STD_VER >= 20

// time_point operator+(time_point x, duration y);

// time_point operator+(duration x, time_point y);

// time_point operator-(time_point x, duration y);

// duration operator-(time_point x, time_point y);

// namespace chrono

// _LIBCPP___CHRONO_TIME_POINT_H


=== system/lib/libcxx/include/__chrono/time_zone.h ===
SHA256: 262b860b2bf7ffdce52cee103a1b1965b07318dc28ff980eac3f9ec35074f444
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html

// Enable the contents of the header only when libc++ was built with experimental features enabled.

// public so it can be used by make_unique.

// The "constructor".

//

// The default constructor is private to avoid the constructor from being

// part of the ABI. Instead use an __ugly_named function as an ABI interface,

// since that gives us the ability to change it in the future.

// We don't apply nodiscard here since this function throws on many inputs,

// so it could be used as a validation.

// TODO TZDB The Standard does not specify anything in these cases.

// first and second are the same

// first and second are the same

// All non-existing values are converted to the same time.

// Note a value out of bounds is not specified.

// TODO TZDB The standard does not specify anything in these cases.

// namespace chrono

// _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// _LIBCPP___CHRONO_TIME_ZONE_H


=== system/lib/libcxx/include/__chrono/time_zone_link.h ===
SHA256: bde4810b73bb229fa19b8095a2c74b174054bb2dd39d228f9ef7f9766392c6b8
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html

// Enable the contents of the header only when libc++ was built with experimental features enabled.

// TODO TZDB instead of the name we can store the pointer to a zone. These

// pointers are immutable. This makes it possible to directly return a

// pointer in the time_zone in the 'locate_zone' function.

// namespace chrono

// _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// _LIBCPP___CHRONO_TIME_ZONE_LINK_H


=== system/lib/libcxx/include/__chrono/tzdb.h ===
SHA256: 3c5d67384be4bff8e4e3a5dfdf382c2d2a717fa44f5f4027136bc5c3e1f73b2f
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html

// Enable the contents of the header only when libc++ was built with experimental features enabled.

// namespace chrono

// _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// _LIBCPP___CHRONO_TZDB_H


=== system/lib/libcxx/include/__chrono/tzdb_list.h ===
SHA256: 97e51186fe181aec9baab26d713d9f0283991d20f7cb2f60995a3614cf8165a5
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html

// Enable the contents of the header only when libc++ was built with experimental features enabled.

// TODO TZDB

// Libc++ recently switched to only export __ugly_names from the dylib.

// Since the library is still experimental the functions in this header

// should be adapted to this new style. The other tzdb headers should be

// evaluated too.

// public to allow construction in dylib

// namespace chrono

// _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// _LIBCPP___CHRONO_TZDB_LIST_H


=== system/lib/libcxx/include/__chrono/utc_clock.h ===
SHA256: 8bc9b46f8e38c91714cd591118f347d82a1d4ecd372dc8f21725417a147a8edf
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Enable the contents of the header only when libc++ was built with experimental features enabled.

// The system_clock is not steady.

// TODO TZDB investigate optimizations.

//

// The leap second database stores all transitions, this mean to calculate

// the current number of leap seconds the code needs to iterate over all

// leap seconds to accumulate the sum. Then the sum can be used to determine

// the sys_time. Accessing the database involves acquiring a mutex.

//

// The historic entries in the database are immutable. Hard-coding these

// values in a table would allow:

// - To store the sum, allowing a binary search on the data.

// - Avoid acquiring a mutex.

// The disadvantage are:

// - A slightly larger code size.

//

// There are two optimization directions

// - hard-code the database and do a linear search for future entries. This

//   search can start at the back, and should probably contain very few

//   entries. (Adding leap seconds is quite rare and new release of libc++

//   can add the new entries; they are announced half a year before they are

//   added.)

// - During parsing the leap seconds store an additional database in the

//   dylib with the list of the sum of the leap seconds. In that case there

//   can be a private function __get_utc_to_sys_table that returns the

//   table.

//

// Note for to_sys there are no optimizations to be done; it uses

// get_leap_second_info. The function get_leap_second_info could benefit

// from optimizations as described above; again both options apply.

// Both UTC and the system clock use the same epoch. The Standard

// specifies from 1970-01-01 even when UTC starts at

// 1972-01-01 00:00:10 TAI. So when the sys_time is before epoch we can be

// sure there both clocks return the same value.

// A time point may only be a leap second during a positive leap second

// insertion, since time points that occur during a (theoretical)

// negative leap second don't exist.

// [time.clock.utc.members]/2

//   Returns: A sys_time t, such that from_sys(t) == u if such a mapping

//   exists. Otherwise u represents a time_point during a positive leap

//   second insertion, the conversion counts that leap second as not

//   inserted, and the last representable value of sys_time prior to the

//   insertion of the leap second is returned.

// namespace chrono

// _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// _LIBCPP___CHRONO_UTC_CLOCK_H


=== system/lib/libcxx/include/__chrono/weekday.h ===
SHA256: 955fd6dbc607790c2ada9464c55d13de958b68ec4637f80866e5f35cc36839aa
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// https://howardhinnant.github.io/date_algorithms.html#weekday_from_days

// namespace chrono

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CHRONO_WEEKDAY_H


=== system/lib/libcxx/include/__chrono/year.h ===
SHA256: 33db8a5f010a524fee959bdf53d696c0f6ab68c6fea99d01265bf587e858813a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace chrono

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CHRONO_YEAR_H


=== system/lib/libcxx/include/__chrono/year_month.h ===
SHA256: 98e3e9e56febd9b4f2f5e77ce54dbf518f3c57da502e92c493e77936ffa9b95a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace chrono

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CHRONO_YEAR_MONTH_H


=== system/lib/libcxx/include/__chrono/year_month_day.h ===
SHA256: 0091c7a0511b0109fcb1220254c3669fd424975a95ba8fb814f249dee5899eb9
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// https://howardhinnant.github.io/date_algorithms.html#civil_from_days

// [0, 146096]

// [0, 399]

// [0, 365]

// [0, 11]

// [1, 31]

// [1, 12]

// https://howardhinnant.github.io/date_algorithms.html#days_from_civil

// [0, 399]

// [0, 365]

// [0, 146096]

// namespace chrono

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CHRONO_YEAR_MONTH_DAY_H


=== system/lib/libcxx/include/__chrono/year_month_weekday.h ===
SHA256: a020710a1d42b13e9637d5a76f0017b9e3f283301174c21258ee860ec95df807
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace chrono

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CHRONO_YEAR_MONTH_WEEKDAY_H


=== system/lib/libcxx/include/__chrono/zoned_time.h ===
SHA256: efbb24285143c7b6c2e42be62d70aa0104a61884554aa97f5fca75a1971bd000
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html

// Enable the contents of the header only when libc++ was built with experimental features enabled.

// [time.zone.zonedtime.ctor]/2

// The wording uses the constraints like

//   constructible_from<zoned_time, decltype(__traits::locate_zone(string_view{}))>

// Using these constraints in the code causes the compiler to give an

// error that the constraint depends on itself. To avoid that issue use

// the fact it is possible to create this object from a _TimeZonePtr.

// per wording choose has no effect

// TODO TZDB This seems wrong.

// Assigning a non-existent or ambiguous time will throw and not satisfy

// the post condition. This seems quite odd; I constructed an object with

// choose::earliest and that choice is not respected.

// what did LEWG do with this.

// MSVC STL and libstdc++ behave the same

// namespace chrono

// _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_TIME_ZONE_DATABASE && _LIBCPP_HAS_FILESYSTEM &&

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP_HAS_EXPERIMENTAL_TZDB

// _LIBCPP___CHRONO_ZONED_TIME_H


=== system/lib/libcxx/include/__compare/common_comparison_category.h ===
SHA256: 8585a3800b10b0bbd709a8a7e8c65fd1d202440abe7946903b854ec82753afe0
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __comp_detail

// [cmp.common], common comparison category type

// _LIBCPP_STD_VER >= 20

// _LIBCPP___COMPARE_COMMON_COMPARISON_CATEGORY_H


=== system/lib/libcxx/include/__compare/compare_partial_order_fallback.h ===
SHA256: cf47bd252def7b2de19eb04b719c7b83ec3b98a53db5cd79e8ca1d494dcc6c75
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [cmp.alg]

// namespace __compare_partial_order_fallback

// namespace __cpo

// _LIBCPP_STD_VER >= 20

// _LIBCPP___COMPARE_COMPARE_PARTIAL_ORDER_FALLBACK


=== system/lib/libcxx/include/__compare/compare_strong_order_fallback.h ===
SHA256: 25d7deef061fcd73da37acd034be023e614dca9bf3bce945af1280ba61c3a6db
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [cmp.alg]

// namespace __compare_strong_order_fallback

// namespace __cpo

// _LIBCPP_STD_VER >= 20

// _LIBCPP___COMPARE_COMPARE_STRONG_ORDER_FALLBACK


=== system/lib/libcxx/include/__compare/compare_three_way.h ===
SHA256: ebb4294639c15ab922bb895cbee14543772392ad5a56c5cb6513fe212f6bf30b
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___COMPARE_COMPARE_THREE_WAY_H


=== system/lib/libcxx/include/__compare/compare_three_way_result.h ===
SHA256: f50f664fc9c030a0074eaaa21168e0cd64f4e520fd01de515117dc66c45bc551
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___COMPARE_COMPARE_THREE_WAY_RESULT_H


=== system/lib/libcxx/include/__compare/compare_weak_order_fallback.h ===
SHA256: a5ddf627d1e17fcbb9e3750a2c2eade1ef12042675318ca319387c10b6222e6b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [cmp.alg]

// namespace __compare_weak_order_fallback

// namespace __cpo

// _LIBCPP_STD_VER >= 20

// _LIBCPP___COMPARE_COMPARE_WEAK_ORDER_FALLBACK


=== system/lib/libcxx/include/__compare/is_eq.h ===
SHA256: 71968af91dcba82a32e82805fb5b457aaaac72badf0db983095ecbc77815c2bc
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___COMPARE_IS_EQ_H


=== system/lib/libcxx/include/__compare/ordering.h ===
SHA256: c2d6412160bf8c3e13b7c3558eb703d8ec8535e815de17e30578cc5577fcefc3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// exposition only

// If anything other than a literal 0 is provided, the behavior is undefined by the Standard.

//

// The alternative to the `__enable_if__` attribute would be to use the fact that a pointer

// can be constructed from literal 0, but this conflicts with `-Wzero-as-null-pointer-constant`.

// valid values

// comparisons

// comparisons

// conversions

// comparisons

/// [cmp.categories.pre]/1

/// The types partial_ordering, weak_ordering, and strong_ordering are

/// collectively termed the comparison category types.

// _LIBCPP_STD_VER >= 20

// _LIBCPP___COMPARE_ORDERING_H


=== system/lib/libcxx/include/__compare/partial_order.h ===
SHA256: 297f278110689b0e407f45139acc37f493594671c97bc50c8b7e65e8c547cd1e
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [cmp.alg]

// NOLINTBEGIN(libcpp-robust-against-adl) partial_order should use ADL, but only here

// NOLINTEND(libcpp-robust-against-adl)

// namespace __partial_order

// namespace __cpo

// _LIBCPP_STD_VER >= 20

// _LIBCPP___COMPARE_PARTIAL_ORDER


=== system/lib/libcxx/include/__compare/strong_order.h ===
SHA256: 1357b37826660c2d997640edcf4f406f9d8b76145115230b4bfa41f850ebf9bd
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [cmp.alg]

// NOLINTBEGIN(libcpp-robust-against-adl) strong_order should use ADL, but only here

// NOLINTEND(libcpp-robust-against-adl)

// This is bullet 3 of the IEEE754 algorithm, relevant

// only for decimal floating-point;

// see https://stackoverflow.com/questions/69068075/

// They're unordered, so one of them must be a NAN.

// The order is -QNAN, -SNAN, numbers, +SNAN, +QNAN.

// Order by sign bit, then by "payload bits" (we'll just use bit_cast).

// namespace __strong_order

// namespace __cpo

// _LIBCPP_STD_VER >= 20

// _LIBCPP___COMPARE_STRONG_ORDER


=== system/lib/libcxx/include/__compare/synth_three_way.h ===
SHA256: 269e22a4fe2c8a5cb41ab8519e7482930c88921091740f7d4de99967b624602c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [expos.only.func]

// _LIBCPP_STD_VER >= 20

// _LIBCPP___COMPARE_SYNTH_THREE_WAY_H


=== system/lib/libcxx/include/__compare/three_way_comparable.h ===
SHA256: b7dfbe1785c3dc4fac568a351eca3fa232210889924c0727488ce50932bf5e22
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___COMPARE_THREE_WAY_COMPARABLE_H


=== system/lib/libcxx/include/__compare/weak_order.h ===
SHA256: c0148a34f53662c8688730debe92fd198609890a6af22fd9330e46caf7c38d25
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [cmp.alg]

// NOLINTBEGIN(libcpp-robust-against-adl) weak_order should use ADL, but only here

// NOLINTEND(libcpp-robust-against-adl)

// Otherwise, at least one of them is a NaN.

// namespace __weak_order

// namespace __cpo

// _LIBCPP_STD_VER >= 20

// _LIBCPP___COMPARE_WEAK_ORDER


=== system/lib/libcxx/include/__concepts/arithmetic.h ===
SHA256: 6dcbd8aac711adb3ea7b25a5c8d5b5d5583aa72531c5535e94c5cb46c33d2a01
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [concepts.arithmetic], arithmetic concepts

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_ARITHMETIC_H


=== system/lib/libcxx/include/__concepts/assignable.h ===
SHA256: a084fe593666de14e929775f27b62c83300d8484d48f5d81a21d62bd103abae4
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [concept.assignable]

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_ASSIGNABLE_H


=== system/lib/libcxx/include/__concepts/boolean_testable.h ===
SHA256: 0e4f0847f07c4132993ebe7ff03b966f67cbc87aafe2410b74c49996372c6af8
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [concepts.booleantestable]

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_BOOLEAN_TESTABLE_H


=== system/lib/libcxx/include/__concepts/class_or_enum.h ===
SHA256: b0593fea410216a64c58262e35d729a14b9a9649e6b3b1c074025077331f0d64
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Whether a type is a class type or enumeration type according to the Core wording.

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_CLASS_OR_ENUM_H


=== system/lib/libcxx/include/__concepts/common_reference_with.h ===
SHA256: c8a377ae7fd0ee94e04fd58f33ed1e8881581581145e8f7a120747ddf07e2dad
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [concept.commonref]

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_COMMON_REFERENCE_WITH_H


=== system/lib/libcxx/include/__concepts/common_with.h ===
SHA256: b4f11dc121979d217071f372f067a0ab3d3b4e9891251aeaf1630b77a57f0886
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [concept.common]

// clang-format off

// clang-format on

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_COMMON_WITH_H


=== system/lib/libcxx/include/__concepts/constructible.h ===
SHA256: b1f147b2dee62ecf8c690da43358fb1c61396d50fadc17e3adb0f8c8506d22dd
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [concept.constructible]

// [concept.default.init]

// [concept.moveconstructible]

// [concept.copyconstructible]

// clang-format off

// clang-format on

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_CONSTRUCTIBLE_H


=== system/lib/libcxx/include/__concepts/convertible_to.h ===
SHA256: e0130321b4cb81bb7ae90eecad5e75188a2d81e1f8841e15a421e34e1ebc731c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [concept.convertible]

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_CONVERTIBLE_TO_H


=== system/lib/libcxx/include/__concepts/copyable.h ===
SHA256: 6ba6614001023de29de8c27ff0e4694204bba9fe670b677ca539c097e3189952
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [concepts.object]

// clang-format off

// clang-format on

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_COPYABLE_H


=== system/lib/libcxx/include/__concepts/derived_from.h ===
SHA256: 5b7fdf0fbda8750b4843cdf5d12f4caddd4e60d80d3d9d3fe02a329ab94f393e
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [concept.derived]

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_DERIVED_FROM_H


=== system/lib/libcxx/include/__concepts/destructible.h ===
SHA256: c69524a72675f8e0a68327c55e5614f44839a261ff5ec60e8f6c63be54103111
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [concept.destructible]

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_DESTRUCTIBLE_H


=== system/lib/libcxx/include/__concepts/different_from.h ===
SHA256: 862300e1f0e972a02d5cab4f81fcdba2eae92690c42e38cf1c77ffe175f4632d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_DIFFERENT_FROM_H


=== system/lib/libcxx/include/__concepts/equality_comparable.h ===
SHA256: a67db93cf701260b793701457364734a93c4c89b35fcb7d9c121081dced2544a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [concept.equalitycomparable]

// clang-format off

// clang-format on

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_EQUALITY_COMPARABLE_H


=== system/lib/libcxx/include/__concepts/invocable.h ===
SHA256: af2eee44fea19d5861ac5eb86e03b643589cd6efd8bb717762a8d9237f33587f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [concept.invocable]

// not required to be equality preserving

// [concept.regular.invocable]

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_INVOCABLE_H


=== system/lib/libcxx/include/__concepts/movable.h ===
SHA256: ecec2c75a7808747a47c3d84f214977eb7daf6fcf73ed080489a89aacb826bfd
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [concepts.object]

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_MOVABLE_H


=== system/lib/libcxx/include/__concepts/predicate.h ===
SHA256: bdfcb2bda60e792475afbf44c0c730181c778b9af58e8f24755dad6c95639d96
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [concept.predicate]

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_PREDICATE_H


=== system/lib/libcxx/include/__concepts/regular.h ===
SHA256: 6be99f051a063943a99ea3678c459c57f4b0adc374c9c9abc838b53f7c8f6f61
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [concept.object]

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_REGULAR_H


=== system/lib/libcxx/include/__concepts/relation.h ===
SHA256: fb41897540dd1ade5860f573b6e7ee8483b1dd8112dda5df8deaa50d195e8f55
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [concept.relation]

// [concept.equiv]

// [concept.strictweakorder]

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_RELATION_H


=== system/lib/libcxx/include/__concepts/same_as.h ===
SHA256: 94e76a6f662c93d8d0dbe03fa901d79608ad8ea43f7276031c17c75f2aec0563
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [concept.same]

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_SAME_AS_H


=== system/lib/libcxx/include/__concepts/semiregular.h ===
SHA256: 850e0a2dc61eb9cb020eb37cb477b84b31768bae217099a9f334a93f7cf754b1
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [concept.object]

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_SEMIREGULAR_H


=== system/lib/libcxx/include/__concepts/swappable.h ===
SHA256: 2fba6a556e81ecfa8095204a773a779e8037d21ec06e717008f62d2b9ed7cfe3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [concept.swappable]

// clang-format off

// clang-format on

// clang-format off

// clang-format on

// 2.1   `S` is `(void)swap(E1, E2)`* if `E1` or `E2` has class or enumeration type and...

// *The name `swap` is used here unqualified.

// 2.2   Otherwise, if `E1` and `E2` are lvalues of array types with equal extent and...

// TODO(cjdb): replace with `ranges::swap_ranges`.

// 2.3   Otherwise, if `E1` and `E2` are lvalues of the same type `T` that models...

// namespace __swap

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_SWAPPABLE_H


=== system/lib/libcxx/include/__concepts/totally_ordered.h ===
SHA256: 802bb6786faeb2401a6031f14a5d431cee4462a3dc845048d545a684a300ce26
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [concept.totallyordered]

// clang-format off

// clang-format on

// _LIBCPP_STD_VER >= 20

// _LIBCPP___CONCEPTS_TOTALLY_ORDERED_H


=== system/lib/libcxx/include/__condition_variable/condition_variable.h ===
SHA256: 5d3eda77a03ab8a3f3436531d03ec1205ee6619b4c7c2e2e8650eb71049feb29
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// enum class cv_status

// _LIBCPP_HAS_THREADS

// _LIBCPP_HAS_COND_CLOCKWAIT

// _LIBCPP_HAS_THREADS

// _LIBCPP___CONDITION_VARIABLE_CONDITION_VARIABLE_H


=== system/lib/libcxx/include/__configuration/abi.h ===
SHA256: ec8f2f4985f40f9569ba8008df24f2e60b276a8d8713b9c7a810fddd35d8aaf6
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// FIXME: ABI detection should be done via compiler builtin macros. This

// is just a placeholder until Clang implements such macros. For now assume

// that Windows compilers pretending to be MSVC++ target the Microsoft ABI,

// and allow the user to explicitly specify the ABI to handle cases where this

// heuristic falls short.

// Windows uses the Microsoft ABI

// 32-bit ARM uses the Itanium ABI with a few differences (array cookies, etc),

// and so does 64-bit ARM on Apple platforms.

// Non-Apple 64-bit ARM uses the vanilla Itanium ABI

// We assume that other architectures also use the vanilla Itanium ABI too

// TODO: Move the description of the remaining ABI flags to ABIGuarantees.rst or remove them.

// Override the default return value of exception::what() for bad_function_call::what()

// with a string that is specific to bad_function_call (see http://wg21.link/LWG2233).

// This is an ABI break on platforms that sign and authenticate vtable function pointers

// because it changes the mangling of the virtual function located in the vtable, which

// changes how it gets signed.

// According to the Standard, `bitset::operator[] const` returns bool

// In LLVM 20, we've changed to take these ABI breaks unconditionally. These flags only exist in case someone is running

// into the static_asserts we added to catch the ABI break and don't care that it is one.

// TODO(LLVM 22): Remove these flags

// These flags are documented in ABIGuarantees.rst

// XXX EMSCRIPTEN https://github.com/emscripten-core/emscripten/issues/11022

//#  define _LIBCPP_ABI_OPTIMIZED_FUNCTION

// Enable compiling copies of now inline methods into the dylib to support

// applications compiled against older libraries. This is unnecessary with

// COFF dllexport semantics, since dllexport forces a non-inline definition

// of inline functions to be emitted anyway. Our own non-inline copy would

// conflict with the dllexport-emitted copy, so we disable it. For XCOFF,

// the linker will take issue with the symbols in the shared object if the

// weak inline methods get visibility (such as from -fvisibility-inlines-hidden),

// so disable it.

// Feature macros for disabling pre ABI v1 features. All of these options

// are deprecated.

// We had some bugs where we use [[no_unique_address]] together with construct_at,

// which causes UB as the call on construct_at could write to overlapping subobjects

//

// https://github.com/llvm/llvm-project/issues/70506

// https://github.com/llvm/llvm-project/issues/70494

//

// To fix the bug we had to change the ABI of some classes to remove [[no_unique_address]] under certain conditions.

// The macro below is used for all classes whose ABI have changed as part of fixing these bugs.

// [[msvc::no_unique_address]] seems to mostly affect empty classes, so the padding scheme for Itanium doesn't work.

// Tracks the bounds of the array owned by std::unique_ptr<T[]>, allowing it to trap when accessed out-of-bounds.

// Note that limited bounds checking is also available outside of this ABI configuration, but only some categories

// of types can be checked.

//

// ABI impact: This causes the layout of std::unique_ptr<T[]> to change and its size to increase.

//             This also affects the representation of a few library types that use std::unique_ptr

//             internally, such as the unordered containers.

// #define _LIBCPP_ABI_BOUNDED_UNIQUE_PTR

// use old string layout on x86_64 and i386

// use old string layout on arm (which does not include aarch64/arm64), except on watch ABIs

// _LIBCPP___CONFIGURATION_ABI_H


=== system/lib/libcxx/include/__configuration/availability.h ===
SHA256: 4aed9fe6f6a97d7a6dea3225374d402a2917bac6d41b80ca680523a01aeaeb42
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Libc++ is shipped by various vendors. In particular, it is used as a system

// library on macOS, iOS and other Apple platforms. In order for users to be

// able to compile a binary that is intended to be deployed to an older version

// of a platform, Clang provides availability attributes [1]. These attributes

// can be placed on declarations and are used to describe the life cycle of a

// symbol in the library.

//

// The main goal is to ensure a compile-time error if a symbol that hasn't been

// introduced in a previously released library is used in a program that targets

// that previously released library. Normally, this would be a load-time error

// when one tries to launch the program against the older library.

//

// For example, the filesystem library was introduced in the dylib in LLVM 9.

// On Apple platforms, this corresponds to macOS 10.15. If a user compiles on

// a macOS 10.15 host but targets macOS 10.13 with their program, the compiler

// would normally not complain (because the required declarations are in the

// headers), but the dynamic loader would fail to find the symbols when actually

// trying to launch the program on macOS 10.13. To turn this into a compile-time

// issue instead, declarations are annotated with when they were introduced, and

// the compiler can produce a diagnostic if the program references something that

// isn't available on the deployment target.

//

// This mechanism is general in nature, and any vendor can add their markup to

// the library (see below). Whenever a new feature is added that requires support

// in the shared library, two macros are added below to allow marking the feature

// as unavailable:

// 1. A macro named `_LIBCPP_AVAILABILITY_HAS_<feature>` which must be defined

//    to `_LIBCPP_INTRODUCED_IN_<version>` for the appropriate LLVM version.

// 2. A macro named `_LIBCPP_AVAILABILITY_<feature>`, which must be defined to

//    `_LIBCPP_INTRODUCED_IN_<version>_MARKUP` for the appropriate LLVM version.

//

// When vendors decide to ship the feature as part of their shared library, they

// can update the `_LIBCPP_INTRODUCED_IN_<version>` macro (and the markup counterpart)

// based on the platform version they shipped that version of LLVM in. The library

// will then use this markup to provide an optimal user experience on these platforms.

//

// Furthermore, many features in the standard library have corresponding

// feature-test macros. The `_LIBCPP_AVAILABILITY_HAS_<feature>` macros

// are checked by the corresponding feature-test macros generated by

// generate_feature_test_macro_components.py to ensure that the library

// doesn't announce a feature as being implemented if it is unavailable on

// the deployment target.

//

// Note that this mechanism is disabled by default in the "upstream" libc++.

// Availability annotations are only meaningful when shipping libc++ inside

// a platform (i.e. as a system library), and so vendors that want them should

// turn those annotations on at CMake configuration time.

//

// [1]: https://clang.llvm.org/docs/AttributeReference.html#availability

// Availability markup is disabled when building the library, or when a non-Clang

// compiler is used because only Clang supports the necessary attributes.

//

// We also allow users to force-disable availability markup via the `_LIBCPP_DISABLE_AVAILABILITY`

// macro because that is the only way to work around a Clang bug related to availability

// attributes: https://github.com/llvm/llvm-project/issues/134151.

// Once that bug has been fixed, we should remove the macro.

// When availability annotations are disabled, we take for granted that features introduced

// in all versions of the library are available.

/* nothing */

/* nothing */

/* nothing */

/* nothing */

/* nothing */

/* nothing */

/* nothing */

/* nothing */

/* nothing */

/* nothing */

/* nothing */

/* nothing */

// clang-format off

// LLVM 21

// TODO: Fill this in

// LLVM 20

// TODO: Fill this in

// LLVM 19

// TODO: Fill this in

// LLVM 18

// LLVM 16

// LLVM 15

// LLVM 14

// LLVM 12

// LLVM 11

// LLVM 9

// clang-format on

// ...New vendors can add availability markup here...

// These macros control the availability of all parts of <filesystem> that

// depend on something in the dylib.

// This controls the availability of the C++20 synchronization library,

// which requires shared library support for various operations

// (see libcxx/src/atomic.cpp). This includes <barier>, <latch>,

// <semaphore>, and notification functions on std::atomic.

// Enable additional explicit instantiations of iostreams components. This

// reduces the number of weak definitions generated in programs that use

// iostreams by providing a single strong definition in the shared library.

//

// TODO: Enable additional explicit instantiations on GCC once it supports exclude_from_explicit_instantiation,

//       or once libc++ doesn't use the attribute anymore.

// TODO: Enable them on Windows once https://llvm.org/PR41018 has been fixed.

// This controls the availability of floating-point std::to_chars functions.

// These overloads were added later than the integer overloads.

// This controls whether the library claims to provide a default verbose

// termination function, and consequently whether the headers will try

// to use it when the mechanism isn't overriden at compile-time.

// This controls the availability of the C++17 std::pmr library,

// which is implemented in large part in the built library.

//

// TODO: Enable std::pmr markup once https://github.com/llvm/llvm-project/issues/40340 has been fixed

//       Until then, it is possible for folks to try to use `std::pmr` when back-deploying to targets that don't support

//       it and it'll be a load-time error, but we don't have a good alternative because the library won't compile if we

//       use availability annotations until that bug has been fixed.

// These macros controls the availability of __cxa_init_primary_exception

// in the built library, which std::make_exception_ptr might use

// (see libcxx/include/__exception/exception_ptr.h).

// This controls the availability of C++23 <print>, which

// has a dependency on the built library (it needs access to

// the underlying buffer types of std::cout, std::cerr, and std::clog.

// This controls the availability of the C++20 time zone database.

// The parser code is built in the library.

// These macros determine whether we assume that std::bad_function_call and

// std::bad_expected_access provide a key function in the dylib. This allows

// centralizing their vtable and typeinfo instead of having all TUs provide

// a weak definition that then gets deduplicated.

// This controls the availability of floating-point std::from_chars functions.

// These overloads were added later than the integer overloads.

// This controls whether `std::__hash_memory` is available in the dylib, which

// is used for some `std::hash` specializations.

// No attribute, since we've had hash in the headers before

// This controls whether we provide a message for `bad_function_call::what()` that specific to `std::bad_function_call`.

// See https://wg21.link/LWG2233. This requires `std::bad_function_call::what()` to be available in the dylib.

// No attribute, since we've had bad_function_call::what() in the headers before

// Define availability attributes that depend on both

// _LIBCPP_HAS_EXCEPTIONS and _LIBCPP_HAS_RTTI.

// _LIBCPP___CONFIGURATION_AVAILABILITY_H


=== system/lib/libcxx/include/__configuration/compiler.h ===
SHA256: d7238c6e075cce2ff302e947fc4f22f62a619efb6d5218b185edca66a3e70160
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Given AppleClang XX.Y.Z, _LIBCPP_APPLE_CLANG_VER is XXYZ (e.g. AppleClang 14.0.3 => 1403)

// Warn if a compiler version is used that is not supported anymore

// LLVM RELEASE Update the minimum compiler versions

// _LIBCPP___CONFIGURATION_COMPILER_H


=== system/lib/libcxx/include/__configuration/language.h ===
SHA256: 1af2851db226ce3368438339d9ba2f66dce8209e2388eb515a68b5bce5413481
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// NOLINTBEGIN(libcpp-cpp-version-check)

// Expected release year of the next C++ standard

// __cplusplus

// NOLINTEND(libcpp-cpp-version-check)

// _LIBCPP___CONFIGURATION_LANGUAGE_H


=== system/lib/libcxx/include/__configuration/platform.h ===
SHA256: efc95e88b9724b38387256a7b8b889f6fbb3b854f31edc5571bef2cdbf1ba1dc
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// ... add new file formats here ...

// Need to detect which libc we're using if we're on Linux.

// defined(__GLIBC_PREREQ)

// This is required in order for _NEWLIB_VERSION to be defined in places where we use it.

// TODO: We shouldn't be including arbitrarily-named headers from libc++ since this can break valid

//       user code. Move code paths that need _NEWLIB_VERSION to another customization mechanism.

// __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__

// _LIBCPP___CONFIGURATION_PLATFORM_H


=== system/lib/libcxx/include/__coroutine/coroutine_handle.h ===
SHA256: 4563db81b95ab4737fa39c08595904af08ffeabbcd5cbe090ab119d0017ecbc0
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [coroutine.handle]

// [coroutine.handle.con], construct/reset

// [coroutine.handle.export.import], export/import

// [coroutine.handle.observers], observers

// [coroutine.handle.resumption], resumption

// FIXME actually implement a check for if the coro is suspended.

// [coroutine.handle.compare]

// [coroutine.handle.con], construct/reset

// [coroutine.handle.export.import], export/import

// [coroutine.handle.conv], conversion

// [coroutine.handle.observers], observers

// [coroutine.handle.resumption], resumption

// [coroutine.handle.promise], promise access

// FIXME actually implement a check for if the coro is suspended.

// [coroutine.handle.hash]

// _LIBCPP_STD_VER >= 20

// _LIBCPP___COROUTINE_COROUTINE_HANDLE_H


=== system/lib/libcxx/include/__coroutine/coroutine_traits.h ===
SHA256: 35f8976a825b9dd9b4068a751456c9abd01069f89fd2a49c67c8245bb314138e
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [coroutine.traits]

// [coroutine.traits.primary]

//   The header <coroutine> defined the primary template coroutine_traits such that

// if ArgTypes is a parameter pack of types and if the qualified-id R::promise_type

// is valid and denotes a type ([temp.deduct]), then coroutine_traits<R, ArgTypes...>

// has the following publicly accessible memebr:

//

//    using promise_type = typename R::promise_type;

//

// Otherwise, coroutine_traits<R, ArgTypes...> has no members.

// _LIBCPP_STD_VER >= 20

// _LIBCPP___COROUTINE_COROUTINE_TRAITS_H


=== system/lib/libcxx/include/__coroutine/noop_coroutine_handle.h ===
SHA256: 40d69dea48d2fa866f697d396f153b422e7c0e228b57577e38f7372d0ef74eec
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [coroutine.noop]

// [coroutine.promise.noop]

// [coroutine.handle.noop]

// [coroutine.handle.noop.conv], conversion

// [coroutine.handle.noop.observers], observers

// [coroutine.handle.noop.resumption], resumption

// [coroutine.handle.noop.promise], promise access

// [coroutine.handle.noop.address], address

// GCC doesn't implement __builtin_coro_noop().

// Construct the coroutine frame manually instead.

// __has_builtin(__builtin_coro_noop)

// [coroutine.noop.coroutine]

// __has_builtin(__builtin_coro_noop) || defined(_LIBCPP_COMPILER_GCC)

// _LIBCPP_STD_VER >= 20

// _LIBCPP___COROUTINE_NOOP_COROUTINE_HANDLE_H


=== system/lib/libcxx/include/__coroutine/trivial_awaitables.h ===
SHA256: 2d731072f3933c5b705cd6647b8854628d6a363385218c7b7e6ebe1769f8149c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [coroutine.trivial.awaitables]

// _LIBCPP_STD_VER >= 20

// __LIBCPP___COROUTINE_TRIVIAL_AWAITABLES_H


=== system/lib/libcxx/include/__cstddef/byte.h ===
SHA256: c153c092667a425796dd7646e51e5510dceae6699c1acbcf1cf8186e46a4bb5d
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___CSTDDEF_BYTE_H


=== system/lib/libcxx/include/__cstddef/max_align_t.h ===
SHA256: 5d1eb26e300760b356991bd88e735ef1d9bf6cf62007470e49fbc02eedf465a1
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// _LIBCPP___CSTDDEF_MAX_ALIGN_T_H


=== system/lib/libcxx/include/__cstddef/nullptr_t.h ===
SHA256: b9f85c012045849937ca4f4d84fde347c0dc88dd4149b7ba6d55816214cbd10d
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// _LIBCPP___CSTDDEF_NULLPTR_T_H


=== system/lib/libcxx/include/__cstddef/ptrdiff_t.h ===
SHA256: c16b4a1bc83107bdd4d5e2d96ae094459fa291084fb977495e2ea51970e86705
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// _LIBCPP___CSTDDEF_PTRDIFF_T_H


=== system/lib/libcxx/include/__cstddef/size_t.h ===
SHA256: 24fcce5e6d3c4a731254461a28148abe1f571c2e8790ab50442446ded352846b
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// _LIBCPP___CSTDDEF_SIZE_T_H


=== system/lib/libcxx/include/__debug_utils/randomize_range.h ===
SHA256: ed04ac54864bffe1577b762e3ea8e1d59387fbd2ed91096597709685b9f25700
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___LIBCXX_DEBUG_RANDOMIZE_RANGE_H


=== system/lib/libcxx/include/__debug_utils/sanitizers.h ===
SHA256: 7eb495e7c6565f6b523630fcd910396427ecd80e2f9637f7126b3d432c391d03
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __has_feature(address_sanitizer)

// ASan choices

// __asan_annotate_container_with_allocator determines whether containers with custom allocators are annotated. This is

// a public customization point to disable annotations if the custom allocator assumes that the memory isn't poisoned.

// See the https://libcxx.llvm.org/UsingLibcxx.html#turning-off-asan-annotation-in-containers for more information.

// Annotate a double-ended contiguous range.

// - [__first_storage, __last_storage) is the allocated memory region,

// - [__first_old_contained, __last_old_contained) is the previously allowed (unpoisoned) range, and

// - [__first_new_contained, __last_new_contained) is the new allowed (unpoisoned) range.

// Annotate a contiguous range.

// [__first_storage, __last_storage) is the allocated memory region,

// __old_last_contained is the previously last allowed (unpoisoned) element, and

// __new_last_contained is the new last allowed (unpoisoned) element.

// _LIBCPP___LIBCXX_DEBUG_UTILS_SANITIZERS_H


=== system/lib/libcxx/include/__debug_utils/strict_weak_ordering_check.h ===
SHA256: 9f55cbf4ca5ad88d5f061e2bf875b562bf97de3d5e0ed50b29f724d5be8cedc6
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Check if the range is actually sorted.

// Limit the number of elements we need to check.

// Find first element that is greater than *(__first+__p).

// Check that the elements from __p to __q are equal between each other.

// Check that elements between __p and __q are less than between __q and __size.

// Skip these equal elements.

// _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG

// _LIBCPP___LIBCXX_DEBUG_STRICT_WEAK_ORDERING_CHECK


=== system/lib/libcxx/include/__exception/exception.h ===
SHA256: 35f5ba4cc29997ca90f616f38692d6792980171efb8466f624bb4cdf4dc9d579
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// <vcruntime_exception.h> defines its own std::exception and std::bad_exception types,

// which we use in order to be ABI-compatible with other STLs on Windows.

// The std::exception class was already included above, but we're explicit about this condition here for clarity.

// However, <vcruntime_exception.h> does not define std::exception and std::bad_exception

// when _HAS_EXCEPTIONS == 0.

//

// Since libc++ still wants to provide the std::exception hierarchy even when _HAS_EXCEPTIONS == 0

// (after all those are simply types like any other), we define an ABI-compatible version

// of the VCRuntime std::exception and std::bad_exception types in that mode.

// base of all library exceptions

// !defined(_LIBCPP_ABI_VCRUNTIME)

// On all other platforms, we define our own std::exception and std::bad_exception types

// regardless of whether exceptions are turned on as a language feature.

// !_LIBCPP_ABI_VCRUNTIME

// _LIBCPP___EXCEPTION_EXCEPTION_H


=== system/lib/libcxx/include/__exception/exception_ptr.h ===
SHA256: 3f93b141c69ff239dff449a7228b6e166caa79bc9c0b2221960f3caaa5931bff
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// In Wasm, a destructor returns its argument

// namespace __cxxabiv1

// exception_ptr is basically a COW string so it is trivially relocatable.

// It is also replaceable because assignment has normal value semantics.

// Objective-C exceptions are thrown via pointer. When throwing an Objective-C exception,

// Clang generates a call to `objc_exception_throw` instead of the usual `__cxa_throw`.

// That function creates an exception with a special Objective-C typeinfo instead of

// the usual C++ typeinfo, since that is needed to implement the behavior documented

// at [1]).

//

// Because of this special behavior, we can't create an exception via `__cxa_init_primary_exception`

// for Objective-C exceptions, otherwise we'd bypass `objc_exception_throw`. See https://llvm.org/PR135089.

//

// [1]:

// https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Exceptions/Articles/Exceptions64Bit.html

// !_LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_ABI_MICROSOFT

// This is a built-in template function which automagically extracts the required

// information.

// _LIBCPP_ABI_MICROSOFT

// _LIBCPP___EXCEPTION_EXCEPTION_PTR_H


=== system/lib/libcxx/include/__exception/nested_exception.h ===
SHA256: ea76ed1de3beb6c43227ff4dd0102b87c8375fa9bb8045bac329435c807d23c9
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// access functions

// FIXME: Make this abort

// _LIBCPP___EXCEPTION_NESTED_EXCEPTION_H


=== system/lib/libcxx/include/__exception/operations.h ===
SHA256: 74b328d0c18ba99f6290b9277a910efb05348f2726d0d7a55fe7ba40c16c4daa
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_UNCAUGHT_EXCEPTION)

// _LIBCPP___EXCEPTION_OPERATIONS_H


=== system/lib/libcxx/include/__exception/terminate.h ===
SHA256: ca0a3ef84356a5058c1b2d6f4f97bb3f742306ca2baf2c56df3b9188078b39fb
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___EXCEPTION_TERMINATE_H


=== system/lib/libcxx/include/__expected/bad_expected_access.h ===
SHA256: 03d1ab297e7f403ef00e1c37bd93cef6935b1837e63e86e581d1131d6a066c9f
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 23

// _LIBCPP___EXPECTED_BAD_EXPECTED_ACCESS_H


=== system/lib/libcxx/include/__expected/expected.h ===
SHA256: cbd046024d6bfb2291837a05230957cb0266fb352276aaca52fc13ff8548871e
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// If parameter type `_Tp` of `__conditional_no_unique_address` is neither

// copyable nor movable, a constructor with this tag is provided. For that

// constructor, the user has to provide a function and arguments. The function

// must return an object of type `_Tp`. When the function is invoked by the

// constructor, guaranteed copy elision kicks in and the `_Tp` is constructed

// in place.

// This class implements an object with `[[no_unique_address]]` conditionally applied to it,

// based on the value of `_NoUnique`.

//

// A member of this class must always have `[[no_unique_address]]` applied to

// it. Otherwise, the `[[no_unique_address]]` in the "`_NoUnique == true`" case

// would not have any effect. In the `false` case, the `__v` is not

// `[[no_unique_address]]`, so nullifies the effects of the "outer"

// `[[no_unique_address]]` regarding data layout.

//

// If we had a language feature, this class would basically be replaced by `[[no_unique_address(condition)]]`.

// This function returns whether the type `_Second` can be stuffed into the tail padding

// of the `_First` type if both of them are given `[[no_unique_address]]`.

// This class implements the storage used by `std::expected`. We have a few

// goals for this storage:

// 1. Whenever the underlying {_Tp | _Unex} combination has free bytes in its

//    tail padding, we should reuse it to store the bool discriminator of the

//    expected, so as to save space.

// 2. Whenever the `expected<_Tp, _Unex>` as a whole has free bytes in its tail

//    padding, we should allow an object following the expected to be stored in

//    its tail padding.

// 3. However, we never want a user object (say `X`) that would follow an

//    `expected<_Tp, _Unex>` to be stored in the padding bytes of the

//    underlying {_Tp | _Unex} union, if any. That is because we use

//    `construct_at` on that union, which would end up overwriting the `X`

//    member if it is stored in the tail padding of the union.

//

// To achieve this, `__expected_base`'s logic is implemented in an inner

// `__repr` class. `__expected_base` holds one `__repr` member which is

// conditionally `[[no_unique_address]]`. The `__repr` class holds the

// underlying {_Tp | _Unex} union and a boolean "has value" flag.

//

// Which one of the `__repr_`/`__union_` members is `[[no_unique_address]]`

// depends on whether the "has value" boolean fits into the tail padding of

// the underlying {_Tp | _Unex} union:

//

// - In case the "has value" bool fits into the tail padding of the union, the

//   whole `__repr_` member is _not_ `[[no_unique_address]]` as it needs to be

//   transparently replaced on `emplace()`/`swap()` etc.

// - In case the "has value" bool does not fit into the tail padding of the

//   union, only the union member must be transparently replaced (therefore is

//   _not_ `[[no_unique_address]]`) and the "has value" flag must be adjusted

//   manually.

//

// This way, the member that is transparently replaced on mutating operations

// is never `[[no_unique_address]]`, satisfying the requirements from

// "[basic.life]" in the standard.

//

// Stripped away of all superfluous elements, the layout of `__expected_base`

// then looks like this:

//

//     template <class Tp, class Err>

//     class expected_base {

//       union union_t {

//         [[no_unique_address]] Tp val;

//         [[no_unique_address]] Err unex;

//       };

//

//       static constexpr bool put_flag_in_tail                    = fits_in_tail_padding<union_t, bool>;

//       static constexpr bool allow_reusing_expected_tail_padding = !put_flag_in_tail;

//

//       struct repr {

//       private:

//         // If "has value" fits into the tail, this should be

//         // `[[no_unique_address]]`, otherwise not.

//         [[no_unique_address]] conditional_no_unique_address<

//             put_flag_in_tail,

//             union_t>::type union_;

//         [[no_unique_address]] bool has_val_;

//       };

//

//     protected:

//       // If "has value" fits into the tail, this must _not_ be

//       // `[[no_unique_address]]` so that we fill out the

//       // complete `expected` object.

//       [[no_unique_address]] conditional_no_unique_address<

//           allow_reusing_expected_tail_padding,

//           repr>::type repr_;

//     };

//

// use named union because [[no_unique_address]] cannot be applied to an unnamed union,

// also guaranteed elision into a potentially-overlapping subobject is unsettled (and

// it's not clear that it's implementable, given that the function is allowed to clobber

// the tail padding) - see https://github.com/itanium-cxx-abi/cxx-abi/issues/107.

// __repr's destructor handles this

// The return value of `__make_union` must be constructed in place in the

// `__v` member of `__union_`, relying on guaranteed copy elision. To do

// this, the `__conditional_no_unique_address_invoke_tag` constructor is

// called with a lambda that is immediately called inside

// `__conditional_no_unique_address`'s constructor.

// Note: Since the destructor of the union is trivial, this does nothing

// except to end the lifetime of the union.

// In case we copy/move construct from another `expected` we need to create

// our `expected` so that it either has a value or not, depending on the "has

// value" flag of the other `expected`. To do this without falling back on

// `std::construct_at` we rely on guaranteed copy elision using two helper

// functions `__make_repr` and `__make_union`. There have to be two since

// there are two data layouts with different members being

// `[[no_unique_address]]`. GCC (as of version 13) does not do guaranteed

// copy elision when initializing `[[no_unique_address]]` members. The two

// cases are:

//

// - `__make_repr`: This is used when the "has value" flag lives in the tail

//   of the union. In this case, the `__repr` member is _not_

//   `[[no_unique_address]]`.

// - `__make_union`: When the "has value" flag does _not_ fit in the tail of

//   the union, the `__repr` member is `[[no_unique_address]]` and the union

//   is not.

//

// This constructor "catches" the first case and leaves the second case to

// `__union_t`, its constructors and `__make_union`.

// [expected.object.ctor], constructors

// strengthened

// strengthened

// use the copy constructor instead, see #92676

// strengthened

// strengthened

// strengthened

// strengthened

// strengthened

// strengthened

// strengthened

// strengthened

// strengthened

// [expected.object.dtor], destructor

// [expected.object.assign], assignment

// strengthened

// [expected.object.swap], swap

// [expected.object.obs], observers

// [expected.void.monadic], monadic

// [expected.object.eq], equality operators

// use named union because [[no_unique_address]] cannot be applied to an unnamed union,

// also guaranteed elision into a potentially-overlapping subobject is unsettled (and

// it's not clear that it's implementable, given that the function is allowed to clobber

// the tail padding) - see https://github.com/itanium-cxx-abi/cxx-abi/issues/107.

// __repr's destructor handles this

// [expected.void.ctor], constructors

// strengthened

// strengthened

// strengthened

// strengthened

// strengthened

// strengthened

// strengthened

// [expected.void.dtor], destructor

// [expected.void.assign], assignment

// strengthened

// [expected.void.swap], swap

// May throw, but will re-engage `__with_val` in that case.

// Will not throw.

// [expected.void.obs], observers

// [expected.void.monadic], monadic

// [expected.void.eq], equality operators

// _LIBCPP_STD_VER >= 23

// _LIBCPP___EXPECTED_EXPECTED_H


=== system/lib/libcxx/include/__expected/unexpect.h ===
SHA256: f78b461d4dd156d54b4a3631e4efa58382662fbb5cc7b078c00683b2773e067a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 23

// _LIBCPP___EXPECTED_UNEXPECT_H


=== system/lib/libcxx/include/__expected/unexpected.h ===
SHA256: 125c10a726da20e56851c6ffebb911758c627a41ab613d5aab5ceeb419f6165f
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

//

//

//

//

//

//

//

//

// strengthened

//

// strengthened

//

// strengthened

// _LIBCPP_STD_VER >= 23

// _LIBCPP___EXPECTED_UNEXPECTED_H


=== system/lib/libcxx/include/__filesystem/copy_options.h ===
SHA256: 294b135e1749bdc70a8aa69cdd7ac97401f655c46255de636a816e064270d4f9
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___FILESYSTEM_COPY_OPTIONS_H


=== system/lib/libcxx/include/__filesystem/directory_entry.h ===
SHA256: 15bee6cbf0ed67acb1bb7679600131aa46c8d7b101f388267cdb78afa5a2a61c
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// constructors and destructors

// _LIBCPP_STD_VER <= 17

// _LIBCPP_STD_VER <= 17

/*allow_dne*/

// _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM

// _LIBCPP___FILESYSTEM_DIRECTORY_ENTRY_H


=== system/lib/libcxx/include/__filesystem/directory_iterator.h ===
SHA256: 35bc6c7cf5f0e375037a72f440fbcd0e47282cebd7423620f6588cbb7d58229d
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// ctor & dtor

// non-default implementation provided to support self-move assign.

// Note: this check duplicates a check in `__dereference()`.

// construct the dir_stream

// enable directory_iterator range-based for statements

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM

// _LIBCPP___FILESYSTEM_DIRECTORY_ITERATOR_H


=== system/lib/libcxx/include/__filesystem/directory_options.h ===
SHA256: 9873482837901f317254b69c91f68089018a75d5109694b6dac2798cc45a833f
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___FILESYSTEM_DIRECTORY_OPTIONS_H


=== system/lib/libcxx/include/__filesystem/file_status.h ===
SHA256: 8f3b3d3364c4ef4fca6c5ba02774cab2e2dc2429962657758e148aad736a6dfb
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// constructors

// observers

// modifiers

// _LIBCPP_STD_VER >= 17

// _LIBCPP___FILESYSTEM_FILE_STATUS_H


=== system/lib/libcxx/include/__filesystem/file_time_type.h ===
SHA256: 9ad5cdfb90af5c1d8ed90557c7f1212266447b84418054c0573282cf22129b22
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___FILESYSTEM_FILE_TIME_TYPE_H


=== system/lib/libcxx/include/__filesystem/file_type.h ===
SHA256: e731a4842b4ea70ec30394dc97cc731f97f4950e04d36f0b33c33c0c290f0523
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// On Windows, the library never identifies files as block, character, fifo

// or socket.

// _LIBCPP_STD_VER >= 17

// _LIBCPP___FILESYSTEM_FILE_TYPE_H


=== system/lib/libcxx/include/__filesystem/filesystem_error.h ===
SHA256: 85cc3142b7506b0a719f29f9b2228f8b6543cea576253a86348f66d34436de8a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// key function

// _LIBCPP_STD_VER >= 17

// _LIBCPP___FILESYSTEM_FILESYSTEM_ERROR_H


=== system/lib/libcxx/include/__filesystem/operations.h ===
SHA256: a91ff0db4b8f776b7e09c5817882dd1fd17c8daa4fe7bde46efd84fbb0e3cf65
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM

// _LIBCPP___FILESYSTEM_OPERATIONS_H


=== system/lib/libcxx/include/__filesystem/path.h ===
SHA256: 2f9454628e7d331ba9e9ef4f35dc4ece1e9b9f05116c4324d0fcf2d069f0c87c
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// for quoted

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP_HAS_CHAR8_T

/* _LIBCPP_WIN32API */

// constructors and destructor

/*
  #if _LIBCPP_HAS_LOCALIZATION
    // TODO Implement locale conversions.
    template <class _Source, class = _EnableIfPathable<_Source, void> >
    path(const _Source& __src, const locale& __loc, format = format::auto_format);
    template <class _InputIt>
    path(_InputIt __first, _InputIt _last, const locale& __loc,
         format = format::auto_format);
  #endif
  */

// assignments

// appends

// FIXME: Use _LIBCPP_DIAGNOSE_WARNING to produce a diagnostic when __src

// is known at compile time to be "/' since the user almost certainly intended

// to append a separator instead of overwriting the path with "/"

// concatenation

// modifiers

// _LIBCPP_STD_VER <= 17

// _LIBCPP_STD_VER <= 17

// private helper to allow reserving memory in the path

// native format observers

// generic format observers

// Note: This (and generic_u8string below) is slightly suboptimal as

// it iterates twice over the string; once to convert it to the right

// character type, and once to replace path delimiters.

// _LIBCPP_HAS_LOCALIZATION

/* _LIBCPP_WIN32API */

// _LIBCPP_HAS_LOCALIZATION

// generic format observers

// _LIBCPP_HAS_LOCALIZATION

/* !_LIBCPP_WIN32API */

// compare

// decomposition

// query

// A drive letter with no root directory is relative, e.g. x:example.

// If no root name, it's relative, e.g. \example is relative to the current drive

// A server root name, like \\server, is always absolute

// Seems to be a server root name

// relative paths

// iterators

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP_STD_VER >= 17

// _LIBCPP___FILESYSTEM_PATH_H


=== system/lib/libcxx/include/__filesystem/path_iterator.h ===
SHA256: d67fa25929d8d905c0f7bd5311b924c905231b4991e0f33c43cb8ae4e65cf97c
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___FILESYSTEM_PATH_ITERATOR_H


=== system/lib/libcxx/include/__filesystem/perm_options.h ===
SHA256: ef3ea93cc026d1c249379ab0a455273081352fe6b4777dd5beaf1e5f2546ecdd
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___FILESYSTEM_PERM_OPTIONS_H


=== system/lib/libcxx/include/__filesystem/perms.h ===
SHA256: b378e2dad767db05fdccacc245d9d0d4f0dd7cd83c645d19fbc77465a21c5315
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// On Windows, these permission bits map to one single readonly flag per

// file, and the executable bit is always returned as set. When setting

// permissions, as long as the write bit is set for either owner, group or

// others, the readonly flag is cleared.

// _LIBCPP_STD_VER >= 17

// _LIBCPP___FILESYSTEM_PERMS_H


=== system/lib/libcxx/include/__filesystem/recursive_directory_iterator.h ===
SHA256: 87670816ba660a8c14f81962197cea8f757aa638ff5ab0060889d3a414c85cd6
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// constructors and destructor

// non-default implementation provided to support self-move assign.

// class recursive_directory_iterator

// enable recursive_directory_iterator range-based for statements

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 17 && _LIBCPP_HAS_FILESYSTEM

// _LIBCPP___FILESYSTEM_RECURSIVE_DIRECTORY_ITERATOR_H


=== system/lib/libcxx/include/__filesystem/space_info.h ===
SHA256: 867f5bf718dc7388b878491ac3d41dce7b48eb78f1cf1d98cbf70cc874d65927
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___FILESYSTEM_SPACE_INFO_H


=== system/lib/libcxx/include/__filesystem/u8path.h ===
SHA256: df68cff559ba4eb4f7c3f11a54ce12b428a95f0e2e722c98102ead5503eb53f5
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/* !_LIBCPP_WIN32API */

/* _LIBCPP_WIN32API */

// _LIBCPP_STD_VER >= 17

// _LIBCPP___FILESYSTEM_U8PATH_H


=== system/lib/libcxx/include/__flat_map/flat_map.h ===
SHA256: 44ed8dc990cb60f911040520fe9e7d730ec3cbe707bb5d0353cd364a62909d25
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// see [container.requirements]

// see [container.requirements]

// [flat.map.cons], construct/copy/destroy

// _LIBCPP_HAS_EXCEPTIONS

// gcc does not like the `throw` keyword in a conditionally noexcept function

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// No matter what happens, we always want to clear the other container before returning

// since we moved from it

/* noexcept */

// If an exception is thrown, we have no choice but to clear *this to preserve invariants

/* noexcept */

// iterators

// [flat.map.capacity], capacity

// [flat.map.access], element access

// [flat.map.modifiers], modifiers

/*WasSorted = */

/*WasSorted = */

/*WasSorted = */

/* noexcept */

/* noexcept */

/* noexcept */

// warning: The spec has unconditional noexcept, which means that

// if any of the following functions throw an exception,

// std::terminate will be called.

// This is discussed in P2767, which hasn't been voted on yet.

// observers

// map operations

// This function is only used in constructors. So there is not exception handling in this function.

// If the function exits via an exception, there will be no flat_map object constructed, thus, there

// is no invariant state to preserve

/* noexcept */

// key equals

/* noexcept */

// _LIBCPP_STD_VER >= 23

// _LIBCPP___FLAT_MAP_FLAT_MAP_H


=== system/lib/libcxx/include/__flat_map/flat_multimap.h ===
SHA256: 1c786be0b98232b83fb72cc1e0b9b164e86906ac7fed9428e9a53fb938fbbd37
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// see [container.requirements]

// see [container.requirements]

// [flat.map.cons], construct/copy/destroy

// The copy/move constructors are not specified in the spec, which means they should be defaulted.

// However, the move constructor can potentially leave a moved-from object in an inconsistent

// state if an exception is thrown.

// _LIBCPP_HAS_EXCEPTIONS

// gcc does not like the `throw` keyword in a conditionally noexcept function

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// copy/move assignment are not specified in the spec (defaulted)

// but move assignment can potentially leave moved from object in an inconsistent

// state if an exception is thrown

/* noexcept */

/* noexcept */

// iterators

// [flat.map.capacity], capacity

// [flat.map.modifiers], modifiers

// hint correct, just use exact hint iterators

// the hint position is more to the right than the key should have been.

// we want to emplace the element to a position as right as possible

// e.g. Insert new element "2" in the following range

// 1, 1, 2, 2, 2, 3, 4, 6

//                   ^

//                   |

//                  hint

// We want to insert "2" after the last existing "2"

// the hint position is more to the left than the key should have been.

// we want to emplace the element to a position as left as possible

//  1, 1, 2, 2, 2, 3, 4, 6

//  ^

//  |

// hint

// We want to insert "2" before the first existing "2"

/*WasSorted = */

/*WasSorted = */

/*WasSorted = */

/* noexcept */

/* noexcept */

/* noexcept */

// warning: The spec has unconditional noexcept, which means that

// if any of the following functions throw an exception,

// std::terminate will be called

// observers

// map operations

/* noexcept */

/* noexcept */

// _LIBCPP_STD_VER >= 23

// _LIBCPP___FLAT_MAP_FLAT_MULTIMAP_H


=== system/lib/libcxx/include/__flat_map/key_value_iterator.h ===
SHA256: 59feebdbac567212391383c10636bec1e504f2ba6f0171754db2a6a487e55377
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/**
 * __key_value_iterator is a proxy iterator which zips the underlying
 * _KeyContainer::iterator and the underlying _MappedContainer::iterator.
 * The two underlying iterators will be incremented/decremented together.
 * And the reference is a pair of the const key reference and the value reference.
 */

// `__key_value_iterator` only satisfy "Cpp17InputIterator" named requirements, because

// its `reference` is not a reference type.

// However, to avoid surprising runtime behaviour when it is used with the

// Cpp17 algorithms or operations, iterator_category is set to random_access_iterator_tag.

// _LIBCPP_STD_VER >= 23

// _LIBCPP___FLAT_MAP_KEY_VALUE_ITERATOR_H


=== system/lib/libcxx/include/__flat_map/sorted_equivalent.h ===
SHA256: f4d350ce5e809b870e7063cb6d9d75715135b74922afbc260dcd29ed429ffa82
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 23

// _LIBCPP___FLAT_MAP_SORTED_EQUIVALENT_H


=== system/lib/libcxx/include/__flat_map/sorted_unique.h ===
SHA256: b87552f67de8ac0efdc12f3316773763cd81af15736b92d75e6c9a9875deb0cb
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 23

// _LIBCPP___FLAT_MAP_SORTED_UNIQUE_H


=== system/lib/libcxx/include/__flat_map/utils.h ===
SHA256: 9b2f790b15971dc2ea868424702460062892be014cf1fc05598a39ca70272479
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// These utilities are defined in a class instead of a namespace so that this class can be befriended more easily.

// Emplace a {key: value} into a flat_{multi}map, at the exact position that

// __it_key and __it_mapped point to, assuming that the key is not already present in the map.

// When an exception is thrown during the emplacement, the function will try its best to

// roll back the changes it made to the map. If it cannot roll back the changes, it will

// clear the map.

// Nothing to roll back!

// we need to clear both because we don't know the state of our keys anymore

/* noexcept */

// we need to clear both because we don't know the state of our values anymore

/* noexcept */

// In this case, we know the values are just like before we attempted emplacement,

// and we also know that the keys have been emplaced successfully. Just roll back the keys.

// _LIBCPP_HAS_EXCEPTIONS

// Now things are funky for real. We're failing to rollback the keys.

// Just give up and clear the whole thing.

//

// Also, swallow the exception that happened during the rollback and let the

// original value-emplacement exception propagate normally.

/* noexcept */

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_STD_VER >= 23

// #define _LIBCPP___FLAT_MAP_UTILS_H


=== system/lib/libcxx/include/__flat_set/flat_multiset.h ===
SHA256: d5d8b1614b8a8cc3da6cf04ea5a31a23a9a6ef4b8bda5f6fd0284bc511f4a62b
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// [flat.multiset.cons], constructors

// The copy/move constructors are not specified in the spec, which means they should be defaulted.

// However, the move constructor can potentially leave a moved-from object in an inconsistent

// state if an exception is thrown.

// _LIBCPP_HAS_EXCEPTIONS

// gcc does not like the `throw` keyword in a conditionally noexcept function

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// copy/move assignment are not specified in the spec (defaulted)

// but move assignment can potentially leave moved from object in an inconsistent

// state if an exception is thrown

/* noexcept */

/* noexcept */

// iterators

// capacity

// [flat.multiset.modifiers], modifiers

/*WasSorted = */

/*WasSorted = */

/*WasSorted = */

/* noexcept */

/* noexcept */

/* noexcept */

// The following overload is the same as the iterator overload

// iterator erase(const_iterator __position);

/* noexcept */

// warning: The spec has unconditional noexcept, which means that

// if any of the following functions throw an exception,

// std::terminate will be called

// This is discussed in P3567, which hasn't been voted on yet.

// observers

// map operations

/* noexcept */

// hint correct, just use exact hint iterator

// the hint position is more to the right than the key should have been.

// we want to emplace the element to a position as right as possible

// e.g. Insert new element "2" in the following range

// 1, 1, 2, 2, 2, 3, 4, 6

//                   ^

//                   |

//                  hint

// We want to insert "2" after the last existing "2"

// the hint position is more to the left than the key should have been.

// we want to emplace the element to a position as left as possible

//  1, 1, 2, 2, 2, 3, 4, 6

//  ^

//  |

// hint

// We want to insert "2" before the first existing "2"

// _LIBCPP_STD_VER >= 23

// _LIBCPP___FLAT_MAP_FLAT_MULTISET_H


=== system/lib/libcxx/include/__flat_set/flat_set.h ===
SHA256: bd8374dce42dfd4c14e64e204aaaaf7af7ad960f71de5663c1f9051bea9e7f62
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// [flat.set.cons], construct/copy/destroy

// _LIBCPP_HAS_EXCEPTIONS

// gcc does not like the `throw` keyword in a conditionally noexcept function

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// No matter what happens, we always want to clear the other container before returning

// since we moved from it

/* noexcept */

// If an exception is thrown, we have no choice but to clear *this to preserve invariants

/* noexcept */

// iterators

// [flat.set.capacity], capacity

// [flat.set.modifiers], modifiers

/*WasSorted = */

/*WasSorted = */

/*WasSorted = */

/* noexcept */

/* noexcept */

/* noexcept */

// The following overload is the same as the iterator overload

// iterator erase(const_iterator __position);

/* noexcept */

// warning: The spec has unconditional noexcept, which means that

// if any of the following functions throw an exception,

// std::terminate will be called.

// This is discussed in P2767, which hasn't been voted on yet.

// observers

// set operations

// This function is only used in constructors. So there is not exception handling in this function.

// If the function exits via an exception, there will be no flat_set object constructed, thus, there

// is no invariant state to preserve

/* noexcept */

// we already have an equal key

// _LIBCPP_STD_VER >= 23

// _LIBCPP___FLAT_SET_FLAT_SET_H


=== system/lib/libcxx/include/__flat_set/ra_iterator.h ===
SHA256: 9cf41a38c75c8524dca3ef8c315b0f0026c20b5edcd556a80c3d86a34bd1bf95
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/**
 * __ra_iterator is a random access iterator that wraps an underlying iterator.
 * It also stores the underlying container type in its type so that algorithms
 * can optimize based on the underlying container type, and to avoid inadvertently
 * mixing iterators coming from different containers..
 */

// note: checking the concept random_access_iterator does not work for incomplete types

// deliberately lower contiguous_iterator

// _LIBCPP_STD_VER >= 23

// _LIBCPP___FLAT_SET_RA_ITERATOR_H


=== system/lib/libcxx/include/__flat_set/utils.h ===
SHA256: 6f5be39b892cde428195f37f6f3d47e9fc64843a6efbb638d605fca9ebba621c
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// These utilities are defined in a class instead of a namespace so that this class can be befriended more easily.

// Emplace a key into a flat_{multi}set, at the exact position that

// __it point to, assuming that the key is not already present in the set.

// When an exception is thrown during the emplacement, the function will clear the set if the container does not

// have strong exception safety guarantee on emplacement.

/* noexcept */

// C++23 Sequence Container should have insert_range member function

// Note that not all Sequence Containers provide append_range.

// _LIBCPP_STD_VER >= 23

// #define _LIBCPP___FLAT_SET_UTILS_H


=== system/lib/libcxx/include/__format/buffer.h ===
SHA256: 4cb3e076a6f71e26c81875ccb64b0ab4c50a78c754583304abaae689efb2aa6b
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// A helper to limit the total size of code units written.

// This function adjusts the size of a (bulk) write operations. It ensures the

// number of code units written by a __output_buffer never exceeds

// __max_size_ code units.

// The code units that would have been written if there was no limit.

// format_to_n returns this value.

/// A "buffer" that handles writing to the proper iterator.

///

/// This helper is used together with the @ref back_insert_iterator to offer

/// type-erasure for the formatting functions. This reduces the number to

/// template instantiations.

///

/// The design is the following:

/// - There is an external object that connects the buffer to the output.

/// - This buffer object:

///   - inherits publicly from this class.

///   - has a static or dynamic buffer.

///   - has a static member function to make space in its buffer write

///     operations. This can be done by increasing the size of the internal

///     buffer or by writing the contents of the buffer to the output iterator.

///

///     This member function is a constructor argument, so its name is not

///     fixed. The code uses the name __prepare_write.

/// - The number of output code units can be limited by a __max_output_size

///   object. This is used in format_to_n This object:

///   - Contains the maximum number of code units to be written.

///   - Contains the number of code units that are requested to be written.

///     This number is returned to the user of format_to_n.

///   - The write functions call the object's __request_write member function.

///     This function:

///     - Updates the number of code units that are requested to be written.

///     - Returns the number of code units that can be written without

///       exceeding the maximum number of code units to be written.

///

/// Documentation for the buffer usage members:

/// - __ptr_

///   The start of the buffer.

/// - __capacity_

///   The number of code units that can be written. This means

///   [__ptr_, __ptr_ + __capacity_) is a valid range to write to.

/// - __size_

///   The number of code units written in the buffer. The next code unit will

///   be written at __ptr_ + __size_. This __size_ may NOT contain the total

///   number of code units written by the __output_buffer. Whether or not it

///   does depends on the sub-class used. Typically the total number of code

///   units written is not interesting. It is interesting for format_to_n which

///   has its own way to track this number.

///

/// Documentation for the modifying buffer operations:

/// The subclasses have a function with the following signature:

///

///   static void __prepare_write(

///     __output_buffer<_CharT>& __buffer, size_t __code_units);

///

/// This function is called when a write function writes more code units than

/// the buffer's available space. When an __max_output_size object is provided

/// the number of code units is the number of code units returned from

/// __max_output_size::__request_write function.

///

/// - The __buffer contains *this. Since the class containing this function

///   inherits from __output_buffer it's safe to cast it to the subclass being

///   used.

/// - The __code_units is the number of code units the caller will write + 1.

///   - This value does not take the available space of the buffer into account.

///   - The push_back function is more efficient when writing before resizing,

///     this means the buffer should always have room for one code unit. Hence

///     the + 1 is the size.

/// - When the function returns there is room for at least one additional code

///   unit. There is no requirement there is room for __code_units code units:

///   - The class has some "bulk" operations. For example, __copy which copies

///     the contents of a basic_string_view to the output. If the sub-class has

///     a fixed size buffer the size of the basic_string_view may be larger

///     than the buffer. In that case it's impossible to honor the requested

///     size.

///   - When the buffer has room for at least one code unit the function may be

///     a no-op.

/// - When the function makes space for more code units it uses one for these

///   functions to signal the change:

///   - __buffer_flushed()

///     - This function is typically used for a fixed sized buffer.

///     - The current contents of [__ptr_, __ptr_ + __size_) have been

///       processed.

///     - __ptr_ remains unchanged.

///     - __capacity_ remains unchanged.

///     - __size_ will be set to 0.

///   - __buffer_moved(_CharT* __ptr, size_t __capacity)

///     - This function is typically used for a dynamic sized buffer. There the

///       location of the buffer changes due to reallocations.

///     - __ptr_ will be set to __ptr. (This value may be the old value of

///       __ptr_).

///     - __capacity_ will be set to __capacity. (This value may be the old

///       value of __capacity_).

///     - __size_ remains unchanged,

///     - The range [__ptr, __ptr + __size_) contains the original data of the

///       range [__ptr_, __ptr_ + __size_).

///

/// The push_back function expects a valid buffer and a capacity of at least 1.

/// This means:

/// - The class is constructed with a valid buffer,

/// - __buffer_moved is called with a valid buffer is used before the first

///   write operation,

/// - no write function is ever called, or

/// - the class is constructed with a __max_output_size object with __max_size 0.

///

/// The latter option allows formatted_size to use the output buffer without

/// ever writing anything to the buffer.

// Used in std::back_insert_iterator.

// Profiling showed flushing after adding is more efficient than flushing

// when entering the function.

/// Copies the input __str to the buffer.

///

/// Since some of the input is generated by std::to_chars, there needs to be a

/// conversion when _CharT is wchar_t.

// When the underlying iterator is a simple iterator the __capacity_ is

// infinite. For a string or container back_inserter it isn't. This means

// that adding a large string to the buffer can cause some overhead. In that

// case a better approach could be:

// - flush the buffer

// - container.append(__str.begin(), __str.end());

// The same holds true for the fill.

// For transform it might be slightly harder, however the use case for

// transform is slightly less common; it converts hexadecimal values to

// upper case. For integral these strings are short.

// TODO FMT Look at the improvements above.

/// A std::transform wrapper.

///

/// Like @ref __copy it may need to do type conversion.

/// A \c fill_n wrapper.

// Always have space for one additional code unit. This is a precondition of the push_back function.

// TODO(hardening): the following check might not apply to hardened iterators and might need to be wrapped in an

// `#ifdef`.

/// Concept to see whether a \a _Container is insertable.

///

/// The concept is used to validate whether multiple calls to a

/// \ref back_insert_iterator can be replace by a call to \c _Container::insert.

///

/// \note a \a _Container needs to opt-in to the concept by specializing

/// \ref __enable_insertable.

/// Extract the container type of a \ref back_insert_iterator.

// A dynamically growing buffer.

// Since allocating is expensive the class has a small internal buffer. When

// its capacity is exceeded a dynamic buffer will be allocated.

// _CharT is an implicit lifetime type so can be used without explicit

// construction or destruction.

// A buffer that directly writes to the underlying buffer.

// The function format_to expects a buffer large enough for the output. The

// function format_to_n has its own helper class that restricts the number of

// write options. So this function class can pretend to have an infinite

// buffer.

// A buffer that writes its output to the end of a container.

// This class uses a fixed size buffer and appends the elements in

// __buffer_size chunks. An alternative would be to use an allocating buffer

// and append the output in a single write operation. Benchmarking showed no

// performance difference.

// A buffer that writes to an iterator.

//

// Unlike the __container_inserter_buffer this class' performance does benefit

// from allocating and then inserting.

// Selects the type of the buffer used for the output iterator.

// A buffer that counts and limits the number of insertions.

// A buffer that counts the number of insertions.

//

// Since formatted_size only needs to know the size, the output itself is

// discarded.

// This function does not need to be r-value qualified, however this is

// consistent with similar objects.

// Note this function does not satisfy the requirement of giving a 1 code unit buffer.

// A dynamically growing buffer intended to be used for retargeting a context.

//

// P2286 Formatting ranges adds range formatting support. It allows the user to

// specify the minimum width for the entire formatted range.  The width of the

// range is not known until the range is formatted. Formatting is done to an

// output_iterator so there's no guarantee it would be possible to add the fill

// to the front of the output. Instead the range is formatted to a temporary

// buffer and that buffer is formatted as a string.

//

// There is an issue with that approach, the format context used in

// std::formatter<T>::format contains the output iterator used as part of its

// type. So using this output iterator means there needs to be a new format

// context and the format arguments need to be retargeted to the new context.

// This retargeting is done by a basic_format_context specialized for the

// __iterator of this container.

//

// This class uses its own buffer management, since using vector

// would lead to a circular include with formatter for vector<bool>.

// When the initial size is very small a lot of resizes happen

// when elements added. So use a hard-coded minimum size.

//

// Note a size < 2 will not work

// - 0 there is no buffer, while push_back requires 1 empty element.

// - 1 multiplied by the grow factor is 1 and thus the buffer never

//   grows.

// Push_back requires the buffer to have room for at least one character.

// Push_back requires the buffer to have room for at least one character.

// Push_back requires the buffer to have room for at least one character.

// This shouldn't throw, but just to be safe. Note that at -O1 this

// guard is optimized away so there is no runtime overhead.

// namespace __format

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_BUFFER_H


=== system/lib/libcxx/include/__format/concepts.h ===
SHA256: 7333b423c78cabc14f99fecd594758aa481a9a932edc542c2e4f82c809857976
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/// The character type specializations of \ref formatter.

// The output iterator isn't specified. A formatter should accept any

// output_iterator. This iterator is a minimal iterator to test the concept.

// (Note testing for (w)format_context would be a valid choice, but requires

// selecting the proper one depending on the type of _CharT.)

// [tuple.like] defines a tuple-like exposition only concept. This concept is

// not related to that. Therefore it uses a different name for the concept.

//

// TODO FMT Add a test to validate we fail when using that concept after P2165

// has been implemented.

// _LIBCPP_STD_VER >= 23

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_CONCEPTS_H


=== system/lib/libcxx/include/__format/container_adaptor.h ===
SHA256: 7a1518b39802a054ac3c10b234548d1dd14d110d46903daec5b646b3e5223fa4
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [container.adaptors.format] only specifies the library should provide the

// formatter specializations, not which header should provide them.

// Since <format> includes a lot of headers, add these headers here instead of

// adding more dependencies like, locale, optinal, string, tuple, etc. to the

// adaptor headers. To use the format functions users already include <format>.

// _LIBCPP_STD_VER >= 23

// _LIBCPP___FORMAT_CONTAINER_ADAPTOR_H


=== system/lib/libcxx/include/__format/enable_insertable.h ===
SHA256: c641200a886604038bd5cb4cce71bd764333ee58656917b54af3b0bccb4e4473
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/// Opt-in to enable \ref __insertable for a \a _Container.

// namespace __format

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_ENABLE_INSERTABLE_H


=== system/lib/libcxx/include/__format/escaped_output_table.h ===
SHA256: 03f7b32ef74f47f63013eefbf68a657f34ebf175ef27ae237ec349ac674c3af7
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// WARNING, this entire header is generated by

// utils/generate_escaped_output_table.py

// DO NOT MODIFY!

// UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE

//

// See Terms of Use <https://www.unicode.org/copyright.html>

// for definitions of Unicode Inc.'s Data Files and Software.

//

// NOTICE TO USER: Carefully read the following legal agreement.

// BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S

// DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),

// YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE

// TERMS AND CONDITIONS OF THIS AGREEMENT.

// IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE

// THE DATA FILES OR SOFTWARE.

//

// COPYRIGHT AND PERMISSION NOTICE

//

// Copyright (c) 1991-2022 Unicode, Inc. All rights reserved.

// Distributed under the Terms of Use in https://www.unicode.org/copyright.html.

//

// Permission is hereby granted, free of charge, to any person obtaining

// a copy of the Unicode data files and any associated documentation

// (the "Data Files") or Unicode software and any associated documentation

// (the "Software") to deal in the Data Files or Software

// without restriction, including without limitation the rights to use,

// copy, modify, merge, publish, distribute, and/or sell copies of

// the Data Files or Software, and to permit persons to whom the Data Files

// or Software are furnished to do so, provided that either

// (a) this copyright and permission notice appear with all copies

// of the Data Files or Software, or

// (b) this copyright and permission notice appear in associated

// Documentation.

//

// THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS.

// IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS

// NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL

// DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,

// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER

// TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR

// PERFORMANCE OF THE DATA FILES OR SOFTWARE.

//

// Except as contained in this notice, the name of a copyright holder

// shall not be used in advertising or otherwise to promote the sale,

// use or other dealings in these Data Files or Software without prior

// written authorization of the copyright holder.

// clang-format off

/// The entries of the characters to escape in format's debug string.

///

/// Contains the entries for [format.string.escaped]/2.2.1.2.1

///   CE is a Unicode encoding and C corresponds to a UCS scalar value whose

///   Unicode property General_Category has a value in the groups Separator (Z)

///   or Other (C), as described by table 12 of UAX #44

///

/// Separator (Z) consists of General_Category

/// - Space_Separator,

/// - Line_Separator,

/// - Paragraph_Separator.

///

/// Other (C) consists of General_Category

/// - Control,

/// - Format,

/// - Surrogate,

/// - Private_Use,

/// - Unassigned.

///

/// The data is generated from

/// - https://www.unicode.org/Public/UCD/latest/ucd/extracted/DerivedGeneralCategory.txt

///

/// The table is similar to the table

///  __extended_grapheme_custer_property_boundary::__entries

/// which explains the details of these classes. The only difference is this

/// table lacks a property, thus having more bits available for the size.

///

/// The data has 2 values:

/// - bits [0, 13] The size of the range, allowing 16384 elements.

/// - bits [14, 31] The lower bound code point of the range. The upper bound of

///   the range is lower bound + size. Note the code expects code units the fit

///   into 18 bits, instead of the 21 bits needed for the full Unicode range.

/* 00000000 - 00000020 [   33] */

/* 0000007f - 000000a0 [   34] */

/* 000000ad - 000000ad [    1] */

/* 00000378 - 00000379 [    2] */

/* 00000380 - 00000383 [    4] */

/* 0000038b - 0000038b [    1] */

/* 0000038d - 0000038d [    1] */

/* 000003a2 - 000003a2 [    1] */

/* 00000530 - 00000530 [    1] */

/* 00000557 - 00000558 [    2] */

/* 0000058b - 0000058c [    2] */

/* 00000590 - 00000590 [    1] */

/* 000005c8 - 000005cf [    8] */

/* 000005eb - 000005ee [    4] */

/* 000005f5 - 00000605 [   17] */

/* 0000061c - 0000061c [    1] */

/* 000006dd - 000006dd [    1] */

/* 0000070e - 0000070f [    2] */

/* 0000074b - 0000074c [    2] */

/* 000007b2 - 000007bf [   14] */

/* 000007fb - 000007fc [    2] */

/* 0000082e - 0000082f [    2] */

/* 0000083f - 0000083f [    1] */

/* 0000085c - 0000085d [    2] */

/* 0000085f - 0000085f [    1] */

/* 0000086b - 0000086f [    5] */

/* 0000088f - 00000896 [    8] */

/* 000008e2 - 000008e2 [    1] */

/* 00000984 - 00000984 [    1] */

/* 0000098d - 0000098e [    2] */

/* 00000991 - 00000992 [    2] */

/* 000009a9 - 000009a9 [    1] */

/* 000009b1 - 000009b1 [    1] */

/* 000009b3 - 000009b5 [    3] */

/* 000009ba - 000009bb [    2] */

/* 000009c5 - 000009c6 [    2] */

/* 000009c9 - 000009ca [    2] */

/* 000009cf - 000009d6 [    8] */

/* 000009d8 - 000009db [    4] */

/* 000009de - 000009de [    1] */

/* 000009e4 - 000009e5 [    2] */

/* 000009ff - 00000a00 [    2] */

/* 00000a04 - 00000a04 [    1] */

/* 00000a0b - 00000a0e [    4] */

/* 00000a11 - 00000a12 [    2] */

/* 00000a29 - 00000a29 [    1] */

/* 00000a31 - 00000a31 [    1] */

/* 00000a34 - 00000a34 [    1] */

/* 00000a37 - 00000a37 [    1] */

/* 00000a3a - 00000a3b [    2] */

/* 00000a3d - 00000a3d [    1] */

/* 00000a43 - 00000a46 [    4] */

/* 00000a49 - 00000a4a [    2] */

/* 00000a4e - 00000a50 [    3] */

/* 00000a52 - 00000a58 [    7] */

/* 00000a5d - 00000a5d [    1] */

/* 00000a5f - 00000a65 [    7] */

/* 00000a77 - 00000a80 [   10] */

/* 00000a84 - 00000a84 [    1] */

/* 00000a8e - 00000a8e [    1] */

/* 00000a92 - 00000a92 [    1] */

/* 00000aa9 - 00000aa9 [    1] */

/* 00000ab1 - 00000ab1 [    1] */

/* 00000ab4 - 00000ab4 [    1] */

/* 00000aba - 00000abb [    2] */

/* 00000ac6 - 00000ac6 [    1] */

/* 00000aca - 00000aca [    1] */

/* 00000ace - 00000acf [    2] */

/* 00000ad1 - 00000adf [   15] */

/* 00000ae4 - 00000ae5 [    2] */

/* 00000af2 - 00000af8 [    7] */

/* 00000b00 - 00000b00 [    1] */

/* 00000b04 - 00000b04 [    1] */

/* 00000b0d - 00000b0e [    2] */

/* 00000b11 - 00000b12 [    2] */

/* 00000b29 - 00000b29 [    1] */

/* 00000b31 - 00000b31 [    1] */

/* 00000b34 - 00000b34 [    1] */

/* 00000b3a - 00000b3b [    2] */

/* 00000b45 - 00000b46 [    2] */

/* 00000b49 - 00000b4a [    2] */

/* 00000b4e - 00000b54 [    7] */

/* 00000b58 - 00000b5b [    4] */

/* 00000b5e - 00000b5e [    1] */

/* 00000b64 - 00000b65 [    2] */

/* 00000b78 - 00000b81 [   10] */

/* 00000b84 - 00000b84 [    1] */

/* 00000b8b - 00000b8d [    3] */

/* 00000b91 - 00000b91 [    1] */

/* 00000b96 - 00000b98 [    3] */

/* 00000b9b - 00000b9b [    1] */

/* 00000b9d - 00000b9d [    1] */

/* 00000ba0 - 00000ba2 [    3] */

/* 00000ba5 - 00000ba7 [    3] */

/* 00000bab - 00000bad [    3] */

/* 00000bba - 00000bbd [    4] */

/* 00000bc3 - 00000bc5 [    3] */

/* 00000bc9 - 00000bc9 [    1] */

/* 00000bce - 00000bcf [    2] */

/* 00000bd1 - 00000bd6 [    6] */

/* 00000bd8 - 00000be5 [   14] */

/* 00000bfb - 00000bff [    5] */

/* 00000c0d - 00000c0d [    1] */

/* 00000c11 - 00000c11 [    1] */

/* 00000c29 - 00000c29 [    1] */

/* 00000c3a - 00000c3b [    2] */

/* 00000c45 - 00000c45 [    1] */

/* 00000c49 - 00000c49 [    1] */

/* 00000c4e - 00000c54 [    7] */

/* 00000c57 - 00000c57 [    1] */

/* 00000c5b - 00000c5c [    2] */

/* 00000c5e - 00000c5f [    2] */

/* 00000c64 - 00000c65 [    2] */

/* 00000c70 - 00000c76 [    7] */

/* 00000c8d - 00000c8d [    1] */

/* 00000c91 - 00000c91 [    1] */

/* 00000ca9 - 00000ca9 [    1] */

/* 00000cb4 - 00000cb4 [    1] */

/* 00000cba - 00000cbb [    2] */

/* 00000cc5 - 00000cc5 [    1] */

/* 00000cc9 - 00000cc9 [    1] */

/* 00000cce - 00000cd4 [    7] */

/* 00000cd7 - 00000cdc [    6] */

/* 00000cdf - 00000cdf [    1] */

/* 00000ce4 - 00000ce5 [    2] */

/* 00000cf0 - 00000cf0 [    1] */

/* 00000cf4 - 00000cff [   12] */

/* 00000d0d - 00000d0d [    1] */

/* 00000d11 - 00000d11 [    1] */

/* 00000d45 - 00000d45 [    1] */

/* 00000d49 - 00000d49 [    1] */

/* 00000d50 - 00000d53 [    4] */

/* 00000d64 - 00000d65 [    2] */

/* 00000d80 - 00000d80 [    1] */

/* 00000d84 - 00000d84 [    1] */

/* 00000d97 - 00000d99 [    3] */

/* 00000db2 - 00000db2 [    1] */

/* 00000dbc - 00000dbc [    1] */

/* 00000dbe - 00000dbf [    2] */

/* 00000dc7 - 00000dc9 [    3] */

/* 00000dcb - 00000dce [    4] */

/* 00000dd5 - 00000dd5 [    1] */

/* 00000dd7 - 00000dd7 [    1] */

/* 00000de0 - 00000de5 [    6] */

/* 00000df0 - 00000df1 [    2] */

/* 00000df5 - 00000e00 [   12] */

/* 00000e3b - 00000e3e [    4] */

/* 00000e5c - 00000e80 [   37] */

/* 00000e83 - 00000e83 [    1] */

/* 00000e85 - 00000e85 [    1] */

/* 00000e8b - 00000e8b [    1] */

/* 00000ea4 - 00000ea4 [    1] */

/* 00000ea6 - 00000ea6 [    1] */

/* 00000ebe - 00000ebf [    2] */

/* 00000ec5 - 00000ec5 [    1] */

/* 00000ec7 - 00000ec7 [    1] */

/* 00000ecf - 00000ecf [    1] */

/* 00000eda - 00000edb [    2] */

/* 00000ee0 - 00000eff [   32] */

/* 00000f48 - 00000f48 [    1] */

/* 00000f6d - 00000f70 [    4] */

/* 00000f98 - 00000f98 [    1] */

/* 00000fbd - 00000fbd [    1] */

/* 00000fcd - 00000fcd [    1] */

/* 00000fdb - 00000fff [   37] */

/* 000010c6 - 000010c6 [    1] */

/* 000010c8 - 000010cc [    5] */

/* 000010ce - 000010cf [    2] */

/* 00001249 - 00001249 [    1] */

/* 0000124e - 0000124f [    2] */

/* 00001257 - 00001257 [    1] */

/* 00001259 - 00001259 [    1] */

/* 0000125e - 0000125f [    2] */

/* 00001289 - 00001289 [    1] */

/* 0000128e - 0000128f [    2] */

/* 000012b1 - 000012b1 [    1] */

/* 000012b6 - 000012b7 [    2] */

/* 000012bf - 000012bf [    1] */

/* 000012c1 - 000012c1 [    1] */

/* 000012c6 - 000012c7 [    2] */

/* 000012d7 - 000012d7 [    1] */

/* 00001311 - 00001311 [    1] */

/* 00001316 - 00001317 [    2] */

/* 0000135b - 0000135c [    2] */

/* 0000137d - 0000137f [    3] */

/* 0000139a - 0000139f [    6] */

/* 000013f6 - 000013f7 [    2] */

/* 000013fe - 000013ff [    2] */

/* 00001680 - 00001680 [    1] */

/* 0000169d - 0000169f [    3] */

/* 000016f9 - 000016ff [    7] */

/* 00001716 - 0000171e [    9] */

/* 00001737 - 0000173f [    9] */

/* 00001754 - 0000175f [   12] */

/* 0000176d - 0000176d [    1] */

/* 00001771 - 00001771 [    1] */

/* 00001774 - 0000177f [   12] */

/* 000017de - 000017df [    2] */

/* 000017ea - 000017ef [    6] */

/* 000017fa - 000017ff [    6] */

/* 0000180e - 0000180e [    1] */

/* 0000181a - 0000181f [    6] */

/* 00001879 - 0000187f [    7] */

/* 000018ab - 000018af [    5] */

/* 000018f6 - 000018ff [   10] */

/* 0000191f - 0000191f [    1] */

/* 0000192c - 0000192f [    4] */

/* 0000193c - 0000193f [    4] */

/* 00001941 - 00001943 [    3] */

/* 0000196e - 0000196f [    2] */

/* 00001975 - 0000197f [   11] */

/* 000019ac - 000019af [    4] */

/* 000019ca - 000019cf [    6] */

/* 000019db - 000019dd [    3] */

/* 00001a1c - 00001a1d [    2] */

/* 00001a5f - 00001a5f [    1] */

/* 00001a7d - 00001a7e [    2] */

/* 00001a8a - 00001a8f [    6] */

/* 00001a9a - 00001a9f [    6] */

/* 00001aae - 00001aaf [    2] */

/* 00001acf - 00001aff [   49] */

/* 00001b4d - 00001b4d [    1] */

/* 00001bf4 - 00001bfb [    8] */

/* 00001c38 - 00001c3a [    3] */

/* 00001c4a - 00001c4c [    3] */

/* 00001c8b - 00001c8f [    5] */

/* 00001cbb - 00001cbc [    2] */

/* 00001cc8 - 00001ccf [    8] */

/* 00001cfb - 00001cff [    5] */

/* 00001f16 - 00001f17 [    2] */

/* 00001f1e - 00001f1f [    2] */

/* 00001f46 - 00001f47 [    2] */

/* 00001f4e - 00001f4f [    2] */

/* 00001f58 - 00001f58 [    1] */

/* 00001f5a - 00001f5a [    1] */

/* 00001f5c - 00001f5c [    1] */

/* 00001f5e - 00001f5e [    1] */

/* 00001f7e - 00001f7f [    2] */

/* 00001fb5 - 00001fb5 [    1] */

/* 00001fc5 - 00001fc5 [    1] */

/* 00001fd4 - 00001fd5 [    2] */

/* 00001fdc - 00001fdc [    1] */

/* 00001ff0 - 00001ff1 [    2] */

/* 00001ff5 - 00001ff5 [    1] */

/* 00001fff - 0000200f [   17] */

/* 00002028 - 0000202f [    8] */

/* 0000205f - 0000206f [   17] */

/* 00002072 - 00002073 [    2] */

/* 0000208f - 0000208f [    1] */

/* 0000209d - 0000209f [    3] */

/* 000020c1 - 000020cf [   15] */

/* 000020f1 - 000020ff [   15] */

/* 0000218c - 0000218f [    4] */

/* 0000242a - 0000243f [   22] */

/* 0000244b - 0000245f [   21] */

/* 00002b74 - 00002b75 [    2] */

/* 00002b96 - 00002b96 [    1] */

/* 00002cf4 - 00002cf8 [    5] */

/* 00002d26 - 00002d26 [    1] */

/* 00002d28 - 00002d2c [    5] */

/* 00002d2e - 00002d2f [    2] */

/* 00002d68 - 00002d6e [    7] */

/* 00002d71 - 00002d7e [   14] */

/* 00002d97 - 00002d9f [    9] */

/* 00002da7 - 00002da7 [    1] */

/* 00002daf - 00002daf [    1] */

/* 00002db7 - 00002db7 [    1] */

/* 00002dbf - 00002dbf [    1] */

/* 00002dc7 - 00002dc7 [    1] */

/* 00002dcf - 00002dcf [    1] */

/* 00002dd7 - 00002dd7 [    1] */

/* 00002ddf - 00002ddf [    1] */

/* 00002e5e - 00002e7f [   34] */

/* 00002e9a - 00002e9a [    1] */

/* 00002ef4 - 00002eff [   12] */

/* 00002fd6 - 00002fef [   26] */

/* 00003000 - 00003000 [    1] */

/* 00003040 - 00003040 [    1] */

/* 00003097 - 00003098 [    2] */

/* 00003100 - 00003104 [    5] */

/* 00003130 - 00003130 [    1] */

/* 0000318f - 0000318f [    1] */

/* 000031e6 - 000031ee [    9] */

/* 0000321f - 0000321f [    1] */

/* 0000a48d - 0000a48f [    3] */

/* 0000a4c7 - 0000a4cf [    9] */

/* 0000a62c - 0000a63f [   20] */

/* 0000a6f8 - 0000a6ff [    8] */

/* 0000a7ce - 0000a7cf [    2] */

/* 0000a7d2 - 0000a7d2 [    1] */

/* 0000a7d4 - 0000a7d4 [    1] */

/* 0000a7dd - 0000a7f1 [   21] */

/* 0000a82d - 0000a82f [    3] */

/* 0000a83a - 0000a83f [    6] */

/* 0000a878 - 0000a87f [    8] */

/* 0000a8c6 - 0000a8cd [    8] */

/* 0000a8da - 0000a8df [    6] */

/* 0000a954 - 0000a95e [   11] */

/* 0000a97d - 0000a97f [    3] */

/* 0000a9ce - 0000a9ce [    1] */

/* 0000a9da - 0000a9dd [    4] */

/* 0000a9ff - 0000a9ff [    1] */

/* 0000aa37 - 0000aa3f [    9] */

/* 0000aa4e - 0000aa4f [    2] */

/* 0000aa5a - 0000aa5b [    2] */

/* 0000aac3 - 0000aada [   24] */

/* 0000aaf7 - 0000ab00 [   10] */

/* 0000ab07 - 0000ab08 [    2] */

/* 0000ab0f - 0000ab10 [    2] */

/* 0000ab17 - 0000ab1f [    9] */

/* 0000ab27 - 0000ab27 [    1] */

/* 0000ab2f - 0000ab2f [    1] */

/* 0000ab6c - 0000ab6f [    4] */

/* 0000abee - 0000abef [    2] */

/* 0000abfa - 0000abff [    6] */

/* 0000d7a4 - 0000d7af [   12] */

/* 0000d7c7 - 0000d7ca [    4] */

/* 0000d7fc - 0000f8ff [ 8452] */

/* 0000fa6e - 0000fa6f [    2] */

/* 0000fada - 0000faff [   38] */

/* 0000fb07 - 0000fb12 [   12] */

/* 0000fb18 - 0000fb1c [    5] */

/* 0000fb37 - 0000fb37 [    1] */

/* 0000fb3d - 0000fb3d [    1] */

/* 0000fb3f - 0000fb3f [    1] */

/* 0000fb42 - 0000fb42 [    1] */

/* 0000fb45 - 0000fb45 [    1] */

/* 0000fbc3 - 0000fbd2 [   16] */

/* 0000fd90 - 0000fd91 [    2] */

/* 0000fdc8 - 0000fdce [    7] */

/* 0000fdd0 - 0000fdef [   32] */

/* 0000fe1a - 0000fe1f [    6] */

/* 0000fe53 - 0000fe53 [    1] */

/* 0000fe67 - 0000fe67 [    1] */

/* 0000fe6c - 0000fe6f [    4] */

/* 0000fe75 - 0000fe75 [    1] */

/* 0000fefd - 0000ff00 [    4] */

/* 0000ffbf - 0000ffc1 [    3] */

/* 0000ffc8 - 0000ffc9 [    2] */

/* 0000ffd0 - 0000ffd1 [    2] */

/* 0000ffd8 - 0000ffd9 [    2] */

/* 0000ffdd - 0000ffdf [    3] */

/* 0000ffe7 - 0000ffe7 [    1] */

/* 0000ffef - 0000fffb [   13] */

/* 0000fffe - 0000ffff [    2] */

/* 0001000c - 0001000c [    1] */

/* 00010027 - 00010027 [    1] */

/* 0001003b - 0001003b [    1] */

/* 0001003e - 0001003e [    1] */

/* 0001004e - 0001004f [    2] */

/* 0001005e - 0001007f [   34] */

/* 000100fb - 000100ff [    5] */

/* 00010103 - 00010106 [    4] */

/* 00010134 - 00010136 [    3] */

/* 0001018f - 0001018f [    1] */

/* 0001019d - 0001019f [    3] */

/* 000101a1 - 000101cf [   47] */

/* 000101fe - 0001027f [  130] */

/* 0001029d - 0001029f [    3] */

/* 000102d1 - 000102df [   15] */

/* 000102fc - 000102ff [    4] */

/* 00010324 - 0001032c [    9] */

/* 0001034b - 0001034f [    5] */

/* 0001037b - 0001037f [    5] */

/* 0001039e - 0001039e [    1] */

/* 000103c4 - 000103c7 [    4] */

/* 000103d6 - 000103ff [   42] */

/* 0001049e - 0001049f [    2] */

/* 000104aa - 000104af [    6] */

/* 000104d4 - 000104d7 [    4] */

/* 000104fc - 000104ff [    4] */

/* 00010528 - 0001052f [    8] */

/* 00010564 - 0001056e [   11] */

/* 0001057b - 0001057b [    1] */

/* 0001058b - 0001058b [    1] */

/* 00010593 - 00010593 [    1] */

/* 00010596 - 00010596 [    1] */

/* 000105a2 - 000105a2 [    1] */

/* 000105b2 - 000105b2 [    1] */

/* 000105ba - 000105ba [    1] */

/* 000105bd - 000105bf [    3] */

/* 000105f4 - 000105ff [   12] */

/* 00010737 - 0001073f [    9] */

/* 00010756 - 0001075f [   10] */

/* 00010768 - 0001077f [   24] */

/* 00010786 - 00010786 [    1] */

/* 000107b1 - 000107b1 [    1] */

/* 000107bb - 000107ff [   69] */

/* 00010806 - 00010807 [    2] */

/* 00010809 - 00010809 [    1] */

/* 00010836 - 00010836 [    1] */

/* 00010839 - 0001083b [    3] */

/* 0001083d - 0001083e [    2] */

/* 00010856 - 00010856 [    1] */

/* 0001089f - 000108a6 [    8] */

/* 000108b0 - 000108df [   48] */

/* 000108f3 - 000108f3 [    1] */

/* 000108f6 - 000108fa [    5] */

/* 0001091c - 0001091e [    3] */

/* 0001093a - 0001093e [    5] */

/* 00010940 - 0001097f [   64] */

/* 000109b8 - 000109bb [    4] */

/* 000109d0 - 000109d1 [    2] */

/* 00010a04 - 00010a04 [    1] */

/* 00010a07 - 00010a0b [    5] */

/* 00010a14 - 00010a14 [    1] */

/* 00010a18 - 00010a18 [    1] */

/* 00010a36 - 00010a37 [    2] */

/* 00010a3b - 00010a3e [    4] */

/* 00010a49 - 00010a4f [    7] */

/* 00010a59 - 00010a5f [    7] */

/* 00010aa0 - 00010abf [   32] */

/* 00010ae7 - 00010aea [    4] */

/* 00010af7 - 00010aff [    9] */

/* 00010b36 - 00010b38 [    3] */

/* 00010b56 - 00010b57 [    2] */

/* 00010b73 - 00010b77 [    5] */

/* 00010b92 - 00010b98 [    7] */

/* 00010b9d - 00010ba8 [   12] */

/* 00010bb0 - 00010bff [   80] */

/* 00010c49 - 00010c7f [   55] */

/* 00010cb3 - 00010cbf [   13] */

/* 00010cf3 - 00010cf9 [    7] */

/* 00010d28 - 00010d2f [    8] */

/* 00010d3a - 00010d3f [    6] */

/* 00010d66 - 00010d68 [    3] */

/* 00010d86 - 00010d8d [    8] */

/* 00010d90 - 00010e5f [  208] */

/* 00010e7f - 00010e7f [    1] */

/* 00010eaa - 00010eaa [    1] */

/* 00010eae - 00010eaf [    2] */

/* 00010eb2 - 00010ec1 [   16] */

/* 00010ec5 - 00010efb [   55] */

/* 00010f28 - 00010f2f [    8] */

/* 00010f5a - 00010f6f [   22] */

/* 00010f8a - 00010faf [   38] */

/* 00010fcc - 00010fdf [   20] */

/* 00010ff7 - 00010fff [    9] */

/* 0001104e - 00011051 [    4] */

/* 00011076 - 0001107e [    9] */

/* 000110bd - 000110bd [    1] */

/* 000110c3 - 000110cf [   13] */

/* 000110e9 - 000110ef [    7] */

/* 000110fa - 000110ff [    6] */

/* 00011135 - 00011135 [    1] */

/* 00011148 - 0001114f [    8] */

/* 00011177 - 0001117f [    9] */

/* 000111e0 - 000111e0 [    1] */

/* 000111f5 - 000111ff [   11] */

/* 00011212 - 00011212 [    1] */

/* 00011242 - 0001127f [   62] */

/* 00011287 - 00011287 [    1] */

/* 00011289 - 00011289 [    1] */

/* 0001128e - 0001128e [    1] */

/* 0001129e - 0001129e [    1] */

/* 000112aa - 000112af [    6] */

/* 000112eb - 000112ef [    5] */

/* 000112fa - 000112ff [    6] */

/* 00011304 - 00011304 [    1] */

/* 0001130d - 0001130e [    2] */

/* 00011311 - 00011312 [    2] */

/* 00011329 - 00011329 [    1] */

/* 00011331 - 00011331 [    1] */

/* 00011334 - 00011334 [    1] */

/* 0001133a - 0001133a [    1] */

/* 00011345 - 00011346 [    2] */

/* 00011349 - 0001134a [    2] */

/* 0001134e - 0001134f [    2] */

/* 00011351 - 00011356 [    6] */

/* 00011358 - 0001135c [    5] */

/* 00011364 - 00011365 [    2] */

/* 0001136d - 0001136f [    3] */

/* 00011375 - 0001137f [   11] */

/* 0001138a - 0001138a [    1] */

/* 0001138c - 0001138d [    2] */

/* 0001138f - 0001138f [    1] */

/* 000113b6 - 000113b6 [    1] */

/* 000113c1 - 000113c1 [    1] */

/* 000113c3 - 000113c4 [    2] */

/* 000113c6 - 000113c6 [    1] */

/* 000113cb - 000113cb [    1] */

/* 000113d6 - 000113d6 [    1] */

/* 000113d9 - 000113e0 [    8] */

/* 000113e3 - 000113ff [   29] */

/* 0001145c - 0001145c [    1] */

/* 00011462 - 0001147f [   30] */

/* 000114c8 - 000114cf [    8] */

/* 000114da - 0001157f [  166] */

/* 000115b6 - 000115b7 [    2] */

/* 000115de - 000115ff [   34] */

/* 00011645 - 0001164f [   11] */

/* 0001165a - 0001165f [    6] */

/* 0001166d - 0001167f [   19] */

/* 000116ba - 000116bf [    6] */

/* 000116ca - 000116cf [    6] */

/* 000116e4 - 000116ff [   28] */

/* 0001171b - 0001171c [    2] */

/* 0001172c - 0001172f [    4] */

/* 00011747 - 000117ff [  185] */

/* 0001183c - 0001189f [  100] */

/* 000118f3 - 000118fe [   12] */

/* 00011907 - 00011908 [    2] */

/* 0001190a - 0001190b [    2] */

/* 00011914 - 00011914 [    1] */

/* 00011917 - 00011917 [    1] */

/* 00011936 - 00011936 [    1] */

/* 00011939 - 0001193a [    2] */

/* 00011947 - 0001194f [    9] */

/* 0001195a - 0001199f [   70] */

/* 000119a8 - 000119a9 [    2] */

/* 000119d8 - 000119d9 [    2] */

/* 000119e5 - 000119ff [   27] */

/* 00011a48 - 00011a4f [    8] */

/* 00011aa3 - 00011aaf [   13] */

/* 00011af9 - 00011aff [    7] */

/* 00011b0a - 00011bbf [  182] */

/* 00011be2 - 00011bef [   14] */

/* 00011bfa - 00011bff [    6] */

/* 00011c09 - 00011c09 [    1] */

/* 00011c37 - 00011c37 [    1] */

/* 00011c46 - 00011c4f [   10] */

/* 00011c6d - 00011c6f [    3] */

/* 00011c90 - 00011c91 [    2] */

/* 00011ca8 - 00011ca8 [    1] */

/* 00011cb7 - 00011cff [   73] */

/* 00011d07 - 00011d07 [    1] */

/* 00011d0a - 00011d0a [    1] */

/* 00011d37 - 00011d39 [    3] */

/* 00011d3b - 00011d3b [    1] */

/* 00011d3e - 00011d3e [    1] */

/* 00011d48 - 00011d4f [    8] */

/* 00011d5a - 00011d5f [    6] */

/* 00011d66 - 00011d66 [    1] */

/* 00011d69 - 00011d69 [    1] */

/* 00011d8f - 00011d8f [    1] */

/* 00011d92 - 00011d92 [    1] */

/* 00011d99 - 00011d9f [    7] */

/* 00011daa - 00011edf [  310] */

/* 00011ef9 - 00011eff [    7] */

/* 00011f11 - 00011f11 [    1] */

/* 00011f3b - 00011f3d [    3] */

/* 00011f5b - 00011faf [   85] */

/* 00011fb1 - 00011fbf [   15] */

/* 00011ff2 - 00011ffe [   13] */

/* 0001239a - 000123ff [  102] */

/* 0001246f - 0001246f [    1] */

/* 00012475 - 0001247f [   11] */

/* 00012544 - 00012f8f [ 2636] */

/* 00012ff3 - 00012fff [   13] */

/* 00013430 - 0001343f [   16] */

/* 00013456 - 0001345f [   10] */

/* 000143fb - 000143ff [    5] */

/* 00014647 - 000160ff [ 6841] */

/* 0001613a - 000167ff [ 1734] */

/* 00016a39 - 00016a3f [    7] */

/* 00016a5f - 00016a5f [    1] */

/* 00016a6a - 00016a6d [    4] */

/* 00016abf - 00016abf [    1] */

/* 00016aca - 00016acf [    6] */

/* 00016aee - 00016aef [    2] */

/* 00016af6 - 00016aff [   10] */

/* 00016b46 - 00016b4f [   10] */

/* 00016b5a - 00016b5a [    1] */

/* 00016b62 - 00016b62 [    1] */

/* 00016b78 - 00016b7c [    5] */

/* 00016b90 - 00016d3f [  432] */

/* 00016d7a - 00016e3f [  198] */

/* 00016e9b - 00016eff [  101] */

/* 00016f4b - 00016f4e [    4] */

/* 00016f88 - 00016f8e [    7] */

/* 00016fa0 - 00016fdf [   64] */

/* 00016fe5 - 00016fef [   11] */

/* 00016ff2 - 00016fff [   14] */

/* 000187f8 - 000187ff [    8] */

/* 00018cd6 - 00018cfe [   41] */

/* 00018d09 - 0001afef [ 8935] */

/* 0001aff4 - 0001aff4 [    1] */

/* 0001affc - 0001affc [    1] */

/* 0001afff - 0001afff [    1] */

/* 0001b123 - 0001b131 [   15] */

/* 0001b133 - 0001b14f [   29] */

/* 0001b153 - 0001b154 [    2] */

/* 0001b156 - 0001b163 [   14] */

/* 0001b168 - 0001b16f [    8] */

/* 0001b2fc - 0001bbff [ 2308] */

/* 0001bc6b - 0001bc6f [    5] */

/* 0001bc7d - 0001bc7f [    3] */

/* 0001bc89 - 0001bc8f [    7] */

/* 0001bc9a - 0001bc9b [    2] */

/* 0001bca0 - 0001cbff [ 3936] */

/* 0001ccfa - 0001ccff [    6] */

/* 0001ceb4 - 0001ceff [   76] */

/* 0001cf2e - 0001cf2f [    2] */

/* 0001cf47 - 0001cf4f [    9] */

/* 0001cfc4 - 0001cfff [   60] */

/* 0001d0f6 - 0001d0ff [   10] */

/* 0001d127 - 0001d128 [    2] */

/* 0001d173 - 0001d17a [    8] */

/* 0001d1eb - 0001d1ff [   21] */

/* 0001d246 - 0001d2bf [  122] */

/* 0001d2d4 - 0001d2df [   12] */

/* 0001d2f4 - 0001d2ff [   12] */

/* 0001d357 - 0001d35f [    9] */

/* 0001d379 - 0001d3ff [  135] */

/* 0001d455 - 0001d455 [    1] */

/* 0001d49d - 0001d49d [    1] */

/* 0001d4a0 - 0001d4a1 [    2] */

/* 0001d4a3 - 0001d4a4 [    2] */

/* 0001d4a7 - 0001d4a8 [    2] */

/* 0001d4ad - 0001d4ad [    1] */

/* 0001d4ba - 0001d4ba [    1] */

/* 0001d4bc - 0001d4bc [    1] */

/* 0001d4c4 - 0001d4c4 [    1] */

/* 0001d506 - 0001d506 [    1] */

/* 0001d50b - 0001d50c [    2] */

/* 0001d515 - 0001d515 [    1] */

/* 0001d51d - 0001d51d [    1] */

/* 0001d53a - 0001d53a [    1] */

/* 0001d53f - 0001d53f [    1] */

/* 0001d545 - 0001d545 [    1] */

/* 0001d547 - 0001d549 [    3] */

/* 0001d551 - 0001d551 [    1] */

/* 0001d6a6 - 0001d6a7 [    2] */

/* 0001d7cc - 0001d7cd [    2] */

/* 0001da8c - 0001da9a [   15] */

/* 0001daa0 - 0001daa0 [    1] */

/* 0001dab0 - 0001deff [ 1104] */

/* 0001df1f - 0001df24 [    6] */

/* 0001df2b - 0001dfff [  213] */

/* 0001e007 - 0001e007 [    1] */

/* 0001e019 - 0001e01a [    2] */

/* 0001e022 - 0001e022 [    1] */

/* 0001e025 - 0001e025 [    1] */

/* 0001e02b - 0001e02f [    5] */

/* 0001e06e - 0001e08e [   33] */

/* 0001e090 - 0001e0ff [  112] */

/* 0001e12d - 0001e12f [    3] */

/* 0001e13e - 0001e13f [    2] */

/* 0001e14a - 0001e14d [    4] */

/* 0001e150 - 0001e28f [  320] */

/* 0001e2af - 0001e2bf [   17] */

/* 0001e2fa - 0001e2fe [    5] */

/* 0001e300 - 0001e4cf [  464] */

/* 0001e4fa - 0001e5cf [  214] */

/* 0001e5fb - 0001e5fe [    4] */

/* 0001e600 - 0001e7df [  480] */

/* 0001e7e7 - 0001e7e7 [    1] */

/* 0001e7ec - 0001e7ec [    1] */

/* 0001e7ef - 0001e7ef [    1] */

/* 0001e7ff - 0001e7ff [    1] */

/* 0001e8c5 - 0001e8c6 [    2] */

/* 0001e8d7 - 0001e8ff [   41] */

/* 0001e94c - 0001e94f [    4] */

/* 0001e95a - 0001e95d [    4] */

/* 0001e960 - 0001ec70 [  785] */

/* 0001ecb5 - 0001ed00 [   76] */

/* 0001ed3e - 0001edff [  194] */

/* 0001ee04 - 0001ee04 [    1] */

/* 0001ee20 - 0001ee20 [    1] */

/* 0001ee23 - 0001ee23 [    1] */

/* 0001ee25 - 0001ee26 [    2] */

/* 0001ee28 - 0001ee28 [    1] */

/* 0001ee33 - 0001ee33 [    1] */

/* 0001ee38 - 0001ee38 [    1] */

/* 0001ee3a - 0001ee3a [    1] */

/* 0001ee3c - 0001ee41 [    6] */

/* 0001ee43 - 0001ee46 [    4] */

/* 0001ee48 - 0001ee48 [    1] */

/* 0001ee4a - 0001ee4a [    1] */

/* 0001ee4c - 0001ee4c [    1] */

/* 0001ee50 - 0001ee50 [    1] */

/* 0001ee53 - 0001ee53 [    1] */

/* 0001ee55 - 0001ee56 [    2] */

/* 0001ee58 - 0001ee58 [    1] */

/* 0001ee5a - 0001ee5a [    1] */

/* 0001ee5c - 0001ee5c [    1] */

/* 0001ee5e - 0001ee5e [    1] */

/* 0001ee60 - 0001ee60 [    1] */

/* 0001ee63 - 0001ee63 [    1] */

/* 0001ee65 - 0001ee66 [    2] */

/* 0001ee6b - 0001ee6b [    1] */

/* 0001ee73 - 0001ee73 [    1] */

/* 0001ee78 - 0001ee78 [    1] */

/* 0001ee7d - 0001ee7d [    1] */

/* 0001ee7f - 0001ee7f [    1] */

/* 0001ee8a - 0001ee8a [    1] */

/* 0001ee9c - 0001eea0 [    5] */

/* 0001eea4 - 0001eea4 [    1] */

/* 0001eeaa - 0001eeaa [    1] */

/* 0001eebc - 0001eeef [   52] */

/* 0001eef2 - 0001efff [  270] */

/* 0001f02c - 0001f02f [    4] */

/* 0001f094 - 0001f09f [   12] */

/* 0001f0af - 0001f0b0 [    2] */

/* 0001f0c0 - 0001f0c0 [    1] */

/* 0001f0d0 - 0001f0d0 [    1] */

/* 0001f0f6 - 0001f0ff [   10] */

/* 0001f1ae - 0001f1e5 [   56] */

/* 0001f203 - 0001f20f [   13] */

/* 0001f23c - 0001f23f [    4] */

/* 0001f249 - 0001f24f [    7] */

/* 0001f252 - 0001f25f [   14] */

/* 0001f266 - 0001f2ff [  154] */

/* 0001f6d8 - 0001f6db [    4] */

/* 0001f6ed - 0001f6ef [    3] */

/* 0001f6fd - 0001f6ff [    3] */

/* 0001f777 - 0001f77a [    4] */

/* 0001f7da - 0001f7df [    6] */

/* 0001f7ec - 0001f7ef [    4] */

/* 0001f7f1 - 0001f7ff [   15] */

/* 0001f80c - 0001f80f [    4] */

/* 0001f848 - 0001f84f [    8] */

/* 0001f85a - 0001f85f [    6] */

/* 0001f888 - 0001f88f [    8] */

/* 0001f8ae - 0001f8af [    2] */

/* 0001f8bc - 0001f8bf [    4] */

/* 0001f8c2 - 0001f8ff [   62] */

/* 0001fa54 - 0001fa5f [   12] */

/* 0001fa6e - 0001fa6f [    2] */

/* 0001fa7d - 0001fa7f [    3] */

/* 0001fa8a - 0001fa8e [    5] */

/* 0001fac7 - 0001facd [    7] */

/* 0001fadd - 0001fade [    2] */

/* 0001faea - 0001faef [    6] */

/* 0001faf9 - 0001faff [    7] */

/* 0001fb93 - 0001fb93 [    1] */

/* 0001fbfa - 0001ffff [ 1030] */

/* 0002a6e0 - 0002a6ff [   32] */

/* 0002b73a - 0002b73f [    6] */

/* 0002b81e - 0002b81f [    2] */

/* 0002cea2 - 0002ceaf [   14] */

/* 0002ebe1 - 0002ebef [   15] */

/* 0002ee5e - 0002f7ff [ 2466] */

/* 0002fa1e - 0002ffff [ 1506] */

/* 0003134b - 0003134f [    5] */

/// Returns whether the code unit needs to be escaped.

///

/// At the end of the valid Unicode code points space a lot of code points are

/// either reserved or a noncharacter. Adding all these entries to the

/// lookup table would greatly increase the size of the table. Instead these

/// entries are manually processed. In this large area of reserved code points,

/// there is a small area of extended graphemes that should not be escaped

/// unconditionally. This is also manually coded. See the generation script for

/// more details.

///

/// \\pre The code point is a valid Unicode code point.

// The entries in the gap at the end.

// The entries at the end.

// clang-format on

// namespace __escaped_output_table

// _LIBCPP_STD_VER >= 23

// _LIBCPP___FORMAT_ESCAPED_OUTPUT_TABLE_H


=== system/lib/libcxx/include/__format/extended_grapheme_cluster_table.h ===
SHA256: 24b2f08deec29f2bd695b784a84edb4e9e76902e9411da18e3c3ca36f4104c27
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// WARNING, this entire header is generated by

// utils/generate_extended_grapheme_cluster_table.py

// DO NOT MODIFY!

// UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE

//

// See Terms of Use <https://www.unicode.org/copyright.html>

// for definitions of Unicode Inc.'s Data Files and Software.

//

// NOTICE TO USER: Carefully read the following legal agreement.

// BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S

// DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),

// YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE

// TERMS AND CONDITIONS OF THIS AGREEMENT.

// IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE

// THE DATA FILES OR SOFTWARE.

//

// COPYRIGHT AND PERMISSION NOTICE

//

// Copyright (c) 1991-2022 Unicode, Inc. All rights reserved.

// Distributed under the Terms of Use in https://www.unicode.org/copyright.html.

//

// Permission is hereby granted, free of charge, to any person obtaining

// a copy of the Unicode data files and any associated documentation

// (the "Data Files") or Unicode software and any associated documentation

// (the "Software") to deal in the Data Files or Software

// without restriction, including without limitation the rights to use,

// copy, modify, merge, publish, distribute, and/or sell copies of

// the Data Files or Software, and to permit persons to whom the Data Files

// or Software are furnished to do so, provided that either

// (a) this copyright and permission notice appear with all copies

// of the Data Files or Software, or

// (b) this copyright and permission notice appear in associated

// Documentation.

//

// THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS.

// IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS

// NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL

// DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,

// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER

// TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR

// PERFORMANCE OF THE DATA FILES OR SOFTWARE.

//

// Except as contained in this notice, the name of a copyright holder

// shall not be used in advertising or otherwise to promote the sale,

// use or other dealings in these Data Files or Software without prior

// written authorization of the copyright holder.

// Values generated from the data files.

// The properies below aren't stored in the "database".

// Text position properties.

// The code unit has none of above properties.

/// The entries of the extended grapheme cluster bondary property table.

///

/// The data is generated from

/// - https://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakProperty.txt

/// - https://www.unicode.org/Public/UCD/latest/ucd/emoji/emoji-data.txt

///

/// The data has 3 values

/// - bits [0, 3] The property. One of the values generated from the datafiles

///   of \ref __property

/// - bits [4, 10] The size of the range.

/// - bits [11, 31] The lower bound code point of the range. The upper bound of

///   the range is lower bound + size.

///

/// The 7 bits for the size allow a maximum range of 128 elements. Some ranges

/// in the Unicode tables are larger. They are stored in multiple consecutive

/// ranges in the data table. An alternative would be to store the sizes in a

/// separate 16-bit value. The original MSVC STL code had such an approach, but

/// this approach uses less space for the data and is about 4% faster in the

/// following benchmark.

/// libcxx/benchmarks/std_format_spec_string_unicode.bench.cpp

// clang-format off

// clang-format on

/// Returns the extended grapheme cluster bondary property of a code point.

// The algorithm searches for the upper bound of the range and, when found,

// steps back one entry. This algorithm is used since the code point can be

// anywhere in the range. After a lower bound is found the next step is to

// compare whether the code unit is indeed in the range.

//

// Since the entry contains a code unit, size, and property the code point

// being sought needs to be adjusted. Just shifting the code point to the

// proper position doesn't work; suppose an entry has property 0, size 1,

// and lower bound 3. This results in the entry 0x1810.

// When searching for code point 3 it will search for 0x1800, find 0x1810

// and moves to the previous entry. Thus the lower bound value will never

// be found.

// The simple solution is to set the bits belonging to the property and

// size. Then the upper bound for code point 3 will return the entry after

// 0x1810. After moving to the previous entry the algorithm arrives at the

// correct entry.

// namespace __extended_grapheme_custer_property_boundary

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_EXTENDED_GRAPHEME_CLUSTER_TABLE_H


=== system/lib/libcxx/include/__format/format_arg.h ===
SHA256: 4be335de6ca5068318be02947ca81629f9e818e63f326195154d208d65b854b6
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/// The type stored in @ref basic_format_arg.

///

/// @note The 128-bit types are unconditionally in the list to avoid the values

/// of the enums to depend on the availability of 128-bit integers.

///

/// @note The value is stored as a 5-bit value in the __packed_arg_t_bits. This

/// limits the maximum number of elements to 32.

/// When modifying update the test

/// test/libcxx/utilities/format/format.arguments/format.arg/arg_t.compile.pass.cpp

/// It could be packed in 4-bits but that means a new type directly becomes an

/// ABI break. The packed type is 64-bit so this reduces the maximum number of

/// packed elements from 16 to 12.

///

/// @note Some members of this enum are an extension. These extensions need

/// special behaviour in visit_format_arg. There they need to be wrapped in a

/// handle to satisfy the user observable behaviour. The internal function

/// __visit_format_arg doesn't do this wrapping. So in the format functions

/// this function is used to avoid unneeded overhead.

// extension

// extension

// namespace __format

// This function is not user observable, so it can directly use the non-standard

// types of the "variant". See __arg_t for more details.

// _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER

/// Contains the values used in basic_format_arg.

///

/// This is a separate type so it's possible to store the values and types in

/// separate arrays.

/// Contains the implementation for basic_format_arg::handle.

// These constructors contain the exact storage type used. If adjustments are

// required, these will be done in __create_format_arg.

// This function is user facing, so it must wrap the non-standard types of

// the "variant" in a handle to stay conforming. See __arg_t for more details.

// This function is user facing, so it must wrap the non-standard types of

// the "variant" in a handle to stay conforming. See __arg_t for more details.

// _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER

// TODO FMT Implement constrain [format.arg]/4

// Constraints: The template specialization

//   typename Context::template formatter_type<T>

// meets the Formatter requirements ([formatter.requirements]).  The extent

// to which an implementation determines that the specialization meets the

// Formatter requirements is unspecified, except that as a minimum the

// expression

//   typename Context::template formatter_type<T>()

//    .format(declval<const T&>(), declval<Context&>())

// shall be well-formed when treated as an unevaluated operand.

// This function is user facing, so it must wrap the non-standard types of

// the "variant" in a handle to stay conforming. See __arg_t for more details.

// _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_FORMAT_ARG_H


=== system/lib/libcxx/include/__format/format_arg_store.h ===
SHA256: 7fcde5a86cdcc5304eb7aa1f3b53341e6f1a3986fb4108f848995b52e1188d23
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/// \returns The @c __arg_t based on the type of the formatting argument.

///

/// \pre \c __formattable<_Tp, typename _Context::char_type>

// Boolean

// Char

// Signed integers

// Unsigned integers

// Floating-point

// Char pointer

// Char array

// String view

// String

// Pointers

// Handle

//

// Note this version can't be constrained avoiding ambiguous overloads.

// That means it can be instantiated by disabled formatters. To solve this, a

// constrained version for not formattable formatters is added.

// The overload for not formattable types allows triggering the static

// assertion below.

// Pseudo constuctor for basic_format_arg

//

// Modeled after template<class T> explicit basic_format_arg(T& v) noexcept;

// [format.arg]/4-6

// Not all types can be used to directly initialize the

// __basic_format_arg_value.  First handle all types needing adjustment, the

// final else requires no adjustment.

// Using std::size on a character array will add the NUL-terminator to the size.

// When the _Traits or _Allocator are different an implicit conversion will fail.

// Assigns the initial value.

// namespace __format

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_FORMAT_ARG_STORE_H


=== system/lib/libcxx/include/__format/format_args.h ===
SHA256: ac3be19842156fa80ef36a78c6f1b881c86b70c8a00051fd436aefab75bed791
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [format.args]/5

// [Note 1: Implementations are encouraged to optimize the representation of

// basic_format_args for small number of formatting arguments by storing

// indices of type alternatives separately from values and packing the

// former. - end note]

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_FORMAT_ARGS_H


=== system/lib/libcxx/include/__format/format_context.h ===
SHA256: d1d3a6e9db25f8cc81a6643196f567168459caff1767784bd1b00952832f4e7c
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/**
 * Helper to create a basic_format_context.
 *
 * This is needed since the constructor is private.
 */

// The Standard doesn't specify how the locale is stored.

// [format.context]/6

// std::locale locale();

//   Returns: The locale passed to the formatting function if the latter

//   takes one, and std::locale() otherwise.

// This is done by storing the locale of the constructor in this optional. If

// locale() is called and the optional has no value the value will be created.

// This allows the implementation to lazily create the locale.

// TODO FMT Validate whether lazy creation is the best solution.

// Note: the Standard doesn't specify the required constructors.

// A specialization for __retarget_buffer

//

// See __retarget_buffer for the motivation for this specialization.

//

// This context holds a reference to the instance of the basic_format_context

// that is retargeted. It converts a formatting argument when it is requested

// during formatting. It is expected that the usage of the arguments is rare so

// the lookups are not expected to be used often. An alternative would be to

// convert all elements during construction.

//

// The elements of the retargets context are only used when an underlying

// formatter uses a locale specific formatting or an formatting argument is

// part for the format spec. For example

//   format("{:256:{}}", input, 8);

// Here the width of an element in input is determined dynamically.

// Note when the top-level element has no width the retargeting is not needed.

// At the moment it's not possible for formatting to use a re-targeted handle.

// TODO FMT add this when support is needed.

// _LIBCPP_STD_VER >= 26 && _LIBCPP_HAS_EXPLICIT_THIS_PARAMETER

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_FORMAT_CONTEXT_H


=== system/lib/libcxx/include/__format/format_error.h ===
SHA256: 5f2fadfa810370c18294b96821f39431a02ec3e1f97fe47bce2470b819f01d95
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_FORMAT_ERROR_H


=== system/lib/libcxx/include/__format/format_functions.h ===
SHA256: 070c17ca4aa562ceae51d095bbff8cb4cb86e43dc4042984e30f8007738d42fb
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// iter_value_t

// TODO FMT Evaluate which templates should be external templates. This

// improves the efficiency of the header. However since the header is still

// under heavy development and not all classes are stable it makes no sense

// to do this optimization now.

/// Helper class parse and handle argument.

///

/// When parsing a handle which is not enabled the code is ill-formed.

/// This helper uses the parser of the appropriate formatter for the stored type.

// Before calling __parse the proper handler needs to be set with __enable.

// The default handler isn't a core constant expression.

// Dummy format_context only providing the parts used during constant

// validation of the basic_format_string.

// During the compile-time validation nothing needs to be written.

// Therefore all operations of this iterator are a NOP.

// [format.string.std]/8

// If { arg-idopt } is used in a width or precision, the value of the

// corresponding formatting argument is used in its place. If the

// corresponding formatting argument is not of standard signed or unsigned

// integer type, or its value is negative for precision or non-positive for

// width, an exception of type format_error is thrown.

//

// _HasPrecision does the formatter have a precision?

// LWG3720 originally allowed "signed or unsigned integer types", however

// the final version explicitly changed it to "*standard* signed or unsigned

// integer types". It's trivial to use 128-bit integrals in libc++'s

// implementation, but other implementations may not implement it.

// (Using a width or precision, that does not fit in 64-bits, sounds very

// unlikely in real world code.)

// This function is not user facing, so it can directly use the non-standard types of the "variant".

// The arg-id has a format-specifier, advance the input to the format-spec.

// The arg-id has no format-specifier.

// The output is written and __begin points to the next character. So

// start the next iteration.

// The string is an escape character.

// Copy the character to the output verbatim.

// namespace __format

// _LIBCPP_STD_VER >= 26

// The function is _LIBCPP_ALWAYS_INLINE since the compiler is bad at inlining

// https://reviews.llvm.org/D110499#inline-1180704

// TODO FMT Evaluate whether we want to file a Clang bug report regarding this.

// Try constant folding the format string instead of going through the whole formatting machinery. If there is no

// constant folding no extra code should be emitted (with optimizations enabled) and the function returns nullopt. When

// constant folding is successful, the formatting is performed and the resulting string is returned.

// Fold strings not containing '{' or '}' to just return the string

// Make sure the compiler knows this call can be eliminated

// Fold '{}' to the appropriate conversion function

// namespace __format

// TODO FMT This needs to be a template or std::to_chars(floating-point) availability markup

// fires too eagerly, see http://llvm.org/PR61563.

// TODO FMT This needs to be a template or std::to_chars(floating-point) availability markup

// fires too eagerly, see http://llvm.org/PR61563.

// TODO FMT This needs to be a template or std::to_chars(floating-point) availability markup

// fires too eagerly, see http://llvm.org/PR61563.

// TODO FMT This needs to be a template or std::to_chars(floating-point) availability markup

// fires too eagerly, see http://llvm.org/PR61563.

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_FORMAT_FUNCTIONS


=== system/lib/libcxx/include/__format/format_parse_context.h ===
SHA256: 70c1697419a5c06a5865b122af76abc96bbbf3876093317e27c18c7a0a844ad3
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Throws an exception to make the expression a non core constant

// expression as required by:

// [format.parse.ctx]/8

//   Remarks: Let cur-arg-id be the value of next_arg_id_ prior to this

//   call. Call expressions where cur-arg-id >= num_args_ is true are not

//   core constant expressions (7.7 [expr.const]).

// Note: the Throws clause [format.parse.ctx]/9 doesn't specify the

// behavior when id >= num_args_.

// Throws an exception to make the expression a non core constant

// expression as required by:

// [format.parse.ctx]/11

//   Remarks: Call expressions where id >= num_args_ are not core constant

//   expressions ([expr.const]).

// Note: the Throws clause [format.parse.ctx]/10 doesn't specify the

// behavior when id >= num_args_.

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_FORMAT_PARSE_CONTEXT_H


=== system/lib/libcxx/include/__format/format_string.h ===
SHA256: 674f44449afd2d04c16ba00e1cdfc8542a24bdd7024cb8abd4f5e01331facf68
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// iter_value_t

/**
 * The maximum value of a numeric argument.
 *
 * This is used for:
 * * arg-id
 * * width as value or arg-id.
 * * precision as value or arg-id.
 *
 * The value is compatible with the maximum formatting width and precision
 * using the `%*` syntax on a 32-bit system.
 */

// can never be larger than the maximum.

// namespace __detail

/**
 * Parses a number.
 *
 * The number is used for the 31-bit values @em width and @em precision. This
 * allows a maximum value of 2147483647.
 */

/*
   * Limit the input to 9 digits, otherwise we need two checks during every
   * iteration:
   * - Are we at the end of the input?
   * - Does the value exceed width of an uint32_t? (Switching to uint64_t would
   *   have the same issue, but with a higher maximum.)
   */

/*
     * There are more than 9 digits, do additional validations:
     * - Does the 10th digit exceed the maximum allowed value?
     * - Are there more than 10 digits?
     * (More than 10 digits always overflows the maximum.)
     */

/**
 * Multiplexer for all parse functions.
 *
 * The parser will return a pointer beyond the last consumed character. This
 * should be the closing '}' of the arg-id.
 */

// This case is conditionally valid. It's allowed in an arg-id in the

// replacement-field, but not in the std-format-spec. The caller can

// provide a better diagnostic, so accept it here unconditionally.

// namespace __format

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_FORMAT_STRING_H


=== system/lib/libcxx/include/__format/format_to_n_result.h ===
SHA256: 657ac41141157850ea93b8700cc10e8ff93f690323f963da1e65fe4230856a77
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_FORMAT_TO_N_RESULT_H


=== system/lib/libcxx/include/__format/formatter.h ===
SHA256: 5515de2254b6917eda0b8b657c53aaa48b9944e99cb1ab6bdd89d8de09829a92
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/// The default formatter template.

///

/// [format.formatter.spec]/5

/// If F is a disabled specialization of formatter, these values are false:

/// - is_default_constructible_v<F>,

/// - is_copy_constructible_v<F>,

/// - is_move_constructible_v<F>,

/// - is_copy_assignable_v<F>, and

/// - is_move_assignable_v<F>.

// _LIBCPP_STD_VER >= 23

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_FORMATTER_H


=== system/lib/libcxx/include/__format/formatter_bool.h ===
SHA256: 2740ea2acc268c5fa4b60954999690cf6afac546531e486f36c55ea3f2523a96
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Promotes bool to an integral type. This reduces the number of

// instantiations of __format_integer reducing code size.

// _LIBCPP_STD_VER >= 23

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_FORMATTER_BOOL_H


=== system/lib/libcxx/include/__format/formatter_char.h ===
SHA256: 324d8b8dc63c57ff07bfcc4701da40bea1b90f434995bba166905f2f8eefc7eb
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP_STD_VER >= 23

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_FORMATTER_CHAR_H


=== system/lib/libcxx/include/__format/formatter_floating_point.h ===
SHA256: cdd5407f838496e920010406a8b8ba94ebdf7e12cc40fbc0b357a8a9c2acc857
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// https://en.cppreference.com/w/cpp/language/types#cite_note-1

// float             min subnormal: +/-0x1p-149   max: +/- 3.402,823,4 10^38

// double            min subnormal: +/-0x1p-1074  max  +/- 1.797,693,134,862,315,7 10^308

// long double (x86) min subnormal: +/-0x1p-16446 max: +/- 1.189,731,495,357,231,765,021 10^4932

//

// The maximum number of digits required for the integral part is based on the

// maximum's value power of 10. Every power of 10 requires one additional

// decimal digit.

// The maximum number of digits required for the fractional part is based on

// the minimal subnormal hexadecimal output's power of 10. Every division of a

// fraction's binary 1 by 2, requires one additional decimal digit.

//

// The maximum size of a formatted value depends on the selected output format.

// Ignoring the fact the format string can request a precision larger than the

// values maximum required, these values are:

//

// sign                    1 code unit

// __max_integral

// radix point             1 code unit

// __max_fractional

// exponent character      1 code unit

// sign                    1 code unit

// __max_fractional_value

// -----------------------------------

// total                   4 code units extra required.

//

// TODO FMT Optimize the storage to avoid storing digits that are known to be zero.

// https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/

// TODO FMT Add long double specialization when to_chars has proper long double support.

/// Helper class to store the conversion buffer.

///

/// Depending on the maximum size required for a value, the buffer is allocated

/// on the stack or the heap.

// TODO FMT Improve this constructor to do a better estimate.

// When using a scientific formatting with a precision of 6 a stack buffer

// will always suffice. At the moment that isn't important since floats and

// doubles use a stack buffer, unless the precision used in the format string

// is large.

// When supporting long doubles the __max_integral part becomes 4932 which

// may be too much for some platforms. For these cases a better estimate is

// required.

// When the precision is larger than _Traits::__max_fractional the digits in

// the range (_Traits::__max_fractional, precision] will contain the value

// zero. There's no need to request to_chars to write these zeros:

// - When the value is large a temporary heap buffer needs to be allocated.

// - When to_chars writes the values they need to be "copied" to the output:

//   - char: std::fill on the output iterator is faster than std::copy.

//   - wchar_t: same argument as char, but additional std::copy won't work.

//     The input is always a char buffer, so every char in the buffer needs

//     to be converted from a char to a wchar_t.

// The allocated buffer's contents don't need initialization.

/// Points at the beginning of the integral part in the buffer.

///

/// When there's no sign character this points at the start of the buffer.

/// Points at the radix point, when not present it's the same as \ref __last.

/// Points at the exponent character, when not present it's the same as \ref __last.

/// Points beyond the last written element in the buffer.

/// Finds the position of the exponent character 'e' at the end of the buffer.

///

/// Assuming there is an exponent the input will terminate with

/// eSdd and eSdddd (S = sign, d = digit)

///

/// \returns a pointer to the exponent or __last when not found.

// Constrains:

// - There's at least one decimal digit before the radix point.

// - The radix point, when present, is placed before the exponent.

// When the radix point isn't found its position is the exponent instead of

// __result.__last.

// clang-format off

// clang-format on

// H = one or more hex-digits

// S = sign

// D = one or more decimal-digits

// When the fractional part is zero and no precision the output is 0p+0

// else the output is                                              0.HpSD

// So testing the second position can differentiate between these two cases.

// One digit is the minimum

// 0.hpSd

//       ^-- last

//     ^---- integral = end of search

// ^-------- start of search

// 0123456

//

// Four digits is the maximum

// 0.hpSdddd

//          ^-- last

//        ^---- integral = end of search

//    ^-------- start of search

// 0123456789

// clang-format off

// clang-format on

// clang-format off

// clang-format on

// When there's no precision there's no radix point.

// Else the radix point is placed at __precision + 1 from the end.

// By converting __precision to a bool the subtraction can be done

// unconditionally.

// clang-format off

// clang-format on

// In scientific mode if there's a radix point it will always be after

// the first digit. (This is the position __first points at).

// In fixed mode the algorithm truncates trailing spaces and possibly the

// radix point. There's no good guess for the position of the radix point

// therefore scan the output after the first digit.

// clang-format off

// clang-format on

/// Fills the buffer with the data based on the requested formatting.

///

/// This function, when needed, turns the characters to upper case and

/// determines the "interesting" locations which are returned to the caller.

///

/// This means the caller never has to convert the contents of the buffer to

/// upper case or search for radix points and the location of the exponent.

/// This gives a bit of overhead. The original code didn't do that, but due

/// to the number of possible additional work needed to turn this number to

/// the proper output the code was littered with tests for upper cases and

/// searches for radix points and exponents.

/// - When a precision larger than the type's precision is selected

///   additional zero characters need to be written before the exponent.

/// - alternate form needs to add a radix point when not present.

/// - localization needs to do grouping in the integral part.

// TODO FMT _Fp should just be _Tp when to_chars has proper long double support.

// When no radix point or exponent are present __last will be __result.__last.

// Formatted string

// Not yet rendered zeros

// Grouping contains one

// additional character

// sign and (zero padding or alignment)

// integral part

// The output is divided in small groups of numbers to write:

// - A group before the first separator.

// - A separator and a group, repeated for the number of separators.

// - A group after the last separator.

// This loop achieves that process by testing the termination condition

// midway in the loop.

// fractional part

// exponent

// alignment

// _LIBCPP_HAS_LOCALIZATION

// to_chars can return inf, infinity, nan, and nan(n-char-sequence).

// The format library requires inf and nan.

// All in one expression to avoid dangling references.

// [format.string.std]/13

// A zero (0) character preceding the width field pads the field with

// leading zeros (following any indication of sign or base) to the field

// width, except when applied to an infinity or NaN.

/// Writes additional zero's for the precision before the exponent.

/// This is used when the precision requested in the format string is larger

/// than the maximum precision of the floating-point type. These precision

/// digits are always 0.

///

/// \param __exponent           The location of the exponent character.

/// \param __num_trailing_zeros The number of 0's to write before the exponent

///                             character.

// Depending on the std-format-spec string the sign and the value

// might not be outputted together:

// - zero-padding may insert additional '0' characters.

// Therefore the value is processed as a non negative value.

// The function @ref __insert_sign will insert a '-' when the value was

// negative.

// TODO FMT _Fp should just be _Tp when to_chars has proper long double support.

// Force the type of the precision to avoid -1 to become an unsigned value.

// When there is an exponent the point needs to be moved before the

// exponent. When there's no exponent the rotate does nothing. Since

// rotate tests whether the operation is a nop, call it unconditionally.

// The radix point is always placed before the exponent.

// - No exponent needs to point to the new last.

// - An exponent needs to move one position to the right.

// So it's safe to increment the value unconditionally.

// [format.string.std]/6

//   In addition, for g and G conversions, trailing zeros are not removed

//   from the result.

//

// If the type option for a floating-point type is none it may use the

// general formatting, but it's not a g or G conversion. So in that case

// the formatting should not append trailing zeros.

// https://en.cppreference.com/w/c/io/fprintf

// Let P equal the precision if nonzero, 6 if the precision is not

// specified, or 1 if the precision is 0. Then, if a conversion with

// style E would have an exponent of X:

// if P > X >= -4, the conversion is with style f or F and precision P - 1 - X.

// By including the radix point it calculates P - (1 + X)

// otherwise, the conversion is with style e or E and precision P - 1.

// Insert trailing zeros before exponent character.

// When there is a sign output it before the padding. Note the __size

// doesn't need any adjustment, regardless whether the sign is written

// here or in __formatter::__write.

// After the sign is written, zero padding is the same a right alignment

// with '0'.

// namespace __formatter

// _LIBCPP_STD_VER >= 23

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_FORMATTER_FLOATING_POINT_H


=== system/lib/libcxx/include/__format/formatter_integer.h ===
SHA256: cbdfe3402142164dacf8ddca44e57dae0522227cbc732b13ba2ae28aa3331127
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Reduce the number of instantiation of the integer formatter

// Signed integral types.

// Unsigned integral types.

// _LIBCPP_STD_VER >= 23

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_FORMATTER_INTEGER_H


=== system/lib/libcxx/include/__format/formatter_integral.h ===
SHA256: 6a1a2aa2af31ab4a6cf7973ab6abb9c0e07f0c4d8664501be92c48040ecf8ee4
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Generic

//

// No sign added.

/**
 * Determines the required grouping based on the size of the input.
 *
 * The grouping's last element will be repeated. For simplicity this repeating
 * is unwrapped based on the length of the input. (When the input is short some
 * groups are not processed.)
 *
 * @returns The size of the groups to write. This means the number of
 * separator characters written is size() - 1.
 *
 * @note Since zero-sized groups cause issues they are silently ignored.
 *
 * @note The grouping field of the locale is always a @c std::string,
 * regardless whether the @c std::numpunct's type is @c char or @c wchar_t.
 */

// __size <= 0 so the value pushed will be <= *__ptr.

// Proceed to the next group.

// Skip grouping with a width of 0.

//

// Char

//

// cmp_less and cmp_greater can't be used for character types.

// _CharT is signed _Tp is unsigned

// _CharT is unsigned _Tp is signed

//

// Integer

//

/** Wrapper around @ref to_chars, returning the output iterator. */

// TODO FMT Evaluate code overhead due to not calling the internal function

// directly. (Should be zero overhead.)

/**
 * Helper to determine the buffer size to output a integer in Base @em x.
 *
 * There are several overloads for the supported bases. The function uses the
 * base as template argument so it can be used in a constant expression.
 */

// The number of binary digits.

// Reserve space for the '0[Bb]' prefix.

// Reserve space for the sign.

// The number of binary digits.

// Adjust to octal.

// Turn floor to ceil.

// Reserve space for the '0' prefix.

// Reserve space for the sign.

// The floored value.

// Turn floor to ceil.

// Reserve space for the sign.

// The number of binary digits.

// Adjust to hexadecimal.

// Reserve space for the '0[Xx]' prefix.

// Reserve space for the sign.

// [sign][prefix]

// data

// number of separator characters

// Write [sign][prefix].

// Write zero padding.

// Determine padding and write padding.

// Write [sign][prefix].

// The output is divided in small groups of numbers to write:

// - A group before the first separator.

// - A separator and a group, repeated for the number of separators.

// - A group after the last separator.

// This loop achieves that process by testing the termination condition

// midway in the loop.

//

// TODO FMT This loop evaluates the loop invariant `__parser.__type !=

// _Flags::_Type::__hexadecimal_upper_case` for every iteration. (This test

// happens in the __write call.) Benchmark whether making two loops and

// hoisting the invariant is worth the effort.

// Writing the grouped form has more overhead than the normal output

// routines. If there will be no separators written the locale-specific

// form is identical to the normal routine. Test whether to grouped form

// is required.

// __buf contains [sign][prefix]data

//                              ^ location of __first

// The zero padding is done like:

// - Write [sign][prefix]

// - Write data right aligned with '0' as fill character.

// Octal is special; if __value == 0 there's no prefix.

// Depending on the std-format-spec string the sign and the value

// might not be outputted together:

// - alternate form may insert a prefix string.

// - zero-padding may insert additional '0' characters.

// Therefore the value is processed as a positive unsigned value.

// The function @ref __insert_sign will a '-' when the value was negative.

//

// Formatter arithmetic (bool)

//

// namespace __formatter

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_FORMATTER_INTEGRAL_H


=== system/lib/libcxx/include/__format/formatter_output.h ===
SHA256: 7ec53e2d7ab0c3ebdcd521532aa0d463aa0bae4ce92aa41fdf013ca293ca519f
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// The extra padding is divided per [format.string.std]/3

// __before = floor(__fill, 2);

// __after = ceil(__fill, 2);

/// Copy wrapper.

///

/// This uses a "mass output function" of __format::__output_buffer when possible.

/// Transform wrapper.

///

/// This uses a "mass output function" of __format::__output_buffer when possible.

/// Fill wrapper.

///

/// This uses a "mass output function" of __format::__output_buffer when possible.

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP_HAS_UNICODE

// _LIBCPP_HAS_UNICODE

/// Writes the input to the output with the required padding.

///

/// Since the output column width is specified the function can be used for

/// ASCII and Unicode output.

///

/// \pre \a __size <= \a __width. Using this function when this pre-condition

///      doesn't hold incurs an unwanted overhead.

///

/// \param __str       The string to write.

/// \param __out_it    The output iterator to write to.

/// \param __specs     The parsed formatting specifications.

/// \param __size      The (estimated) output column width. When the elements

///                    to be written are ASCII the following condition holds

///                    \a __size == \a __last - \a __first.

///

/// \returns           An iterator pointing beyond the last element written.

///

/// \note The type of the elements in range [\a __first, \a __last) can differ

/// from the type of \a __specs. Integer output uses \c std::to_chars for its

/// conversion, which means the [\a __first, \a __last) always contains elements

/// of the type \c char.

/// \overload

///

/// Calls the function above where \a __size = \a __last - \a __first.

/// Writes a string using format's width estimation algorithm.

///

/// \pre !__specs.__has_precision()

///

/// \note When \c _LIBCPP_HAS_UNICODE is false the function assumes the input is ASCII.

// No padding -> copy the string

// Note when the estimated width is larger than size there's no padding. So

// there's no reason to get the real size when the estimate is larger than or

// equal to the minimum field width.

// namespace __formatter

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_FORMATTER_OUTPUT_H


=== system/lib/libcxx/include/__format/formatter_pointer.h ===
SHA256: 18608fb9d1863db1114a4cf10522e01f7e17731dcd4bf568cec7d1b40c7ea019
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [format.formatter.spec]/2.4

// For each charT, the pointer type specializations template<>

// - struct formatter<nullptr_t, charT>;

// - template<> struct formatter<void*, charT>;

// - template<> struct formatter<const void*, charT>;

// _LIBCPP_STD_VER >= 23

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_FORMATTER_POINTER_H


=== system/lib/libcxx/include/__format/formatter_string.h ===
SHA256: c0fb2d5ac6a08145e11388719f3492c0c7a36f670b5e4b52cf2d17abb934a900
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Formatter const char*.

// Converting the input to a basic_string_view means the data is looped over twice;

// - once to determine the length, and

// - once to process the data.

//

// This sounds slower than writing the output directly. However internally

// the output algorithms have optimizations for "bulk" operations, which

// makes this faster than a single-pass character-by-character output.

// Formatter char*.

// Formatter char[].

// Formatter std::string.

// Drop _Traits and _Allocator to have one std::basic_string formatter.

// Formatter std::string_view.

// Drop _Traits to have one std::basic_string_view formatter.

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP_STD_VER >= 23

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_FORMATTER_STRING_H


=== system/lib/libcxx/include/__format/formatter_tuple.h ===
SHA256: 0ca49afa0be93fb2f2f20e8744d54d5ce43bc0348acbbc15818516a72c783a1b
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Note 'n' is part of the type here

// [format.tuple]/7

//   ... For each element e in underlying_, if e.set_debug_format()

//   is a valid expression, calls e.set_debug_format().

// Unlike the range_formatter we don't guard against evil parsers. Since

// this format-spec never has a format-spec for the underlying type

// adding the test would give additional overhead.

// The size of the buffer needed is:

// - open bracket characters

// - close bracket character

// - n elements where every element may have a different size

// - (n -1) separators

// The size of the element is hard to predict, knowing the type helps but

// it depends on the format-spec. As an initial estimate we guess 6

// characters.

// Typically both brackets are 1 character and the separator is 2

// characters. Which means there will be

//   (n - 1) * 2 + 1 + 1 = n * 2 character

// So estimate 8 times the range size as buffer.

// _LIBCPP_STD_VER >= 23

// _LIBCPP___FORMAT_FORMATTER_TUPLE_H


=== system/lib/libcxx/include/__format/indic_conjunct_break_table.h ===
SHA256: 2b5f04dc15d1d3244e355ec4fe8ccc5932c658ae42ffba5a0ce43e2420ed99f7
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// WARNING, this entire header is generated by

// utils/generate_indic_conjunct_break_table.py

// DO NOT MODIFY!

// UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE

//

// See Terms of Use <https://www.unicode.org/copyright.html>

// for definitions of Unicode Inc.'s Data Files and Software.

//

// NOTICE TO USER: Carefully read the following legal agreement.

// BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S

// DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),

// YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE

// TERMS AND CONDITIONS OF THIS AGREEMENT.

// IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE

// THE DATA FILES OR SOFTWARE.

//

// COPYRIGHT AND PERMISSION NOTICE

//

// Copyright (c) 1991-2022 Unicode, Inc. All rights reserved.

// Distributed under the Terms of Use in https://www.unicode.org/copyright.html.

//

// Permission is hereby granted, free of charge, to any person obtaining

// a copy of the Unicode data files and any associated documentation

// (the "Data Files") or Unicode software and any associated documentation

// (the "Software") to deal in the Data Files or Software

// without restriction, including without limitation the rights to use,

// copy, modify, merge, publish, distribute, and/or sell copies of

// the Data Files or Software, and to permit persons to whom the Data Files

// or Software are furnished to do so, provided that either

// (a) this copyright and permission notice appear with all copies

// of the Data Files or Software, or

// (b) this copyright and permission notice appear in associated

// Documentation.

//

// THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS.

// IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS

// NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL

// DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,

// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER

// TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR

// PERFORMANCE OF THE DATA FILES OR SOFTWARE.

//

// Except as contained in this notice, the name of a copyright holder

// shall not be used in advertising or otherwise to promote the sale,

// use or other dealings in these Data Files or Software without prior

// written authorization of the copyright holder.

// Values generated from the data files.

// The code unit has none of above properties.

/// The entries of the indic conjunct break property table.

///

/// The data is generated from

/// -  https://www.unicode.org/Public/UCD/latest/ucd/DerivedCoreProperties.txt

///

/// The data has 3 values

/// - bits [0, 1] The property. One of the values generated from the datafiles

///   of \ref __property

/// - bits [2, 10] The size of the range.

/// - bits [11, 31] The lower bound code point of the range. The upper bound of

///   the range is lower bound + size.

///

/// The 9 bits for the size allow a maximum range of 512 elements. Some ranges

/// in the Unicode tables are larger. They are stored in multiple consecutive

/// ranges in the data table. An alternative would be to store the sizes in a

/// separate 16-bit value. The original MSVC STL code had such an approach, but

/// this approach uses less space for the data and is about 4% faster in the

/// following benchmark.

/// libcxx/benchmarks/std_format_spec_string_unicode.bench.cpp

// clang-format off

// clang-format on

/// Returns the indic conjuct break property of a code point.

// The algorithm searches for the upper bound of the range and, when found,

// steps back one entry. This algorithm is used since the code point can be

// anywhere in the range. After a lower bound is found the next step is to

// compare whether the code unit is indeed in the range.

//

// Since the entry contains a code unit, size, and property the code point

// being sought needs to be adjusted. Just shifting the code point to the

// proper position doesn't work; suppose an entry has property 0, size 1,

// and lower bound 3. This results in the entry 0x1810.

// When searching for code point 3 it will search for 0x1800, find 0x1810

// and moves to the previous entry. Thus the lower bound value will never

// be found.

// The simple solution is to set the bits belonging to the property and

// size. Then the upper bound for code point 3 will return the entry after

// 0x1810. After moving to the previous entry the algorithm arrives at the

// correct entry.

// namespace __indic_conjunct_break

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_INDIC_CONJUNCT_BREAK_TABLE_H


=== system/lib/libcxx/include/__format/parser_std_format_spec.h ===
SHA256: e790275c1be8b3e3fac3146dd6e753b5180289e96020f3af8bdf7c2c35304a7a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/// \file Contains the std-format-spec parser.

///

/// Most of the code can be reused in the chrono-format-spec.

/// This header has some support for the chrono-format-spec since it doesn't

/// affect the std-format-spec.

// iter_value_t

// This function is a wrapper to call the real parser. But it does the

// validation for the pre-conditions and post-conditions.

// [format.string.std]/8

//   If the corresponding formatting argument is not of integral type...

// This wording allows char and bool too. LWG-3720 changes the wording to

//    If the corresponding formatting argument is not of standard signed or

//    unsigned integer type,

// This means the 128-bit will not be valid anymore.

// TODO FMT Verify this resolution is accepted and add a test to verify

//          128-bit integrals fail and switch to visit_format_arg.

// [format.string.std]/8

// If { arg-idopt } is used in a width or precision, the value of the

// corresponding formatting argument is used in its place. If the

// corresponding formatting argument is not of standard signed or unsigned

// integer type, or its value is negative for precision or non-positive for

// width, an exception of type format_error is thrown.

//

// When an integral is used in a format function, it is stored as one of

// the types checked below. Other integral types are promoted. For example,

// a signed char is stored as an int.

//

/// These fields are a filter for which elements to parse.

///

/// They default to false so when a new field is added it needs to be opted in

/// explicitly.

// Determines the valid values for fill.

//

// Originally the fill could be any character except { and }. Range-based

// formatters use the colon to mark the beginning of the

// underlying-format-spec. To avoid parsing ambiguities these formatter

// specializations prohibit the use of the colon as a fill character.

// By not placing this constant in the formatter class it's not duplicated for

// char and wchar_t.

/// No alignment is set in the format string.

/// No sign is set in the format string.

///

/// The sign isn't allowed for certain format-types. By using this value

/// it's possible to detect whether or not the user explicitly set the sign

/// flag. For formatting purposes it behaves the same as \ref __minus.

//

//

//

//

//

// The fill UCS scalar value.

//

// This is always an array, with 1, 2, or 4 elements.

// The size of the data structure is always 32-bits.

/// Contains the parsed formatting specifications.

///

/// This contains information for both the std-format-spec and the

/// chrono-format-spec. This results in some unused members for both

/// specifications. However these unused members don't increase the size

/// of the structure.

///

/// This struct doesn't cross ABI boundaries so its layout doesn't need to be

/// kept stable.

// The field __alignment_ is the first element in __std_ and __chrono_.

// This allows the code to always inspect this value regards which member

// of the union is the active member [class.union.general]/2.

//

// This is needed since the generic output routines handle the alignment of

// the output.

/// The requested width.

///

/// When the format-spec used an arg-id for this field it has already been

/// replaced with the value of that arg-id.

/// The requested precision.

///

/// When the format-spec used an arg-id for this field it has already been

/// replaced with the value of that arg-id.

// Validate the struct is small and cheap to copy since the struct is passed by

// value in formatting functions.

/// The parser for the std-format-spec.

///

/// Note this class is a member of std::formatter specializations. It's

/// expected developers will create their own formatter specializations that

/// inherit from the std::formatter specializations. This means this class

/// must be ABI stable. To aid the stability the unused bits in the class are

/// set to zero. That way they can be repurposed if a future revision of the

/// Standards adds new fields to std-format-spec.

// Parses the format specification.

//

// Depending on whether the parsing is done compile-time or run-time

// the method slightly differs.

// - Only parses a field when it is in the __fields. Accepting all

//   fields and then validating the valid ones has a performance impact.

//   This is faster but gives slighly worse error messages.

// - At compile-time when a field is not accepted the parser will still

//   parse it and give an error when it's present. This gives a more

//   accurate error.

// The idea is that most times the format instead of the vformat

// functions are used. In that case the error will be detected during

// compilation and there is no need to pay for the run-time overhead.

// Validates the selected the parsed data.

//

// The valid fields in the parser may depend on the display type

// selected. But the type is the last optional field, so by the time

// it's known an option can't be used, it already has been parsed.

// This does the validation again.

//

// For example an integral may have a sign, zero-padding, or alternate

// form when the type option is not 'c'. So the generic approach is:

//

// typename _ParseContext::iterator __result = __parser_.__parse(__ctx, __format_spec::__fields_integral);

// if (__parser.__type_ == __format_spec::__type::__char) {

//   __parser.__validate((__format_spec::__fields_bool, "an integer");

//   ... // more char adjustments

// } else {

//   ... // validate an integral type.

// }

//

// For some types all valid options need a second validation run, like

// boolean types.

//

// Depending on whether the validation is done at compile-time or

// run-time the error differs

// - run-time the exception is thrown and contains the type of field

//   being validated.

// - at compile-time the line with `std::__throw_format_error` is shown

//   in the output. In that case it's important for the error to be on one

//   line.

// Note future versions of C++ may allow better compile-time error

// reporting.

// Works both when the precision has a value or an arg-id.

/// \returns the `__parsed_specifications` with the resolved dynamic sizes..

// These flags are only used for formatting chrono. Since the struct has

// padding space left it's added to this structure.

// These two flags are only used internally and not part of the

// __parsed_specifications. Therefore put them at the end.

/// The requested width, either the value or the arg-id.

/// The requested precision, either the value or the arg-id.

// The forbidden fill characters all code points formed from a single code unit, thus the

// check can be omitted when more code units are used.

// range-fill and tuple-fill are identical

// The forbidden fill characters all are code points encoded

// in one code unit, thus the check can be omitted when more

// code units are used.

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP_HAS_UNICODE

// range-fill and tuple-fill are identical

// _LIBCPP_HAS_UNICODE

// Determines the type. It does not validate whether the selected type is

// valid. Most formatters have optional fields that are only allowed for

// certain types. These parsers need to do validation after the type has

// been parsed. So its easier to implement the validation for all types in

// the specific parse function.

// Validates whether the reserved bitfields don't change the size.

// Precision specific behavior will be handled later.

// Set the default precision for the call to to_chars.

/// The number of output columns.

/// One beyond the last code unit used in the estimation.

///

/// This limits the original output to fit in the wanted number of columns.

/// Since a column width can be two it's possible that the requested column

/// width can't be achieved. Depending on the intended usage the policy can be

/// selected.

/// - When used as precision the maximum width may not be exceeded and the

///   result should be "rounded down" to the previous boundary.

/// - When used as a width we're done once the minimum is reached, but

///   exceeding is not an issue. Rounding down is an issue since that will

///   result in writing fill characters. Therefore the result needs to be

///   "rounded up".

// When the next entry would exceed the maximum width the previous width

// might be returned. For example when a width of 100 is requested the

// returned width might be 99, since the next code point has an estimated

// column width of 2. This depends on the rounding flag.

// When the maximum is exceeded the loop will abort the next iteration.

// namespace __detail

// Unicode can be stored in several formats: UTF-8, UTF-16, and UTF-32.

// Depending on format the relation between the number of code units stored and

// the number of output columns differs. The first relation is the number of

// code units forming a code point. (The text assumes the code units are

// unsigned.)

// - UTF-8 The number of code units is between one and four. The first 127

//   Unicode code points match the ASCII character set. When the highest bit is

//   set it means the code point has more than one code unit.

// - UTF-16: The number of code units is between 1 and 2. When the first

//   code unit is in the range [0xd800,0xdfff) it means the code point uses two

//   code units.

// - UTF-32: The number of code units is always one.

//

// The code point to the number of columns is specified in

// [format.string.std]/11. This list might change in the future.

//

// Another thing to be taken into account is Grapheme clustering. This means

// that in some cases multiple code points are combined one element in the

// output. For example:

// - an ASCII character with a combined diacritical mark

// - an emoji with a skin tone modifier

// - a group of combined people emoji to create a family

// - a combination of flag emoji

//

// See also:

// - [format.string.general]/11

// - https://en.wikipedia.org/wiki/UTF-8#Encoding

// - https://en.wikipedia.org/wiki/UTF-16#U+D800_to_U+DFFF

/// Determines the number of output columns needed to render the input.

///

/// \note When the scanner encounters malformed Unicode it acts as-if every

/// code unit is a one column code point. Typically a terminal uses the same

/// strategy and replaces every malformed code unit with a one column

/// replacement character.

///

/// \param __first    Points to the first element of the input range.

/// \param __last     Points beyond the last element of the input range.

/// \param __maximum  The maximum number of output columns. The returned number

///                   of estimated output columns will not exceed this value.

/// \param __rounding Selects the rounding method.

///                   \c __down result.__width_ <= __maximum

///                   \c __up result.__width_ <= __maximum + 1

// The width estimation is done in two steps:

// - Quickly process for the ASCII part. ASCII has the following properties

//   - One code unit is one code point

//   - Every code point has an estimated width of one

// - When needed it will a Unicode Grapheme clustering algorithm to find

//   the proper place for truncation.

// ASCII has one caveat; when an ASCII character is followed by a non-ASCII

// character they might be part of an extended grapheme cluster. For example:

//   an ASCII letter and a COMBINING ACUTE ACCENT

// The truncate should happen after the COMBINING ACUTE ACCENT. Therefore we

// need to scan one code unit beyond the requested precision. When this code

// unit is non-ASCII we omit the current code unit and let the Grapheme

// clustering algorithm do its work.

// _LIBCPP_HAS_UNICODE

// When Unicode isn't supported assume ASCII and every code unit is one code

// point. In ASCII the estimated column width is always one. Thus there's no

// need for rounding.

// _LIBCPP_HAS_UNICODE

// namespace __format_spec

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_PARSER_STD_FORMAT_SPEC_H


=== system/lib/libcxx/include/__format/range_default_formatter.h ===
SHA256: 80e0a094811c07c09ad5aa6edee8476f8d1c43a31f1c3b79694549829276a0a5
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// This shadows map, set, and string.

// There is no definition of this struct, it's purely intended to be used to

// generate diagnostics.

// [format.range.fmtkind]/1

// A program that instantiates the primary template of format_kind is ill-formed.

// [format.range.fmtkind]/2

// 2.1 If same_as<remove_cvref_t<ranges::range_reference_t<R>>, R> is true,

// Otherwise format_kind<R> is range_format::disabled.

// 2.2 Otherwise, if the qualified-id R::key_type is valid and denotes a type:

// 2.2.1 If the qualified-id R::mapped_type is valid and denotes a type ...

// 2.2.1 ... If either U is a specialization of pair or U is a specialization

// of tuple and tuple_size_v<U> == 2

// 2.2.2 Otherwise format_kind<R> is range_format::set.

// 2.3 Otherwise, format_kind<R> is range_format::sequence.

// Required specializations

// This deviates from the Standard, there the exposition only type is

//   formatter<basic_string<charT>, charT> underlying_;

// Using a string_view allows the format function to avoid a copy of the

// input range when it is a contigious range.

// When the range is contiguous use a basic_string_view instead to avoid a

// copy of the underlying data. The basic_string_view formatter

// specialization is the "basic" string formatter in libc++.

// _LIBCPP_STD_VER >= 23

// _LIBCPP___FORMAT_RANGE_DEFAULT_FORMATTER_H


=== system/lib/libcxx/include/__format/range_formatter.h ===
SHA256: 694dd7b2b6c40f3163a018d54fcda5e2548edb5ab86159c408074ea66336dbd5
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Note the cases where __begin == __end in this code only happens when the

// replacement-field has no terminating }, or when the parse is manually

// called with a format-spec. The former is an error and the latter means

// using a formatter without the format functions or print.

// The n field overrides a possible m type, therefore delay applying the

// effect of n until the type has been procesed.

// range-underlying-spec:

//   :  format-spec

// When there is no underlaying range the current parse should have

// consumed the format-spec. If not, the not consumed input will be

// processed by the underlying. For example {:-} for a range in invalid,

// the sign field is not present. Without this check the underlying_ will

// get -} as input which my be valid.

// This test should not be required if __has_range_underlying_spec is false.

// However this test makes sure the underlying formatter left the parser in

// a valid state. (Note this is not a full protection against evil parsers.

// For example

//   } this is test for the next argument {}

//   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

// could consume more than it should.

// [format.range.formatter]/6

//   If the range-type is s or ?s, then there shall be no n option and no

//   range-underlying-spec.

// The size of the buffer needed is:

// - open bracket characters

// - close bracket character

// - n elements where every element may have a different size

// - (n -1) separators

// The size of the element is hard to predict, knowing the type helps but

// it depends on the format-spec. As an initial estimate we guess 6

// characters.

// Typically both brackets are 1 character and the separator is 2

// characters. Which means there will be

//   (n - 1) * 2 + 1 + 1 = n * 2 character

// So estimate 8 times the range size as buffer.

// When the range is contiguous use a basic_string_view instead to avoid a

// copy of the underlying data. The basic_string_view formatter

// specialization is the "basic" string formatter in libc++.

// _LIBCPP_STD_VER >= 23

// _LIBCPP___FORMAT_RANGE_FORMATTER_H


=== system/lib/libcxx/include/__format/unicode.h ===
SHA256: a1671fd161def8be5760784a12355a757901346acfdf8667b7875132a1b27143
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// iter_value_t

// Helper struct for the result of a consume operation.

//

// The status value for a correct code point is 0. This allows a valid value to

// be used without masking.

// When the decoding fails it know the number of code units affected. For the

// current use-cases that value is not needed, therefore it is not stored.

// The escape routine needs the number of code units for both a valid and

// invalid character and keeps track of it itself. Doing it in this result

// unconditionally would give some overhead when the value is unneeded.

// When __status == __ok it contains the decoded code point.

// Else it contains the replacement character U+FFFD

// Consumed a well-formed code point.

// Encountered invalid UTF-8

/// Implements the grapheme cluster boundary rules

///

/// These rules are used to implement format's width estimation as stated in

/// [format.string.std]/11

///

/// The Standard refers to UAX \#29 for Unicode 12.0.0

/// https://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundary_Rules

///

/// The data tables used are

/// https://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakProperty.txt

/// https://www.unicode.org/Public/UCD/latest/ucd/emoji/emoji-data.txt

/// https://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakTest.txt (for testing only)

// The error of a consume operation.

//

// This sets the code point to the replacement character. This code point does

// not participate in the grapheme clustering, so grapheme clustering code can

// ignore the error status and always use the code point.

// https://www.unicode.org/glossary/#surrogate_code_point

// https://www.unicode.org/glossary/#code_point

// https://www.unicode.org/glossary/#unicode_scalar_value

/// Helper class to extract a code unit from a Unicode character range.

///

/// The stored range is a view. There are multiple specialization for different

/// character types.

/// UTF-8 specialization.

// https://www.unicode.org/versions/latest/ch03.pdf#G7404

// Based on Table 3-7, Well-Formed UTF-8 Byte Sequences

//

// Code Points        First Byte Second Byte Third Byte Fourth Byte  Remarks

// U+0000..U+007F     00..7F                                         U+0000..U+007F 1 code unit range

//                    C0..C1     80..BF                              invalid overlong encoding

// U+0080..U+07FF     C2..DF     80..BF                              U+0080..U+07FF 2 code unit range

//                    E0         80..9F      80..BF                  invalid overlong encoding

// U+0800..U+0FFF     E0         A0..BF      80..BF                  U+0800..U+FFFF 3 code unit range

// U+1000..U+CFFF     E1..EC     80..BF      80..BF

// U+D000..U+D7FF     ED         80..9F      80..BF

// U+D800..U+DFFF     ED         A0..BF      80..BF                  invalid encoding of surrogate code point

// U+E000..U+FFFF     EE..EF     80..BF      80..BF

//                    F0         80..8F      80..BF     80..BF       invalid overlong encoding

// U+10000..U+3FFFF   F0         90..BF      80..BF     80..BF       U+10000..U+10FFFF 4 code unit range

// U+40000..U+FFFFF   F1..F3     80..BF      80..BF     80..BF

// U+100000..U+10FFFF F4         80..8F      80..BF     80..BF

//                    F4         90..BF      80..BF     80..BF       U+110000.. invalid code point range

//

// Unlike other parsers, these invalid entries are tested after decoding.

// - The parser always needs to consume these code units

// - The code is optimized for well-formed UTF-8

// Based on the number of leading 1 bits the number of code units in the

// code point can be determined. See

// https://en.wikipedia.org/wiki/UTF-8#Encoding

// These values should be encoded in 1 UTF-8 code unit.

// These values should be encoded in 1 or 2 UTF-8 code units.

// A surrogate value is always encoded in 3 UTF-8 code units.

// These values should be encoded in 1, 2, or 3 UTF-8 code units.

// A value too large is always encoded in 4 UTF-8 code units.

// An invalid number of leading ones can be garbage or a code unit in the

// middle of a code point. By consuming one code unit the parser may get

// "in sync" after a few code units.

/// This specialization depends on the size of wchar_t

/// - 2 UTF-16 (for example Windows and AIX)

/// - 4 UTF-32 (for example Linux)

// _LIBCPP_HAS_WIDE_CHARACTERS

// State machine to implement the Extended Grapheme Cluster Boundary

//

// The exact rules may change between Unicode versions.

// This implements the extended rules see

// https://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries

// Initializes the active rule.

// The code point whose break propery are considered during the next

// evaluation cyle.

// The naming of the identifiers matches the Unicode standard.

// NOLINTBEGIN(readability-identifier-naming)

// *** Break at the start and end of text, unless the text is empty. ***

// GB1

// GB2

// *** Do not break between a CR and LF. Otherwise, break before and after controls. ***

// GB3

// GB4

// GB5

// *** Do not break Hangul syllable sequences. ***

// GB6

// GB7

// GB8

// *** Do not break before extending characters or ZWJ. ***

// GB9

// *** Do not break before SpacingMarks, or after Prepend characters. ***

// GB9a

// GB9b

// *** Do not break within certain combinations with Indic_Conjunct_Break (InCB)=Linker. ***

// *** Do not break within emoji modifier sequences or emoji zwj sequences. ***

// *** Do not break within emoji flag sequences ***

// That is, do not break between regional indicator (RI) symbols if there

// is an odd number of RI characters before the break point.

// GB12 + GB13

// *** Otherwise, break everywhere. ***

// GB999

// NOLINTEND(readability-identifier-naming)

/// Helper class to extract an extended grapheme cluster from a Unicode character range.

///

/// This function is used to determine the column width of an extended grapheme

/// cluster. In order to do that only the first code point is evaluated.

/// Therefore only this code point is extracted.

/// The first code point of the extended grapheme cluster.

///

/// The first code point is used to estimate the width of the extended

/// grapheme cluster.

/// Points one beyond the last code unit in the extended grapheme cluster.

///

/// It's expected the caller has the start position and thus can determine

/// the code unit range of the extended grapheme cluster.

// _LIBCPP_HAS_UNICODE

// For ASCII every character is a "code point".

// This makes it easier to write code agnostic of the _LIBCPP_HAS_UNICODE define.

// _LIBCPP_HAS_UNICODE

// namespace __unicode

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_UNICODE_H


=== system/lib/libcxx/include/__format/width_estimation_table.h ===
SHA256: 529e9ac6a6e36234dc9b897bffe7e38f1268fd75ee858653d3647139163d327a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// WARNING, this entire header is generated by

// utils/generate_width_estimation_table.py

// DO NOT MODIFY!

// UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE

//

// See Terms of Use <https://www.unicode.org/copyright.html>

// for definitions of Unicode Inc.'s Data Files and Software.

//

// NOTICE TO USER: Carefully read the following legal agreement.

// BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S

// DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),

// YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE

// TERMS AND CONDITIONS OF THIS AGREEMENT.

// IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE

// THE DATA FILES OR SOFTWARE.

//

// COPYRIGHT AND PERMISSION NOTICE

//

// Copyright (c) 1991-2022 Unicode, Inc. All rights reserved.

// Distributed under the Terms of Use in https://www.unicode.org/copyright.html.

//

// Permission is hereby granted, free of charge, to any person obtaining

// a copy of the Unicode data files and any associated documentation

// (the "Data Files") or Unicode software and any associated documentation

// (the "Software") to deal in the Data Files or Software

// without restriction, including without limitation the rights to use,

// copy, modify, merge, publish, distribute, and/or sell copies of

// the Data Files or Software, and to permit persons to whom the Data Files

// or Software are furnished to do so, provided that either

// (a) this copyright and permission notice appear with all copies

// of the Data Files or Software, or

// (b) this copyright and permission notice appear in associated

// Documentation.

//

// THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS.

// IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS

// NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL

// DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,

// DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER

// TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR

// PERFORMANCE OF THE DATA FILES OR SOFTWARE.

//

// Except as contained in this notice, the name of a copyright holder

// shall not be used in advertising or otherwise to promote the sale,

// use or other dealings in these Data Files or Software without prior

// written authorization of the copyright holder.

/// The entries of the characters with an estimated width of 2.

///

/// Contains the entries for [format.string.std]/12

///  -  Any code point with the East_Asian_Width="W" or East_Asian_Width="F"

///     Derived Extracted Property as described by UAX #44

/// - U+4DC0 - U+4DFF (Yijing Hexagram Symbols)

/// - U+1F300 - U+1F5FF (Miscellaneous Symbols and Pictographs)

/// - U+1F900 - U+1F9FF (Supplemental Symbols and Pictographs)

///

/// The data is generated from

/// - https://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt

/// - The "overrides" in [format.string.std]/12

///

/// The format of EastAsianWidth.txt is two fields separated by a semicolon.

/// Field 0: Unicode code point value or range of code point values

/// Field 1: East_Asian_Width property, consisting of one of the following values:

///         "A", "F", "H", "N", "Na", "W"

///  - All code points, assigned or unassigned, that are not listed

///      explicitly are given the value "N".

///  - The unassigned code points in the following blocks default to "W":

///         CJK Unified Ideographs Extension A: U+3400..U+4DBF

///         CJK Unified Ideographs:             U+4E00..U+9FFF

///         CJK Compatibility Ideographs:       U+F900..U+FAFF

///  - All undesignated code points in Planes 2 and 3, whether inside or

///      outside of allocated blocks, default to "W":

///         Plane 2:                            U+20000..U+2FFFD

///         Plane 3:                            U+30000..U+3FFFD

///

/// The table is similar to the table

///  __extended_grapheme_custer_property_boundary::__entries

/// which explains the details of these classes. The only difference is this

/// table lacks a property, thus having more bits available for the size.

///

/// The maximum code point that has an estimated width of 2 is U+3FFFD. This

/// value can be encoded in 18 bits. Thus the upper 3 bits of the code point

/// are always 0. These 3 bits are used to enlarge the offset range. This

/// optimization reduces the table in Unicode 15 from 184 to 104 entries,

/// saving 320 bytes.

///

/// The data has 2 values:

/// - bits [0, 13] The size of the range, allowing 16384 elements.

/// - bits [14, 31] The lower bound code point of the range. The upper bound of

///   the range is lower bound + size.

/* 00001100 - 0000115f [   96] */

//

/* 0000231a - 0000231b [    2] */

//

/* 00002329 - 0000232a [    2] */

//

/* 000023e9 - 000023ec [    4] */

//

/* 000023f0 - 000023f0 [    1] */

//

/* 000023f3 - 000023f3 [    1] */

//

/* 000025fd - 000025fe [    2] */

//

/* 00002614 - 00002615 [    2] */

//

/* 00002630 - 00002637 [    8] */

//

/* 00002648 - 00002653 [   12] */

//

/* 0000267f - 0000267f [    1] */

//

/* 0000268a - 0000268f [    6] */

//

/* 00002693 - 00002693 [    1] */

//

/* 000026a1 - 000026a1 [    1] */

//

/* 000026aa - 000026ab [    2] */

//

/* 000026bd - 000026be [    2] */

//

/* 000026c4 - 000026c5 [    2] */

//

/* 000026ce - 000026ce [    1] */

//

/* 000026d4 - 000026d4 [    1] */

//

/* 000026ea - 000026ea [    1] */

//

/* 000026f2 - 000026f3 [    2] */

//

/* 000026f5 - 000026f5 [    1] */

//

/* 000026fa - 000026fa [    1] */

//

/* 000026fd - 000026fd [    1] */

//

/* 00002705 - 00002705 [    1] */

//

/* 0000270a - 0000270b [    2] */

//

/* 00002728 - 00002728 [    1] */

//

/* 0000274c - 0000274c [    1] */

//

/* 0000274e - 0000274e [    1] */

//

/* 00002753 - 00002755 [    3] */

//

/* 00002757 - 00002757 [    1] */

//

/* 00002795 - 00002797 [    3] */

//

/* 000027b0 - 000027b0 [    1] */

//

/* 000027bf - 000027bf [    1] */

//

/* 00002b1b - 00002b1c [    2] */

//

/* 00002b50 - 00002b50 [    1] */

//

/* 00002b55 - 00002b55 [    1] */

//

/* 00002e80 - 00002e99 [   26] */

//

/* 00002e9b - 00002ef3 [   89] */

//

/* 00002f00 - 00002fd5 [  214] */

//

/* 00002ff0 - 0000303e [   79] */

//

/* 00003041 - 00003096 [   86] */

//

/* 00003099 - 000030ff [  103] */

//

/* 00003105 - 0000312f [   43] */

//

/* 00003131 - 0000318e [   94] */

//

/* 00003190 - 000031e5 [   86] */

//

/* 000031ef - 0000321e [   48] */

//

/* 00003220 - 00003247 [   40] */

//

/* 00003250 - 0000724f [16384] */

//

/* 00007250 - 0000a48c [12861] */

//

/* 0000a490 - 0000a4c6 [   55] */

//

/* 0000a960 - 0000a97c [   29] */

//

/* 0000ac00 - 0000d7a3 [11172] */

//

/* 0000f900 - 0000faff [  512] */

//

/* 0000fe10 - 0000fe19 [   10] */

//

/* 0000fe30 - 0000fe52 [   35] */

//

/* 0000fe54 - 0000fe66 [   19] */

//

/* 0000fe68 - 0000fe6b [    4] */

//

/* 0000ff01 - 0000ff60 [   96] */

//

/* 0000ffe0 - 0000ffe6 [    7] */

//

/* 00016fe0 - 00016fe4 [    5] */

//

/* 00016ff0 - 00016ff1 [    2] */

//

/* 00017000 - 000187f7 [ 6136] */

//

/* 00018800 - 00018cd5 [ 1238] */

//

/* 00018cff - 00018d08 [   10] */

//

/* 0001aff0 - 0001aff3 [    4] */

//

/* 0001aff5 - 0001affb [    7] */

//

/* 0001affd - 0001affe [    2] */

//

/* 0001b000 - 0001b122 [  291] */

//

/* 0001b132 - 0001b132 [    1] */

//

/* 0001b150 - 0001b152 [    3] */

//

/* 0001b155 - 0001b155 [    1] */

//

/* 0001b164 - 0001b167 [    4] */

//

/* 0001b170 - 0001b2fb [  396] */

//

/* 0001d300 - 0001d356 [   87] */

//

/* 0001d360 - 0001d376 [   23] */

//

/* 0001f004 - 0001f004 [    1] */

//

/* 0001f0cf - 0001f0cf [    1] */

//

/* 0001f18e - 0001f18e [    1] */

//

/* 0001f191 - 0001f19a [   10] */

//

/* 0001f200 - 0001f202 [    3] */

//

/* 0001f210 - 0001f23b [   44] */

//

/* 0001f240 - 0001f248 [    9] */

//

/* 0001f250 - 0001f251 [    2] */

//

/* 0001f260 - 0001f265 [    6] */

//

/* 0001f300 - 0001f64f [  848] */

//

/* 0001f680 - 0001f6c5 [   70] */

//

/* 0001f6cc - 0001f6cc [    1] */

//

/* 0001f6d0 - 0001f6d2 [    3] */

//

/* 0001f6d5 - 0001f6d7 [    3] */

//

/* 0001f6dc - 0001f6df [    4] */

//

/* 0001f6eb - 0001f6ec [    2] */

//

/* 0001f6f4 - 0001f6fc [    9] */

//

/* 0001f7e0 - 0001f7eb [   12] */

//

/* 0001f7f0 - 0001f7f0 [    1] */

//

/* 0001f900 - 0001f9ff [  256] */

//

/* 0001fa70 - 0001fa7c [   13] */

//

/* 0001fa80 - 0001fa89 [   10] */

//

/* 0001fa8f - 0001fac6 [   56] */

//

/* 0001face - 0001fadc [   15] */

//

/* 0001fadf - 0001fae9 [   11] */

//

/* 0001faf0 - 0001faf8 [    9] */

//

/* 00020000 - 00023fff [16384] */

//

/* 00024000 - 00027fff [16384] */

//

/* 00028000 - 0002bfff [16384] */

//

/* 0002c000 - 0002fffd [16382] */

//

/* 00030000 - 00033fff [16384] */

//

/* 00034000 - 00037fff [16384] */

//

/* 00038000 - 0003bfff [16384] */

//

/* 0003c000 - 0003fffd [16382] */

/// The upper bound entry of EastAsianWidth.txt.

///

/// Values greater than this value may have more than 18 significant bits.

/// They always have a width of 1. This property makes it possible to store

/// the table in its compact form.

/// Returns the estimated width of a Unicode code point.

///

/// \\pre The code point is a valid Unicode code point.

// Since __table_upper_bound contains the unshifted range do the

// comparison without shifting.

// When the code-point is less than the first element in the table

// the lookup is quite expensive. Since quite some scripts are in

// that range, it makes sense to validate that first.

// The std_format_spec_string_unicode benchmark gives a measurable

// improvement.

// namespace __width_estimation_table

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FORMAT_WIDTH_ESTIMATION_TABLE_H


=== system/lib/libcxx/include/__format/write_escaped.h ===
SHA256: 3f222358310015479955d5e61fd0c9190698255e0e74003bfa828f9493e8ca01
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/// Writes a string using format's width estimation algorithm.

///

/// \note When \c _LIBCPP_HAS_UNICODE is false the function assumes the input is ASCII.

// _LIBCPP_STD_VER >= 20

// [format.string.escaped]/2.2.1.2

// ...

// then the sequence \u{hex-digit-sequence} is appended to E, where

// hex-digit-sequence is the shortest hexadecimal representation of C using

// lower-case hexadecimal digits.

// [format.string.escaped]/2.2.3

// Otherwise (X is a sequence of ill-formed code units), each code unit U is

// appended to E in order as the sequence \x{hex-digit-sequence}, where

// hex-digit-sequence is the shortest hexadecimal representation of U using

// lower-case hexadecimal digits.

// For ASCII assume everything above 127 is printable.

// [format.string.escaped]/2.2.1.2.1

//   CE is UTF-8, UTF-16, or UTF-32 and C corresponds to a Unicode scalar

//   value whose Unicode property General_Category has a value in the groups

//   Separator (Z) or Other (C), as described by UAX #44 of the Unicode Standard,

// [format.string.escaped]/2.2.1.2.2

//   CE is UTF-8, UTF-16, or UTF-32 and C corresponds to a Unicode scalar

//   value with the Unicode property Grapheme_Extend=Yes as described by UAX

//   #44 of the Unicode Standard and C is not immediately preceded in S by a

//   character P appended to E without translation to an escape sequence,

// [format.string.escaped]/2

// 2.2.1.1 - Mapped character in [tab:format.escape.sequences]

// 2.2.1.2 - Space

// 2.2.2

//   Otherwise, if X is a shift sequence, the effect on E and further

//   decoding of S is unspecified.

// For now shift sequences are ignored and treated as Unicode. Other parts

// of the format library do the same. It's unknown how ostream treats them.

// TODO FMT determine what to do with shift sequences.

// 2.2.1.2.1 and 2.2.1.2.2 - Escape

// When the first code unit has the property Grapheme_Extend=Yes it needs to

// be escaped. This happens when the previous code unit was also escaped.

// 2.2.1.3 - Add the character

// 2.2.3 sequence of ill-formed code units

// _LIBCPP_STD_VER >= 23

// namespace __formatter

// _LIBCPP___FORMAT_WRITE_ESCAPED_H


=== system/lib/libcxx/include/__functional/binary_function.h ===
SHA256: 79c06888c062ce565aefbea396263de547085fdc8201eda94d0b69f0e3180322
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)

// _LIBCPP___FUNCTIONAL_BINARY_FUNCTION_H


=== system/lib/libcxx/include/__functional/binary_negate.h ===
SHA256: 8e9374e84c187e7ef07d734b4d8fc83d326b15d1ab674136e9c016095ee4d121
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)

// _LIBCPP___FUNCTIONAL_BINARY_NEGATE_H


=== system/lib/libcxx/include/__functional/bind.h ===
SHA256: bca26703696739a30093ad74f8fa4beac5c7ba2ce818fc05f95d2a401218f3c8
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// C++17 recommends that we implement placeholders as `inline constexpr`, but allows

// implementing them as `extern <implementation-defined>`. Libc++ implements them as

// `extern const` in all standard modes to avoid an ABI break in C++03: making them

// `inline constexpr` requires removing their definition in the shared library to

// avoid ODR violations, which is an ABI break.

//

// In practice, since placeholders are empty, `extern const` is almost impossible

// to distinguish from `inline constexpr` from a usage stand point.

// namespace placeholders

// false

// _LIBCPP_CXX03_LANG

// _LIBCPP___FUNCTIONAL_BIND_H


=== system/lib/libcxx/include/__functional/bind_back.h ===
SHA256: 0b7bc9368f0cfd4b09bed36115a19245590aea57de6a3a08cadab8874a987853
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 23

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FUNCTIONAL_BIND_BACK_H


=== system/lib/libcxx/include/__functional/bind_front.h ===
SHA256: 7bcd4578945286a2d0e64243b682d9a424ab1ce78837660f83f644594e495d90
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FUNCTIONAL_BIND_FRONT_H


=== system/lib/libcxx/include/__functional/binder1st.h ===
SHA256: a0bda8990ac02abe6158ea53b775ffbadac3828f30476a60630c973321332605
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)

// _LIBCPP___FUNCTIONAL_BINDER1ST_H


=== system/lib/libcxx/include/__functional/binder2nd.h ===
SHA256: 060057213b9e4fa78296af422b12f3ddceac82529619c3de29c0d73741a0f147
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)

// _LIBCPP___FUNCTIONAL_BINDER2ND_H


=== system/lib/libcxx/include/__functional/boyer_moore_searcher.h ===
SHA256: 646d6d6d9da34dea7bf8e83be5b50cbdc2b74f04195b75f6320420c100335021
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*useArray*/

// General case for BM data searching; use a map

// Special case small numeric values; use an array

// _LIBCPP_STD_VER >= 17

// _LIBCPP___FUNCTIONAL_BOYER_MOORE_SEARCHER_H


=== system/lib/libcxx/include/__functional/compose.h ===
SHA256: 7f224138a6a3a51644ca76f7c20b002273749f31ac2b845a879a3fff13b4f4e2
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FUNCTIONAL_COMPOSE_H


=== system/lib/libcxx/include/__functional/default_searcher.h ===
SHA256: 6d678181327e523870c5385c2f40b6c99c3edc068471057a6a15488f3d518cbb
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// default searcher

// _LIBCPP_STD_VER >= 17

// _LIBCPP___FUNCTIONAL_DEFAULT_SEARCHER_H


=== system/lib/libcxx/include/__functional/function.h ===
SHA256: 051a14abd208bf84e77e5061f03990c93a407f1110fd623333514152a5261a27
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// bad_function_call

// Note that when a key function is not used, every translation unit that uses

// bad_function_call will end up containing a weak definition of the vtable and

// typeinfo.

// undefined

// namespace __function

// __base provides an abstract interface for copyable functors.

// _LIBCPP_HAS_RTTI

// __func implements __base for a given functor type.

// _LIBCPP_HAS_RTTI

// __value_func creates a value-type from a __func.

// _LIBCPP_HAS_RTTI

// Storage for a functor object, to be used with __policy to manage copy and

// destruction.

// True if _Fun can safely be held in __policy_storage.__small.

// Policy contains information about how to copy, destroy, and move the

// underlying functor. You can think of it as a vtable of sorts.

// Used to copy or destroy __large values. null for trivial objects.

// True if this is the null policy (no value).

// The target type. May be null if RTTI is disabled.

// Returns a pointer to a static policy object suitable for the functor

// type.

/* is_small = */

/* is_small = */

// Used to choose between perfect forwarding or pass-by-value. Pass-by-value is

// faster for types that can be passed in registers.

// __policy_func uses a __policy to create a type-erased, copyable functor.

// Inline storage for small objects.

// The policy that describes how to move / copy / destroy __buf_. Never

// null, even if the function is empty.

// Out of line storage.

// _LIBCPP_HAS_RTTI

// [TODO] add && to save on a retain

// _LIBCPP_HAS_RTTI

// _LIBCPP_HAS_BLOCKS_RUNTIME

// namespace __function

// construct/copy/destroy:

// function modifiers:

// function capacity:

// deleted overloads close possible hole in the type system

// function invocation:

// function target access:

// _LIBCPP_HAS_RTTI

// _LIBCPP_STD_VER >= 17

// _LIBCPP_HAS_RTTI

// _LIBCPP_STD_VER <= 17

// _LIBCPP_CXX03_LANG

// _LIBCPP___FUNCTIONAL_FUNCTION_H


=== system/lib/libcxx/include/__functional/hash.h ===
SHA256: 78934b5d2eef79d65735a117966edaea5b0d619c4f1622d4c813ab4b9e33e834
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// We use murmur2 when size_t is 32 bits, and cityhash64 when size_t

// is 64 bits.  This is because cityhash64 uses 64bit x 64bit

// multiplication, which can be very slow on 32-bit systems.

// murmur2

// cityhash64

// For strings over 64 bytes we hash the end first, and then as we

// loop we keep 56 bytes of state: v, w, x, y, and z.

// Decrease len to the nearest multiple of 64, and operate on 64-byte chunks.

// Some primes between 2^63 and 2^64.

// Return a 16-byte hash for 48 bytes.  Quick and dirty.

// Callers do best to use "random-looking" values for a and b.

// Return a 16-byte hash for s[0] ... s[31], a, and b.  Quick and dirty.

// Return an 8-byte hash for 33 to 64 bytes.

// -0.0 and 0.0 should return same hash

// -0.0 and 0.0 should return same hash

// Zero out padding bits

// Zero out padding bits

// !_LIBCPP_CXX03_LANG

// _LIBCPP___FUNCTIONAL_HASH_H


=== system/lib/libcxx/include/__functional/identity.h ===
SHA256: 41b4b22fab046a270281898fbc13c4072a07db271a502f8490c6c826d500ed15
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FUNCTIONAL_IDENTITY_H


=== system/lib/libcxx/include/__functional/invoke.h ===
SHA256: bfb60ef4455b0b140bb03f114e90ca28f264468638c1a7688fcc5dccb91619ac
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// TODO: Use reference_converts_from_temporary_v once implemented

// using _ImplicitInvokeResult = invoke_result_t<_Fn, _Args...>;

// static_assert(!reference_converts_from_temporary_v<_Result, _ImplicitInvokeResult>,

// _LIBCPP___FUNCTIONAL_INVOKE_H


=== system/lib/libcxx/include/__functional/is_transparent.h ===
SHA256: 111a382ad2005586d01592ffb40a41544504fd400f44c47c0ae6efb06ff39a16
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___FUNCTIONAL_IS_TRANSPARENT


=== system/lib/libcxx/include/__functional/mem_fn.h ===
SHA256: be2533927b79d76701755e1df1177d8e0b3b49115660b395889ea293924b62da
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// invoke

// _LIBCPP___FUNCTIONAL_MEM_FN_H


=== system/lib/libcxx/include/__functional/mem_fun_ref.h ===
SHA256: 5d053b00db4c874b3302f2042eed510d42a0bf4d7a6eb9a25ca9d33e095428b4
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)

// _LIBCPP___FUNCTIONAL_MEM_FUN_REF_H


=== system/lib/libcxx/include/__functional/not_fn.h ===
SHA256: 2e45e6c90cde94c77004866801dca82f81d5d80f56859a078d071ec54d01d371
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP_STD_VER >= 26

// _LIBCPP___FUNCTIONAL_NOT_FN_H


=== system/lib/libcxx/include/__functional/operations.h ===
SHA256: 0c111fc001f13ee2ecbcfca288432b19aa3b0552733fabcaa03b3b75cef58e39
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Arithmetic operations

// used by valarray

// The non-transparent std::plus specialization is only equivalent to a raw plus

// operator when we don't perform an implicit conversion when calling it.

//

// used by valarray

//

// used by valarray

//

// used by valarray

//

// used by valarray

//

// used by valarray

//

// Bitwise operations

// used by valarray

//

// used by valarray

//

// used by valarray

//

// Comparison operations

// used by valarray

//

// The non-transparent std::equal_to specialization is only equivalent to a raw equality

// comparison when we don't perform an implicit conversion when calling it.

// In the transparent case, we do not enforce that

// used by valarray

//

// used by valarray

//

// used by valarray

//

// used by valarray

// used by valarray

//

// Logical operations

// used by valarray

//

// used by valarray

//

// used by valarray

//

// _LIBCPP___FUNCTIONAL_OPERATIONS_H


=== system/lib/libcxx/include/__functional/perfect_forward.h ===
SHA256: 45f100aa22f870682be816fb2f300c58994247af38f06d1e0b6bcd5ed31ec566
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __perfect_forward implements a perfect-forwarding call wrapper as explained in [func.require].

// _LIBCPP_STD_VER >= 17

// _LIBCPP___FUNCTIONAL_PERFECT_FORWARD_H


=== system/lib/libcxx/include/__functional/pointer_to_binary_function.h ===
SHA256: 0cca95e81e7bda763887d6d4341f041966a315c716c7d15478a43b759982f3d5
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H


=== system/lib/libcxx/include/__functional/pointer_to_unary_function.h ===
SHA256: fdeea3638a817556bf0eff70ad223533118d2280d42e66bcdc62dc22e1dbe9e6
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)

// _LIBCPP___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H


=== system/lib/libcxx/include/__functional/ranges_operations.h ===
SHA256: c4058d173fa14414a15d0ae942c0c67e3f31516ac577cffbd0b357003eeb7a87
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace ranges

// For ranges we do not require that the types on each side of the equality

// operator are of the same type

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FUNCTIONAL_RANGES_OPERATIONS_H


=== system/lib/libcxx/include/__functional/reference_wrapper.h ===
SHA256: 81475a0a417acbb6bcbfe5277e446bfa52480da8c0ceed8fbfc9d1df88669373
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// NOLINT(modernize-use-equals-delete) ; This is llvm.org/PR54276

// access

// invoke

// Since is_nothrow_invocable requires C++17 LWG3764 is not backported

// to earlier versions.

// [refwrap.comparisons], comparisons

// _LIBCPP_STD_VER >= 26

// Let desugars-to pass through std::reference_wrapper

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FUNCTIONAL_REFERENCE_WRAPPER_H


=== system/lib/libcxx/include/__functional/unary_function.h ===
SHA256: 2e953bccfd624f590e6e981485e19642053f547c54893a746053a020269bd990
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER <= 14

// _LIBCPP___FUNCTIONAL_UNARY_FUNCTION_H


=== system/lib/libcxx/include/__functional/unary_negate.h ===
SHA256: 2f3fb2f71c23bffdd66517551a955e8d2b3169f336c94d5698fc179c7c4a5ddb
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS)

// _LIBCPP___FUNCTIONAL_UNARY_NEGATE_H


=== system/lib/libcxx/include/__functional/weak_result_type.h ===
SHA256: 830ef9c58693be26ed93df7f4d4f00ed2860c71a0e9ca5cea1d16ae032b2e86c
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __weak_result_type

// bool is true

// bool is true

// bool is true

// 0 argument case

// 1 argument case

// 2 argument case

// 3 or more arguments

// _LIBCPP___FUNCTIONAL_WEAK_RESULT_TYPE_H


=== system/lib/libcxx/include/__fwd/array.h ===
SHA256: b9d6326666db62e674f4efe5adbef48e870a2381de08021e93548acec2a902e0
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// _LIBCPP___FWD_ARRAY_H


=== system/lib/libcxx/include/__fwd/bit_reference.h ===
SHA256: c73b9806cafc2cd80b52fe247e4d0c917f29f32baf4e5ea8b5fdbe1acbead9a4
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___FWD_BIT_REFERENCE_H


=== system/lib/libcxx/include/__fwd/byte.h ===
SHA256: 4465d56f10be4ac0340d502ad34f4a6f772a194d08e981eadcffcea91f138670
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___FWD_BYTE_H


=== system/lib/libcxx/include/__fwd/complex.h ===
SHA256: 5befaf43df62169554fca10902604c781b5620e12fbf796e181284247fe597d3
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 26

// _LIBCPP___FWD_COMPLEX_H


=== system/lib/libcxx/include/__fwd/deque.h ===
SHA256: 8956c260510e5a0155e48307f0dcaf0453256a8a9f1ccae677b11612395cc902
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// _LIBCPP___FWD_DEQUE_H


=== system/lib/libcxx/include/__fwd/format.h ===
SHA256: 9a68b9dbbafe5e15b364b64f5cc714fbc6497d09bfd8e7c693f628e36364fe73
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FWD_FORMAT_H


=== system/lib/libcxx/include/__fwd/fstream.h ===
SHA256: b3ae261e58613d535b8c1dbc71124b3e14b221c7c37b570e09d5c7571e8598c5
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___FWD_FSTREAM_H


=== system/lib/libcxx/include/__fwd/functional.h ===
SHA256: 2d26baab5b231afc99459e1e25f3d51206ead48ee8b243df815b6499914041ce
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// _LIBCPP___FWD_FUNCTIONAL_H


=== system/lib/libcxx/include/__fwd/get.h ===
SHA256: 848e053f445295c14bc43d7dba2bdf684a2d4437cfbd05df769989fa1a422aeb
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// _LIBCPP___FWD_GET_H


=== system/lib/libcxx/include/__fwd/ios.h ===
SHA256: 36af53873a2102c0f5d43663e8ebb9a2b2249ebf83bdbfc71674dd90dc520aca
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// On newlib, off_t is 'long int'

// for char_traits in <string>

// for char_traits in <string>

// _LIBCPP___FWD_IOS_H


=== system/lib/libcxx/include/__fwd/istream.h ===
SHA256: a11a5180410e7eeee2e026cb392f45882ebc0a7e9fa0927403e91b6f5da4922a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___FWD_ISTREAM_H


=== system/lib/libcxx/include/__fwd/map.h ===
SHA256: 15e7924f0a428cb2fc4dd5c46717426fa93a97b365c50cc6e165e2895f82f87f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___FWD_MAP_H


=== system/lib/libcxx/include/__fwd/mdspan.h ===
SHA256: bbe8750379f06d14c917a294ca97124ae3852a5b9239f40839015bd49bfea9d6
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//                        Kokkos v. 4.0

//       Copyright (2022) National Technology & Engineering

//               Solutions of Sandia, LLC (NTESS).

//

// Under the terms of Contract DE-NA0003525 with NTESS,

// the U.S. Government retains certain rights in this software.

//

//===---------------------------------------------------------------------===//

// Layout policy with a mapping which corresponds to FORTRAN-style array layouts

// Layout policy with a mapping which corresponds to C-style array layouts

// Layout policy with a unique mapping where strides are arbitrary

// _LIBCPP_STD_VER >= 23

// _LIBCPP___MDSPAN_LAYOUTS_H


=== system/lib/libcxx/include/__fwd/memory.h ===
SHA256: 4ce993e742d2ea49235129acd00f15ef054c3b97aa96803636c89e62469f00e1
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// _LIBCPP___FWD_MEMORY_H


=== system/lib/libcxx/include/__fwd/memory_resource.h ===
SHA256: fdf4324bbd8ce3e374521238cf0e81c3f099f3a9f3e9ede0aff52d7821d9e870
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace pmr

// _LIBCPP_STD_VER >= 17

// _LIBCPP___FWD_MEMORY_RESOURCE_H


=== system/lib/libcxx/include/__fwd/ostream.h ===
SHA256: 47da2c6752942575e2b8b6b5081decdad8cb407e3949481b0c33311c662bb63c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___FWD_OSTREAM_H


=== system/lib/libcxx/include/__fwd/pair.h ===
SHA256: f8fde246162f539b8f2e9db1aeb57dc97f9341ac797718db9bceabafc9b21fda
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// _LIBCPP___FWD_PAIR_H


=== system/lib/libcxx/include/__fwd/queue.h ===
SHA256: a8d8673e74b19eddb087538d9680d863eb6a900acf2d4ea4a313c2309345c640
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// _LIBCPP___FWD_QUEUE_H


=== system/lib/libcxx/include/__fwd/set.h ===
SHA256: 9ee3003df28d414dceb30a2d1741856dc75ab979d86875cf02b9e6caa4d149de
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___FWD_SET_H


=== system/lib/libcxx/include/__fwd/span.h ===
SHA256: 038ddc66c7f8e8b3b9c53660d97f334fcb60864c0b5210aec68f392b4eaa4c8b
// -*- C++ -*-

//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// _LIBCPP___FWD_SPAN_H


=== system/lib/libcxx/include/__fwd/sstream.h ===
SHA256: 690180c6e3f09ca34495a72b26f82da7fad94d229474700843f7af7b351f7931
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___FWD_SSTREAM_H


=== system/lib/libcxx/include/__fwd/stack.h ===
SHA256: f75e103d64d3e772a8db6b637bb51f3bca5354668315053deed96721cdd85ad6
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// _LIBCPP___FWD_STACK_H


=== system/lib/libcxx/include/__fwd/streambuf.h ===
SHA256: 84e32fb3f42298dfab6b6ba2a74ab3b158c658bfc2b1dd07ddee51e4b3d37a42
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___FWD_STREAMBUF_H


=== system/lib/libcxx/include/__fwd/string.h ===
SHA256: 24078ff241336827cef80ea2b0c25681b9bf0e1390ceed4ed4a9e9ff88425256
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace pmr

// _LIBCPP_STD_VER >= 17

// clang-format off

// clang-format on

// _LIBCPP___FWD_STRING_H


=== system/lib/libcxx/include/__fwd/string_view.h ===
SHA256: ff806a696e86545cb5081df0fd3b5c2f0b31b7fd7259196660d7ea0f7ce451f1
// -*- C++ -*-

//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// clang-format off

// clang-format on

// _LIBCPP___FWD_STRING_VIEW_H


=== system/lib/libcxx/include/__fwd/subrange.h ===
SHA256: 56899aa1c11a2e041917f59771cd087605df3aa21901e74c04e4db68d6e8c971
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___FWD_SUBRANGE_H


=== system/lib/libcxx/include/__fwd/tuple.h ===
SHA256: 243d380f780e3e1dca633c665b6516f959d5d908eff353976dcb8054513ffde1
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// _LIBCPP_CXX03_LANG

// _LIBCPP___FWD_TUPLE_H


=== system/lib/libcxx/include/__fwd/variant.h ===
SHA256: 6856f5ed11bed7cc9222fd35bcbd985cb7f2e50956f92bdb8b4d466cc442a318
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___FWD_VARIANT_H


=== system/lib/libcxx/include/__fwd/vector.h ===
SHA256: 53d4dcbcdae10fdcdbe5c6a354aeb610ef713cde53e786351e4ef095eb4ced67
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// _LIBCPP___FWD_VECTOR_H


=== system/lib/libcxx/include/__ios/fpos.h ===
SHA256: 5770877a12297c0143d0342ef3cb8465e4d71fb7a2fbcb3fcc81bb3bda6edfd8
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___IOS_FPOS_H


=== system/lib/libcxx/include/__iterator/access.h ===
SHA256: bbce9419527d68ad3188a30bf82afc4c45467fb320fde7cfe21b229f0e893849
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// defined(_LIBCPP_CXX03_LANG)

// !defined(_LIBCPP_CXX03_LANG)

// _LIBCPP___ITERATOR_ACCESS_H


=== system/lib/libcxx/include/__iterator/advance.h ===
SHA256: e419d50ca413e7c06f67c67cbe585ec5ef5f6c1b69d2c1c1ab366b38e26d3001
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [range.iter.op.advance]

// Preconditions: If `I` does not model `bidirectional_iterator`, `n` is not negative.

// If `I` models `random_access_iterator`, equivalent to `i += n`.

// Otherwise, if `n` is non-negative, increments `i` by `n`.

// Otherwise, decrements `i` by `-n`.

// Otherwise, if `n` is non-negative, increments `i` by `n`.

// Preconditions: Either `assignable_from<I&, S> || sized_sentinel_for<S, I>` is modeled, or [i, bound_sentinel)

// denotes a range.

// If `I` and `S` model `assignable_from<I&, S>`, equivalent to `i = std::move(bound_sentinel)`.

// Otherwise, if `S` and `I` model `sized_sentinel_for<S, I>`, equivalent to `ranges::advance(i, bound_sentinel -

// i)`.

// Otherwise, while `bool(i != bound_sentinel)` is true, increments `i`.

// Preconditions:

//   * If `n > 0`, [i, bound_sentinel) denotes a range.

//   * If `n == 0`, [i, bound_sentinel) or [bound_sentinel, i) denotes a range.

//   * If `n < 0`, [bound_sentinel, i) denotes a range, `I` models `bidirectional_iterator`, and `I` and `S` model

//   `same_as<I, S>`.

// Returns: `n - M`, where `M` is the difference between the ending and starting position.

// If `S` and `I` model `sized_sentinel_for<S, I>`:

// If |n| >= |bound_sentinel - i|, equivalent to `ranges::advance(i, bound_sentinel)`.

// __magnitude_geq(a, b) returns |a| >= |b|, assuming they have the same sign.

// Otherwise, equivalent to `ranges::advance(i, n)`.

// Otherwise, if `n` is non-negative, while `bool(i != bound_sentinel)` is true, increments `i` but at

// most `n` times.

// Otherwise, while `bool(i != bound_sentinel)` is true, decrements `i` but at most `-n` times.

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_ADVANCE_H


=== system/lib/libcxx/include/__iterator/aliasing_iterator.h ===
SHA256: ef69532195ee2378fb97e3a9faad6ffeefdf7d58e47eaaf1647cbc1a3ded6b30
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// This iterator wrapper is used to type-pun an iterator to return a different type. This is done without UB by not

// actually punning the type, but instead inspecting the object representation of the base type and copying that into

// an instance of the alias type. For that reason the alias type has to be trivial. The alias is returned as a prvalue

// when derferencing the iterator, since it is temporary storage. This wrapper is used to vectorize some algorithms.

// This is required to avoid ADL instantiations on _BaseT

// _LIBCPP___ITERATOR_ALIASING_ITERATOR_H


=== system/lib/libcxx/include/__iterator/back_insert_iterator.h ===
SHA256: 6668e3e7592d4cfb432044e42a8249d6a144cf9072eafc10d128469c3752cf56
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_CXX03_LANG

// _LIBCPP___ITERATOR_BACK_INSERT_ITERATOR_H


=== system/lib/libcxx/include/__iterator/bounded_iter.h ===
SHA256: 8365f1a07a443b6ab122986e2433f4ace17f41a7cea29227070590a921fe730a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Iterator wrapper that carries the valid range it is allowed to access.

//

// This is a simple iterator wrapper for contiguous iterators that points

// within a [begin, end] range and carries these bounds with it. The iterator

// ensures that it is pointing within [begin, end) range when it is

// dereferenced. It also ensures that it is never iterated outside of

// [begin, end]. This is important for two reasons:

//

// 1. It allows `operator*` and `operator++` bounds checks to be `iter != end`.

//    This is both less for the optimizer to prove, and aligns with how callers

//    typically use iterators.

//

// 2. Advancing an iterator out of bounds is undefined behavior (see the table

//    in [input.iterators]). In particular, when the underlying iterator is a

//    pointer, it is undefined at the language level (see [expr.add]). If

//    bounded iterators exhibited this undefined behavior, we risk compiler

//    optimizations deleting non-redundant bounds checks.

// Create a singular iterator.

//

// Such an iterator points past the end of an empty range, so it is not dereferenceable.

// Operations like comparison and assignment are valid.

// Assign a bounded iterator to another one, rebinding the bounds of the iterator as well.

// Create an iterator wrapping the given iterator, and whose bounds are described

// by the provided [begin, end] range.

//

// The constructor does not check whether the resulting iterator is within its bounds. It is a

// responsibility of the container to ensure that the given bounds are valid.

//

// Since it is non-standard for iterators to have this constructor, __bounded_iter must

// be created via `std::__make_bounded_iter`.

// Dereference and indexing operations.

//

// These operations check that the iterator is dereferenceable. Since the class invariant is

// that the iterator is always within `[begin, end]`, we only need to check it's not pointing to

// `end`. This is easier for the optimizer because it aligns with the `iter != container.end()`

// checks that typical callers already use (see

// https://github.com/llvm/llvm-project/issues/78829).

// Arithmetic operations.

//

// These operations check that the iterator remains within `[begin, end]`.

// Comparison operations.

//

// These operations do not check whether the iterators are within their bounds.

// The valid range for each iterator is also not considered as part of the comparison,

// i.e. two iterators pointing to the same location will be considered equal even

// if they have different validity ranges.

// _LIBCPP_STD_VER >= 20

// current iterator

// valid range represented as [begin, end]

// _LIBCPP___ITERATOR_BOUNDED_ITER_H


=== system/lib/libcxx/include/__iterator/common_iterator.h ===
SHA256: 172f2eaa6cd63f4dd967d5fdfbaa1a38ab00a136cd9126fc40dd90c5185bf514
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// If they're the same index, just assign.

// Otherwise replace with the oposite element.

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_COMMON_ITERATOR_H


=== system/lib/libcxx/include/__iterator/concepts.h ===
SHA256: c8905c5a8bdf04d385255b1fbf9bec992efc05fa6bd7d6eb32f22dd30219187f
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [iterator.concept.readable]

// [iterator.concept.writable]

// not required to be equality-preserving

// not required to be equality-preserving

// not required to be equality-preserving

// not required to be equality-preserving

// [iterator.concept.winc]

// TODO: remove this once the clang bug is fixed (bugs.llvm.org/PR48173).

// Currently, clang does not handle bool correctly.

// not required to be equality-preserving

// not required to be equality-preserving

// [iterator.concept.inc]

// [iterator.concept.iterator]

// [iterator.concept.sentinel]

// [iterator.concept.input]

// [iterator.concept.output]

// not required to be equality-preserving

// [iterator.concept.forward]

// [iterator.concept.bidir]

// [indirectcallable.indirectinvocable]

// Note: indirectly_swappable is located in iter_swap.h to prevent a dependency cycle

// (both iter_swap and indirectly_swappable require indirectly_readable).

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER < 20

// _LIBCPP_STD_VER

// _LIBCPP___ITERATOR_CONCEPTS_H


=== system/lib/libcxx/include/__iterator/counted_iterator.h ===
SHA256: a7b9f04a3abfb43459b87026d003bdfe6152a24426a1cc8978bdf75cb09a5047
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_COUNTED_ITERATOR_H


=== system/lib/libcxx/include/__iterator/cpp17_iterator_concepts.h ===
SHA256: 558d5f126755e59e14ebed5fad758aaa4de649087650f9270270abfd4e11038c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_CPP17_ITERATOR_CONCEPTS_H


=== system/lib/libcxx/include/__iterator/data.h ===
SHA256: 1c929b9ef011da3aa608332e28183705c845e64e237fad28f75276d3a93eca9a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ITERATOR_DATA_H


=== system/lib/libcxx/include/__iterator/default_sentinel.h ===
SHA256: d5e2128f2af1c4ee592de6c8f340e81d99e49a01266a92c925f97d7427933dfb
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_DEFAULT_SENTINEL_H


=== system/lib/libcxx/include/__iterator/distance.h ===
SHA256: 3063d6462266bcfeb966bcfaea2ee3558e9831e73c6fbd03e95ae83308cf0de3
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [range.iter.op.distance]

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_DISTANCE_H


=== system/lib/libcxx/include/__iterator/empty.h ===
SHA256: 0509c177d6712428dd9d38b4b2f45cbe05af430b4b493396b2856bbe23cd5245
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___ITERATOR_EMPTY_H


=== system/lib/libcxx/include/__iterator/erase_if_container.h ===
SHA256: b89716184bd6ecee76c6150f17d1c81ec2cd2d956f9a8d9ee9b613f1ca3671a0
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ITERATOR_ERASE_IF_CONTAINER_H


=== system/lib/libcxx/include/__iterator/front_insert_iterator.h ===
SHA256: 5045409ad4b5b271470e477ab0cca7951d9c6b481fc21faf5b38f3965604994d
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_CXX03_LANG

// _LIBCPP___ITERATOR_FRONT_INSERT_ITERATOR_H


=== system/lib/libcxx/include/__iterator/incrementable_traits.h ===
SHA256: d4415a6e50f0e94dc6e9344ad3fd768ad280ada3c46630eaca7ca4543605437a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [incrementable.traits]

// Let `RI` be `remove_cvref_t<I>`. The type `iter_difference_t<I>` denotes

// `incrementable_traits<RI>::difference_type` if `iterator_traits<RI>` names a specialization

// generated from the primary template, and `iterator_traits<RI>::difference_type` otherwise.

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_INCREMENTABLE_TRAITS_H


=== system/lib/libcxx/include/__iterator/indirectly_comparable.h ===
SHA256: d256f902eeb6b85b73111a8d0b3d891006c86ffc1d1daaa379433bb782802fcd
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_INDIRECTLY_COMPARABLE_H


=== system/lib/libcxx/include/__iterator/insert_iterator.h ===
SHA256: 23f1f18f93769844627666dea95704e53b7e0f3f47301460f1dea999e927c1bc
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_CXX03_LANG

// _LIBCPP___ITERATOR_INSERT_ITERATOR_H


=== system/lib/libcxx/include/__iterator/istream_iterator.h ===
SHA256: a28ff50da24ba210acdb30694c532421b2f2519db084bff79f2d1c19af2203e5
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// LWG3600 Changed the wording of the copy constructor. In libc++ this constructor

// can still be trivial after this change.

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER <= 17

// _LIBCPP___ITERATOR_ISTREAM_ITERATOR_H


=== system/lib/libcxx/include/__iterator/istreambuf_iterator.h ===
SHA256: 773219b52df8e303df49bd883056d6fe988691f6d124074d809c306bb81b37b4
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER <= 17

// _LIBCPP___ITERATOR_ISTREAMBUF_ITERATOR_H


=== system/lib/libcxx/include/__iterator/iter_move.h ===
SHA256: 7f60015b4afce557e27f8da694a7db73c4818121e184d8940f1b6628b86d68c6
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [iterator.cust.move]

// NOLINTNEXTLINE(libcpp-robust-against-adl) iter_swap ADL calls should only be made through ranges::iter_swap

// [iterator.cust.move]

// NOLINTBEGIN(libcpp-robust-against-adl) iter_move ADL calls should only be made through ranges::iter_move

// NOLINTEND(libcpp-robust-against-adl)

// namespace __iter_move

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_ITER_MOVE_H


=== system/lib/libcxx/include/__iterator/iter_swap.h ===
SHA256: 7af59b7e0cced7fad729a0925775bbc7a0b36740fb021ed8d1cada3819b6a345
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [iter.cust.swap]

// NOLINTNEXTLINE(libcpp-robust-against-adl) iter_swap ADL calls should only be made through ranges::iter_swap

// NOLINTBEGIN(libcpp-robust-against-adl) iter_swap ADL calls should only be made through ranges::iter_swap

// NOLINTEND(libcpp-robust-against-adl)

//

//

//

//

//

// namespace __iter_swap

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_ITER_SWAP_H


=== system/lib/libcxx/include/__iterator/iterator.h ===
SHA256: e799380c0721eab591e9fc590b1003ec75a371cb69f870ed7746845c425ee840
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ITERATOR_ITERATOR_H


=== system/lib/libcxx/include/__iterator/iterator_traits.h ===
SHA256: cd011ed6f67fe3d0fe7fc3562c226d5eab00285863b1fd86e60e9210f8c1ef33
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// not required to be equality-preserving

// [iterator.traits]

// _LIBCPP_STD_VER >= 20

// The `cpp17-*-iterator` exposition-only concepts have very similar names to the `Cpp17*Iterator` named requirements

// from `[iterator.cpp17]`. To avoid confusion between the two, the exposition-only concepts have been banished to

// a "detail" namespace indicating they have a niche use-case.

// NOLINT(misc-redundant-expression) ; This is llvm.org/PR54114

// namespace __iterator_traits_detail

// Otherwise, `pointer` names `void`.

// [iterator.traits]/3.2.1

// If the qualified-id `I::pointer` is valid and denotes a type, `pointer` names that type.

// Otherwise, if `decltype(declval<I&>().operator->())` is well-formed, then `pointer` names that

// type.

// Otherwise, `reference` names `iter-reference-t<I>`.

// [iterator.traits]/3.2.2

// If the qualified-id `I::reference` is valid and denotes a type, `reference` names that type.

// [iterator.traits]/3.2.3.4

// input_iterator_tag

// [iterator.traits]/3.2.3.1

// `random_access_iterator_tag` if `I` satisfies `cpp17-random-access-iterator`, or otherwise

// [iterator.traits]/3.2.3.2

// `bidirectional_iterator_tag` if `I` satisfies `cpp17-bidirectional-iterator`, or otherwise

// [iterator.traits]/3.2.3.3

// `forward_iterator_tag` if `I` satisfies `cpp17-forward-iterator`, or otherwise

// [iterator.traits]/3.2.3

// If the qualified-id `I::iterator-category` is valid and denotes a type, `iterator-category` names

// that type.

// otherwise, it names void.

// If the qualified-id `incrementable_traits<I>::difference_type` is valid and denotes a type, then

// `difference_type` names that type;

// [iterator.traits]/3.4

// Otherwise, `iterator_traits<I>` has no members by any of the above names.

// [iterator.traits]/3.1

// If `I` has valid ([temp.deduct]) member types `difference-type`, `value-type`, `reference`, and

// `iterator-category`, then `iterator-traits<I>` has the following publicly accessible members:

// [iterator.traits]/3.2

// Otherwise, if `I` satisfies the exposition-only concept `cpp17-input-iterator`,

// `iterator-traits<I>` has the following publicly accessible members:

// Otherwise, if `I` satisfies the exposition-only concept `cpp17-iterator`, then

// `iterator_traits<I>` has the following publicly accessible members:

// _LIBCPP_STD_VER >= 20

// iterator_traits<Iterator> will only have the nested types if Iterator::iterator_category

//    exists.  Else iterator_traits<Iterator> will be an empty class.  This is a

//    conforming extension which allows some programs to compile and behave as

//    the client expects instead of failing at compile time.

// _LIBCPP_STD_VER >= 20

// __libcpp_is_contiguous_iterator determines if an iterator is known by

// libc++ to be contiguous, either because it advertises itself as such

// (in C++20) or because it is a pointer type or a known trivial wrapper

// around a (possibly fancy) pointer type, such as __wrap_iter<T*>.

// Such iterators receive special "contiguous" optimizations in

// std::copy and std::sort.

//

// Any native pointer which is an iterator is also a contiguous iterator.

// _LIBCPP_STD_VER >= 23

// [readable.traits]

// Let `RI` be `remove_cvref_t<I>`. The type `iter_value_t<I>` denotes

// `indirectly_readable_traits<RI>::value_type` if `iterator_traits<RI>` names a specialization

// generated from the primary template, and `iterator_traits<RI>::value_type` otherwise.

// This has to be in this file and not readable_traits.h to break the include cycle between the two.

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_ITERATOR_TRAITS_H


=== system/lib/libcxx/include/__iterator/iterator_with_data.h ===
SHA256: 2f57dfaca3b486772e55c7c1a8b5bfe991938fecdae24962247c8fd52ea06056
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_ITERATOR_WITH_DATA_H


=== system/lib/libcxx/include/__iterator/mergeable.h ===
SHA256: 1fd4bb433e7427c9f9c7cc0b55aaefc62c88f0d1119578d21ab1eeebec62ce8a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_MERGEABLE_H


=== system/lib/libcxx/include/__iterator/move_iterator.h ===
SHA256: b61dd22746c0612eb25de5f77848b19fc029f8b4e0103725359ad51a3abd104a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// iterator_category is inherited and not always present

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER <= 17

// _LIBCPP_STD_VER >= 20

// !_LIBCPP_CXX03_LANG

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_MOVE_ITERATOR_H


=== system/lib/libcxx/include/__iterator/move_sentinel.h ===
SHA256: 53c2e1383eddb027b7f698e24581b56d71cc3bfb636be8d22c6b0fe0d3279e15
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_MOVE_SENTINEL_H


=== system/lib/libcxx/include/__iterator/next.h ===
SHA256: 0ede1be1b1b203c89631ac1dfcf191a0d7e1b525f2637dc763a597221ff686d6
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [range.iter.op.next]

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_NEXT_H


=== system/lib/libcxx/include/__iterator/ostream_iterator.h ===
SHA256: 268d790e8c47549eb6e774c3e73df197dd7f9d523548bc59e42e1118b737f57a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ITERATOR_OSTREAM_ITERATOR_H


=== system/lib/libcxx/include/__iterator/ostreambuf_iterator.h ===
SHA256: 88decc8a290b598b3fa282e69a0dc52e52e78e4c8366edb06e45cba73cb6d07e
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// for forward declaration of ostreambuf_iterator

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP___ITERATOR_OSTREAMBUF_ITERATOR_H


=== system/lib/libcxx/include/__iterator/permutable.h ===
SHA256: d2f6c030d310fc7e767bc281b097252e46bee52e6504f54c741024875f5243f5
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_PERMUTABLE_H


=== system/lib/libcxx/include/__iterator/prev.h ===
SHA256: 20b7ebd5dc34a1fb5f5b84e84560a09648750142be790315b86d7e66fe98a1c8
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// LWG 3197

// It is unclear what the implications of "BidirectionalIterator" in the standard are.

// However, calling std::prev(non-bidi-iterator) is obviously an error and we should catch it at compile time.

// [range.iter.op.prev]

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_PREV_H


=== system/lib/libcxx/include/__iterator/product_iterator.h ===
SHA256: 585ba26fafb9e0db8854a9712a6d484db3e22ed844f0de4b84bdbfd024013970
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Product iterators are iterators that contain two or more underlying iterators.

//

// For example, std::flat_map stores its data into two separate containers, and its iterator

// is a proxy over two separate underlying iterators. The concept of product iterators

// allows algorithms to operate over these underlying iterators separately, opening the

// door to various optimizations.

//

// If __product_iterator_traits can be instantiated, the following functions and associated types must be provided:

// - static constexpr size_t Traits::__size

//   The number of underlying iterators inside the product iterator.

//

// - template <size_t _N>

//   static decltype(auto) Traits::__get_iterator_element(It&& __it)

//   Returns the _Nth iterator element of the given product iterator.

//

// - template <class... _Iters>

//   static _Iterator __make_product_iterator(_Iters&&...);

//   Creates a product iterator from the given underlying iterators.

/* exposition-only:
{
  static constexpr size_t __size = ...;

  template <size_t _N, class _Iter>
  static decltype(auto) __get_iterator_element(_Iter&&);

  template <class... _Iters>
  static _Iterator __make_product_iterator(_Iters&&...);
};
*/

// _LIBCPP___ITERATOR_PRODUCT_ITERATOR_H


=== system/lib/libcxx/include/__iterator/projected.h ===
SHA256: 799d3c5d6c2d96a7220f3f161b58a6cfa6ceb069787358408b09c36899ea7f92
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// iter_difference_t

// not defined

// not defined

// Note that we implement std::projected in a way that satisfies P2538R1 even in standard

// modes before C++26 to avoid breaking the ABI between standard modes (even though ABI

// breaks with std::projected are expected to have essentially no impact).

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_PROJECTED_H


=== system/lib/libcxx/include/__iterator/ranges_iterator_traits.h ===
SHA256: 3ae56a9ca9db7f439fe562d6cb483307fd1a722d6b7d02ad257a5f1f7cf67672
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___ITERATOR_RANGES_ITERATOR_TRAITS_H


=== system/lib/libcxx/include/__iterator/readable_traits.h ===
SHA256: 2010a8faf858510c62a085569f43711e1780f8870a8e7ba399f2652a63f270ab
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [readable.traits]

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_READABLE_TRAITS_H


=== system/lib/libcxx/include/__iterator/reverse_access.h ===
SHA256: abd6f930c1c238e69daf9c862211bcaad1fb5bf376db569f55777d87e560b85a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 14

// _LIBCPP___ITERATOR_REVERSE_ACCESS_H


=== system/lib/libcxx/include/__iterator/reverse_iterator.h ===
SHA256: f0f58429f29618c6b80a6f716d4f64ba8f8d0ad75cfb5e29b81f7a62684ffef5
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// no longer used as of LWG #2360, not removed due to ABI break

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_REVERSE_ITERATOR_H


=== system/lib/libcxx/include/__iterator/segmented_iterator.h ===
SHA256: 3c2361085ab506c88c85424125f7e303053bc9b8895bde90e51dcd894e5ea0b0
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Segmented iterators are iterators over (not necessarily contiguous) sub-ranges.

//

// For example, std::deque stores its data into multiple blocks of contiguous memory,

// which are not stored contiguously themselves. The concept of segmented iterators

// allows algorithms to operate over these multi-level iterators natively, opening the

// door to various optimizations. See http://lafstern.org/matt/segmented.pdf for details.

//

// If __segmented_iterator_traits can be instantiated, the following functions and associated types must be provided:

// - Traits::__local_iterator

//   The type of iterators used to iterate inside a segment.

//

// - Traits::__segment_iterator

//   The type of iterators used to iterate over segments.

//   Segment iterators can be forward iterators or bidirectional iterators, depending on the

//   underlying data structure.

//

// - static __segment_iterator Traits::__segment(It __it)

//   Returns an iterator to the segment that the provided iterator is in.

//

// - static __local_iterator Traits::__local(It __it)

//   Returns the local iterator pointing to the element that the provided iterator points to.

//

// - static __local_iterator Traits::__begin(__segment_iterator __it)

//   Returns the local iterator to the beginning of the segment that the provided iterator is pointing into.

//

// - static __local_iterator Traits::__end(__segment_iterator __it)

//   Returns the one-past-the-end local iterator to the segment that the provided iterator is pointing into.

//

// - static It Traits::__compose(__segment_iterator, __local_iterator)

//   Returns the iterator composed of the segment iterator and local iterator.

/* exposition-only:
{
  using __segment_iterator = ...;
  using __local_iterator   = ...;

  static __segment_iterator __segment(_Iterator);
  static __local_iterator __local(_Iterator);
  static __local_iterator __begin(__segment_iterator);
  static __local_iterator __end(__segment_iterator);
  static _Iterator __compose(__segment_iterator, __local_iterator);
};
*/

// _LIBCPP___SEGMENTED_ITERATOR_H


=== system/lib/libcxx/include/__iterator/size.h ===
SHA256: 001355d509f20b550c15bf8e211fcd4e28ea74dcde50704943c483c8670d6337
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// GCC complains about the implicit conversion from ptrdiff_t to size_t in

// the array bound.

// _LIBCPP_STD_VER >= 17

// _LIBCPP___ITERATOR_SIZE_H


=== system/lib/libcxx/include/__iterator/sortable.h ===
SHA256: 65a778ed97ef601d3239d6e025e60686e501c7070a0c063dc7a8bcfc82839f40
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_SORTABLE_H


=== system/lib/libcxx/include/__iterator/static_bounded_iter.h ===
SHA256: dadd72ab7d7bb0779ea2b7e3973a2e4d530c52650ca915fce29d4f5092542361
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// current iterator

// start of the valid range, which is [__begin_, __begin_ + _Size)

/* __begin */

// current iterator

// This is an iterator wrapper for contiguous iterators that points within a range

// whose size is known at compile-time. This is very similar to `__bounded_iter`,

// except that we don't have to store the end of the range in physical memory since

// it can be computed from the start of the range.

//

// The operations on which this iterator wrapper traps are the same as `__bounded_iter`.

// Create a singular iterator.

//

// Such an iterator points past the end of an empty range, so it is not dereferenceable.

// Operations like comparison and assignment are valid.

// Assign a bounded iterator to another one, rebinding the bounds of the iterator as well.

// Create an iterator wrapping the given iterator, and whose bounds are described

// by the provided [begin, begin + _Size] range.

// Dereference and indexing operations.

// Arithmetic operations.

//

// These operations check that the iterator remains within `[begin, end]`.

// Comparison operations.

//

// These operations do not check whether the iterators are within their bounds.

// The valid range for each iterator is also not considered as part of the comparison,

// i.e. two iterators pointing to the same location will be considered equal even

// if they have different validity ranges.

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_STATIC_BOUNDED_ITER_H


=== system/lib/libcxx/include/__iterator/unreachable_sentinel.h ===
SHA256: f23c13fe34b1f11dcab06e1cd6b79f1b9b71c9da07a6ccd83cb8f8053655f2e9
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___ITERATOR_UNREACHABLE_SENTINEL_H


=== system/lib/libcxx/include/__iterator/wrap_iter.h ===
SHA256: a3ec14287b9888a54b10ba8a463dcef487fd4ea2611f6621faa133fc50f4547a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// C++03

// _LIBCPP___ITERATOR_WRAP_ITER_H


=== system/lib/libcxx/include/__locale_dir/check_grouping.h ===
SHA256: f1da1ebf0af45e64f1fb05ca7aa4fc242e1356eb2513287fbbc1220e56e465db
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP___LOCALE_DIR_CHECK_GROUPING_H


=== system/lib/libcxx/include/__locale_dir/get_c_locale.h ===
SHA256: 3d91eb0d528ab084653a6e379f01b6eeff01e461cf59e6607c17f2df845dd0b1
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// FIXME: This should really be part of the locale base API

// Get the C locale object

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP___LOCALE_DIR_GET_C_LOCALE_H


=== system/lib/libcxx/include/__locale_dir/locale_base_api.h ===
SHA256: f876b23300f381ab24767aaa786c1a08ccf513066c3a268f45e45656d6f97887
//===-----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// The platform-specific headers have to provide the following interface.

//

// These functions are equivalent to their C counterparts, except that __locale::__locale_t

// is used instead of the current global locale.

//

// Variadic functions may be implemented as templates with a parameter pack instead

// of C-style variadic functions.

//

// Most of these functions are only required when building the library. Functions that are also

// required when merely using the headers are marked as such below.

//

// TODO: __localeconv shouldn't take a reference, but the Windows implementation doesn't allow copying __locale_t

// TODO: Eliminate the need for any of these functions from the headers.

//

// Locale management

// -----------------

// namespace __locale {

//  using __locale_t = implementation-defined;  // required by the headers

//  using __lconv_t  = implementation-defined;

//  __locale_t  __newlocale(int, const char*, __locale_t);

//  void        __freelocale(__locale_t);

//  char*       __setlocale(int, const char*);

//  __lconv_t*  __localeconv(__locale_t&);

// }

//

// // required by the headers

// #define _LIBCPP_COLLATE_MASK   /* implementation-defined */

// #define _LIBCPP_CTYPE_MASK     /* implementation-defined */

// #define _LIBCPP_MONETARY_MASK  /* implementation-defined */

// #define _LIBCPP_NUMERIC_MASK   /* implementation-defined */

// #define _LIBCPP_TIME_MASK      /* implementation-defined */

// #define _LIBCPP_MESSAGES_MASK  /* implementation-defined */

// #define _LIBCPP_ALL_MASK       /* implementation-defined */

// #define _LIBCPP_LC_ALL         /* implementation-defined */

//

// Strtonum functions

// ------------------

// namespace __locale {

//  // required by the headers

//  float               __strtof(const char*, char**, __locale_t);

//  double              __strtod(const char*, char**, __locale_t);

//  long double         __strtold(const char*, char**, __locale_t);

//  long long           __strtoll(const char*, char**, __locale_t);

//  unsigned long long  __strtoull(const char*, char**, __locale_t);

// }

//

// Character manipulation functions

// --------------------------------

// namespace __locale {

//  int     __isdigit(int, __locale_t);  // required by the headers

//  int     __isxdigit(int, __locale_t); // required by the headers

//  int     __toupper(int, __locale_t);

//  int     __tolower(int, __locale_t);

//  int     __strcoll(const char*, const char*, __locale_t);

//  size_t  __strxfrm(char*, const char*, size_t, __locale_t);

//

//  int     __iswctype(wint_t, wctype_t, __locale_t);

//  int     __iswspace(wint_t, __locale_t);

//  int     __iswprint(wint_t, __locale_t);

//  int     __iswcntrl(wint_t, __locale_t);

//  int     __iswupper(wint_t, __locale_t);

//  int     __iswlower(wint_t, __locale_t);

//  int     __iswalpha(wint_t, __locale_t);

//  int     __iswblank(wint_t, __locale_t);

//  int     __iswdigit(wint_t, __locale_t);

//  int     __iswpunct(wint_t, __locale_t);

//  int     __iswxdigit(wint_t, __locale_t);

//  wint_t  __towupper(wint_t, __locale_t);

//  wint_t  __towlower(wint_t, __locale_t);

//  int     __wcscoll(const wchar_t*, const wchar_t*, __locale_t);

//  size_t  __wcsxfrm(wchar_t*, const wchar_t*, size_t, __locale_t);

//

//  size_t  __strftime(char*, size_t, const char*, const tm*, __locale_t);

// }

//

// Other functions

// ---------------

// namespace __locale {

//  implementation-defined __mb_len_max(__locale_t);

//  wint_t  __btowc(int, __locale_t);

//  int     __wctob(wint_t, __locale_t);

//  size_t  __wcsnrtombs(char*, const wchar_t**, size_t, size_t, mbstate_t*, __locale_t);

//  size_t  __wcrtomb(char*, wchar_t, mbstate_t*, __locale_t);

//  size_t  __mbsnrtowcs(wchar_t*, const char**, size_t, size_t, mbstate_t*, __locale_t);

//  size_t  __mbrtowc(wchar_t*, const char*, size_t, mbstate_t*, __locale_t);

//  int     __mbtowc(wchar_t*, const char*, size_t, __locale_t);

//  size_t  __mbrlen(const char*, size_t, mbstate_t*, __locale_t);

//  size_t  __mbsrtowcs(wchar_t*, const char**, size_t, mbstate_t*, __locale_t);

//

//  int     __snprintf(char*, size_t, __locale_t, const char*, ...); // required by the headers

//  int     __asprintf(char**, __locale_t, const char*, ...);        // required by the headers

//  int     __sscanf(const char*, __locale_t, const char*, ...);     // required by the headers

// }

// TODO: This is a temporary definition to bridge between the old way we defined the locale base API

//       (by providing global non-reserved names) and the new API. As we move individual platforms

//       towards the new way of defining the locale base API, this should disappear since each platform

//       will define those directly.

//

// Locale management

//

// _LIBCPP_BUILDING_LIBRARY

//

// Strtonum functions

//

//

// Character manipulation functions

//

//

// Other functions

//

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP_BUILDING_LIBRARY

// GCC doesn't support [[gnu::format]] on variadic templates

/* nothing */

// namespace __locale

// Compatibility definition of locale base APIs

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_H


=== system/lib/libcxx/include/__locale_dir/locale_base_api/android.h ===
SHA256: 99deb0fd52f78bf70b4532dc81618cdf4a0fcc473076cb7702abadc66c62699a
// -*- C++ -*-

//===-----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// FIXME: Is this actually required?

// If we do not have this header, we are in a platform build rather than an NDK

// build, which will always be at least as new as the ToT NDK, in which case we

// don't need any of the inlines below since libc provides them.

// In NDK versions later than 16, locale-aware functions are provided by

// legacy_stdlib_inlines.h

// __ANDROID_API__ < 26

// __NDK_MAJOR__ <= 16

// __has_include(<android/ndk-version.h>)

// _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_ANDROID_H


=== system/lib/libcxx/include/__locale_dir/locale_base_api/bsd_locale_fallbacks.h ===
SHA256: 2aecacdd82c7b8563ffea85b2c500d6ab55650fb37fb4983777144ccb70a51b6
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// The BSDs have lots of *_l functions.  This file provides reimplementations

// of those functions for non-BSD platforms.

//===----------------------------------------------------------------------===//

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_BSD_LOCALE_FALLBACKS_H


=== system/lib/libcxx/include/__locale_dir/locale_base_api/ibm.h ===
SHA256: b8c19aa4a66c5e676a6bb29ba01b50f42d4f35823f250d63c4578e1c197823a9
// -*- C++ -*-

//===-----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// defined(__MVS__)

// POSIX routines

// defined(__MVS__)

/* base */

// namespace

// The following are not POSIX routines.  These are quick-and-dirty hacks

// to make things pretend to work

// va_copy may not be provided by the C library in C++03 mode.

// _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_IBM_H


=== system/lib/libcxx/include/__locale_dir/locale_base_api/musl.h ===
SHA256: 94f618f3e16128dc59e7fc6ff5c29215f463b35e0eff42a6329559f4a7782c8a
// -*- C++ -*-

//===-----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// This adds support for the extended locale functions that are currently

// missing from the Musl C library.

//

// This only works when the specified locale is "C" or "POSIX", but that's

// about as good as we can do without implementing full xlocale support

// in Musl.

//===----------------------------------------------------------------------===//

// _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_MUSL_H


=== system/lib/libcxx/include/__locale_dir/locale_base_api/openbsd.h ===
SHA256: acc1b1bf75ada4dfc9250318948e7327f721a57b90fe9fb1895e2b1b6458e159
// -*- C++ -*-

//===-----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_OPENBSD_H


=== system/lib/libcxx/include/__locale_dir/messages.h ===
SHA256: e173731a6b37426bfc21ea86bbac406432ab9453ce8cfccff076329a92d2d9f5
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Most unix variants have catopen.  These are the specific ones that don't.

// !_LIBCPP_HAS_CATOPEN

// _LIBCPP_HAS_CATOPEN

// !_LIBCPP_HAS_CATOPEN

// _LIBCPP_HAS_CATOPEN

// !_LIBCPP_HAS_CATOPEN

// _LIBCPP_HAS_CATOPEN

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP___LOCALE_DIR_MESSAGES_H


=== system/lib/libcxx/include/__locale_dir/money.h ===
SHA256: 67c1a516925d25813f9498286d94cc0d230cfc1b860ad3545560940875c91c2f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// money_base

// moneypunct

// moneypunct_byname

// money_get

// true == success

// Capture the spaces read into money_base::{space,none} so they

// can be compared to initial spaces in __sym.

// sign is required

// locale has no way of specifying a sign. Use the initial value of __neg as a default

// Match spaces we've already read against spaces at

// the beginning of __sym.

// No match. Put __sym_space_end back at the

// beginning of __sym, which will prevent a

// match in the next loop.

// money_put

// remember start of value so we can reverse it

// find beginning of digits

// find end of digits

// print fractional part

// print units part

// reverse it

// print rest of sign, if any

// set alignment

// convert to char

// secure memory for digit storage

// gather info

// secure memory for formatting

// format

// gather info

// secure memory for formatting

// format

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP___LOCALE_DIR_MONEY_H


=== system/lib/libcxx/include/__locale_dir/num.h ===
SHA256: 4aa5af94f28e2a2a62dc216f7e1c27c9685b5149783dac0f942e6f4e541d6501
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// TODO: Properly qualify calls now that the locale base API defines functions instead of macros

// NOLINTBEGIN(libcpp-robust-against-adl)

// "0123456789abcdefABCDEFxX+-pPiInN"

// count of leading characters in __src used for parsing integers ("012..X+-")

// count of leading characters in __src used for parsing floating-point values ("012..-pP")

// Stage 1, nothing to do

// Stage 2

// the leading character excluding the sign must be a decimal digit

// Stage 3

// Digit grouping checked

// EOF checked

// Stage 1

// Stage 2

// Stage 3

// Digit grouping checked

// EOF checked

// Stage 1

// Stage 2

// Stage 3

// Digit grouping checked

// EOF checked

// Stage 1

// Stage 2

// Stage 3

// EOF checked

// Stage 1 - Get number in narrow char

// Worst case is octal, with showbase enabled. Note that octal is always

// printed as an unsigned value.

// 1 char per 3 bits

// round up

// base prefix + terminating null character

// Extract base

// Print '-' and make the argument unsigned

// Maybe add '+' prefix

// Add base prefix

// Make letters uppercase

// Stage 2 - Widen __nar while adding thousands separators

// pad here

// end of output

// [__o, __oe) contains thousands_sep'd wide number

// Stage 3 & 4

// Stage 1 - Get number in narrow char

// Stage 2 - Widen __nar while adding thousands separators

// pad here

// end of output

// [__o, __oe) contains thousands_sep'd wide number

// Stage 3 & 4

// NOLINTEND(libcpp-robust-against-adl)

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP___LOCALE_DIR_NUM_H


=== system/lib/libcxx/include/__locale_dir/pad_and_output.h ===
SHA256: b965438d9e746e6bada7600b69974188be6dd1b2c81221c2691b5c9a7b0cc72d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP___LOCALE_DIR_PAD_AND_OUTPUT_H


=== system/lib/libcxx/include/__locale_dir/scan_keyword.h ===
SHA256: 60f94c9eaaae375ac559b0d5130cfeec6aa63b587a1620b6e73bb9c2c1c4ee01
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __scan_keyword

// Scans [__b, __e) until a match is found in the basic_strings range

//  [__kb, __ke) or until it can be shown that there is no match in [__kb, __ke).

//  __b will be incremented (visibly), consuming CharT until a match is found

//  or proved to not exist.  A keyword may be "", in which will match anything.

//  If one keyword is a prefix of another, and the next CharT in the input

//  might match another keyword, the algorithm will attempt to find the longest

//  matching keyword.  If the longer matching keyword ends up not matching, then

//  no keyword match is found.  If no keyword match is found, __ke is returned

//  and failbit is set in __err.

//  Else an iterator pointing to the matching keyword is found.  If more than

//  one keyword matches, an iterator to the first matching keyword is returned.

//  If on exit __b == __e, eofbit is set in __err.  If __case_sensitive is false,

//  __ct is used to force to lower case before comparing characters.

//  Examples:

//  Keywords:  "a", "abb"

//  If the input is "a", the first keyword matches and eofbit is set.

//  If the input is "abc", no match is found and "ab" are consumed.

// At this point, any keyword might match

// but none of them definitely do

// Initialize all statuses to __might_match, except for "" keywords are __does_match

// While there might be a match, test keywords against the next CharT

// Peek at the next CharT but don't consume it

// For each keyword which might match, see if the __indx character is __c

// If a match if found, consume __c

// If a match is found, and that is the last character in the keyword,

//    then that keyword matches.

// If the keyword doesn't match this character, then change the keyword

//    to doesn't match

// consume if we matched a character

// If we consumed a character and there might be a matched keyword that

//   was marked matched on a previous iteration, then such keywords

//   which are now marked as not matching.

// We've exited the loop because we hit eof and/or we have no more "might matches".

// Return the first matching result

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP___LOCALE_DIR_SCAN_KEYWORD_H


=== system/lib/libcxx/include/__locale_dir/support/apple.h ===
SHA256: c2be4b14ad29b3395452a4667a5f390f8c7eb58f1b8121d2ad0c566afb7cd165
//===-----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___LOCALE_DIR_SUPPORT_APPLE_H


=== system/lib/libcxx/include/__locale_dir/support/bsd_like.h ===
SHA256: 4e346ecf6a4ccdcf33edda731ec5b954acd2a9ca14a687f1045d0893b130f4d6
//===-----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// std::lconv

//

// Locale management

//

// _LIBCPP_BUILDING_LIBRARY

//

// Strtonum functions

//

//

// Character manipulation functions

//

// _LIBCPP_HAS_WIDE_CHARACTERS

//

// Other functions

//

// wcsnrtombs is a POSIX extension

// mbsnrtowcs is a POSIX extension

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP_BUILDING_LIBRARY

// GCC doesn't support [[gnu::format]] on variadic templates

/* nothing */

// non-standard

// namespace __locale

// _LIBCPP___LOCALE_DIR_SUPPORT_BSD_LIKE_H


=== system/lib/libcxx/include/__locale_dir/support/freebsd.h ===
SHA256: db1b0dfcbccc9c3792637498be608f50cf304fa7bd29f32cedfb8c5d0c1f827a
//===-----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___LOCALE_DIR_SUPPORT_FREEBSD_H


=== system/lib/libcxx/include/__locale_dir/support/fuchsia.h ===
SHA256: 7c237be2d449e87c691894026992f737d68298bac479c67176b8126d3b2c93fb
//===-----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// uselocale & friends

//

// Locale management

//

//

// Other functions

//

// non-standard

// non-standard

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP_BUILDING_LIBRARY

// GCC doesn't support [[gnu::format]] on variadic templates

/* nothing */

// non-standard

// namespace __locale

// _LIBCPP___LOCALE_DIR_SUPPORT_FUCHSIA_H


=== system/lib/libcxx/include/__locale_dir/support/linux.h ===
SHA256: b0891467888e2105cc10f5bc068ea26ffddbeb1a42b23969df5527329a841fc9
//===-----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// std::lconv

//

// Locale management

//

// _LIBCPP_BUILDING_LIBRARY

//

// Strtonum functions

//

//

// Character manipulation functions

//

// _LIBCPP_HAS_WIDE_CHARACTERS

//

// Other functions

//

// non-standard

// non-standard

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP_BUILDING_LIBRARY

// GCC complains that this can't be always_inline due to C-style varargs

// GCC complains that this can't be always_inline due to C-style varargs

// non-standard

// GCC complains that this can't be always_inline due to C-style varargs

// namespace __locale

// _LIBCPP___LOCALE_DIR_SUPPORT_LINUX_H


=== system/lib/libcxx/include/__locale_dir/support/no_locale/characters.h ===
SHA256: fd8df90587f16570c69186d1c965b691351ac0088144ec57f3976ca81f0666d8
//===-----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Character manipulation functions

//

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP_BUILDING_LIBRARY

// namespace __locale

// _LIBCPP___LOCALE_DIR_SUPPORT_NO_LOCALE_CHARACTERS_H


=== system/lib/libcxx/include/__locale_dir/support/no_locale/strtonum.h ===
SHA256: 24c3924eb7b0e4f949c74c1dbfbb05fcfe972e32c051d67df7dbc9b66fbfb30a
//===-----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Strtonum functions

//

// namespace __locale

// _LIBCPP___LOCALE_DIR_SUPPORT_NO_LOCALE_STRTONUM_H


=== system/lib/libcxx/include/__locale_dir/support/windows.h ===
SHA256: 122899946d556351c12c018c9527d85882ac855e2e112c00cb38e7c593e0e36f
//===-----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// std::lconv & friends

// ::_isupper_l & friends

// ::_locale_t

// ::_sscanf_l

// ::_strtod_l & friends

// ::_strcoll_l

// ::_strftime_l

//

// Locale management

//

// __lc_ not copied

// _LIBCPP_BUILDING_LIBRARY

//

// Strtonum functions

//

// the *_l functions are prefixed on Windows, only available for msvcr80+, VS2005+

//

// Character manipulation functions

//

// TODO: use locale to determine blank characters

/*loc*/

// _LIBCPP_HAS_WIDE_CHARACTERS

//

// Other functions

//

// _LIBCPP_BUILDING_LIBRARY

// GCC doesn't support [[gnu::format]] on variadic templates

/* nothing */

// Setting the locale can be expensive even when the locale given is

// already the current locale, so do an explicit check to see if the

// current locale is already the one we want.

// If every category is the same, the locale string will simply be the

// locale name, otherwise it will be a semicolon-separated string listing

// each category.  In the second case, we know at least one category won't

// be what we want, so we only have to check the first case.

// The CRT documentation doesn't explicitly say, but setlocale() does the

// right thing when given a semicolon-separated list of locale settings

// for the different categories in the same format as returned by

// setlocale(LC_ALL, nullptr).

// _LIBCPP_BUILDING_LIBRARY

// namespace __locale

// _LIBCPP___LOCALE_DIR_SUPPORT_WINDOWS_H


=== system/lib/libcxx/include/__locale_dir/time.h ===
SHA256: 5cb4971fcf2f49c891351bfb8d1bc0771cd2b8504d1aa7c4dcc71fe33191320d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Precondition:  __n >= 1

// get first digit

// get next digit

// time_get primitives

// Note:  ignoring case comes from the POSIX strptime spec

// Note:  ignoring case comes from the POSIX strptime spec

// time_get end primitives

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP___LOCALE_DIR_TIME_H


=== system/lib/libcxx/include/__locale_dir/wbuffer_convert.h ===
SHA256: 73be26e86222438221cb69cddb52a0efe80a897651b5beeeaf2f8c87209e8d1d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types:

// FIXME: Do we ever need to restore the state here?

// state_type __svs = __st_;

// __width > 0 || __off == 0, now check __way

// _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_WSTRING_CONVERT)

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP___LOCALE_DIR_WBUFFER_CONVERT_H


=== system/lib/libcxx/include/__locale_dir/wstring_convert.h ===
SHA256: e69bb0754715e5fc318273fec9323e4580c91c3a93929e9a1d8e5decb18f0d6f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_CXX03_LANG

// This only gets executed if _Elem is char

// This only gets executed if _Elem is char

// _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_WSTRING_CONVERT)

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP___LOCALE_DIR_WSTRING_CONVERT_H


=== system/lib/libcxx/include/__math/abs.h ===
SHA256: 341636b5293360e5251d138fe4743f0d3a29f09068070ef4d34be40b0750ad84
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// fabs

// abs

// namespace __math

// _LIBCPP___MATH_ABS_H


=== system/lib/libcxx/include/__math/copysign.h ===
SHA256: 1186c10483aa839f0a5a1d8d9b3b36ef79dfba201b1cdadc9707bd4affdfe372
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// copysign

// namespace __math

// _LIBCPP___MATH_COPYSIGN_H


=== system/lib/libcxx/include/__math/error_functions.h ===
SHA256: fa89421a0449506b2f2f3aa41eb00bd24bd10a852b6e4c2ce6d16e90bf098efb
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// erf

// erfc

// namespace __math

// _LIBCPP___MATH_ERROR_FUNCTIONS_H


=== system/lib/libcxx/include/__math/exponential_functions.h ===
SHA256: 0e2cd5e3733199554e1ad39a19167768b9c2d815188bd7c7c51f57bfe41c2150
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// exp

// frexp

// ldexp

// exp2

// expm1

// scalbln

// scalbn

// pow

// namespace __math

// _LIBCPP___MATH_EXPONENTIAL_FUNCTIONS_H


=== system/lib/libcxx/include/__math/fdim.h ===
SHA256: ea4c2ec47ad56b2c0ed613fdf66cfc970f5d25206623188d4bd176c249f856f8
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __math

// _LIBCPP___MATH_FDIM_H


=== system/lib/libcxx/include/__math/fma.h ===
SHA256: df168ad9d3eb80dc58510cc6ccfbc8b7ca700a462f08b32893a67a8936bbfe7b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __math

// _LIBCPP___MATH_FMA_H


=== system/lib/libcxx/include/__math/gamma.h ===
SHA256: be2051df98f846118eb92308af1043dc96a6cd057cea04b754a575e0487b2c32
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// lgamma

// nan

// tgamma

// namespace __math

// _LIBCPP___MATH_GAMMA_H


=== system/lib/libcxx/include/__math/hyperbolic_functions.h ===
SHA256: c842d8cb6f6d33a03314129242f95f13fa5ca449f035f4ae99b45dfd5faaa77e
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// cosh

// sinh

// tanh

// namespace __math

// _LIBCPP___MATH_HYPERBOLIC_FUNCTIONS_H


=== system/lib/libcxx/include/__math/hypot.h ===
SHA256: 91b467044de6d82eacde765e0ec974086c9fad3b70aa3608f06fe34c8c739f18
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Computes the three-dimensional hypotenuse: `std::hypot(x,y,z)`.

// The naive implementation might over-/underflow which is why this implementation is more involved:

//    If the square of an argument might run into issues, we scale the arguments appropriately.

// See https://github.com/llvm/llvm-project/issues/92782 for a detailed discussion and summary.

// Factors needed to determine if over-/underflow might happen

// Scale arguments depending on their size

// x*x + y*y + z*z might overflow

// x*x + y*y + z*z might underflow

// Compute hypot of scaled arguments and undo scaling

// namespace __math

// _LIBCPP___MATH_HYPOT_H


=== system/lib/libcxx/include/__math/inverse_hyperbolic_functions.h ===
SHA256: 80f7bc2ced8484502f671a453885da090386e2dfd13a41afe295904764c1c819
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// acosh

// asinh

// atanh

// namespace __math

// _LIBCPP___MATH_INVERSE_HYPERBOLIC_FUNCTIONS_H


=== system/lib/libcxx/include/__math/inverse_trigonometric_functions.h ===
SHA256: 2048ecd7bdccc6c86fc14906db6281d34b802b4a964a423c6825998a7d4857ae
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// acos

// asin

// atan

// atan2

// namespace __math

// _LIBCPP___MATH_INVERSE_TRIGONOMETRIC_FUNCTIONS_H


=== system/lib/libcxx/include/__math/logarithms.h ===
SHA256: 80f4a7ce8d0697901775692a40100e810dac7638bd404bcf5747f2a0a8c8a137
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// log

// log10

// ilogb

// log1p

// log2

// logb

// namespace __math

// _LIBCPP___MATH_LOGARITHMS_H


=== system/lib/libcxx/include/__math/min_max.h ===
SHA256: 5ebf09855cb39bb0441c64239dda1159bc65a68d99abff1b9db2388dae06a870
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// fmax

// fmin

// namespace __math

// _LIBCPP___MATH_MIN_MAX_H


=== system/lib/libcxx/include/__math/modulo.h ===
SHA256: 129e47ebcc44fa8118cf5ecddbd49cdb5c96a37b82d55c8e9e84b7408a844546
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// fmod

// modf

// namespace __math

// _LIBCPP___MATH_MODULO_H


=== system/lib/libcxx/include/__math/remainder.h ===
SHA256: 24cb82e905b99314642d15f4c49098698d30d8e255941b48d2a7565b40117653
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// remainder

// remquo

// namespace __math

// _LIBCPP___MATH_REMAINDER_H


=== system/lib/libcxx/include/__math/roots.h ===
SHA256: 9e3600a0563353af7b159158a758892d661a7ca5aca8b333f4cff40e669381cc
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// sqrt

// cbrt

// namespace __math

// _LIBCPP___MATH_ROOTS_H


=== system/lib/libcxx/include/__math/rounding_functions.h ===
SHA256: 515720b3b8565a99a108cb130ca46f0010cf29d802ee3fe417b806d023743a26
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// ceil

// floor

// llrint

// llround

// lrint

// lround

// nearbyint

// nextafter

// nexttoward

// rint

// round

// trunc

// namespace __math

// _LIBCPP___MATH_ROUNDING_FUNCTIONS_H


=== system/lib/libcxx/include/__math/special_functions.h ===
SHA256: 14dcecd19f231b712acbc06a693210c5b0f7037758df45595c63f312e1d06fac
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// The Hermite polynomial H_n(x).

// The implementation is based on the recurrence formula: H_{n+1}(x) = 2x H_n(x) - 2n H_{n-1}.

// Press, William H., et al. Numerical recipes 3rd edition: The art of scientific computing.

// Cambridge university press, 2007, p. 183.

// NOLINTBEGIN(readability-identifier-naming)

// Overflow occured. Two possible cases:

//    n is odd:  return infinity of the same sign as x.

//    n is even: return +Inf

// NOLINTEND(readability-identifier-naming)

// use double internally -- float is too prone to overflow!

// _LIBCPP_STD_VER >= 17

// _LIBCPP___MATH_SPECIAL_FUNCTIONS_H


=== system/lib/libcxx/include/__math/traits.h ===
SHA256: d9f2eef42aae7c25d8f0003dd28f00e60dfd71d696bc5cf97bf4050c440703e5
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// signbit

// TODO(LLVM 22): Remove conditional once support for Clang 19 is dropped.

// The universal C runtime (UCRT) in the WinSDK provides floating point overloads

// for std::signbit(). By defining our overloads as templates, we can work around

// this issue as templates are less preferred than non-template functions.

// isfinite

// isinf

// isnan

// isnormal

// isgreater

// isgreaterequal

// isless

// islessequal

// islessgreater

// isunordered

// namespace __math

// _LIBCPP___MATH_TRAITS_H


=== system/lib/libcxx/include/__math/trigonometric_functions.h ===
SHA256: d5f51af11c3fb5a6d7ddc66cbbd1246e99026f7e0b0edd6e3122db7ce5033df8
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// cos

// sin

// tan

// namespace __math

// _LIBCPP___MATH_TRIGONOMETRIC_FUNCTIONS_H


=== system/lib/libcxx/include/__mbstate_t.h ===
SHA256: 95ae2c6836739ef0ffc55b342e03675fd2cf8f1b6b884ec87ae3f2aa955c4811
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// The goal of this header is to provide mbstate_t without requiring all of

// <uchar.h> or <wchar.h>. It's also used by the libc++ versions of <uchar.h>

// and <wchar.h> to get mbstate_t when the C library doesn't provide <uchar.h>

// or <wchar.h>, hence the #include_next of those headers instead of #include.

// (e.g. if <wchar.h> isn't present in the C library, the libc++ <wchar.h>

// will include this header. This header needs to not turn around and cyclically

// include <wchar.h>, but fall through to <uchar.h>.)

//

// This does not define std::mbstate_t -- this only brings in the declaration

// in the global namespace.

// We define this here to support older versions of glibc <wchar.h> that do

// not define this for clang. This is also set in libc++'s <wchar.h> header,

// and we need to do so here too to avoid a different function signature given

// a different include order.

// works on most Unixes

// works on Darwin

// use the C standard provider of mbstate_t if present

// Try <uchar.h> in absence of <wchar.h> for mbstate_t

// _LIBCPP___MBSTATE_T_H


=== system/lib/libcxx/include/__mdspan/aligned_accessor.h ===
SHA256: 6c186b339c7f079dcb0bc16466301e03a15d9cc003cd69962ae22d25d69ab6dc
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//                        Kokkos v. 4.0

//       Copyright (2022) National Technology & Engineering

//               Solutions of Sandia, LLC (NTESS).

//

// Under the terms of Contract DE-NA0003525 with NTESS,

// the U.S. Government retains certain rights in this software.

//

//===---------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 26

// _LIBCPP___MDSPAN_ALIGNED_ACCESSOR_H


=== system/lib/libcxx/include/__mdspan/default_accessor.h ===
SHA256: ec2d8cb8f543accfc842c48ed6f8fb1d42097a679696882bd480f7d596ffe33d
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//                        Kokkos v. 4.0

//       Copyright (2022) National Technology & Engineering

//               Solutions of Sandia, LLC (NTESS).

//

// Under the terms of Contract DE-NA0003525 with NTESS,

// the U.S. Government retains certain rights in this software.

//

//===---------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 23

// _LIBCPP___MDSPAN_DEFAULT_ACCESSOR_H


=== system/lib/libcxx/include/__mdspan/extents.h ===
SHA256: c7ad9969b447944d3c5756690aec4681f7b3035e30af8e18b5df30003d608e6a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//                        Kokkos v. 4.0

//       Copyright (2022) National Technology & Engineering

//               Solutions of Sandia, LLC (NTESS).

//

// Under the terms of Contract DE-NA0003525 with NTESS,

// the U.S. Government retains certain rights in this software.

//

//===---------------------------------------------------------------------===//

// ------------------------------------------------------------------

// ------------ __static_array --------------------------------------

// ------------------------------------------------------------------

// array like class which provides an array of static values with get

// ------------------------------------------------------------------

// ------------ __possibly_empty_array  -----------------------------

// ------------------------------------------------------------------

// array like class which provides get function and operator [], and

// has a specialization for the size 0 case.

// This is needed to make the __maybe_static_array be truly empty, for

// all static values.

// ------------------------------------------------------------------

// ------------ static_partial_sums ---------------------------------

// ------------------------------------------------------------------

// Provides a compile time partial sum one can index into

// ------------------------------------------------------------------

// ------------ __maybe_static_array --------------------------------

// ------------------------------------------------------------------

// array like class which has a mix of static and runtime values but

// only stores the runtime values.

// The type of the static and the runtime values can be different.

// The position of a dynamic value is indicated through a tag value.

// Static values member

// Dynamic values member

// static mapping of indices to the position in the dynamic values array

// constructors from dynamic values only -- this covers the case for rank() == 0

// constructors from all values -- here rank will be greater than 0

// Not catching this could lead to out of bounds errors later

// e.g. using my_mdspan_t = mdspan<int, extents<int, 10>>; my_mdspan_t = m(new int[5], 5);

// Right-hand-side construction looks ok with allocation and size matching,

// but since (potentially elsewhere defined) my_mdspan_t has static size m now thinks its range is 10 not 5

// Not catching this could lead to out of bounds errors later

// e.g. using my_mdspan_t = mdspan<int, extents<int, 10>>; my_mdspan_t = m(new int[N], span<int,1>(&N));

// Right-hand-side construction looks ok with allocation and size matching,

// but since (potentially elsewhere defined) my_mdspan_t has static size m now thinks its range is 10 not N

// access functions

// observers

// Function to check whether a value is representable as another type

// value must be a positive integer otherwise returns false

// if _From is not an integral, we just check positivity

// namespace __mdspan_detail

// ------------------------------------------------------------------

// ------------ extents ---------------------------------------------

// ------------------------------------------------------------------

// Class to describe the extents of a multi dimensional array.

// Used by mdspan, mdarray and layout mappings.

// See ISO C++ standard [mdspan.extents]

// typedefs for integral types used

// internal storage type using __maybe_static_array

// [mdspan.extents.obs], observers of multidimensional index space

// [mdspan.extents.cons], constructors

// Construction from just dynamic or all values.

// Precondition check is deferred to __maybe_static_array constructor

// Not catching this could lead to out of bounds errors later

// e.g. mdspan m(ptr, dextents<char, 1>(200u)); leads to an extent of -56 on m

// Not catching this could lead to out of bounds errors later

// e.g. mdspan m(ptr, dextents<char, 1>(array<unsigned,1>(200))); leads to an extent of -56 on m

// Not catching this could lead to out of bounds errors later

// e.g. array a{200u}; mdspan<int, dextents<char,1>> m(ptr, extents(span<unsigned,1>(a))); leads to an extent of -56

// on m

// Function to construct extents storage from other extents.

// Converting constructor from other extents specializations

// Not catching this could lead to out of bounds errors later

// e.g. dextents<char,1>> e(dextents<unsigned,1>(200)) leads to an extent of -56 on e

// Not catching this could lead to out of bounds errors later

// e.g. mdspan<int, extents<int, 10>> m = mdspan<int, dextents<int, 1>>(new int[5], 5);

// Right-hand-side construction was ok, but m now thinks its range is 10 not 5

// Comparison operator

// avoid warning when comparing signed and unsigner integers and pick the wider of two types

// Recursive helper classes to implement dextents alias for extents

// namespace __mdspan_detail

// [mdspan.extents.dextents], alias template

// [mdspan.extents.dims], alias template `dims`

// Deduction guide for extents

// Helper type traits for identifying a class as extents.

// Function to check whether a set of indices are a multidimensional

// index into extents. This is a word of power in the C++ standard

// requiring that the indices are larger than 0 and smaller than

// the respective extents.

// namespace __mdspan_detail

// _LIBCPP_STD_VER >= 23

// _LIBCPP___MDSPAN_EXTENTS_H


=== system/lib/libcxx/include/__mdspan/layout_left.h ===
SHA256: 5af3048efa147f0b20247be39689825590934f55d32d434daee84f7a9ebc79bf
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//                        Kokkos v. 4.0

//       Copyright (2022) National Technology & Engineering

//               Solutions of Sandia, LLC (NTESS).

//

// Under the terms of Contract DE-NA0003525 with NTESS,

// the U.S. Government retains certain rights in this software.

//

//===---------------------------------------------------------------------===//

// [mdspan.layout.left.cons], constructors

// not catching this could lead to out-of-bounds access later when used inside mdspan

// mapping<dextents<char, 2>> map(dextents<char, 2>(40,40)); map(10, 3) == -126

// not catching this could lead to out-of-bounds access later when used inside mdspan

// mapping<dextents<char, 2>> map(mapping<dextents<int, 2>>(dextents<int, 2>(40,40))); map(10, 3) == -126

// not catching this could lead to out-of-bounds access later when used inside mdspan

// Note: since this is constraint to rank 1, extents itself would catch the invalid conversion first

//       and thus this assertion should never be triggered, but keeping it here for consistency

// layout_left::mapping<dextents<char, 1>> map(

//           layout_right::mapping<dextents<unsigned, 1>>(dextents<unsigned, 1>(200))); map.extents().extent(0) ==

//           -56

// [mdspan.layout.left.obs], observers

// Mappings are generally meant to be used for accessing allocations and are meant to guarantee to never

// return a value exceeding required_span_size(), which is used to know how large an allocation one needs

// Thus, this is a canonical point in multi-dimensional data structures to make invalid element access checks

// However, mdspan does check this on its own, so for now we avoid double checking in hardened mode

// While it would be caught by extents itself too, using a too large __r

// is functionally an out of bounds access on the stored information needed to compute strides

// _LIBCPP_STD_VER >= 23

// _LIBCPP___MDSPAN_LAYOUT_LEFT_H


=== system/lib/libcxx/include/__mdspan/layout_right.h ===
SHA256: 8b3114420b4b9c95a2c04d3f325de429395387ec70683d4e47207046172b72ca
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//                        Kokkos v. 4.0

//       Copyright (2022) National Technology & Engineering

//               Solutions of Sandia, LLC (NTESS).

//

// Under the terms of Contract DE-NA0003525 with NTESS,

// the U.S. Government retains certain rights in this software.

//

//===---------------------------------------------------------------------===//

// [mdspan.layout.right.cons], constructors

// not catching this could lead to out-of-bounds access later when used inside mdspan

// mapping<dextents<char, 2>> map(dextents<char, 2>(40,40)); map(3, 10) == -126

// not catching this could lead to out-of-bounds access later when used inside mdspan

// mapping<dextents<char, 2>> map(mapping<dextents<int, 2>>(dextents<int, 2>(40,40))); map(3, 10) == -126

// not catching this could lead to out-of-bounds access later when used inside mdspan

// Note: since this is constraint to rank 1, extents itself would catch the invalid conversion first

//       and thus this assertion should never be triggered, but keeping it here for consistency

// layout_right::mapping<dextents<char, 1>> map(

//           layout_left::mapping<dextents<unsigned, 1>>(dextents<unsigned, 1>(200))); map.extents().extent(0) ==

//           -56

// [mdspan.layout.right.obs], observers

// Mappings are generally meant to be used for accessing allocations and are meant to guarantee to never

// return a value exceeding required_span_size(), which is used to know how large an allocation one needs

// Thus, this is a canonical point in multi-dimensional data structures to make invalid element access checks

// However, mdspan does check this on its own, so for now we avoid double checking in hardened mode

// While it would be caught by extents itself too, using a too large __r

// is functionally an out of bounds access on the stored information needed to compute strides

// _LIBCPP_STD_VER >= 23

// _LIBCPP___MDSPAN_LAYOUT_RIGHT_H


=== system/lib/libcxx/include/__mdspan/layout_stride.h ===
SHA256: b7f232623469a84625af946cad08dc57ef4a0db93d5fe668e644bd65a88d9ea3
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//                        Kokkos v. 4.0

//       Copyright (2022) National Technology & Engineering

//               Solutions of Sandia, LLC (NTESS).

//

// Under the terms of Contract DE-NA0003525 with NTESS,

// the U.S. Government retains certain rights in this software.

//

//===---------------------------------------------------------------------===//

// namespace __mdspan_detail

// Used for default construction check and mandates

// We can only check correct conversion of _OtherIndexType if it is an integral

// compute offset of a strided layout mapping

// compute the permutation for sorting the stride array

// we never actually sort the stride array

// if two strides are the same then one of the associated extents must be 1 or 0

// both could be, but you can't have one larger than 1 come first

// [mdspan.layout.stride.cons], constructors

// Note the nominal precondition is covered by above static assert since

// if rank_dynamic is != 0 required_span_size is zero for default construction

// For integrals we can do a pre-conversion check, for other types not

// basically sort the dimensions based on strides and extents, sorting is represented in permute array

// check that this permutations represents a growing set

// stride() only compiles for rank > 0

// stride() only compiles for rank > 0

// [mdspan.layout.stride.obs], observers

// Mappings are generally meant to be used for accessing allocations and are meant to guarantee to never

// return a value exceeding required_span_size(), which is used to know how large an allocation one needs

// Thus, this is a canonical point in multi-dimensional data structures to make invalid element access checks

// However, mdspan does check this on its own, so for now we avoid double checking in hardened mode

// The answer of this function is fairly complex in the case where one or more

// extents are zero.

// Technically it is meaningless to query is_exhaustive() in that case, but unfortunately

// the way the standard defines this function, we can't give a simple true or false then.

// according to the standard layout_stride does not have a constraint on stride(r) for rank>0

// it still has the precondition though

// avoid warning when comparing signed and unsigner integers and pick the wider of two types

// _LIBCPP_STD_VER >= 23

// _LIBCPP___MDSPAN_LAYOUT_STRIDE_H


=== system/lib/libcxx/include/__mdspan/mdspan.h ===
SHA256: 2ab7f338d45f0a2da8986b47a55b81cbd862ecae33aad008febb481dc5855c39
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//                        Kokkos v. 4.0

//       Copyright (2022) National Technology & Engineering

//               Solutions of Sandia, LLC (NTESS).

//

// Under the terms of Contract DE-NA0003525 with NTESS,

// the U.S. Government retains certain rights in this software.

//

//===---------------------------------------------------------------------===//

// Helper for lightweight test checking that one did pass a layout policy as LayoutPolicy template argument

// namespace __mdspan_detail

//--------------------------------------------------------------------------------

// [mdspan.mdspan.cons], mdspan constructors, assignment, and destructor

// The following precondition is part of the standard, but is unlikely to be triggered.

// The extents constructor checks this and the mapping must be storing the extents, since

// its extents() function returns a const reference to extents_type.

// The only way this can be triggered is if the mapping conversion constructor would for example

// always construct its extents() only from the dynamic extents, instead of from the other extents.

// Not catching this could lead to out of bounds errors later

// e.g. mdspan<int, dextents<char,1>, non_checking_layout> m =

//        mdspan<int, dextents<unsigned, 1>, non_checking_layout>(ptr, 200); leads to an extent of -56 on m

//--------------------------------------------------------------------------------

// [mdspan.mdspan.members], members

// Note the standard layouts would also check this, but user provided ones may not, so we

// check the precondition here

// Could leave this as only checked in debug mode: semantically size() is never

// guaranteed to be related to any accessible range

// per LWG-4021 "mdspan::is_always_meow() should be noexcept"

// This one is necessary because all the constructors take `data_handle_type`s, not

// `_ElementType*`s, and `data_handle_type` is taken from `accessor_type::data_handle_type`, which

// seems to throw off automatic deduction guides.

// _LIBCPP_STD_VER >= 23

// _LIBCPP___MDSPAN_MDSPAN_H


=== system/lib/libcxx/include/__memory/addressof.h ===
SHA256: 21fe41d6b855c5bf29c0d404fdc5faec95af819442cfe2b272668c7b0e0c7ead
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Objective-C++ Automatic Reference Counting uses qualified pointers

// that require special addressof() signatures.

// _LIBCPP___MEMORY_ADDRESSOF_H


=== system/lib/libcxx/include/__memory/align.h ===
SHA256: 478fc259bb28ffdb4c18f096fb982fcc3321bbb54de689be8c8ac17767adeb73
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___MEMORY_ALIGN_H


=== system/lib/libcxx/include/__memory/aligned_alloc.h ===
SHA256: 978bfe99baf0f2280b4ccf768f87bc8fb54a0be05d518b83a6f42833a5e04f86
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Low-level helpers to call the aligned allocation and deallocation functions

// on the target platform. This is used to implement libc++'s own memory

// allocation routines -- if you need to allocate memory inside the library,

// chances are that you want to use `__libcpp_allocate` instead.

//

// Returns the allocated memory, or `nullptr` on failure.

// aligned_alloc() requires that __size is a multiple of __alignment,

// but for C++ [new.delete.general], only states "if the value of an

// alignment argument passed to any of these functions is not a valid

// alignment value, the behavior is undefined".

// To handle calls such as ::operator new(1, std::align_val_t(128)), we

// round __size up to the next multiple of __alignment.

// Rounding up could have wrapped around to zero, so we have to add another

// max() ternary to the actual call site to avoid succeeded in that case.

// If posix_memalign fails, __result is unmodified so we still return `nullptr`.

// _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION

// _LIBCPP___MEMORY_ALIGNED_ALLOC_H


=== system/lib/libcxx/include/__memory/allocate_at_least.h ===
SHA256: 154126d253126555850287c03ee3c069d30a35d916f72107d673f2f4d2212ab6
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 23

// _LIBCPP___MEMORY_ALLOCATE_AT_LEAST_H


=== system/lib/libcxx/include/__memory/allocation_guard.h ===
SHA256: 7b4ffb97d19c7759009332fe3ee76e57c8b8706ad27dba590e2f7f93b682153d
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Helper class to allocate memory using an Allocator in an exception safe

// manner.

//

// The intended usage of this class is as follows:

//

// 0

// 1     __allocation_guard<SomeAllocator> guard(alloc, 10);

// 2     do_some_initialization_that_may_throw(guard.__get());

// 3     save_allocated_pointer_in_a_noexcept_operation(guard.__release_ptr());

// 4

//

// If line (2) throws an exception during initialization of the memory, the

// guard's destructor will be called, and the memory will be released using

// Allocator deallocation. Otherwise, we release the memory from the guard on

// line (3) in an operation that can't throw -- after that, the guard is not

// responsible for the memory anymore.

//

// This is similar to a unique_ptr, except it's easier to use with a

// custom allocator.

// we perform the allocator conversion inside the constructor

// initialization order is important

// not called __release() because it's a keyword in objective-c++

// _LIBCPP___MEMORY_ALLOCATION_GUARD_H


=== system/lib/libcxx/include/__memory/allocator.h ===
SHA256: 51ccfb63b3aadffe77c5231d6a95ca4ba9de5a4136635aeff18b0a46cc9245e3
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// These specializations shouldn't be marked _LIBCPP_DEPRECATED_IN_CXX17.

// Specializing allocator<void> is deprecated, but not using it.

// _LIBCPP_STD_VER <= 17

// This class provides a non-trivial default constructor to the class that derives from it

// if the condition is satisfied.

//

// The second template parameter exists to allow giving a unique type to __non_trivial_if,

// which makes it possible to avoid breaking the ABI when making this a base class of an

// existing class. Without that, imagine we have classes D1 and D2, both of which used to

// have no base classes, but which now derive from __non_trivial_if. The layout of a class

// that inherits from both D1 and D2 will change because the two __non_trivial_if base

// classes are not allowed to share the same address.

//

// By making those __non_trivial_if base classes unique, we work around this problem and

// it is safe to start deriving from __non_trivial_if in existing classes.

// allocator

//

// Note: For ABI compatibility between C++20 and previous standards, we make

//       allocator<void> trivial in C++20.

// C++20 Removed members

// _LIBCPP___MEMORY_ALLOCATOR_H


=== system/lib/libcxx/include/__memory/allocator_arg_t.h ===
SHA256: 1544acfa10339724c3fea3f79278ca4f69f8162009c23396e6ec790961bf02ea
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// allocator construction

// FIXME: This should have a version which takes a non-const alloc.

// FIXME: This should have a version which takes a non-const alloc.

// _LIBCPP_CXX03_LANG

// _LIBCPP___MEMORY_ALLOCATOR_ARG_T_H


=== system/lib/libcxx/include/__memory/allocator_destructor.h ===
SHA256: 2826fdcdff3c2983f5b79cf0af91f40a6b9b270e7a459220079b663ca2404f06
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___MEMORY_ALLOCATOR_DESTRUCTOR_H


=== system/lib/libcxx/include/__memory/allocator_traits.h ===
SHA256: c013d853c6e3136fa335b8a8860d4b54e91140e00af36b748233f3bf26f923d1
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __pointer

// This trait returns _Alias<_Alloc> if that's well-formed, and _Ptr rebound to _Tp otherwise

// __const_pointer

// __void_pointer

// __const_void_pointer

// __size_type

// __alloc_traits_difference_type

// __propagate_on_container_copy_assignment

// __propagate_on_container_move_assignment

// __propagate_on_container_swap

// __is_always_equal

// __allocator_traits_rebind

// __has_allocate_hint_v

// __has_construct_v

// __has_destroy_v

// __has_max_size_v

// __has_select_on_container_copy_construction_v

// _LIBCPP_STD_VER

// _LIBCPP_CXX03_LANG

// _LIBCPP_CXX03_LANG

// __is_default_allocator_v

// __is_cpp17_move_insertable_v

// __is_cpp17_copy_insertable_v

// _LIBCPP___MEMORY_ALLOCATOR_TRAITS_H


=== system/lib/libcxx/include/__memory/array_cookie.h ===
SHA256: 61d997245beaa44e309baa9b69cac51a01752f8d0b5cf5c1df3d26d4105247da
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Trait representing whether a type requires an array cookie at the start of its allocation when

// allocated as `new T[n]` and deallocated as `delete[] array`.

//

// Under the Itanium C++ ABI [1] and the ARM ABI which derives from it, we know that an array cookie is available

// unless `T` is trivially destructible and the call to `operator delete[]` is not a sized operator delete. Under

// other ABIs, we assume there are no array cookies.

//

// [1]: https://itanium-cxx-abi.github.io/cxx-abi/abi.html#array-cookies

// TODO: Use a builtin instead

// TODO: We should factor in the choice of the usual deallocation function in this determination:

//       a cookie may be available in more cases but we ignore those for now.

// Return the element count in the array cookie located before the given pointer.

//

// In the Itanium ABI [1]

// ----------------------

// The element count is stored immediately before the first element of the array. If the preferred alignment

// of array elements (which is different from the ABI alignment) is more than that of size_t, additional

// padding bytes exist before the array cookie. Assuming array elements of size and alignment 16 bytes, that

// gives us the following layout:

//

// |ooooooooxxxxxxxxaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbccccccccccccccccdddddddddddddddd|

//  ^^^^^^^^        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

//     |    ^^^^^^^^                               |

//     |       |                              array elements

//  padding    |

//       element count

//

//

// In the Itanium ABI with ARM differences [2]

// -------------------------------------------

// The array cookie is stored at the very start of the allocation and it has the following form:

//

//    struct array_cookie {

//      std::size_t element_size; // element_size != 0

//      std::size_t element_count;

//    };

//

// Assuming elements of size and alignment 32 bytes, this gives us the following layout:

//

//  |xxxxxxxxXXXXXXXXooooooooooooooooaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb|

//   ^^^^^^^^        ^^^^^^^^^^^^^^^^

//      |    ^^^^^^^^        |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

// element size  |        padding                                 |

//         element count                                     array elements

//

// We must be careful to take into account the alignment of the array cookie, which may result in padding

// bytes between the element count and the first element of the array. Note that for ARM, the compiler

// aligns the array cookie using the ABI alignment, not the preferred alignment of array elements.

//

// [1]: https://itanium-cxx-abi.github.io/cxx-abi/abi.html#array-cookies

// [2]: https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms#Handle-C++-differences

// Avoid failures when -fsanitize-address-poison-custom-array-cookie is enabled

// dummy definition required to make the function parse

// This is necessary to avoid violating strict aliasing. It's valid because _ArrayCookie is an

// implicit lifetime type.

// _LIBCPP___MEMORY_ARRAY_COOKIE_H


=== system/lib/libcxx/include/__memory/assume_aligned.h ===
SHA256: d2a42751673c82c521671b3d6418f7e902f1da122080a94a8699206c9766e00d
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___MEMORY_ASSUME_ALIGNED_H


=== system/lib/libcxx/include/__memory/auto_ptr.h ===
SHA256: 0dd27b290d4e3940594ece26a4e62bea4e3f35a58566f843bac76269fe71e556
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)

// _LIBCPP___MEMORY_AUTO_PTR_H


=== system/lib/libcxx/include/__memory/compressed_pair.h ===
SHA256: 9818cb459373447042cf7e8f2ac4b2996cc5ea556f1edd8fd122ab4bfa490787
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// ================================================================================================================== //

// The utilites here are for staying ABI compatible with the legacy `__compressed_pair`. They should not be used      //

// for new data structures. Use `_LIBCPP_NO_UNIQUE_ADDRESS` for new data structures instead (but make sure you        //

// understand how it works).                                                                                          //

// ================================================================================================================== //

// The first member is aligned to the alignment of the second member to force padding in front of the compressed pair

// in case there are members before it.

//

// For example:

// (assuming x86-64 linux)

// class SomeClass {

//   uint32_t member1;

//   _LIBCPP_COMPRESSED_PAIR(uint32_t, member2, uint64_t, member3);

// }

//

// The layout with __compressed_pair is:

// member1 - offset: 0,  size: 4

// padding - offset: 4,  size: 4

// member2 - offset: 8,  size: 4

// padding - offset: 12, size: 4

// member3 - offset: 16, size: 8

//

// If the [[gnu::aligned]] wasn't there, the layout would instead be:

// member1 - offset: 0, size: 4

// member2 - offset: 4, size: 4

// member3 - offset: 8, size: 8

//

// Furthermore, that alignment must be the same as what was used in the old __compressed_pair layout, so we must

// handle reference types specially since alignof(T&) == alignof(T).

// See https://github.com/llvm/llvm-project/issues/118559.

// TODO: Fix the ABI for GCC as well once https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121637 is fixed

// _LIBCPP_ABI_NO_COMPRESSED_PAIR_PADDING

// _LIBCPP___MEMORY_COMPRESSED_PAIR_H


=== system/lib/libcxx/include/__memory/concepts.h ===
SHA256: 206c6b7477d45f1489f29bc316d55bee23d7876120efd61f542ea8216fa1ffa3
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// TODO(modules): This should not be required

// [special.mem.concepts]

// This concept ensures that uninitialized algorithms can construct an object

// at the address pointed-to by the iterator, which requires an lvalue.

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___MEMORY_CONCEPTS_H


=== system/lib/libcxx/include/__memory/construct_at.h ===
SHA256: e0785f06cc52bcd9e71a263b3e8ff43e29222425e62862769f692140f384704b
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// construct_at

// destroy_at

// The internal functions are available regardless of the language version (with the exception of the `__destroy_at`

// taking an array).

// _LIBCPP_STD_VER >= 17

// _LIBCPP___MEMORY_CONSTRUCT_AT_H


=== system/lib/libcxx/include/__memory/destroy.h ===
SHA256: 6740f8ef81ce23df7c18ac47383dc0c7a625568f72def8c6cc2ceb3a185cc7c8
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Destroy all elements in [__first, __last) from left to right using allocator destruction.

// _LIBCPP___MEMORY_DESTROY_H


=== system/lib/libcxx/include/__memory/destruct_n.h ===
SHA256: 7f349a4f14c549c1e42b25b980a4a4506480dd09ff692376227fdc36d0e410f5
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___MEMORY_DESTRUCT_N_H


=== system/lib/libcxx/include/__memory/inout_ptr.h ===
SHA256: 55f3f2131ad90ff0a5fcfdab2a4e62a252677cf7fd512a5986a7bddc397ef800
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// LWG-3897 inout_ptr will not update raw pointer to null

// _LIBCPP_STD_VER >= 23

// _LIBCPP___INOUT_PTR_H


=== system/lib/libcxx/include/__memory/is_sufficiently_aligned.h ===
SHA256: c9c395e79c65b17b000f8ec6a156d9a02207de890762ac6d0cc8764a33d5c4ac
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 26

// _LIBCPP___MEMORY_IS_SUFFICIENTLY_ALIGNED_H


=== system/lib/libcxx/include/__memory/noexcept_move_assign_container.h ===
SHA256: d98ceb90307578b64c6e9f7d09ec7791e644f2bcf5a2698234f0629f0e474f92
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___MEMORY_NOEXCEPT_MOVE_ASSIGN_CONTAINER_H


=== system/lib/libcxx/include/__memory/out_ptr.h ===
SHA256: 3fde2ea334566cf79dda0423316e52d480f42733567a501f0c2630eee8ad8b29
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 23

// _LIBCPP___OUT_PTR_H


=== system/lib/libcxx/include/__memory/pointer_traits.h ===
SHA256: e7a9602c45abe3af040b841411294ffd5563ee858abeb83a317c1f1cdfad2ee5
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_CXX03_LANG

// to_address

// enable_if is needed here to avoid instantiating checks for fancy pointers on raw pointers

// This function ensures safe conversions between fancy pointers at compile-time, where we avoid casts from/to

// `__void_pointer` by obtaining the underlying raw pointer from the fancy pointer using `std::to_address`,

// then dereferencing it to retrieve the pointed-to object, and finally constructing the target fancy pointer

// to that object using the `std::pointer_traits<>::pinter_to` function.

// _LIBCPP___MEMORY_POINTER_TRAITS_H


=== system/lib/libcxx/include/__memory/ranges_construct_at.h ===
SHA256: 674c275c21bb9fe1b543d9f1e3714b0e120a964bb8e13bd539f095710e08020a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// construct_at

// namespace __cpo

// destroy_at

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___MEMORY_RANGES_CONSTRUCT_AT_H


=== system/lib/libcxx/include/__memory/ranges_destroy.h ===
SHA256: ce04eec64d6db8f821199b1bc74ccc52e457937fb2bda2b26a1d4fba3fd0615b
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// destroy

// namespace __cpo

// destroy_n

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___MEMORY_RANGES_DESTROY_H


=== system/lib/libcxx/include/__memory/ranges_uninitialized_algorithms.h ===
SHA256: ce3a82e8e74254157573fa8463d162533e3c27becdfeef04d3892d13379fd7d1
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// uninitialized_default_construct

// namespace __cpo

// uninitialized_default_construct_n

// namespace __cpo

// uninitialized_value_construct

// namespace __cpo

// uninitialized_value_construct_n

// namespace __cpo

// uninitialized_fill

// namespace __cpo

// uninitialized_fill_n

// namespace __cpo

// uninitialized_copy

// namespace __cpo

// uninitialized_copy_n

// namespace __cpo

// uninitialized_move

// namespace __cpo

// uninitialized_move_n

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___MEMORY_RANGES_UNINITIALIZED_ALGORITHMS_H


=== system/lib/libcxx/include/__memory/raw_storage_iterator.h ===
SHA256: f8815f00402c8d01218702dd0b76a3ce7f9a3a6a1451ec0844c24b4e1b463781
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_RAW_STORAGE_ITERATOR)

// _LIBCPP___MEMORY_RAW_STORAGE_ITERATOR_H


=== system/lib/libcxx/include/__memory/shared_count.h ===
SHA256: 2626de6333a62b24edc3cb820a13b1a7139537b1009fc34043edeb3a26b96d0f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// NOTE: Relaxed and acq/rel atomics (for increment and decrement respectively)

// should be sufficient for thread safety.

// See https://llvm.org/PR22803

// _LIBCPP___MEMORY_SHARED_COUNT_H


=== system/lib/libcxx/include/__memory/shared_ptr.h ===
SHA256: 3241af290fc414e0228b5312656a4afbe11b7de9ed9d09e80a97fab6e8dc4293
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_HAS_RTTI

// This tag is used to instantiate an allocator type. The various shared_ptr control blocks

// detect that the allocator has been instantiated for this type and perform alternative

// initialization/destruction based on that.

// TODO: It should be possible to refactor this to remove `_Storage` entirely.

// This class implements the control block for non-array shared pointers created

// through `std::allocate_shared` and `std::make_shared`.

// http://eel.is/c++draft/util.sharedptr#util.smartptr.shared.general-6

// A pointer type Y* is said to be compatible with a pointer type T*

// when either Y* is convertible to T* or Y is U[N] and T is cv U[].

// _LIBCPP_STD_VER >= 17

// Constructors that take raw pointers have a different set of "compatible" constraints

// http://eel.is/c++draft/util.sharedptr#util.smartptr.shared.const-9.1

// - If T is an array type, then either T is U[N] and Y(*)[N] is convertible to T*,

//   or T is U[] and Y(*)[] is convertible to T*.

// - If T is not an array type, then Y* is convertible to T*.

// _LIBCPP_STD_VER >= 17

// A shared_ptr contains only two raw pointers which point to the heap and move constructing already doesn't require

// any bookkeeping, so it's always trivially relocatable. It is also replaceable because assignment just rebinds the

// shared_ptr to manage a different object.

// In C++03 we get errors when trying to do SFINAE with the

// delete operator, so we always pretend that it's deletable.

// The same happens on GCC.

// _LIBCPP_HAS_EXCEPTIONS

// not _LIBCPP_CXX03_LANG

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// not _LIBCPP_CXX03_LANG

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// not _LIBCPP_CXX03_LANG

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// not _LIBCPP_CXX03_LANG

// _LIBCPP_HAS_EXCEPTIONS

// LWG-2996

// We don't backport because it is an evolutionary change.

// _LIBCPP_HAS_RTTI

//

// std::allocate_shared and std::make_shared

//

// _LIBCPP_STD_VER >= 20

// We are purposefully not using an allocator-aware default construction because the spec says so.

// There's currently no way of expressing default initialization in an allocator-aware manner anyway.

// Returns the number of bytes required to store a control block followed by the given number

// of elements of _Tp, with the whole storage being aligned to a multiple of _Tp's alignment.

// When there's 0 elements, the control block alone is enough since it holds one element.

// Otherwise, we allocate one fewer element than requested because the control block already

// holds one. Also, we use the bitwise formula below to ensure that we allocate enough bytes

// for the whole allocation to be a multiple of _Tp's alignment. That formula is taken from [1].

//

// [1]: https://en.wikipedia.org/wiki/Data_structure_alignment#Computing_padding

// can't be `= default` because of the sometimes-non-trivial union member __data_

// We compute the number of bytes necessary to hold the control block and the

// array elements. Then, we allocate an array of properly-aligned dummy structs

// large enough to hold the control block and array. This allows shifting the

// burden of aligning memory properly from us to the allocator.

// We are purposefully not using an allocator-aware default construction because the spec says so.

// There's currently no way of expressing default initialization in an allocator-aware manner anyway.

// can't be `= default` because of the sometimes-non-trivial union member __data_

// _LIBCPP_STD_VER >= 17

// bounded array variants

// unbounded array variants

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER <= 17

// _LIBCPP_STD_VER <= 17

// LWG-2996

// We don't backport because it is an evolutionary change.

// LWG-2996

// We don't backport because it is an evolutionary change.

// LWG-2996

// We don't backport because it is an evolutionary change.

// LWG-2996

// We don't backport because it is an evolutionary change.

// _LIBCPP_HAS_RTTI

// A weak_ptr contains only two raw pointers which point to the heap and move constructing already doesn't require

// any bookkeeping, so it's always trivially relocatable. It's also replaceable for the same reason.

// _LIBCPP_STD_VER >= 17

// _LIBCPP_HAS_THREADS

// _LIBCPP___MEMORY_SHARED_PTR_H


=== system/lib/libcxx/include/__memory/swap_allocator.h ===
SHA256: 06fab932c2c39f6b0a1b1cccae94c4308ddba216e0cd4f715dc3f63ce1092453
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___MEMORY_SWAP_ALLOCATOR_H


=== system/lib/libcxx/include/__memory/temp_value.h ===
SHA256: 22c81c1341365e3e48f21b0a868a59d7daee523e07e474d3c7524f2d1ea04669
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___MEMORY_TEMP_VALUE_H


=== system/lib/libcxx/include/__memory/temporary_buffer.h ===
SHA256: fc26542776d089c6acb460995ce1378740808ebcb0eab377940602f4b87e991f
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TEMPORARY_BUFFER)

// _LIBCPP___MEMORY_TEMPORARY_BUFFER_H


=== system/lib/libcxx/include/__memory/uninitialized_algorithms.h ===
SHA256: 24bc53d72f7bbbcd8c1ae822ffe513710ddbd7f99e2a5e6c2d2d26b1a9b8375b
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// uninitialized_copy

// uninitialized_copy_n

// uninitialized_fill

// uninitialized_fill_n

// uninitialized_default_construct

// uninitialized_default_construct_n

// uninitialized_value_construct

// uninitialized_value_construct_n

// uninitialized_move

// uninitialized_move_n

// TODO: Rewrite this to iterate left to right and use reverse_iterators when calling

// Destroys every element in the range [first, last) FROM RIGHT TO LEFT using allocator

// destruction. If elements are themselves C-style arrays, they are recursively destroyed

// in the same manner.

//

// This function assumes that destructors do not throw, and that the allocator is bound to

// the correct type.

// Constructs the object at the given location using the allocator's construct method.

//

// If the object being constructed is an array, each element of the array is allocator-constructed,

// recursively. If an exception is thrown during the construction of an array, the initialized

// elements are destroyed in reverse order of initialization using allocator destruction.

//

// This function assumes that the allocator is bound to the correct type.

// If an exception is thrown, destroy what we have constructed so far in reverse order.

// Constructs the object at the given location using the allocator's construct method, passing along

// the provided argument.

//

// If the object being constructed is an array, the argument is also assumed to be an array. Each

// each element of the array being constructed is allocator-constructed from the corresponding

// element of the argument array. If an exception is thrown during the construction of an array,

// the initialized elements are destroyed in reverse order of initialization using allocator

// destruction.

//

// This function assumes that the allocator is bound to the correct type.

// If an exception is thrown, destroy what we have constructed so far in reverse order.

// Given a range starting at it and containing n elements, initializes each element in the

// range from left to right using the construct method of the allocator (rebound to the

// correct type).

//

// If an exception is thrown, the initialized elements are destroyed in reverse order of

// initialization using allocator_traits destruction. If the elements in the range are C-style

// arrays, they are initialized element-wise using allocator construction, and recursively so.

// If an exception is thrown, destroy what we have constructed so far in reverse order.

// Same as __uninitialized_allocator_fill_n_multidimensional, but doesn't pass any initialization argument

// to the allocator's construct method, which results in value initialization.

// If an exception is thrown, destroy what we have constructed so far in reverse order.

// _LIBCPP_STD_VER >= 17

// Copy-construct [__first1, __last1) in [__first2, __first2 + N), where N is distance(__first1, __last1).

//

// The caller has to ensure that __first2 can hold at least N uninitialized elements. If an exception is thrown the

// already copied elements are destroyed in reverse order of their construction.

// __uninitialized_allocator_relocate relocates the objects in [__first, __last) into __result.

// Relocation means that the objects in [__first, __last) are placed into __result as-if by move-construct and destroy,

// except that the move constructor and destructor may never be called if they are known to be equivalent to a memcpy.

//

// Preconditions:  __result doesn't contain any objects and [__first, __last) contains objects

// Postconditions: __result contains the objects from [__first, __last) and

//                 [__first, __last) doesn't contain any objects

//

// The strong exception guarantee is provided if any of the following are true:

// - is_nothrow_move_constructible<_ValueType>

// - is_copy_constructible<_ValueType>

// - __libcpp_is_trivially_relocatable<_ValueType>

// Casting to void* to suppress clang complaining that this is technically UB.

// _LIBCPP___MEMORY_UNINITIALIZED_ALGORITHMS_H


=== system/lib/libcxx/include/__memory/unique_ptr.h ===
SHA256: be0fdedc779bb6975ab01cea7654ad70b1bf1a848ff6bcc6c9652e23ae28cb0c
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __pointer

// A unique_ptr contains the following members which may be trivially relocatable:

// - pointer : this may be trivially relocatable, so it's checked

// - deleter_type: this may be trivially relocatable, so it's checked

//

// This unique_ptr implementation only contains a pointer to the unique object and a deleter, so there are no

// references to itself. This means that the entire structure is trivially relocatable if its members are.

// Bounds checking in unique_ptr<T[]>

// ==================================

//

// We provide some helper classes that allow bounds checking when accessing a unique_ptr<T[]>.

// There are a few cases where bounds checking can be implemented:

//

// 1. When an array cookie exists at the beginning of the array allocation, we are

//    able to reuse that cookie to extract the size of the array and perform bounds checking.

//    An array cookie is a size inserted at the beginning of the allocation by the compiler.

//    That size is inserted implicitly when doing `new T[n]` in some cases (as of writing this

//    exactly when the array elements are not trivially destructible), and its main purpose is

//    to allow the runtime to destroy the `n` array elements when doing `delete[] array`.

//    When we are able to use array cookies, we reuse information already available in the

//    current runtime, so bounds checking does not require changing libc++'s ABI.

//

//    However, note that we cannot assume the presence of an array cookie when a custom deleter

//    is used, because the unique_ptr could have been created from an allocation that wasn't

//    obtained via `new T[n]` (since it may not be deleted with `delete[] arr`).

//

// 2. When the "bounded unique_ptr" ABI configuration (controlled by `_LIBCPP_ABI_BOUNDED_UNIQUE_PTR`)

//    is enabled, we store the size of the allocation (when it is known) so we can check it when

//    indexing into the `unique_ptr`. That changes the layout of `std::unique_ptr<T[]>`, which is

//    an ABI break from the default configuration.

//

//    Note that even under this ABI configuration, we can't always know the size of the unique_ptr.

//    Indeed, the size of the allocation can only be known when the unique_ptr is created via

//    make_unique or a similar API. For example, it can't be known when constructed from an arbitrary

//    pointer, in which case we are not able to check the bounds on access:

//

//      unique_ptr<T[], MyDeleter> ptr(new T[3]);

//

//    When we don't know the size of the allocation via the API used to create the unique_ptr, we

//    try to fall back to using an array cookie when available.

//

//    Finally, note that when this ABI configuration is enabled, we have no choice but to always

//    make space for the size to be stored in the unique_ptr. Indeed, while we might want to avoid

//    storing the size when an array cookie is available, knowing whether an array cookie is available

//    requires the type stored in the unique_ptr to be complete, while unique_ptr can normally

//    accommodate incomplete types.

//

// (1) Implementation where we rely on the array cookie to know the size of the allocation, if

//     an array cookie exists.

// In constant expressions, we can't check the array cookie so we just pretend that the index

// is in-bounds. The compiler catches invalid accesses anyway.

// If we don't have an array cookie, we assume the access is in-bounds

// (2) Implementation where we store the size in the class whenever we have it.

//

// Semantically, we'd need to store the size as an optional<size_t>. However, since that

// is really heavy weight, we instead store a size_t and use SIZE_MAX as a magic value

// meaning that we don't know the size.

// Use the array cookie if there's one

// Otherwise, fall back on the stored size (if any)

// A unique_ptr contains the following members which may be trivially relocatable:

// - pointer: this may be trivially relocatable, so it's checked

// - deleter_type: this may be trivially relocatable, so it's checked

// - (optionally) size: this is trivially relocatable

//

// This unique_ptr implementation only contains a pointer to the unique object and a deleter, so there are no

// references to itself. This means that the entire structure is trivially relocatable if its members are.

// Private constructor used by make_unique & friends to pass the size that was allocated

// The deleter and the optional bounds-checker are left unchanged. The bounds-checker

// will be reinitialized appropriately when/if the unique_ptr gets assigned-to or reset.

// _LIBCPP_STD_VER <= 17

// _LIBCPP_STD_VER >= 14

// _LIBCPP_STD_VER >= 20

// _LIBCPP___MEMORY_UNIQUE_PTR_H


=== system/lib/libcxx/include/__memory/unique_temporary_buffer.h ===
SHA256: 29673ef0fb6e58f7bc050cf984e646891d88548d038046593784fa7bce39e9a2
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// ignored in non-constant evaluation

// Since aligned operator new is unavailable, constructs an empty buffer rather than one with invalid alignment.

// _LIBCPP___MEMORY_UNIQUE_TEMPORARY_BUFFER_H


=== system/lib/libcxx/include/__memory/uses_allocator.h ===
SHA256: a8789198629140a577b4a4033a9a9a74d66c7eb0fdf29385c79122be66edd870
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___MEMORY_USES_ALLOCATOR_H


=== system/lib/libcxx/include/__memory/uses_allocator_construction.h ===
SHA256: a1d090477b8b835e128c8138243579ac990d06a2eac1f39c6b04b1012ecabac6
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __uses_allocator_detail

// _LIBCPP_STD_VER >= 17

/*--*/

/*--*/

/*--*/

// _LIBCPP_STD_VER >= 20

// _LIBCPP___MEMORY_USES_ALLOCATOR_CONSTRUCTION_H


=== system/lib/libcxx/include/__memory_resource/memory_resource.h ===
SHA256: 714639f9c1f06bfd2d1b0b378b666161018b0d591eb73e4de4cebec3edb8c698
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [mem.res.class]

// [mem.res.eq]

// [mem.res.global]

// namespace pmr

// _LIBCPP_STD_VER >= 17

// _LIBCPP___MEMORY_RESOURCE_MEMORY_RESOURCE_H


=== system/lib/libcxx/include/__memory_resource/monotonic_buffer_resource.h ===
SHA256: f3474dfcbdbff1d80d4010182f49e6df6217d7ef81f68186e0d1f2645bbaa513
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [mem.res.monotonic.buffer]

// key function

// namespace pmr

// _LIBCPP_STD_VER >= 17

// _LIBCPP___MEMORY_RESOURCE_MONOTONIC_BUFFER_RESOURCE_H


=== system/lib/libcxx/include/__memory_resource/polymorphic_allocator.h ===
SHA256: 273c495c866999a0a2044e304ee3e10d17cdf1ded636a9221d750e0374980396
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [mem.poly.allocator.class]

// [mem.poly.allocator.ctor]

// [mem.poly.allocator.mem]

// _LIBCPP_STD_VER >= 20

// This overload is not specified, it was added due to LWG3683.

// [mem.poly.allocator.eq]

// namespace pmr

// _LIBCPP_STD_VER >= 17

// _LIBCPP___MEMORY_RESOURCE_POLYMORPHIC_ALLOCATOR_H


=== system/lib/libcxx/include/__memory_resource/pool_options.h ===
SHA256: f170dc8fe58b8165cbf6c5a95419c110bbbf0b6c3bc70bcf18963fa04d1ed6de
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [mem.res.pool.options]

// namespace pmr

// _LIBCPP_STD_VER >= 17

// _LIBCPP___MEMORY_RESOURCE_POOL_OPTIONS_H


=== system/lib/libcxx/include/__memory_resource/synchronized_pool_resource.h ===
SHA256: dedc01cf0285a7596badaed3f9dbce86528ffcf81ab3c972a18301082fe66124
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [mem.res.pool.overview]

// key function

// namespace pmr

// _LIBCPP_STD_VER >= 17

// _LIBCPP___MEMORY_RESOURCE_SYNCHRONIZED_POOL_RESOURCE_H


=== system/lib/libcxx/include/__memory_resource/unsynchronized_pool_resource.h ===
SHA256: c93f4b6b5349a15ae8235824180de9c82627ae64350c2d1d5800aa05b160ca24
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [mem.res.pool.overview]

// key function

// namespace pmr

// _LIBCPP_STD_VER >= 17

// _LIBCPP___MEMORY_RESOURCE_UNSYNCHRONIZED_POOL_RESOURCE_H


=== system/lib/libcxx/include/__mutex/lock_guard.h ===
SHA256: c95d4d2af631ba61f16e9554fe2d665261763f3c9e2fbd93f2eeb309132e34f6
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___MUTEX_LOCK_GUARD_H


=== system/lib/libcxx/include/__mutex/mutex.h ===
SHA256: 6e358c196340a5619758eac70fe4013aff9381d4f4cd0b614db2915ce6c2ba6a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_HAS_THREADS

// _LIBCPP___MUTEX_MUTEX_H


=== system/lib/libcxx/include/__mutex/once_flag.h ===
SHA256: 7d729c6b159730f0c69b2dfd990b258309c2d5a9bf270875f0057136866d7b51
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __libcpp_acquire_load

// _LIBCPP_CXX03_LANG

// _LIBCPP_CXX03_LANG

// _LIBCPP_CXX03_LANG

// _LIBCPP_CXX03_LANG

// _LIBCPP_CXX03_LANG

// _LIBCPP_CXX03_LANG

// _LIBCPP___MUTEX_ONCE_FLAG_H


=== system/lib/libcxx/include/__mutex/tag_types.h ===
SHA256: 7a34e8ed73da641eecc41592dc11135fb6fd7b597077f1c33c3fa76901ad06b4
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___MUTEX_TAG_TYPES_H


=== system/lib/libcxx/include/__mutex/unique_lock.h ===
SHA256: 6718062dda4d578e4f57b7e14d0845ef6971b436b52523ab88749d5efe808678
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___MUTEX_UNIQUE_LOCK_H


=== system/lib/libcxx/include/__new/align_val_t.h ===
SHA256: 386b47afc9d4facd51a7fa5fb450e6ffc7b25999c1293454d213af4cbd780c4b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___NEW_ALIGN_VAL_T_H


=== system/lib/libcxx/include/__new/allocate.h ===
SHA256: 143f28b6970484e270e6c1b073465e2ade7103cb92682ae94ce99b04c7281f68
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// for _LIBCPP_HAS_SIZED_DEALLOCATION

/* nothing */

// _LIBCPP___NEW_ALLOCATE_H


=== system/lib/libcxx/include/__new/destroying_delete_t.h ===
SHA256: 9ebf03678c03cdda1621fa2940086cab2a3ebb56f0658fa64572d0a24a7cbb25
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Enable the declaration even if the compiler doesn't support the language

// feature.

// _LIBCPP___NEW_DESTROYING_DELETE_T_H


=== system/lib/libcxx/include/__new/exceptions.h ===
SHA256: 0a553f0d4476c94b767d71f598eb31fcb48170ad8d7d9504d6b0166f34fc0673
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// !_LIBCPP_ABI_VCRUNTIME

// When _HAS_EXCEPTIONS == 0, these complete definitions are needed,

// since they would normally be provided in vcruntime_exception.h

// defined(_LIBCPP_ABI_VCRUNTIME) && defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS == 0

// not in C++ spec

// _LIBCPP___NEW_EXCEPTIONS_H


=== system/lib/libcxx/include/__new/global_new_delete.h ===
SHA256: 85bd11b4943da45518d3f7e24a2232907eddd137e1d841ce99223415ed9b50ea
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___NEW_GLOBAL_NEW_DELETE_H


=== system/lib/libcxx/include/__new/interference_size.h ===
SHA256: 0ee589e64b68c34db4f328a3ec11215cf0b661fb898a49645116ba2a67e7514f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE)

// _LIBCPP_STD_VER >= 17

// _LIBCPP___NEW_INTERFERENCE_SIZE_H


=== system/lib/libcxx/include/__new/launder.h ===
SHA256: f2dac329b1b88611d97b00117de3dd6d940ff3a4629230ed9f29ecffd2b7c4e3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___NEW_LAUNDER_H


=== system/lib/libcxx/include/__new/new_handler.h ===
SHA256: ecc23b162e0c91fc86f8e8f236a9ccf07e9bbed2f0adcc77c06602f288c8802a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_ABI_VCRUNTIME

// _LIBCPP___NEW_NEW_HANDLER_H


=== system/lib/libcxx/include/__new/nothrow_t.h ===
SHA256: fb66f7f8a222ac48866363394ad4ff663b161a35b9d504b8c5ae30329a4ed869
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_ABI_VCRUNTIME

// _LIBCPP___NEW_NOTHROW_T_H


=== system/lib/libcxx/include/__new/placement_new_delete.h ===
SHA256: 1d4af0082dd3253fd23aad4b3c9f926848dc7bee4aef0ff092b3f88d156e8af1
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___NEW_PLACEMENT_NEW_DELETE_H


=== system/lib/libcxx/include/__numeric/accumulate.h ===
SHA256: 7628c656ed2c45537ce3cf1afefcf85b5bbe7ea4ec36397f0bff51699128ca28
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___NUMERIC_ACCUMULATE_H


=== system/lib/libcxx/include/__numeric/adjacent_difference.h ===
SHA256: 9f29e25c380513f6fc10182410b285fde33b752f9db95006a5d50beb032fd885
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___NUMERIC_ADJACENT_DIFFERENCE_H


=== system/lib/libcxx/include/__numeric/exclusive_scan.h ===
SHA256: 7c014b25db4e22757d008aff80983dc43829330a674363a2f3f12b3ae38ec464
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___NUMERIC_EXCLUSIVE_SCAN_H


=== system/lib/libcxx/include/__numeric/gcd_lcm.h ===
SHA256: f0bf31ad288ad552ce81abc31487aa1ab251873fd5079de648f560fd0cc250e3
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Using Binary GCD algorithm https://en.wikipedia.org/wiki/Binary_GCD_algorithm, based on an implementation

// from https://lemire.me/blog/2024/04/13/greatest-common-divisor-the-extended-euclidean-algorithm-and-speed/

//

// If power of two divides both numbers, we can push it out.

// - gcd( 2^x * a, 2^x * b) = 2^x * gcd(a, b)

//

// If and only if exactly one number is even, we can divide that number by that power.

// - if a, b are odd, then gcd(2^x * a, b) = gcd(a, b)

//

// And standard gcd algorithm where instead of modulo, minus is used.

// Make both argument of the same size, and early result in the easy case.

// _LIBCPP_STD_VER >= 17

// _LIBCPP___NUMERIC_GCD_LCM_H


=== system/lib/libcxx/include/__numeric/inclusive_scan.h ===
SHA256: 724cce224801a986b05f198208097cc5b89811e4722d01f6a66cbaa618515fba
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___NUMERIC_INCLUSIVE_SCAN_H


=== system/lib/libcxx/include/__numeric/inner_product.h ===
SHA256: 6fa7a71437a5c606306dbce2541524350bceff59ff3b65309a9113ccca020660
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___NUMERIC_INNER_PRODUCT_H


=== system/lib/libcxx/include/__numeric/iota.h ===
SHA256: bf7a064ffa56c649c3fcbc6719a084a714873f5a382ca6ebb152b5b010c34236
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___NUMERIC_IOTA_H


=== system/lib/libcxx/include/__numeric/midpoint.h ===
SHA256: 5bedb1372162989f25e5fa633ddeace9bc6cef09604a9e7c1849befc69402f49
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// typical case: overflow is impossible

// always correctly rounded

// not safe to halve a

// not safe to halve b

// otherwise correctly rounded

// _LIBCPP_STD_VER >= 20

// _LIBCPP___NUMERIC_MIDPOINT_H


=== system/lib/libcxx/include/__numeric/partial_sum.h ===
SHA256: c86cd3a78b52247a50107f80bd03d3934dfa21dfd9441fa8fa7ae0f89d25d994
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___NUMERIC_PARTIAL_SUM_H


=== system/lib/libcxx/include/__numeric/pstl.h ===
SHA256: 5d5cba7c67f8562d49edbf273281bbdf17f3a3473b8a133c1750bc51ee42c97f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// This overload doesn't get a customization point because it's trivial to detect (through e.g.

// __desugars_to_v) when specializing the more general variant, which should always be preferred

// _LIBCPP_HAS_EXPERIMENTAL_PSTL && _LIBCPP_STD_VER >= 17

// _LIBCPP___NUMERIC_PSTL_H


=== system/lib/libcxx/include/__numeric/ranges_iota.h ===
SHA256: 078e59d191b438f5fb695246502e7fa2a05b14da48faa6c333f87de5c4c43f61
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace ranges

// _LIBCPP_STD_VER >= 23

// _LIBCPP___NUMERIC_RANGES_IOTA_H


=== system/lib/libcxx/include/__numeric/reduce.h ===
SHA256: 6c47d327fea3ecbf9f870db2b3eb4ab6165171f094537a89fc99272b27f1078d
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___NUMERIC_REDUCE_H


=== system/lib/libcxx/include/__numeric/saturation_arithmetic.h ===
SHA256: 385ede0d9d1a7457ff7c31b870bf005dc0c4abcce414c61ce1b80f23cb397dab
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Handle overflow

// Signed addition overflow

// Overflows if (x > 0 && y > 0)

// Overflows if  (x < 0 && y < 0)

// Handle overflow

// Overflows if (x < y)

// Signed subtration overflow

// Overflows if (x >= 0 && y < 0)

// Overflows if (x < 0 && y > 0)

// Handle overflow

// Signed multiplication overflow

// Overflows if (x < 0 && y > 0) || (x > 0 && y < 0)

// Handle signed division overflow

// Saturation is impossible edge case when ((min _Rp) < (min _Tp) && (max _Rp) > (max _Tp)) and it is expected to be

// optimized out by the compiler.

// Handle overflow

// No overflow

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 26

// _LIBCPP___NUMERIC_SATURATION_ARITHMETIC_H


=== system/lib/libcxx/include/__numeric/transform_exclusive_scan.h ===
SHA256: 243bc3a525c0e2bb2cbb51fbad27caef17444b9a041db05437218d45c94f0a6d
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___NUMERIC_TRANSFORM_EXCLUSIVE_SCAN_H


=== system/lib/libcxx/include/__numeric/transform_inclusive_scan.h ===
SHA256: 10395bfe812a8d60ba61a8c30a78bd57d316cdf2595d03d64cdaf4604d330845
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___NUMERIC_TRANSFORM_INCLUSIVE_SCAN_H


=== system/lib/libcxx/include/__numeric/transform_reduce.h ===
SHA256: 26a1dbc9b44276b1c1c7b5a9bce37389ce793d87b448283c963ec58afcd6e07d
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___NUMERIC_TRANSFORM_REDUCE_H


=== system/lib/libcxx/include/__ostream/basic_ostream.h ===
SHA256: 06f5708a68a405cb4bb1eb16c757ca2a33b4a81bf7aae93fdb9a74a534e0c898
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// types (inherited from basic_ios (27.5.4)):

// 27.7.2.2 Constructor/destructor:

// 27.7.2.3 Assign/swap

// 27.7.2.4 Prefix/suffix:

// 27.7.2.6 Formatted output:

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// LWG 2221 - nullptr. This is not backported to older standards modes.

// See https://reviews.llvm.org/D127033 for more info on the rationale.

// 27.7.2.7 Unformatted output:

// 27.7.2.5 seeks:

// extension, intentially does not initialize

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP_STD_VER >= 20

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP___OSTREAM_BASIC_OSTREAM_H


=== system/lib/libcxx/include/__ostream/print.h ===
SHA256: 971da176275a3495490538b5aaaba03eed4d3e633d9074a0ccfa67eecbe715a0
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).

// [ostream.formatted.print]/3

// Effects: Behaves as a formatted output function

// ([ostream.formatted.reqmts]) of os, except that:

// - failure to generate output is reported as specified below, and

// - any exception thrown by the call to vformat is propagated without regard

//   to the value of os.exceptions() and without turning on ios_base::badbit

//   in the error state of os.

// After constructing a sentry object, the function initializes an automatic

// variable via

//   string out = vformat(os.getloc(), fmt, args);

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).

// Returns the FILE* associated with the __os.

// Returns a nullptr when no FILE* is associated with __os.

// This function is in the dylib since the type of the buffer associated

// with std::cout, std::cerr, and std::clog is only known in the dylib.

//

// This function implements part of the implementation-defined behavior

// of [ostream.formatted.print]/3

//   If the function is vprint_unicode and os is a stream that refers to

//   a terminal capable of displaying Unicode which is determined in an

//   implementation-defined manner, writes out to the terminal using the

//   native Unicode API;

// Whether the returned FILE* is "a terminal capable of displaying Unicode"

// is determined in the same way as the print(FILE*, ...) overloads.

// TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).

// [ostream.formatted.print]/3

//    If the function is vprint_unicode and os is a stream that refers to a

//    terminal capable of displaying Unicode which is determined in an

//    implementation-defined manner, writes out to the terminal using the

//    native Unicode API; if out contains invalid code units, the behavior is

//    undefined and implementations are encouraged to diagnose it. If the

//    native Unicode API is used, the function flushes os before writing out.

//

// This is the path for the native API, start with flushing.

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_AVAILABILITY_HAS_PRINT

// TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).

// _LIBCPP_HAS_UNICODE

// _LIBCPP_HAS_UNICODE

// _LIBCPP_HAS_UNICODE

// Note the wording in the Standard is inefficient. The output of

// std::format is a std::string which is then copied. This solution

// just appends a newline at the end of the output.

// _LIBCPP_HAS_UNICODE

// _LIBCPP_HAS_UNICODE

// TODO PRINT template or availability markup fires too eagerly (http://llvm.org/PR61563).

// _LIBCPP_STD_VER >= 23

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP___OSTREAM_PRINT_H


=== system/lib/libcxx/include/__ostream/put_character_sequence.h ===
SHA256: c7d47009ef4dd9db79ddd2062210cd670d0346f693a30ed53d3555dbf3a8e9a2
//===---------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===---------------------------------------------------------------------===//

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_LOCALIZATION

// _LIBCPP___OSTREAM_PUT_CHARACTER_SEQUENCE_H


=== system/lib/libcxx/include/__pstl/backend.h ===
SHA256: 5fa26686c03e053626ccaa4fd3fc69d57ff6ac75e3ca48fb5da42858aa74879e
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___PSTL_BACKEND_H


=== system/lib/libcxx/include/__pstl/backend_fwd.h ===
SHA256: 115d6809212adca8968181def7471ab4abd4455e56cc44d1ff496eb85ea64bc6
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This header declares available PSTL backends and the functions that must be implemented in order for the

// PSTL algorithms to be provided.

//

// Backends often do not implement the full set of functions themselves -- a configuration of the PSTL is

// usually a set of backends "stacked" together which each implement some algorithms under some execution

// policies. It is only necessary for the "stack" of backends to implement all algorithms under all execution

// policies, but a single backend is not required to implement everything on its own.

//

// The signatures used by each backend function are documented below.

//

// Exception handling

// ==================

//

// PSTL backends are expected to report errors (i.e. failure to allocate) by returning a disengaged `optional` from

// their implementation. Exceptions shouldn't be used to report an internal failure-to-allocate, since all exceptions

// are turned into a program termination at the front-end level. When a backend returns a disengaged `optional` to the

// frontend, the frontend will turn that into a call to `std::__throw_bad_alloc();` to report the internal failure to

// the user.

//

// ...New vendors can add parallel backends here...

// template <class _Policy, class _ForwardIterator, class _Predicate>

// optional<_ForwardIterator>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) const noexcept;

// template <class _Policy, class _ForwardIterator, class _Predicate>

// optional<_ForwardIterator>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) const noexcept;

// template <class _Policy, class _ForwardIterator, class _Tp>

// optional<_ForwardIterator>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) const noexcept;

// template <class _Policy, class _ForwardIterator, class _Predicate>

// optional<bool>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) const noexcept;

// template <class _Policy, class _ForwardIterator, class _Predicate>

// optional<bool>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) const noexcept;

// template <class _Policy, class _ForwardIterator, class _Predicate>

// optional<bool>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) const noexcept;

// template <class _Policy, class _ForwardIterator, class _Predicate>

// optional<bool>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) const noexcept;

// template <class _Policy, class _ForwardIterator, class _Function>

// optional<__empty>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Function __func) const noexcept;

// template <class _Policy, class _ForwardIterator, class _Size, class _Function>

// optional<__empty>

// operator()(_Policy&&, _ForwardIterator __first, _Size __size, _Function __func) const noexcept;

// template <class _Policy, class _ForwardIterator, class _Tp>

// optional<__empty>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Tp const& __value) const noexcept;

// template <class _Policy, class _ForwardIterator, class _Size, class _Tp>

// optional<__empty>

// operator()(_Policy&&, _ForwardIterator __first, _Size __n, _Tp const& __value) const noexcept;

// template <class _Policy, class _ForwardIterator, class _Tp>

// optional<__empty>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last,

//                       _Tp const& __old, _Tp const& __new) const noexcept;

// template <class _Policy, class _ForwardIterator, class _Predicate, class _Tp>

// optional<__empty>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last,

//                       _Predicate __pred, _Tp const& __new_value) const noexcept;

// template <class _Policy, class _ForwardIterator, class _Generator>

// optional<__empty>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Generator __gen) const noexcept;

// template <class _Policy, class _ForwardIterator, class _Size, class _Generator>

// optional<__empty>

// operator()(_Policy&&, _ForwardIterator __first, _Size __n, _Generator __gen) const noexcept;

// template <class _Policy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardOutIterator, class _Comp>

// optional<_ForwardOutIterator>

// operator()(_Policy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1,

//                       _ForwardIterator2 __first2, _ForwardIterator2 __last2,

//                       _ForwardOutIterator __result, _Comp __comp) const noexcept;

// template <class _Policy, class _RandomAccessIterator, class _Comp>

// optional<__empty>

// operator()(_Policy&&, _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) const noexcept;

// template <class _Policy, class _RandomAccessIterator, class _Comp>

// optional<__empty>

// operator()(_Policy&&, _RandomAccessIterator __first, _RandomAccessIterator __last, _Comp __comp) const noexcept;

// template <class _Policy, class _ForwardIterator, class _ForwardOutIterator, class _UnaryOperation>

// optional<_ForwardOutIterator>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last,

//                       _ForwardOutIterator __result,

//                       _UnaryOperation __op) const noexcept;

// template <class _Policy, class _ForwardIterator1, class _ForwardIterator2,

//                          class _ForwardOutIterator,

//                          class _BinaryOperation>

// optional<_ForwardOutIterator>

// operator()(_Policy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1,

//                       _ForwardIterator2 __first2,

//                       _ForwardOutIterator __result,

//                       _BinaryOperation __op) const noexcept;

// template <class _Policy, class _ForwardIterator, class _ForwardOutIterator, class _Predicate, class _Tp>

// optional<__empty>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last,

//                       _ForwardOutIterator __out_it,

//                       _Predicate __pred,

//                       _Tp const& __new_value) const noexcept;

// template <class _Policy, class _ForwardIterator, class _ForwardOutIterator, class _Tp>

// optional<__empty>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last,

//                       _ForwardOutIterator __out_it,

//                       _Tp const& __old_value,

//                       _Tp const& __new_value) const noexcept;

// template <class _Policy, class _ForwardIterator, class _ForwardOutIterator>

// optional<_ForwardOutIterator>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last,

//                       _ForwardOutIterator __out_it) const noexcept;

// template <class _Policy, class _ForwardIterator, class _ForwardOutIterator>

// optional<_ForwardOutIterator>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last,

//                       _ForwardOutIterator __out_it) const noexcept;

// template <class _Policy, class _ForwardIterator, class _Size, class _ForwardOutIterator>

// optional<_ForwardOutIterator>

// operator()(_Policy&&, _ForwardIterator __first, _Size __n, _ForwardOutIterator __out_it) const noexcept;

// template <class _Policy, class _ForwardIterator, class _ForwardOutIterator>

// optional<_ForwardOutIterator>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,

//                       _ForwardOutIterator __out_it) const noexcept;

// template <class _Policy, class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation>

// optional<_Tp>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last,

//                       _Tp __init,

//                       _BinaryOperation __reduce,

//                       _UnaryOperation __transform) const noexcept;

// template <class _Policy, class _ForwardIterator1, class _ForwardIterator2,

//           class _Tp, class _BinaryOperation1, class _BinaryOperation2>

// optional<_Tp> operator()(_Policy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1,

//                                     _ForwardIterator2 __first2,

//                                     _Tp __init,

//                                     _BinaryOperation1 __reduce,

//                                     _BinaryOperation2 __transform) const noexcept;

// template <class _Policy, class _ForwardIterator, class _Predicate>

// optional<__iter_diff_t<_ForwardIterator>>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) const noexcept;

// template <class _Policy, class _ForwardIterator, class _Tp>

// optional<__iter_diff_t<_ForwardIterator>>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last, _Tp const& __value) const noexcept;

// template <class _Policy, class _ForwardIterator1, class _ForwardIterator2, class _Predicate>

// optional<bool>

// operator()(_Policy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1,

//                       _ForwardIterator2 __first2,

//                       _Predicate __pred) const noexcept;

// template <class _Policy, class _ForwardIterator1, class _ForwardIterator2, class _Predicate>

// optional<bool>

// operator()(_Policy&&, _ForwardIterator1 __first1, _ForwardIterator1 __last1,

//                       _ForwardIterator2 __first2, _ForwardIterator2 __last2,

//                       _Predicate __pred) const noexcept;

// template <class _Policy, class _ForwardIterator, class _Tp, class _BinaryOperation>

// optional<_Tp>

// operator()(_Policy&&, _ForwardIterator __first, _ForwardIterator __last,

//                       _Tp __init, _BinaryOperation __op) const noexcept;

// namespace __pstl

// _LIBCPP_STD_VER >= 17

// _LIBCPP___PSTL_BACKEND_FWD_H


=== system/lib/libcxx/include/__pstl/backends/default.h ===
SHA256: f40ca4e42992af8c4ad02828fa4d5371252c81d4e75df70e2b5d09403a6e71c0
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file provides an incomplete PSTL backend that implements all of the PSTL algorithms

// based on a smaller set of basis operations.

//

// It is intended as a building block for other PSTL backends that implement some operations more

// efficiently but may not want to define the full set of PSTL algorithms.

//

// This backend implements all the PSTL algorithms based on the following basis operations:

//

// find_if family

// --------------

// - find

// - find_if_not

// - any_of

// - all_of

// - none_of

// - is_partitioned

//

// for_each family

// ---------------

// - for_each_n

// - fill

// - fill_n

// - replace

// - replace_if

// - generate

// - generate_n

//

// merge family

// ------------

// No other algorithms based on merge

//

// stable_sort family

// ------------------

// - sort

//

// transform_reduce and transform_reduce_binary family

// ---------------------------------------------------

// - count_if

// - count

// - equal(3 legs)

// - equal

// - reduce

//

// transform and transform_binary family

// -------------------------------------

// - replace_copy_if

// - replace_copy

// - move

// - copy

// - copy_n

// - rotate_copy

//

//////////////////////////////////////////////////////////////

// find_if family

//////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////

// for_each family

//////////////////////////////////////////////////////////////

// Otherwise, use the serial algorithm to avoid doing two passes over the input

// Otherwise, use the serial algorithm to avoid doing two passes over the input

//////////////////////////////////////////////////////////////

// stable_sort family

//////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////

// transform_reduce family

//////////////////////////////////////////////////////////////

// Fall back to the 3 legged algorithm

// If we don't have random access, fall back to the serial algorithm cause we can't do much

//////////////////////////////////////////////////////////////

// transform family

//////////////////////////////////////////////////////////////

// TODO: Use the std::copy/move shenanigans to forward to std::memmove

//       Investigate whether we want to still forward to std::transform(policy)

//       in that case for the execution::par part, or whether we actually want

//       to run everything serially in that case.

// TODO: Use the std::copy/move shenanigans to forward to std::memmove

// Otherwise, use the serial algorithm to avoid doing two passes over the input

// namespace __pstl

// _LIBCPP_STD_VER >= 17

// _LIBCPP___PSTL_BACKENDS_DEFAULT_H


=== system/lib/libcxx/include/__pstl/backends/libdispatch.h ===
SHA256: b619f688658c642f758f8ffd60f3fee8c9c7fd23f4264a07281695a95dcf98b8
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// ::dispatch_apply is marked as __attribute__((nothrow)) because it doesn't let exceptions propagate, and neither do

// we.

// TODO: Do we want to add [[_Clang::__callback__(__func, __context, __)]]?

// includes the first chunk

// Perform the chunked execution.

// namespace __libdispatch

// TODO: use __uninitialized_buffer

// TODO: Improve the case where the smaller range is merged into just a few (or even one) chunks of the larger case

// handle first chunk

// handle 2 -> N - 1 chunks

// handle last chunk

// TODO: use __uninitialized_buffer

// TODO: allocate one element per worker instead of one element per chunk

// __dispatch_apply is noexcept

// TODO: use __uninitialized_buffer

// Initialize all elements to a moved-from state

// TODO: Don't do this - this can be done in the first merge - see https://llvm.org/PR63928

// Mandatory implementations of the computational basis

// Not mandatory, but better optimized

// namespace __pstl

// _LIBCPP_STD_VER >= 17

// _LIBCPP___PSTL_BACKENDS_LIBDISPATCH_H


=== system/lib/libcxx/include/__pstl/backends/serial.h ===
SHA256: 9c4a6cb6993c0804cbbca274003d69bac901bad60fe8ac384b7a376ae781baab
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This partial PSTL backend runs everything serially.

//

// TODO: Right now, the serial backend must be used with another backend

//       like the "default backend" because it doesn't implement all the

//       necessary PSTL operations. It would be better to dispatch all

//       algorithms to their serial counterpart directly, since this can

//       often be more efficient than the "default backend"'s implementation

//       if we end up running serially anyways.

//

// namespace __pstl

// _LIBCPP_STD_VER >= 17

// _LIBCPP___PSTL_BACKENDS_SERIAL_H


=== system/lib/libcxx/include/__pstl/backends/std_thread.h ===
SHA256: 7c522773a0fa15cfe0307417fe03e5fc39389f00899abc628c2a6d8bd7342765
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This partial backend implementation is for testing purposes only and not meant for production use. This will be

// replaced by a proper implementation once the PSTL implementation is somewhat stable.

//

// This is intended to be used on top of the "default backend".

//

// Mandatory implementations of the computational basis

// Not mandatory, but better optimized

// namespace __pstl

// _LIBCPP_STD_VER >= 17

// _LIBCPP___PSTL_BACKENDS_STD_THREAD_H


=== system/lib/libcxx/include/__pstl/cpu_algos/any_of.h ===
SHA256: 5f19fc0e90432d1038367645b41b763d016729f84331f555fe21a6c658e8a7af
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// TODO: check whether __simd_first() can be used here

// Double the block _Size.  Any unnecessary iterations can be amortized against work done so far.

// namespace __pstl

// _LIBCPP_STD_VER >= 17

// _LIBCPP___PSTL_CPU_ALGOS_ANY_OF_H


=== system/lib/libcxx/include/__pstl/cpu_algos/cpu_traits.h ===
SHA256: 4a5b5c0fe1beb2b6aebba47bcd3ed5269efd0d518d13ac5297888e1147a3fb5a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __cpu_traits

//

// This traits class encapsulates the basis operations for a CPU-based implementation of the PSTL.

// All the operations in the PSTL can be implemented from these basis operations, so a pure CPU backend

// only needs to customize these traits in order to get an implementation of the whole PSTL.

//

// Basis operations

// ================

//

//  template <class _RandomAccessIterator, class _Functor>

//  optional<__empty> __for_each(_RandomAccessIterator __first, _RandomAccessIterator __last, _Functor __func);

//    - __func must take a subrange of [__first, __last) that should be executed in serial

//

//  template <class _Iterator, class _UnaryOp, class _Tp, class _BinaryOp, class _Reduction>

//  optional<_Tp> __transform_reduce(_Iterator __first, _Iterator __last, _UnaryOp, _Tp __init, _BinaryOp, _Reduction);

//

//  template <class _RandomAccessIterator1,

//            class _RandomAccessIterator2,

//            class _RandomAccessIterator3,

//            class _Compare,

//            class _LeafMerge>

//  optional<_RandomAccessIterator3> __merge(_RandomAccessIterator1 __first1,

//                                           _RandomAccessIterator1 __last1,

//                                           _RandomAccessIterator2 __first2,

//                                           _RandomAccessIterator2 __last2,

//                                           _RandomAccessIterator3 __outit,

//                                           _Compare __comp,

//                                           _LeafMerge __leaf_merge);

//

//  template <class _RandomAccessIterator, class _Comp, class _LeafSort>

//  optional<__empty> __stable_sort(_RandomAccessIterator __first,

//                                  _RandomAccessIterator __last,

//                                  _Comp __comp,

//                                  _LeafSort __leaf_sort);

//

//   void __cancel_execution();

//      Cancel the execution of other jobs - they aren't needed anymore. This is not a binding request,

//      some backends may not actually be able to cancel jobs.

//

//   constexpr size_t __lane_size;

//      Size of SIMD lanes.

//      TODO: Merge this with __native_vector_size from __algorithm/simd_utils.h

//

//

// Exception handling

// ==================

//

// CPU backends are expected to report errors (i.e. failure to allocate) by returning a disengaged `optional` from their

// implementation. Exceptions shouldn't be used to report an internal failure-to-allocate, since all exceptions are

// turned into a program termination at the front-end level. When a backend returns a disengaged `optional` to the

// frontend, the frontend will turn that into a call to `std::__throw_bad_alloc();` to report the internal failure to

// the user.

// namespace __pstl

// _LIBCPP_STD_VER >= 17

// _LIBCPP___PSTL_CPU_ALGOS_CPU_TRAITS_H


=== system/lib/libcxx/include/__pstl/cpu_algos/fill.h ===
SHA256: aeef09df6899652d158447bc691c337181e7cacdbcdea21750691bbbda8b1f81
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __pstl

// _LIBCPP_STD_VER >= 17

// _LIBCPP___PSTL_CPU_ALGOS_FILL_H


=== system/lib/libcxx/include/__pstl/cpu_algos/find_if.h ===
SHA256: 8b0dfb15ebb33b0db363549b37b536c615d1633786ef955bfab5d1bda91a5e18
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// TODO: find out what is better here: parallel_for or parallel_reduce

// See "Reducing Contention Through Priority Updates", PPoPP '13, for discussion of

// why using a shared variable scales fairly well in this situation.

// If not '__last' returned then we found what we want so put this to extremum

// Experiments show good block sizes like this

// This will vectorize

// Keep remainder scalar

// namespace __pstl

// _LIBCPP_STD_VER >= 17

// _LIBCPP___PSTL_CPU_ALGOS_FIND_IF_H


=== system/lib/libcxx/include/__pstl/cpu_algos/for_each.h ===
SHA256: 0a3d552c42f9f0e8a44a901f1b6afe6d41c87ac406ab6fe24f99e9efd26d6cfb
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __pstl

// _LIBCPP_STD_VER >= 17

// _LIBCPP___PSTL_CPU_ALGOS_FOR_EACH_H


=== system/lib/libcxx/include/__pstl/cpu_algos/merge.h ===
SHA256: cd19576449390381eb4014f0de693f64f01591a7dc67226d97675b53a43c99f3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __pstl

// _LIBCPP_STD_VER >= 17

// _LIBCPP___PSTL_CPU_ALGOS_MERGE_H


=== system/lib/libcxx/include/__pstl/cpu_algos/stable_sort.h ===
SHA256: fe2a1b1c9ede5d508d95ad3a2314c5604eb821062bfa324b13fd7afad64c2c52
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __pstl

// _LIBCPP_STD_VER >= 17

// _LIBCPP___PSTL_CPU_ALGOS_STABLE_SORT_H


=== system/lib/libcxx/include/__pstl/cpu_algos/transform.h ===
SHA256: b243300a19b25afd86c62e4fe60cfa099f33ac93bbae3443be3bec788b6e289f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __pstl

// _LIBCPP_STD_VER >= 17

// _LIBCPP___PSTL_CPU_ALGOS_TRANSFORM_H


=== system/lib/libcxx/include/__pstl/cpu_algos/transform_reduce.h ===
SHA256: 49a53cd29eb170a69e55d21884f5c706163149b1e2b629a0a78c8c19a71aff6b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// initializer

// main loop

// remainder

// combiner

// destroyer

// namespace __pstl

// _LIBCPP_STD_VER >= 17

// _LIBCPP___PSTL_CPU_ALGOS_TRANSFORM_REDUCE_H


=== system/lib/libcxx/include/__pstl/dispatch.h ===
SHA256: 9455dc2d402b410141cdc2fae0230e9f6489991195bd96341b67a28bdc82a60d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Helpful to provide better error messages. This will show the algorithm and the execution policy

// in the compiler diagnostic.

// namespace __pstl

// _LIBCPP_STD_VER >= 17

// _LIBCPP___PSTL_DISPATCH_H


=== system/lib/libcxx/include/__pstl/handle_exception.h ===
SHA256: 9416b0c2df5386fa9e838e4547e1a1bdafa3e8ec0206bba7350f5ccb67960264
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// This function is used to call a backend PSTL algorithm from a frontend algorithm.

//

// All PSTL backend algorithms return an optional denoting whether there was an

// "infrastructure"-level failure (aka failure to allocate). This function takes

// care of unwrapping that and throwing `bad_alloc()` in case there was a problem

// in the underlying implementation.

//

// We must also be careful not to call any user code that could throw an exception

// (such as moving or copying iterators) in here since that should terminate the

// program, which is why we delegate to a noexcept helper below.

// namespace __pstl

// _LIBCPP_STD_VER >= 17

// _LIBCPP___PSTL_HANDLE_EXCEPTION_H


=== system/lib/libcxx/include/__random/bernoulli_distribution.h ===
SHA256: 9d0c246466bfb4f7930afbec328ba3d68b5f257571390a68071e4462186260e0
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// constructors and reset functions

// generating functions

// property functions

// _LIBCPP___RANDOM_BERNOULLI_DISTRIBUTION_H


=== system/lib/libcxx/include/__random/binomial_distribution.h ===
SHA256: 8cd289f1f3e25558af5c2b2aa3e93a2b7cf2fbeb6d1bf34a0779a2f06dba3e4c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// constructors and reset functions

// generating functions

// property functions

// The LLVM C library provides this with conflicting `noexcept` attributes.

// Reference: Kemp, C.D. (1986). `A modal method for generating binomial

//           variables', Commun. Statist. - Theor. Meth. 15(3), 805-813.

// _LIBCPP___RANDOM_BINOMIAL_DISTRIBUTION_H


=== system/lib/libcxx/include/__random/cauchy_distribution.h ===
SHA256: 41247fcb7f3d5f566623adeaae7aeb5ccd8d4fafd87d1da3316ea91a3934cb2b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// constructor and reset functions

// generating functions

// property functions

// purposefully let tan arg get as close to pi/2 as it wants, tan will return a finite

// _LIBCPP___RANDOM_CAUCHY_DISTRIBUTION_H


=== system/lib/libcxx/include/__random/chi_squared_distribution.h ===
SHA256: 97664864013bd52ee2e92094aeacf97c77c02fad7aa01c7a0db0853844a3093a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// constructor and reset functions

// generating functions

// property functions

// _LIBCPP___RANDOM_CHI_SQUARED_DISTRIBUTION_H


=== system/lib/libcxx/include/__random/clamp_to_integral.h ===
SHA256: 02e70e725be490bb68fb225055928c31e5d6583bf3bc41cc6e84fd8a9d089d21
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Convert a floating point number to the specified integral type after

// clamping to the integral type's representable range.

//

// The behavior is undefined if `__r` is NaN.

// _LIBCPP___RANDOM_CLAMP_TO_INTEGRAL_H


=== system/lib/libcxx/include/__random/default_random_engine.h ===
SHA256: edec62fe7965574d57ab4be0b78715083fdb6dcf6fa9b780534e175aca9de5ef
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___RANDOM_DEFAULT_RANDOM_ENGINE_H


=== system/lib/libcxx/include/__random/discard_block_engine.h ===
SHA256: 879dd2b8f22aa3f35489fe5d5cf2cb49810f198f828afe552c6d99cd8cc317bc
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// numeric_limits::max() is not constexpr in C++03

// types

// engine characteristics

// constructors and seeding functions

// _LIBCPP_CXX03_LANG

// generating functions

// property functions

// _LIBCPP___RANDOM_DISCARD_BLOCK_ENGINE_H


=== system/lib/libcxx/include/__random/discrete_distribution.h ===
SHA256: feb89180d07e46e8bd06314c8e82ae4dc47a2491029cf581ba63b9b2d424e9e0
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// _LIBCPP_CXX03_LANG

// constructor and reset functions

// _LIBCPP_CXX03_LANG

// generating functions

// property functions

// _LIBCPP___RANDOM_DISCRETE_DISTRIBUTION_H


=== system/lib/libcxx/include/__random/exponential_distribution.h ===
SHA256: a7cc258214df3e58bbcc1b5fa930984e25ea4c3155b26e48e4eed8fc4b758a92
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// constructors and reset functions

// generating functions

// property functions

// _LIBCPP___RANDOM_EXPONENTIAL_DISTRIBUTION_H


=== system/lib/libcxx/include/__random/extreme_value_distribution.h ===
SHA256: 8a4336d940065a6f94310314af1511100168c5bee4642f84867f05ca76c00ea3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// constructor and reset functions

// generating functions

// property functions

// _LIBCPP___RANDOM_EXTREME_VALUE_DISTRIBUTION_H


=== system/lib/libcxx/include/__random/fisher_f_distribution.h ===
SHA256: d5699664c4074ae581fba956545bd62876ee438d0c44f128f541fb2296ba0d0f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// constructor and reset functions

// generating functions

// property functions

// _LIBCPP___RANDOM_FISHER_F_DISTRIBUTION_H


=== system/lib/libcxx/include/__random/gamma_distribution.h ===
SHA256: 4e1f0a49aac4fdb9ce608c25f06b60f4ccedef2aec83e71a4527240907d81750
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// constructors and reset functions

// generating functions

// property functions

// __a < 1

// _LIBCPP___RANDOM_GAMMA_DISTRIBUTION_H


=== system/lib/libcxx/include/__random/generate_canonical.h ===
SHA256: 27ba63d20ed6b2a803b679b574121ec185dc80705224aafe103dd4109c2319ad
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// generate_canonical

// _LIBCPP___RANDOM_GENERATE_CANONICAL_H


=== system/lib/libcxx/include/__random/geometric_distribution.h ===
SHA256: 43142d0fe9f5115d3ce10c2af04c5f7409b84aecbdd63b964dff87ee017eaafc
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// constructors and reset functions

// generating functions

// property functions

// _LIBCPP___RANDOM_GEOMETRIC_DISTRIBUTION_H


=== system/lib/libcxx/include/__random/independent_bits_engine.h ===
SHA256: e4ad4a91966fbbf1258a89765a93f027504745b2ffc8696e234a8ada05b7fd3d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// engine characteristics

// constructors and seeding functions

// _LIBCPP_CXX03_LANG

// generating functions

// property functions

// _LIBCPP___RANDOM_INDEPENDENT_BITS_ENGINE_H


=== system/lib/libcxx/include/__random/is_seed_sequence.h ===
SHA256: f26a98a4b54947b91f84bdcd0b8299d1c5b8f91cdebf9a0b5cedaf9657b22c38
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___RANDOM_IS_SEED_SEQUENCE_H


=== system/lib/libcxx/include/__random/is_valid.h ===
SHA256: 0dbf38b3f8c04360407d16f3c032f30ed6488d6e102ffc2fce3969a2c39666c0
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [rand.req.genl]/1.4:

// The effect of instantiating a template that has a template type parameter

// named RealType is undefined unless the corresponding template argument is

// cv-unqualified and is one of float, double, or long double.

// [rand.req.genl]/1.5:

// The effect of instantiating a template that has a template type parameter

// named IntType is undefined unless the corresponding template argument is

// cv-unqualified and is one of short, int, long, long long, unsigned short,

// unsigned int, unsigned long, or unsigned long long.

// extension

// extension

// extension

// extension

// _LIBCPP_HAS_INT128

// [rand.req.urng]/3:

// A class G meets the uniform random bit generator requirements if G models

// uniform_random_bit_generator, invoke_result_t<G&> is an unsigned integer type,

// and G provides a nested typedef-name result_type that denotes the same type

// as invoke_result_t<G&>.

// (In particular, reject URNGs with signed result_types; our distributions cannot

// handle such generator types.)

// _LIBCPP___RANDOM_IS_VALID_H


=== system/lib/libcxx/include/__random/knuth_b.h ===
SHA256: cb41ac032361dacda57f28009f0452977214076951b87d472ef61da58e329c97
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___RANDOM_KNUTH_B_H


=== system/lib/libcxx/include/__random/linear_congruential_engine.h ===
SHA256: b896ec44015e35b947b71c54ac2b46488d15f24d5336d9d2d240e2a913102e6b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// a != 0, m != 0, m != 2^n

// (a * x + c) % m works

// (a * x) % m works

// r <= q

// 64

// Schrage's algorithm

// Schrage's algorithm

// Use (((a*x) % m) + c) % m

// 32

// Schrage's algorithm

// Schrage's algorithm

// Use (((a*x) % m) + c) % m

// 16

// types

// engine characteristics

// constructors and seeding functions

// generating functions

// _LIBCPP___RANDOM_LINEAR_CONGRUENTIAL_ENGINE_H


=== system/lib/libcxx/include/__random/log2.h ===
SHA256: 0e4c8f954379b838194f71a868ffefc68d00f20bc01b91122ea50725672dccab
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_HAS_INT128

// _LIBCPP_HAS_INT128

// _LIBCPP___RANDOM_LOG2_H


=== system/lib/libcxx/include/__random/lognormal_distribution.h ===
SHA256: a704d262e6092828674adf76b35f762ff5fd6c498fdd9fed87ef962e35175fd3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// constructor and reset functions

// generating functions

// property functions

// _LIBCPP___RANDOM_LOGNORMAL_DISTRIBUTION_H


=== system/lib/libcxx/include/__random/mersenne_twister_engine.h ===
SHA256: 4ccbc55fd0fde51f4ad7a1511728be9a705915593d6f625e1c87905c7d18cff8
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// engine characteristics

// constructors and seeding functions

// generating functions

// __w >= 2

// _LIBCPP___RANDOM_MERSENNE_TWISTER_ENGINE_H


=== system/lib/libcxx/include/__random/negative_binomial_distribution.h ===
SHA256: 96e9673cefb8f06295d99be2d230a6e227744595ffe40e9c52407df7ad1a04b6
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// constructor and reset functions

// generating functions

// property functions

// When the number of bits in _IntType is small, we are too likely to

// overflow __f below to use this technique.

// _LIBCPP___RANDOM_NEGATIVE_BINOMIAL_DISTRIBUTION_H


=== system/lib/libcxx/include/__random/normal_distribution.h ===
SHA256: 9b6efd4714a6dad65f0b34587b187fb0251ba7594b1070b77c87725603c0bf0c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// constructors and reset functions

// generating functions

// property functions

// _LIBCPP___RANDOM_NORMAL_DISTRIBUTION_H


=== system/lib/libcxx/include/__random/piecewise_constant_distribution.h ===
SHA256: 5c57f4599d951820e8a6288259903976da48dfa51fa8df6699fc9c4a92364493
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// _LIBCPP_CXX03_LANG

// constructor and reset functions

// _LIBCPP_CXX03_LANG

// generating functions

// property functions

//  These can throw

//  These can not throw

// __densities_ contains non-normalized areas

// __densities_ contains normalized areas

// __areas_ contains partial sums of normalized areas: [0, __densities_ - 1]

// correct round off error

// __densities_ now contains __densities_

// _LIBCPP_CXX03_LANG

// _LIBCPP___RANDOM_PIECEWISE_CONSTANT_DISTRIBUTION_H


=== system/lib/libcxx/include/__random/piecewise_linear_distribution.h ===
SHA256: 93bf785818fe120bd2379c9c77af444ecb85e68da2761708770b637fe9975d6e
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// _LIBCPP_CXX03_LANG

// constructor and reset functions

// _LIBCPP_CXX03_LANG

// generating functions

// property functions

//  These can throw

//  These can not throw

// _LIBCPP_CXX03_LANG

// _LIBCPP___RANDOM_PIECEWISE_LINEAR_DISTRIBUTION_H


=== system/lib/libcxx/include/__random/poisson_distribution.h ===
SHA256: e2b0997173ac044fefc6eeb863d3baa00bf4f0c13bcc7e24cd685cf8f943db99
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// constructors and reset functions

// generating functions

// property functions

// According to the standard `inf` is a valid input, but it causes the

// distribution to hang, so we replace it with the maximum representable

// mean.

// _LIBCPP___RANDOM_POISSON_DISTRIBUTION_H


=== system/lib/libcxx/include/__random/random_device.h ===
SHA256: b00c7b4e45a000be7daf033576cc82861bf932887a164ac00ef940ceb37b3301
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Apple platforms used to use the `_LIBCPP_USING_DEV_RANDOM` code path, and now

// use `arc4random()` as of this comment. In order to avoid breaking the ABI, we

// retain the same layout as before.

// padding to fake the `__f_` field above

// ... vendors can add workarounds here if they switch to a different representation ...

// types

// generator characteristics

// constructors

// generating functions

// property functions

// _LIBCPP_HAS_RANDOM_DEVICE

// _LIBCPP___RANDOM_RANDOM_DEVICE_H


=== system/lib/libcxx/include/__random/ranlux.h ===
SHA256: 043dbe85d5c0ec7c0712652b09dc96f85539b7386a4fad3f0fa16968a94beaa0
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___RANDOM_RANLUX_H


=== system/lib/libcxx/include/__random/seed_seq.h ===
SHA256: 6bedf509db34b87042062e2d2082d7f0a0c6cfa31c1a21a59431413ae5e78bd2
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// constructors

// _LIBCPP_CXX03_LANG

// generating functions

// property functions

// __k = 0;

// Initialize indexing terms used with if statements as an optimization to

// avoid calculating modulo n on every loop iteration for each term.

// __k % __n

// (__k - 1) % __n

// (__k + __p) % __n

// (__k + __q) % __n

// _LIBCPP___RANDOM_SEED_SEQ_H


=== system/lib/libcxx/include/__random/shuffle_order_engine.h ===
SHA256: 48a779ee3e9f92ea273fbd489ec4ce04c79c270532bc96578aedae78453773ea
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// engine characteristics

// constructors and seeding functions

// _LIBCPP_CXX03_LANG

// generating functions

// property functions

// _LIBCPP___RANDOM_SHUFFLE_ORDER_ENGINE_H


=== system/lib/libcxx/include/__random/student_t_distribution.h ===
SHA256: b0a8a3981e9a5caab5c3c9f6d7dd7c6a1814165ac503c3c99b5870c0bbfd200a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// constructor and reset functions

// generating functions

// property functions

// _LIBCPP___RANDOM_STUDENT_T_DISTRIBUTION_H


=== system/lib/libcxx/include/__random/subtract_with_carry_engine.h ===
SHA256: 12eeb11b2c4e8523c45b0fe078f5ff65fbfdece627f3ba6bb8a5b5c5157b8c83
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// engine characteristics

// constructors and seeding functions

// generating functions

// _LIBCPP___RANDOM_SUBTRACT_WITH_CARRY_ENGINE_H


=== system/lib/libcxx/include/__random/uniform_int_distribution.h ===
SHA256: 90d1c832a1a402cb7e4b7e7d10d5e2ae4428a3bc1baa3bde08c19c20d452c84b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// constructors and seeding functions

// generating functions

// types

// constructors and reset functions

// generating functions

// property functions

// _LIBCPP___RANDOM_UNIFORM_INT_DISTRIBUTION_H


=== system/lib/libcxx/include/__random/uniform_random_bit_generator.h ===
SHA256: a9d26bddca997566c548f4537534d99cc800c026cab44d646e3f3f155e9b2ac6
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [rand.req.urng]

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANDOM_UNIFORM_RANDOM_BIT_GENERATOR_H


=== system/lib/libcxx/include/__random/uniform_real_distribution.h ===
SHA256: 619d8ba098c55bfde04795086051aa36ec1bdb9e0b684f48049913f5f01793fd
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// constructors and reset functions

// generating functions

// property functions

// _LIBCPP___RANDOM_UNIFORM_REAL_DISTRIBUTION_H


=== system/lib/libcxx/include/__random/weibull_distribution.h ===
SHA256: 9897eb8336c4c2d653bb8f75383675b5f872f82c43c4062e739e459660d3abd9
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// constructor and reset functions

// generating functions

// property functions

// _LIBCPP___RANDOM_WEIBULL_DISTRIBUTION_H


=== system/lib/libcxx/include/__ranges/access.h ===
SHA256: 0cd04406f79034adefc2f6389bf24f7d7acfa7752f2710da7199d0f7604c0723
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace ranges

// [range.access.begin]

// Disallow incomplete element types.

// Disallow incomplete element types.

// namespace __begin

// namespace __cpo

// namespace ranges

// [range.range]

// namespace ranges

// [range.access.end]

// Disallow incomplete element types.

// namespace __end

// namespace __cpo

// namespace ranges

// [range.access.cbegin]

// namespace __cbegin

// namespace __cpo

// namespace ranges

// [range.access.cend]

// namespace __cend

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_ACCESS_H


=== system/lib/libcxx/include/__ranges/all.h ===
SHA256: 03594db6b8f1a25b581c03fb30aad61be94eed6309e66b08a34c5ea1b5720eea
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// TODO(modules): Those should not be required

//

// namespace __all

// namespace __cpo

// namespace ranges::views

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_ALL_H


=== system/lib/libcxx/include/__ranges/as_rvalue_view.h ===
SHA256: dfd7cfc90d3cb495052476940f072daa78c813ed1a1d8e90f33a0ae4e716da4a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*--------------------------*/

/*---------------------------------*/

/*--------------------------*/

/*---------------------------------*/

// namespace __as_rvalue

// namespace __cpo

// namespace views

// namespace ranges

// _LIBCPP_STD_VER >= 23

// _LIBCPP___RANGES_AS_RVALUE_H


=== system/lib/libcxx/include/__ranges/chunk_by_view.h ===
SHA256: 1f540a16cd9edea987df3fd262ffbc0e3393b38afff807997e33028240cd90da
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// We cache the result of begin() to allow providing an amortized O(1).

// Note: this duplicates a check in `optional` but provides a better error message.

// Attempting to decrement a begin iterator is a no-op (`__find_prev` would return the same argument given to it).

// Note: this duplicates a check in `optional` but provides a better error message.

// Note: this duplicates a check in `optional` but provides a better error message.

// If the iterator is at end, this would return an empty range which can be checked by the calling code and doesn't

// necessarily lead to a bad access.

// Attempting to increment an end iterator is a no-op (`__find_next` would return the same argument given to it).

/**/

/*--*/

/*-------------*/

// namespace __chunk_by

// namespace __cpo

// namespace views

// namespace ranges

// _LIBCPP_STD_VER >= 23

// _LIBCPP___RANGES_CHUNK_BY_VIEW_H


=== system/lib/libcxx/include/__ranges/common_view.h ===
SHA256: 48f23dd6c8b989d3c7ec32003dd2db50ac7eee7f8a73cf527f6bf2b5f3e0bde1
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __common

// namespace __cpo

// namespace views

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_COMMON_VIEW_H


=== system/lib/libcxx/include/__ranges/concepts.h ===
SHA256: 9eb2431a4ca83e29f50bbd6faf2fc15ef39108d764ea5896ad15b3b014d4aaa8
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [range.range]

// sometimes equality-preserving

// `iterator_t` defined in <__ranges/access.h>

// [range.sized]

// `disable_sized_range` defined in `<__ranges/size.h>`

// [range.view], views

// `enable_view` defined in <__ranges/enable_view.h>

// `view_base` defined in <__ranges/enable_view.h>

// [range.refinements], other range refinements

// _LIBCPP_STD_VER >= 23

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_CONCEPTS_H


=== system/lib/libcxx/include/__ranges/container_compatible_range.h ===
SHA256: e76ede621ce8d5a0d1884aecaddb94ce2104a9ac19193be2b091f408f4405f01
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 23

// _LIBCPP___RANGES_CONTAINER_COMPATIBLE_RANGE_H


=== system/lib/libcxx/include/__ranges/counted.h ===
SHA256: 623aef08a92f238fdc3eb694fee6db1642a7043d9ed8aa3414886f2d5485f65d
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Deliberately omit return-type SFINAE, because to_address is not SFINAE-friendly

// namespace __counted

// namespace __cpo

// namespace ranges::views

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_COUNTED_H


=== system/lib/libcxx/include/__ranges/dangling.h ===
SHA256: 1e6905e7ac85ff945a9ef05feb69237ca69932cf4db7d32b90a1de4054e39a7e
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// borrowed_subrange_t defined in <__ranges/subrange.h>

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_DANGLING_H


=== system/lib/libcxx/include/__ranges/data.h ===
SHA256: 52c8501f9b47b8c17133d110af656263998530bf909e995c757b10b0ee621f79
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [range.prim.data]

// namespace __data

// namespace __cpo

// namespace ranges

// [range.prim.cdata]

// namespace __cdata

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_DATA_H


=== system/lib/libcxx/include/__ranges/drop_view.h ===
SHA256: b91f44a32f82012d8f1a5ce79eeb72e5e77926a69194538b0faf4737fb4fc3f9
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// We cache begin() whenever ranges::next is not guaranteed O(1) to provide an

// amortized O(1) begin() method. If this is an input_range, then we cannot cache

// begin because begin is not equality preserving.

// Note: drop_view<input-range>::begin() is still trivially amortized O(1) because

// one can't call begin() on it more than once.

// [range.drop.overview]: the `empty_view` case.

// [range.drop.overview]: the `span | basic_string_view | iota_view | subrange (StoreSize == false)` case.

// Note: deliberately not forwarding `__rng` to guard against double moves.

// [range.drop.overview]: the `subrange (StoreSize == true)` case.

// Note: deliberately not forwarding `__rng` to guard against double moves.

// Introducing local variables avoids calculating `min` and `distance` twice (at the cost of diverging from the

// expression used in the `noexcept` clause and the return statement).

// clang-format off

// [range.drop.overview]: the `repeat_view` "_RawRange models sized_range" case.

// [range.drop.overview]: the `repeat_view` "otherwise" case.

// clang-format on

// [range.drop.overview]: the "otherwise" case.

// Note: without specifically excluding the other cases, GCC sees this overload as ambiguous with the other

// overloads.

// namespace __drop

// namespace __cpo

// namespace views

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_DROP_VIEW_H


=== system/lib/libcxx/include/__ranges/drop_while_view.h ===
SHA256: 27cc7504894f7d9ba06f245a3cc777d3a3d86800c9389621c9434beccf9c2a73
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Note: this duplicates a check in `optional` but provides a better error message.

/**/

/*--*/

/*-------------*/

// namespace __drop_while

// namespace __cpo

// namespace views

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_DROP_WHILE_VIEW_H


=== system/lib/libcxx/include/__ranges/elements_view.h ===
SHA256: 0d5ec5c8b302cff6d3f6ab0dfbc8310899cb82e44bf3d8e9c43f9619820a4446
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// std::get

/*_Const=*/

/*_Const=*/

/*_Const=*/

/*_Const=*/

/*_Const=*/

/*_Const=*/

/**/

/*------*/

/*-------------*/

// namespace __elements

// namespace __cpo

// namespace views

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_ELEMENTS_VIEW_H


=== system/lib/libcxx/include/__ranges/empty.h ===
SHA256: e0911940c203cb16cc25d9611cdd12d879ef936b09404ada4a42299db6892aab
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [range.prim.empty]

// namespace __empty

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_EMPTY_H


=== system/lib/libcxx/include/__ranges/empty_view.h ===
SHA256: 12a2fe7af3a0c97df961546c0e3bd70216cd6b74fad260aa42e3ae2c660ad1ca
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace views

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_EMPTY_VIEW_H


=== system/lib/libcxx/include/__ranges/enable_borrowed_range.h ===
SHA256: 623ba4c99ef1fb8c8489608dbca7a619089eb100072875315e7faf1d0c7a8fe1
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// These customization variables are used in <span> and <string_view>. The

// separate header is used to avoid including the entire <ranges> header in

// <span> and <string_view>.

// [range.range], ranges

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_ENABLE_BORROWED_RANGE_H


=== system/lib/libcxx/include/__ranges/enable_view.h ===
SHA256: e4bdb5e52cff3625b6fa939deef843cf6984f40b93ae46e74555c20cbf29ff6f
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_ENABLE_VIEW_H


=== system/lib/libcxx/include/__ranges/filter_view.h ===
SHA256: c78d3016efa8f6e98c16c3f58d250a796c0bd04cb3dc897c6d79c0e2dd882bcd
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// We cache the result of begin() to allow providing an amortized O(1) begin() whenever

// the underlying range is at least a forward_range.

// Note: this duplicates a check in `optional` but provides a better error message.

/* else */

/* else */

// using iterator_category = inherited;

// namespace __filter

// namespace __cpo

// namespace views

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_FILTER_VIEW_H


=== system/lib/libcxx/include/__ranges/from_range.h ===
SHA256: 02252a9d8692e5de1df740bb7526dfa8fe1317f82e53aca4b26d8bc0922541ba
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 23

// _LIBCPP___RANGES_FROM_RANGE_H


=== system/lib/libcxx/include/__ranges/iota_view.h ===
SHA256: 40077bc870531ec8e239ba6ea3f744adab7460891eaad8fb726f3379b62865b7
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*Else*/

// Validate the precondition if possible.

// namespace __iota

// namespace __cpo

// namespace views

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_IOTA_VIEW_H


=== system/lib/libcxx/include/__ranges/istream_view.h ===
SHA256: 9d521717a2bf9a9fb279a48f79c8405519f77de11ef6fa141f19379742df42ce
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// clang-format off

// clang-format on

// namespace __istream

// namespace __cpo

// namespace views

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_ISTREAM_VIEW_H


=== system/lib/libcxx/include/__ranges/join_view.h ===
SHA256: ad6dd695ceea3253288ddfa212e7228b08f8e597bc27e35e86c746e807dd9e70
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// https://reviews.llvm.org/D142811#inline-1383022

// To simplify the segmented iterator traits specialization,

// make the iterator `final`

// Skip empty inner ranges when going backwards.

// namespace __join_view

// namespace __cpo

// namespace views

// namespace ranges

// TODO: Would it make sense to enable the optimization for other iterator types?

// #if _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_JOIN_VIEW_H


=== system/lib/libcxx/include/__ranges/join_with_view.h ===
SHA256: 055b33888c64b052eabadc764a36315584db9d215d2fd6386b5057f5b550542b
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/**/

/*--*/

/*-------------*/

// namespace __join_with_view

// namespace __cpo

// namespace views

// namespace ranges

// _LIBCPP_STD_VER >= 23

// _LIBCPP___RANGES_JOIN_WITH_VIEW_H


=== system/lib/libcxx/include/__ranges/lazy_split_view.h ===
SHA256: 95a375c35b5b57a8929e0de5ed1eb894121fcb6b3851b5c959d430d7b27c2741
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Workaround for the GCC issue that doesn't allow calling `__parent_->__base_` from friend functions (because

// `__base_` is private).

// using iterator_category = inherited;

// Empty pattern: split on every element in the input range

// One-element pattern: we can use `ranges::find`.

// Make sure we point to after the separator we just found.

// General case for n-element pattern.

// The pattern matched; skip it.

// Workaround for a GCC issue.

// Note: these private functions are necessary because GCC doesn't allow calls to private members of `__i_` from

// free functions that are friends of `inner-iterator`.

// using iterator_category = inherited;

// namespace __lazy_split_view

// namespace __cpo

// namespace views

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_LAZY_SPLIT_VIEW_H


=== system/lib/libcxx/include/__ranges/movable_box.h ===
SHA256: 90bacf7a5586b4392a5970699bcb400c93cad2c9f4405eecd90120b6e4726db0
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __movable_box allows turning a type that is move-constructible (but maybe not move-assignable) into

// a type that is both move-constructible and move-assignable. It does that by introducing an empty state

// and basically doing destroy-then-copy-construct in the assignment operator. The empty state is necessary

// to handle the case where the copy construction fails after destroying the object.

//

// In some cases, we can completely avoid the use of an empty state; we provide a specialization of

// __movable_box that does this, see below for the details.

// until C++23, `__movable_box` was named `__copyable_box` and required the stored type to be copy-constructible, not

// just move-constructible; we preserve the old behavior in pre-C++23 modes.

// Primary template - uses std::optional and introduces an empty state in case assignment fails.

// This partial specialization implements an optimization for when we know we don't need to store

// an empty state to represent failure to perform an assignment. For copy-assignment, this happens:

//

// 1. If the type is copyable (which includes copy-assignment), we can use the type's own assignment operator

//    directly and avoid using std::optional.

// 2. If the type is not copyable, but it is nothrow-copy-constructible, then we can implement assignment as

//    destroy-and-then-construct and we know it will never fail, so we don't need an empty state.

//

// The exact same reasoning can be applied for move-assignment, with copyable replaced by movable and

// nothrow-copy-constructible replaced by nothrow-move-constructible. This specialization is enabled

// whenever we can apply any of these optimizations for both the copy assignment and the move assignment

// operator.

// 1. If copy_constructible<T> is true, movable-box<T> should store only a T if either T models

//    copyable, or is_nothrow_move_constructible_v<T> && is_nothrow_copy_constructible_v<T> is true.

// 2. Otherwise, movable-box<T> should store only a T if either T models movable or

//    is_nothrow_move_constructible_v<T> is true.

// When _Tp doesn't have an assignment operator, we must implement __movable_box's assignment operator

// by doing destroy_at followed by construct_at. However, that implementation strategy leads to UB if the nested

// _Tp is potentially overlapping, as it is doing a non-transparent replacement of the sub-object, which means that

// we're not considered "nested" inside the movable-box anymore, and since we're not nested within it, [basic.life]/1.5

// says that we essentially just reused the storage of the movable-box for a completely unrelated object and ended the

// movable-box's lifetime.

// https://github.com/llvm/llvm-project/issues/70494#issuecomment-1845646490

//

// Hence, when the _Tp doesn't have an assignment operator, we can't risk making it a potentially-overlapping

// subobject because of the above, and we don't use [[no_unique_address]] in that case.

// Implementation of assignment operators in case we perform optimization (1)

// Implementation of assignment operators in case we perform optimization (2)

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_MOVABLE_BOX_H


=== system/lib/libcxx/include/__ranges/non_propagating_cache.h ===
SHA256: 95d48113504b5abc0af2ce1119298bf7786552d7cb65eb4632c2659304541715
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// indirectly_readable

// iter_reference_t

// __non_propagating_cache is a helper type that allows storing an optional value in it,

// but which does not copy the source's value when it is copy constructed/assigned to,

// and which resets the source's value when it is moved-from.

//

// This type is used as an implementation detail of some views that need to cache the

// result of `begin()` in order to provide an amortized O(1) begin() method. Typically,

// we don't want to propagate the value of the cache upon copy because the cached iterator

// may refer to internal details of the source view.

// This helper class is needed to perform copy and move elision when

// constructing the contained type from an iterator.

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_NON_PROPAGATING_CACHE_H


=== system/lib/libcxx/include/__ranges/owning_view.h ===
SHA256: b98a3a47ee6a21e19fde1294a497146009c1cee8348c8c5cbd3d790e58c802c4
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_OWNING_VIEW_H


=== system/lib/libcxx/include/__ranges/range_adaptor.h ===
SHA256: 96b7fd013005cbb2018c52122ff48b356b78b33ce394ce6a0838905d2c9e5fe6
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// CRTP base that one can derive from in order to be considered a range adaptor closure

// by the library. When deriving from this class, a pipe operator will be provided to

// make the following hold:

// - `x | f` is equivalent to `f(x)`

// - `f1 | f2` is an adaptor closure `g` such that `g(x)` is equivalent to `f2(f1(x))`

// Type that wraps an arbitrary function object and makes it into a range adaptor closure,

// i.e. something that can be called via the `x | f` notation.

// Ensure that `remove_cvref_t<_Tp>` is derived from `__range_adaptor_closure<remove_cvref_t<_Tp>>` and isn't derived

// from `__range_adaptor_closure<U>` for any other type `U`.

// _LIBCPP_STD_VER >= 23

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_RANGE_ADAPTOR_H


=== system/lib/libcxx/include/__ranges/rbegin.h ===
SHA256: c33a93931c2a7905bf47a783f046553de8a86db810aa316714ad6ed42bf449df
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [ranges.access.rbegin]

// namespace __rbegin

// namespace __cpo

// namespace ranges

// [range.access.crbegin]

// namespace __crbegin

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_RBEGIN_H


=== system/lib/libcxx/include/__ranges/ref_view.h ===
SHA256: 6fe9a781222419c44d625bb36eb1598144fb5cb486aeb356dbb974ff9567155a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// NOLINT(modernize-use-equals-delete) ; This is llvm.org/PR54276

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_REF_VIEW_H


=== system/lib/libcxx/include/__ranges/rend.h ===
SHA256: ed8cd46b033bad15f5fe64b00ea7e5e58b852163777a42e333a1aea13ff00705
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [range.access.rend]

// namespace __rend

// namespace __cpo

// namespace ranges

// [range.access.crend]

// namespace __crend

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_REND_H


=== system/lib/libcxx/include/__ranges/repeat_view.h ===
SHA256: 3570906cf96635c7c57077520290f82a1af7e4f7f990cc69d8a9e0674e4a4fe1
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace views::__drop

// namespace views::__take

// [range.repeat.iterator]

// clang-format off

// namespace __repeat

// clang-format on

// namespace __cpo

// namespace views

// namespace ranges

// _LIBCPP_STD_VER >= 23

// _LIBCPP___RANGES_REPEAT_VIEW_H


=== system/lib/libcxx/include/__ranges/reverse_view.h ===
SHA256: d422d5d713478472e2e75a9d18692b4847f8cde9d9ee11f4bbd3197c15a2f724
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// We cache begin() whenever ranges::next is not guaranteed O(1) to provide an

// amortized O(1) begin() method.

// avoid SFINAE-ing out the overload below -- let the concept requirements do it for better diagnostics

// namespace __reverse

// namespace __cpo

// namespace views

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_REVERSE_VIEW_H


=== system/lib/libcxx/include/__ranges/single_view.h ===
SHA256: 7ba1dfd4d785053a88ef8f3f4721ac7096932f279cbe6b925bf68f1166e012d6
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __single_view

// namespace __cpo

// namespace views

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_SINGLE_VIEW_H


=== system/lib/libcxx/include/__ranges/size.h ===
SHA256: 8699b03748fec066aea3e01337bc904c0c29dce5964bfb1d9ed86746a9e1291d
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace ranges

// [range.prim.size]

// `[range.prim.size]`: the array case (for rvalues).

// `[range.prim.size]`: the array case (for lvalues).

// `[range.prim.size]`: `auto(t.size())` is a valid expression.

// `[range.prim.size]`: `auto(size(t))` is a valid expression.

// [range.prim.size]: the `to-unsigned-like` case.

// namespace __size

// namespace __cpo

// namespace ranges

// [range.prim.ssize]

// namespace __ssize

// namespace __cpo

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_SIZE_H


=== system/lib/libcxx/include/__ranges/split_view.h ===
SHA256: dd995ade93be1c81a3ba3db0b6198979ed32c5d98c4b66b79aae7510914b6bb5
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// clang-format off

// clang-format on

// namespace __split_view

// namespace __cpo

// namespace views

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_SPLIT_VIEW_H


=== system/lib/libcxx/include/__ranges/subrange.h ===
SHA256: f3eb53cdcddc4ccd6b640a8a3529a50a0c6301f9144a268b3aa2ad296b93f147
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Note: this is an internal implementation detail that is public only for internal usage.

// just to improve compiler diagnostics

// namespace ranges

// [range.subrange.general]

// [ranges.syn]

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_SUBRANGE_H


=== system/lib/libcxx/include/__ranges/take_view.h ===
SHA256: 529f3ea4183ac98167eb08687c6dec0da48a5c000461bed56e6da44ff3d6f5cf
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [range.take.overview]: the `empty_view` case.

// [range.take.overview]: the `span | basic_string_view | subrange` case.

// Note: deliberately not forwarding `__rng` to guard against double moves.

// [range.take.overview]: the `iota_view` case.

// clang-format off

// Note: deliberately not forwarding `__rng` to guard against double moves.

// [range.take.overview]: the `repeat_view` "_RawRange models sized_range" case.

// [range.take.overview]: the `repeat_view` "otherwise" case.

// clang-format on

// [range.take.overview]: the "otherwise" case.

// Note: without specifically excluding the other cases, GCC sees this overload as ambiguous with the other

// overloads.

// namespace __take

// namespace __cpo

// namespace views

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_TAKE_VIEW_H


=== system/lib/libcxx/include/__ranges/take_while_view.h ===
SHA256: 664911289502e4db3411a76a685ebfb40a0e9787d0aa4fc69b8150ee808fd6ec
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*_Const=*/

/*_Const=*/

/**/

/*--*/

/*-------------*/

// namespace __take_while

// namespace __cpo

// namespace views

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_TAKE_WHILE_VIEW_H


=== system/lib/libcxx/include/__ranges/to.h ===
SHA256: f2aa533b3363f70b21ca512e239abc3d5493bf63514d2c089ab404e4cbef95f5
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Note: making this a concept allows short-circuiting the second condition.

// `ranges::to` base template -- the `_Container` type is a simple type template parameter.

// Mandates: C is a cv-unqualified class type.

// First see if the non-recursive case applies -- the conversion target is either:

// - a range with a convertible value type;

// - a non-range type which might support being created from the input argument(s) (e.g. an `optional`).

// Case 1 -- construct directly from the given range.

// Case 2 -- construct using the `from_range_t` tagged constructor.

// Case 3 -- construct from a begin-end iterator pair.

// Case 4 -- default-construct (or construct from the extra arguments) and insert, reserving the size if possible.

// Try the recursive case.

// Deduces the full type of the container from the given template template parameter.

// Case 1 -- can construct directly from the given range.

//

// Case 2 -- can construct from the given range using the `from_range_t` tagged constructor.

//

//

// Case 3 -- can construct from a begin-end iterator pair.

//

// `ranges::to` specialization -- `_Container` is a template template parameter requiring deduction to figure out the

// container element type.

// Range adaptor closure object 1 -- wrapping the `ranges::to` version where `_Container` is a simple type template

// parameter.

// Mandates: C is a cv-unqualified class type.

//

/**/

// Range adaptor closure object 2 -- wrapping the `ranges::to` version where `_Container` is a template template

// parameter.

// clang-format off

//

/**/

// clang-format on

// namespace ranges

// _LIBCPP_STD_VER >= 23

// _LIBCPP___RANGES_TO_H


=== system/lib/libcxx/include/__ranges/transform_view.h ===
SHA256: 5bfef030125202aed40837adae6b6975bce90d085f0ccc14cc75a7e742ab19a0
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Note: `__i` should always be `__iterator<false>`, but directly using

// `__iterator<false>` is ill-formed when `_Const` is false

// (see http://wg21.link/class.copy.ctor#5).

// Note: `__i` should always be `__sentinel<false>`, but directly using

// `__sentinel<false>` is ill-formed when `_Const` is false

// (see http://wg21.link/class.copy.ctor#5).

// namespace __transform

// namespace __cpo

// namespace views

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_TRANSFORM_VIEW_H


=== system/lib/libcxx/include/__ranges/view_interface.h ===
SHA256: 0a063d28315015fed6eaac18b90e595281b4fee283fa9d7fdf043c0d6ed3418d
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_VIEW_INTERFACE_H


=== system/lib/libcxx/include/__ranges/views.h ===
SHA256: ff4e164c986495ba957637e686cd884df62385ba2915050e9b4d0035f7a118c5
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace ranges

// _LIBCPP_STD_VER >= 20

// _LIBCPP___RANGES_VIEWS


=== system/lib/libcxx/include/__ranges/zip_view.h ===
SHA256: f6a1075c27f57d0d4a6bb6e813bc709e6f89c4b23d1bc8dc3ddf8f30bbb4e5f7
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// abs in cstdlib is not constexpr

// TODO : remove __abs once P0533R9 is implemented.

// hidden friend cannot access private member of iterator because they are friends of friends

// namespace __zip

// namespace __cpo

// namespace views

// namespace ranges

// _LIBCPP_STD_VER >= 23

// _LIBCPP___RANGES_ZIP_VIEW_H


=== system/lib/libcxx/include/__std_mbstate_t.h ===
SHA256: 2677e8a6fe4469233279818ed7ff9eb5a204faacd0011f6706f3df5a8785df86
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// The goal of this header is to provide std::mbstate_t without requiring all

// of <cuchar> or <cwchar>.

// _LIBCPP___STD_MBSTATE_T_H


=== system/lib/libcxx/include/__stop_token/atomic_unique_lock.h ===
SHA256: 51147afb4c32ebd400961b77bb05ca860f9fc1cfe010be1c253d29faa05e090a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// This class implements an RAII unique_lock without a mutex.

// It uses std::atomic<State>,

// where State contains a lock bit and might contain other data,

// and LockedBit is the value of State when the lock bit is set, e.g  1 << 2

// std::memory_order_acquire because we'd like to make sure that all the read operations after the lock can read the

// up-to-date values.

// unset the _LockedBit. `memory_order_release` because we need to make sure all the write operations before calling

// `__unlock` will be made visible to other threads

// while trying to lock the state, if the predicate returns true, give up

// locking and return

// At this stage, until we exit the inner while loop, other than the atomic state, we are not reading any order

// dependent values that is written on other threads, or writing anything that needs to be seen on other threads.

// Therefore `memory_order_relaxed` is enough.

// user provided early return condition. fail to lock

// another thread has locked the state, we need to wait

// when it is woken up by notifyAll or spuriously, the __state_

// might have changed. reload the state

// Note that the new state's _LockedBit may or may not equal to 0

// at least for now, it is not locked. we can try `compare_exchange_weak` to lock it.

// Note that the variable `__current_state`'s lock bit has to be 0 at this point.

// if __state_ has the same value of __current_state, lock bit must be zero before exchange and

// we are good to lock/exchange and return. If _state has a different value, because other

// threads locked it between the `break` statement above and this statement, exchange will fail

// and go back to the inner while loop above.

// state after lock. Usually it should be __current_state | _LockedBit.

// Some use cases need to set other bits at the same time as an atomic

// operation therefore we accept a function

// sucessful exchange order. Usually it should be std::memory_order_acquire.

// Some use cases need more strict ordering therefore we accept it as a parameter

// fail to exchange order. We don't need any ordering as we are going back to the

// inner while loop

// _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS

// _LIBCPP___STOP_TOKEN_ATOMIC_UNIQUE_LOCK_H


=== system/lib/libcxx/include/__stop_token/intrusive_list_view.h ===
SHA256: 9ad2933be0806d9d1a38488a3b54329f09a3daa5861ac93e9b55035ad618f3dc
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// This class is a view of underlying double-linked list.

// It does not own the nodes. It provides user-friendly

// operations on the linked list.

// OK not to set __front->__next_ = nullptr as __front is not part of the list anymore

// prev exists, set its next to our next to skip __node

// _LIBCPP_STD_VER >= 20

// _LIBCPP___STOP_TOKEN_INTRUSIVE_LIST_VIEW_H


=== system/lib/libcxx/include/__stop_token/intrusive_shared_ptr.h ===
SHA256: b6a8dbefeead6448623465f2b135fb38467ced639a5918878cf3af54ad1aa51c
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// For intrusive_shared_ptr to work with a type T, specialize __intrusive_shared_ptr_traits<T> and implement

// the following function:

//

// static std::atomic<U>& __get_atomic_ref_count(T&);

//

// where U must be an integral type representing the number of references to the object.

// A reference counting shared_ptr for types whose reference counter

// is stored inside the class _Tp itself.

// When the reference count goes to zero, the destructor of _Tp will be called

// the memory order for increment/decrement the counter is the same for shared_ptr

// increment is relaxed and decrement is acq_rel

// _LIBCPP_STD_VER >= 20

// _LIBCPP___STOP_TOKEN_INTRUSIVE_SHARED_PTR_H


=== system/lib/libcxx/include/__stop_token/stop_callback.h ===
SHA256: 08e351d2d04ffc8719f3b9d373a4939c3bcc9905c4d779ade502bed612dc07d6
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// stop callback is supposed to only be called once

// st.stop_requested() was false and this is successfully added to the linked list

// _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS

// _LIBCPP___STOP_TOKEN_STOP_CALLBACK_H


=== system/lib/libcxx/include/__stop_token/stop_source.h ===
SHA256: a7c77ad4a452082785ecb1db12730431a5330a8f6efd2ef4e498417b0f365c70
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// increment `__other` first so that we don't hit 0 in case of self-assignment

// _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS

// _LIBCPP___STOP_TOKEN_STOP_SOURCE_H


=== system/lib/libcxx/include/__stop_token/stop_state.h ===
SHA256: 541ff539129d05f6c840c8c8ee6388736de9efda2e991f82292dd9eaa4d2131a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// The "stop_source counter" is not used for lifetime reference counting.

// When the number of stop_source reaches 0, the remaining stop_tokens's

// stop_possible will return false. We need this counter to track this.

//

// The "callback list locked" bit implements the atomic_unique_lock to

// guard the operations on the callback list

//

//       31 - 2          |  1                   |    0           |

//  stop_source counter  | callback list locked | stop_requested |

// Reference count for stop_token + stop_callback + stop_source

// When the counter reaches zero, the state is destroyed

// It is used by __intrusive_shared_ptr, but it is stored here for better layout

// We are not destroying the object after counter decrements to zero, nor do we have

// operations depend on the ordering of decrementing the counter. relaxed is enough.

// acquire because [thread.stoptoken.intro] A call to request_stop that returns true

// synchronizes with a call to stop_requested on an associated stop_token or stop_source

// object that returns true.

// request_stop's compare_exchange_weak has release which syncs with this acquire

// [stoptoken.mem] false if "a stop request was not made and there are no associated stop_source objects"

// Todo: Can this be std::memory_order_relaxed as the standard does not say anything except not to introduce data

// race?

// allow other callbacks to be removed while invoking the current callback

// __cb's invoke function could potentially delete itself. We need to check before accessing __cb's member

// needs to set __destroyed_ pointer to nullptr, otherwise it points to a local variable

// which is to be destroyed at the end of the loop

// [stopcallback.cons] If callback is concurrently executing on another thread, then the return

// from the invocation of callback strongly happens before ([intro.races]) callback is destroyed.

// this release syncs with the acquire in the remove_callback

// If it is already stop_requested. Do not try to request it again.

// already stop requested, synchronously run the callback and no need to lock the list again

// no stop source. no need to lock the list to add the callback as it can never be invoked

// unlock here: [thread.stoptoken.intro] Registration of a callback synchronizes with the invocation of

// that callback.

// Note: this release sync with the acquire in the request_stop' __try_lock_for_request_stop

// called by the destructor of stop_callback

// under below condition, the request_stop call just popped __cb from the list and could execute it now

// [stopcallback.cons] If callback is concurrently executing on another thread, then the return

// from the invocation of callback strongly happens before ([intro.races]) callback is destroyed.

// The destructor of stop_callback runs on the same thread of the thread that invokes the callback.

// The callback is potentially invoking its own destuctor. Set the flag to avoid accessing destroyed

// members on the invoking side

// If it is already stop_requested, do not try to request stop or lock the list again.

// set locked and requested bit at the same time

// acq because [thread.stoptoken.intro] Registration of a callback synchronizes with the invocation of that

//     callback. We are going to invoke the callback after getting the lock, acquire so that we can see the

//     registration of a callback (and other writes that happens-before the add_callback)

//     Note: the rel (unlock) in the add_callback syncs with this acq

// rel because [thread.stoptoken.intro] A call to request_stop that returns true synchronizes with a call

//     to stop_requested on an associated stop_token or stop_source object that returns true.

//     We need to make sure that all writes (including user code) before request_stop will be made visible

//     to the threads that waiting for `stop_requested == true`

//     Note: this rel syncs with the acq in `stop_requested`

// _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS

// _LIBCPP___STOP_TOKEN_STOP_STATE_H


=== system/lib/libcxx/include/__stop_token/stop_token.h ===
SHA256: 5847a0152dd9f3bc11d6e111fcd60f7edd61aeaca748d9c02f3011205ec3288f
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS

// _LIBCPP___STOP_TOKEN_STOP_TOKEN_H


=== system/lib/libcxx/include/__string/char_traits.h ===
SHA256: 5bab4b79ca4eb4f36a2d6f59a1d556b393927a43ef897a161b6f3619777b8a8b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// for wmemcpy

/*
The Standard does not define the base template for char_traits because it is impossible to provide
a correct definition for arbitrary character types. Instead, it requires implementations to provide
specializations for predefined character types like `char`, `wchar_t` and others. We provide this as
exposition-only to document what members a char_traits specialization should provide:
{
    using char_type  = _CharT;
    using int_type   = ...;
    using off_type   = ...;
    using pos_type   = ...;
    using state_type = ...;

    static void assign(char_type&, const char_type&);
    static bool eq(char_type, char_type);
    static bool lt(char_type, char_type);

    static int              compare(const char_type*, const char_type*, size_t);
    static size_t           length(const char_type*);
    static const char_type* find(const char_type*, size_t, const char_type&);
    static char_type*       move(char_type*, const char_type*, size_t);
    static char_type*       copy(char_type*, const char_type*, size_t);
    static char_type*       assign(char_type*, size_t, char_type);

    static int_type  not_eof(int_type);
    static char_type to_char_type(int_type);
    static int_type  to_int_type(char_type);
    static bool      eq_int_type(int_type, int_type);
    static int_type  eof();
};
*/

// char_traits<char>

// TODO: Make this _LIBCPP_HIDE_FROM_ABI

// __constexpr_memcmp requires a trivially lexicographically comparable type, but char is not when char is a signed

// type

// _LIBCPP_COMPILER_CLANG_BASED

// There are different aliases for the different char types, but they are all aliases to this type

// char_traits<wchar_t>

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP_HAS_CHAR8_T

// helper fns for basic_string and string_view

// __str_find

// Take advantage of knowing source and pattern lengths.

// Stop short when source is smaller than pattern.

// First element of __first2 is loop invariant.

// Check whether __first1 still has at least __len2 bytes.

// Find __f2 the first byte matching in __first1.

// It is faster to compare from the first byte of __first1 even if we

// already know that it matches the first byte of __first2: this is because

// __first2 is most likely aligned, as it is user's "pattern" string, and

// __first1 + 1 is most likely not aligned, as the match is in the middle of

// the string.

// There is nothing to search, just return __pos.

// __str_rfind

// __str_find_first_of

// __str_find_last_of

// __str_find_first_not_of

// __str_find_last_not_of

// _LIBCPP___STRING_CHAR_TRAITS_H


=== system/lib/libcxx/include/__string/constexpr_c_functions.h ===
SHA256: 4e9abdbae2f90c7c71cb5f81b117d684816d259ecc8e2012674cfe47ee9ddafe
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// GCC currently doesn't support __builtin_strlen for heap-allocated memory during constant evaluation.

// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70816

// Because of __is_trivially_lexicographically_comparable_v we know that comparing the object representations is

// equivalent to a std::memcmp. Since we have multiple objects contiguously in memory, we can call memcmp once instead

// of invoking it on every object individually.

// Because of __libcpp_is_trivially_equality_comparable we know that comparing the object representations is equivalent

// to a std::memcmp(...) == 0. Since we have multiple objects contiguously in memory, we can call memcmp once instead

// of invoking it on every object individually.

// use __builtin_char_memchr to optimize constexpr evaluation if we can

// This function performs an assignment to an existing, already alive TriviallyCopyable object

// from another TriviallyCopyable object.

//

// It basically works around the fact that TriviallyCopyable objects are not required to be

// syntactically copy/move constructible or copy/move assignable. Technically, only one of the

// four operations is required to be syntactically valid -- but at least one definitely has to

// be valid.

//

// This is necessary in order to implement __constexpr_memmove below in a way that mirrors as

// closely as possible what the compiler's __builtin_memmove is able to do.

// clang-format off

// clang-format on

// this is safe, we're not actually moving anything since the assignment is trivial

// clang-format off

// clang-format on

// _Tp is trivially destructible, so we don't need to call its destructor to end the lifetime of the object

// that was there previously

// clang-format off

// clang-format on

// _Tp is trivially destructible, so we don't need to call its destructor to end the lifetime of the object

// that was there previously

// this is safe, we're not actually moving anything since the constructor is trivial

// _LIBCPP___STRING_CONSTEXPR_C_FUNCTIONS_H


=== system/lib/libcxx/include/__string/extern_template_lists.h ===
SHA256: 20c0832484122e823f90b1c3c9000d43ffde4367df4aafc36c43d988c2e4c366
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// clang-format off

// We maintain multiple ABI lists:

// - _LIBCPP_STRING_COMMON_EXTERN_TEMPLATE_LIST

// - _LIBCPP_STRING_V1_EXTERN_TEMPLATE_LIST

// - _LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST

// As the name implies, the ABI lists define a common subset, the V1 (Stable) and unstable ABI.

//

// For unstable, we may explicitly remove function that are external in V1.

//

// For stable, the ABI list should rarely change, except for adding new

// functions supporting new c++ version / API changes. Typically entries

// must never be removed from the stable list.

// clang-format on

// _LIBCPP___STRING_EXTERN_TEMPLATE_LISTS_H


=== system/lib/libcxx/include/__support/ibm/gettod_zos.h ===
SHA256: 59701475f301efe1f087c4ff278bb27a63e03fa242048d105d8053e6b6ca4fdf
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// The POSIX gettimeofday() function is not available on z/OS. Therefore,

// we will call stcke and other hardware instructions in implement equivalent.

// Note that nanoseconds alone will overflow when reaching new epoch in 2042.

// dividend (upper half), remainder

// dividend (lower half), quotient

// _LIBCPP___SUPPORT_IBM_GETTOD_ZOS_H


=== system/lib/libcxx/include/__support/ibm/locale_mgmt_zos.h ===
SHA256: fc377298feafd3c85755408f0b14ca05a3fe20e10cc770d1016e41e61f125dc2
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/* highest real category */

/* maximum + 1 */

// z/OS does not have newlocale, freelocale and uselocale.

// The functions below are workarounds in single thread mode.

// defined(__MVS__)

// _LIBCPP___SUPPORT_IBM_LOCALE_MGMT_ZOS_H


=== system/lib/libcxx/include/__support/ibm/nanosleep.h ===
SHA256: 42c329ceab82baaaba29a0f6489d63eb91a4c84e05ff9ef6ca1e103c9b53dd0f
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// The nanosleep() function is not available on z/OS. Therefore, we will call

// sleep() to sleep for whole seconds and usleep() to sleep for any remaining

// fraction of a second. Any remaining nanoseconds will round up to the next

// microsecond.

// Updating the remaining time to sleep in case of unsuccessful call to sleep().

// The usleep() does not provide the amount of remaining time upon its failure,

// so the time slept will be ignored.

// The errno is already set.

// _LIBCPP___SUPPORT_IBM_NANOSLEEP_H


=== system/lib/libcxx/include/__support/xlocale/__nop_locale_mgmt.h ===
SHA256: 1c620a914a57a192a9819201650d6486f0ce01a1c18b5de3247555189e2a6c3f
// -*- C++ -*-

//===-----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Patch over lack of extended locale support

// _LIBCPP___SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H


=== system/lib/libcxx/include/__support/xlocale/__posix_l_fallback.h ===
SHA256: 98b5f5ceb724a206b80883adb5d810cc2d97b2b1ff460a0031a7e20601547b54
// -*- C++ -*-

//===-----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// These are reimplementations of some extended locale functions ( *_l ) that

// are normally part of POSIX.  This shared implementation provides parts of the

// extended locale support for libc's that normally don't have any (like

// Android's bionic and Newlib).

//===----------------------------------------------------------------------===//

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP___SUPPORT_XLOCALE_POSIX_L_FALLBACK_H


=== system/lib/libcxx/include/__support/xlocale/__strtonum_fallback.h ===
SHA256: d97d0d3ae1d5704060eef68a11624bf0a512d6d15a89ca80230523d871589cd7
// -*- C++ -*-

//===-----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// These are reimplementations of some extended locale functions ( *_l ) that

// aren't part of POSIX.  They are widely available though (GLIBC, BSD, maybe

// others).  The unifying aspect in this case is that all of these functions

// convert strings to some numeric type.

//===----------------------------------------------------------------------===//

// _LIBCPP___SUPPORT_XLOCALE_STRTONUM_FALLBACK_H


=== system/lib/libcxx/include/__system_error/errc.h ===
SHA256: 3cf654b8e602e8b2b4b3ee969c03fbb6ae373cd420361590be0ce6666debaf3c
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*
    system_error synopsis

namespace std
{

enum class errc
{
    address_family_not_supported,       // EAFNOSUPPORT
    address_in_use,                     // EADDRINUSE
    address_not_available,              // EADDRNOTAVAIL
    already_connected,                  // EISCONN
    argument_list_too_long,             // E2BIG
    argument_out_of_domain,             // EDOM
    bad_address,                        // EFAULT
    bad_file_descriptor,                // EBADF
    bad_message,                        // EBADMSG
    broken_pipe,                        // EPIPE
    connection_aborted,                 // ECONNABORTED
    connection_already_in_progress,     // EALREADY
    connection_refused,                 // ECONNREFUSED
    connection_reset,                   // ECONNRESET
    cross_device_link,                  // EXDEV
    destination_address_required,       // EDESTADDRREQ
    device_or_resource_busy,            // EBUSY
    directory_not_empty,                // ENOTEMPTY
    executable_format_error,            // ENOEXEC
    file_exists,                        // EEXIST
    file_too_large,                     // EFBIG
    filename_too_long,                  // ENAMETOOLONG
    function_not_supported,             // ENOSYS
    host_unreachable,                   // EHOSTUNREACH
    identifier_removed,                 // EIDRM
    illegal_byte_sequence,              // EILSEQ
    inappropriate_io_control_operation, // ENOTTY
    interrupted,                        // EINTR
    invalid_argument,                   // EINVAL
    invalid_seek,                       // ESPIPE
    io_error,                           // EIO
    is_a_directory,                     // EISDIR
    message_size,                       // EMSGSIZE
    network_down,                       // ENETDOWN
    network_reset,                      // ENETRESET
    network_unreachable,                // ENETUNREACH
    no_buffer_space,                    // ENOBUFS
    no_child_process,                   // ECHILD
    no_link,                            // ENOLINK
    no_lock_available,                  // ENOLCK
    no_message_available,               // ENODATA         // deprecated
    no_message,                         // ENOMSG
    no_protocol_option,                 // ENOPROTOOPT
    no_space_on_device,                 // ENOSPC
    no_stream_resources,                // ENOSR           // deprecated
    no_such_device_or_address,          // ENXIO
    no_such_device,                     // ENODEV
    no_such_file_or_directory,          // ENOENT
    no_such_process,                    // ESRCH
    not_a_directory,                    // ENOTDIR
    not_a_socket,                       // ENOTSOCK
    not_a_stream,                       // ENOSTR          // deprecated
    not_connected,                      // ENOTCONN
    not_enough_memory,                  // ENOMEM
    not_supported,                      // ENOTSUP
    operation_canceled,                 // ECANCELED
    operation_in_progress,              // EINPROGRESS
    operation_not_permitted,            // EPERM
    operation_not_supported,            // EOPNOTSUPP
    operation_would_block,              // EWOULDBLOCK
    owner_dead,                         // EOWNERDEAD
    permission_denied,                  // EACCES
    protocol_error,                     // EPROTO
    protocol_not_supported,             // EPROTONOSUPPORT
    read_only_file_system,              // EROFS
    resource_deadlock_would_occur,      // EDEADLK
    resource_unavailable_try_again,     // EAGAIN
    result_out_of_range,                // ERANGE
    state_not_recoverable,              // ENOTRECOVERABLE
    stream_timeout,                     // ETIME           // deprecated
    text_file_busy,                     // ETXTBSY
    timed_out,                          // ETIMEDOUT
    too_many_files_open_in_system,      // ENFILE
    too_many_files_open,                // EMFILE
    too_many_links,                     // EMLINK
    too_many_symbolic_link_levels,      // ELOOP
    value_too_large,                    // EOVERFLOW
    wrong_protocol_type                 // EPROTOTYPE
};

*/

// The method of pushing and popping the diagnostics fails for GCC.  GCC does

// not recognize the pragma's used to generate deprecated diagnostics for

// macros. So GCC does not need the pushing and popping.

//

// TODO Remove this when the deprecated constants are removed.

//

// Note based on the post-review comments in

// https://github.com/llvm/llvm-project/pull/80542 libc++ no longer deprecates

// the macros. Since C libraries may start to deprecate these POSIX macros the

// deprecation warning avoidance is kept.

// Some error codes are not present on all platforms, so we provide equivalents

// for them:

// enum class errc

//

// LWG3869 deprecates the UNIX STREAMS macros and enum values.

// This makes the code cumbersome:

// - the enum value is deprecated and should show a diagnostic,

// - the macro is deprecated and should _not_ show a diagnostic in this

//   context, and

// - the macro is not always available.

// This leads to the odd pushing and popping of the deprecated

// diagnostic.

// clang-format off

// clang-format on

// clang-format off

// clang-format on

// clang-format off

// clang-format on

// clang-format off

// clang-format on

// _LIBCPP___ERRC


=== system/lib/libcxx/include/__system_error/error_category.h ===
SHA256: ae4d3a9e343edd0a2f7276e3149f497b1bde19fb958b941fe568da0794a3d539
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// _LIBCPP___SYSTEM_ERROR_ERROR_CATEGORY_H


=== system/lib/libcxx/include/__system_error/error_code.h ===
SHA256: 8bebb3b7dd545a548bca02341d4e665135e374c0b04ad79fc95acc6ffcd41c16
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Those cause ADL to trigger but they are not viable candidates,

// so they are never actually selected.

// namespace __adl_only

// _LIBCPP_STD_VER <= 17

// _LIBCPP_STD_VER <= 17

// _LIBCPP___SYSTEM_ERROR_ERROR_CODE_H


=== system/lib/libcxx/include/__system_error/error_condition.h ===
SHA256: ba865819ab91126638b3b006f6753df5da870af683908d7cf38c83fa2a3d5fb6
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Those cause ADL to trigger but they are not viable candidates,

// so they are never actually selected.

// namespace __adl_only

// _LIBCPP_STD_VER <= 17

// _LIBCPP_STD_VER <= 17

// _LIBCPP___SYSTEM_ERROR_ERROR_CONDITION_H


=== system/lib/libcxx/include/__system_error/system_error.h ===
SHA256: 42c6b22d21cbb4006435b9efc114e283ef58a5152cc052932bc116b7c69150a6
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __ev is expected to be an error in the generic_category domain (e.g. from

// errno, or std::errc::*), not system_category (e.g. from windows syscalls).

// _LIBCPP___SYSTEM_ERROR_SYSTEM_ERROR_H


=== system/lib/libcxx/include/__system_error/throw_system_error.h ===
SHA256: 356d8643b1be953252c2c0eabb2161e6ecce7f831fcef58adeaaa1e01e6d7c80
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___SYSTEM_ERROR_THROW_SYSTEM_ERROR_H


=== system/lib/libcxx/include/__thread/formatter.h ===
SHA256: 562872bdac499f69bf6157d96ac585444a7f840b893a9c8d9bcf0a29e812c513
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// In __thread/support/pthread.h, __libcpp_thread_id is either a

// unsigned long long or a pthread_t.

//

// The type of pthread_t is left unspecified in POSIX so it can be any

// type. The most logical types are an integral or pointer.

// On Linux systems pthread_t is an unsigned long long.

// On Apple systems pthread_t is a pointer type.

//

// Note the output should match what the stream operator does. Since

// the ostream operator has been shipped years before this formatter

// was added to the Standard, this formatter does what the stream

// operator does. This may require platform specific changes.

// _LIBCPP_HAS_THREADS

// _LIBCPP_STD_VER >= 23

// _LIBCPP___THREAD_FORMATTER_H


=== system/lib/libcxx/include/__thread/id.h ===
SHA256: c3b35b203f6e27b66ea297a1225acf43a6e793818ed714aa3214c2860271582b
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace this_thread

// FIXME: pthread_t is a pointer on Darwin but a long on Linux.

// NULL is the no-thread value on Darwin.  Someone needs to check

// on other platforms.  We assume 0 works everywhere for now.

// id==0 is always less than any other thread_id

// _LIBCPP_STD_VER <= 17

// _LIBCPP_STD_VER <= 17

// Don't pass id==0 to underlying routines

// _LIBCPP_STD_VER <= 17

// _LIBCPP_STD_VER <= 17

// namespace this_thread

// _LIBCPP_HAS_THREADS

// _LIBCPP___THREAD_ID_H


=== system/lib/libcxx/include/__thread/jthread.h ===
SHA256: 8884b383cb001e453e923a4adcd8277dd377b0762df0d65826709416465c6831
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// types

// [thread.jthread.cons], constructors, move, and assignment

// [thread.jthread.mem], members

// [thread.jthread.stop], stop token handling

// [thread.jthread.special], specialized algorithms

// [thread.jthread.static], static members

// _LIBCPP_STD_VER >= 20 && _LIBCPP_HAS_THREADS

// _LIBCPP___THREAD_JTHREAD_H


=== system/lib/libcxx/include/__thread/poll_with_backoff.h ===
SHA256: 53059cee059f0f899577f2b59167f9d1ce6a97127e05735dd9c8da00834c20d8
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Polls a thread for a condition given by a predicate, and backs off based on a backoff policy

// before polling again.

//

// - __poll is the "test function" that should return true if polling succeeded, and false if it failed.

//

// - __backoff is the "backoff policy", which is called with the duration since we started polling. It should

//   return false in order to resume polling, and true if polling should stop entirely for some reason.

//   In general, backoff policies sleep for some time before returning control to the polling loop.

//

// - __max_elapsed is the maximum duration to try polling for. If the maximum duration is exceeded,

//   the polling loop will return false to report a timeout.

// __poll completion means success

// timeout failure

// __backoff completion means failure

// A trivial backoff policy that always immediately returns the control to

// the polling loop.

//

// This is not very well-behaved since it will cause the polling loop to spin,

// so this should most likely only be used on single-threaded systems where there

// are no other threads to compete with.

// _LIBCPP___THREAD_POLL_WITH_BACKOFF_H


=== system/lib/libcxx/include/__thread/support.h ===
SHA256: 5c8574d2cb73f85c05d849fde0322e19aa2c097d5215b3a1984d897f914d55bc
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*

//
// The library supports multiple implementations of the basic threading functionality.
// The following functionality must be provided by any implementation:
//

_LIBCPP_BEGIN_NAMESPACE_STD

using __libcpp_timespec_t = ...;

//
// Mutex
//
using __libcpp_mutex_t = ...;
#define _LIBCPP_MUTEX_INITIALIZER ...

using __libcpp_recursive_mutex_t = ...;

int __libcpp_recursive_mutex_init(__libcpp_recursive_mutex_t*);
_LIBCPP_NO_THREAD_SAFETY_ANALYSIS int __libcpp_recursive_mutex_lock(__libcpp_recursive_mutex_t*);
_LIBCPP_NO_THREAD_SAFETY_ANALYSIS bool __libcpp_recursive_mutex_trylock(__libcpp_recursive_mutex_t*);
_LIBCPP_NO_THREAD_SAFETY_ANALYSIS int __libcpp_recursive_mutex_unlock(__libcpp_recursive_mutex_t*);
int __libcpp_recursive_mutex_destroy(__libcpp_recursive_mutex_t*);

_LIBCPP_NO_THREAD_SAFETY_ANALYSIS int __libcpp_mutex_lock(__libcpp_mutex_t*);
_LIBCPP_NO_THREAD_SAFETY_ANALYSIS bool __libcpp_mutex_trylock(__libcpp_mutex_t*);
_LIBCPP_NO_THREAD_SAFETY_ANALYSIS int __libcpp_mutex_unlock(__libcpp_mutex_t*);
int __libcpp_mutex_destroy(__libcpp_mutex_t*);

//
// Condition Variable
//
using __libcpp_condvar_t = ...;
#define _LIBCPP_CONDVAR_INITIALIZER ...

int __libcpp_condvar_signal(__libcpp_condvar_t*);
int __libcpp_condvar_broadcast(__libcpp_condvar_t*);
_LIBCPP_NO_THREAD_SAFETY_ANALYSIS int __libcpp_condvar_wait(__libcpp_condvar_t*, __libcpp_mutex_t*);
_LIBCPP_NO_THREAD_SAFETY_ANALYSIS
int __libcpp_condvar_timedwait(__libcpp_condvar_t*, __libcpp_mutex_t*, __libcpp_timespec_t*);
int __libcpp_condvar_destroy(__libcpp_condvar_t*);

//
// Execute once
//
using __libcpp_exec_once_flag = ...;
#define _LIBCPP_EXEC_ONCE_INITIALIZER ...

int __libcpp_execute_once(__libcpp_exec_once_flag*, void (*__init_routine)());

//
// Thread id
//
using __libcpp_thread_id = ...;

bool __libcpp_thread_id_equal(__libcpp_thread_id, __libcpp_thread_id);
bool __libcpp_thread_id_less(__libcpp_thread_id, __libcpp_thread_id);

//
// Thread
//
#define _LIBCPP_NULL_THREAD ...
using __libcpp_thread_t = ...;

bool __libcpp_thread_isnull(const __libcpp_thread_t*);
int __libcpp_thread_create(__libcpp_thread_t*, void* (*__func)(void*), void* __arg);
__libcpp_thread_id __libcpp_thread_get_current_id();
__libcpp_thread_id __libcpp_thread_get_id(const __libcpp_thread_t*);
int __libcpp_thread_join(__libcpp_thread_t*);
int __libcpp_thread_detach(__libcpp_thread_t*);
void __libcpp_thread_yield();
void __libcpp_thread_sleep_for(const chrono::nanoseconds&);

//
// Thread local storage
//
#define _LIBCPP_TLS_DESTRUCTOR_CC ...
using __libcpp_tls_key = ...;

int __libcpp_tls_create(__libcpp_tls_key*, void (*__at_exit)(void*));
void* __libcpp_tls_get(__libcpp_tls_key);
int __libcpp_tls_set(__libcpp_tls_key, void*);

_LIBCPP_END_NAMESPACE_STD

*/

// _LIBCPP_HAS_THREADS

// _LIBCPP___THREAD_SUPPORT_H


=== system/lib/libcxx/include/__thread/support/c11.h ===
SHA256: 1ee09b31801f6ce31b627aa05ec0de9fdea0cc39b119e1081bd16287f028b72a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Mutex

//

// mtx_t is a struct so using {} for initialization is valid.

//

// Condition Variable

//

// cnd_t is a struct so using {} for initialization is valid.

//

// Execute once

//

//

// Thread id

//

// Returns non-zero if the thread ids are equal, otherwise 0

// Returns non-zero if t1 < t2, otherwise 0

//

// Thread

//

//

// Thread local storage

//

/* nothing */

// _LIBCPP___THREAD_SUPPORT_C11_H


=== system/lib/libcxx/include/__thread/support/external.h ===
SHA256: a88ed2c3aed78fb93a159418a7a7aa3ed3383e7cf747be2e902841497adb1c3e
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___THREAD_SUPPORT_EXTERNAL_H


=== system/lib/libcxx/include/__thread/support/pthread.h ===
SHA256: e0c5d97745451cf19dcd329e1b88fbf611f47ab701e5f5d7f673ccacdbdaac60
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Some platforms require <bits/atomic_wide_counter.h> in order for

// PTHREAD_COND_INITIALIZER to be expanded. Normally that would come

// in via <pthread.h>, but it's a non-modular header on those platforms,

// so libc++'s <math.h> usually absorbs atomic_wide_counter.h into the

// module with <math.h> and makes atomic_wide_counter.h invisible.

// Include <math.h> here to work around that.

// This checks wheter a Clang module is built

//

// Mutex

//

//

// Condition Variable

//

//

// Execute once

//

//

// Thread id

//

// Returns non-zero if the thread ids are equal, otherwise 0

// Returns non-zero if t1 < t2, otherwise 0

//

// Thread

//

//

// Thread local storage

//

/* nothing */

// _LIBCPP___THREAD_SUPPORT_PTHREAD_H


=== system/lib/libcxx/include/__thread/support/windows.h ===
SHA256: 56e170ab4b51c00a5b2838085975e34f647e33c5fcd191ab59287196c10e4112
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Mutex

//

//

// Condition variable

//

//

// Execute once

//

//

// Thread id

//

//

// Thread

//

//

// Thread local storage

//

// _LIBCPP___THREAD_SUPPORT_WINDOWS_H


=== system/lib/libcxx/include/__thread/this_thread.h ===
SHA256: 9d5f8ca73e60f02e5c15e66e927ab7ff4072ab1ad438e7e5935eda660cd98bbc
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// The standard guarantees a 64bit signed integer resolution for nanoseconds,

// so use INT64_MAX / 1e9 as cut-off point. Use a constant to avoid <climits>

// and issues with long double folding on PowerPC with GCC.

// _LIBCPP_HAS_THREADS

// namespace this_thread

// _LIBCPP___THREAD_THIS_THREAD_H


=== system/lib/libcxx/include/__thread/thread.h ===
SHA256: c0089c3d4d02554e6496a4a83ac3223e3579076c9723c210744b2242500aa9a1
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Only __thread_local_data() may construct a __thread_specific_ptr

// and only with _Tp == __thread_struct.

// __thread_specific_ptr is only created with a static storage duration

// so this destructor is only invoked during program termination. Invoking

// pthread_key_delete(__key_) may prevent other threads from deleting their

// thread local data. For this reason we leak the key.

// [thread.thread.id]/9

//   Effects: Inserts the text representation for charT of id into out.

//

// [thread.thread.id]/2

//   The text representation for the character type charT of an

//   object of type thread::id is an unspecified sequence of charT

//   such that, for two objects of type thread::id x and y, if

//   x == y is true, the thread::id objects have the same text

//   representation, and if x != y is true, the thread::id objects

//   have distinct text representations.

//

// Since various flags in the output stream can affect how the

// thread id is represented (e.g. numpunct or showbase), we

// use a temporary stream instead and just output the thread

// id representation as a string.

// _LIBCPP_HAS_LOCALIZATION

// _Fp = tuple< unique_ptr<__thread_struct>, Functor, Args...>

// _LIBCPP_CXX03_LANG

// This type is used to pass memory for thread local storage and a functor

// to a newly created thread because std::pair doesn't work with

// std::unique_ptr in C++03.

// _LIBCPP_CXX03_LANG

// _LIBCPP_CXX03_LANG

// _LIBCPP_HAS_THREADS

// _LIBCPP___THREAD_THREAD_H


=== system/lib/libcxx/include/__thread/timed_backoff_policy.h ===
SHA256: fe760693b6b3dd8d86f1f1b2d4f1cc47bcb14af627a63aec491557d8ae2abed9
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// poll

// _LIBCPP_HAS_THREADS

// _LIBCPP___THREAD_TIMED_BACKOFF_POLICY_H


=== system/lib/libcxx/include/__tuple/find_index.h ===
SHA256: de1ed757508518e13b837c76a65c0e1a96a9243f2d617ead40c898a7458b662d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __find_detail

// _LIBCPP_STD_VER >= 14

// _LIBCPP___TUPLE_FIND_INDEX_H


=== system/lib/libcxx/include/__tuple/ignore.h ===
SHA256: f24c3bf22b5ed77c419fa69b9f23004e72420e1909aa860a74b36634b8d77553
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_CXX03_LANG

// _LIBCPP___TUPLE_IGNORE_H


=== system/lib/libcxx/include/__tuple/make_tuple_types.h ===
SHA256: 3f59284cc96cbcf326310fb6037b7466a09af0107375fb8f19283a83401fa27b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __make_tuple_types<_Tuple<_Types...>, _Ep, _Sp>::type is a

// __tuple_types<_Types...> using only those _Types in the range [_Sp, _Ep).

// _Sp defaults to 0 and _Ep defaults to tuple_size<_Tuple>.  If _Tuple is a

// lvalue_reference type, then __tuple_types<_Types&...> is the result.

// Specialization for pair, tuple, and __tuple_types

// _LIBCPP_CXX03_LANG

// _LIBCPP___TUPLE_MAKE_TUPLE_TYPES_H


=== system/lib/libcxx/include/__tuple/sfinae_helpers.h ===
SHA256: 1bb6f156bdae7ade87069a4cf4a809b8360fb504dce7eeb42510e6d961c6a089
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __tuple_constructible

// !defined(_LIBCPP_CXX03_LANG)

// _LIBCPP_STD_VER >= 17

// _LIBCPP___TUPLE_SFINAE_HELPERS_H


=== system/lib/libcxx/include/__tuple/tuple_element.h ===
SHA256: 9d31b590593b6d6f304ed10e33dba8bcd0a42c1ed9f473473c9a306fcdc0e6ca
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_CXX03_LANG

// _LIBCPP___TUPLE_TUPLE_ELEMENT_H


=== system/lib/libcxx/include/__tuple/tuple_indices.h ===
SHA256: cafa3cf1d4d4e3ec1ae1238f711e7b7483ba93e43ecbc89552885613fc89b655
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_CXX03_LANG

// _LIBCPP___TUPLE_MAKE_TUPLE_INDICES_H


=== system/lib/libcxx/include/__tuple/tuple_like.h ===
SHA256: 4198e74abc3b55ce5db02335aab2360ac2653b35b1eb74a9e93d483948dc971d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// As of writing this comment every use of `pair-like` in the standard excludes `ranges::subrange`, so

// you most likely want to use `__pair_like_no_subrange` if you're looking for `pair-like`.

// _LIBCPP_STD_VER >= 20

// _LIBCPP___TUPLE_TUPLE_LIKE_H


=== system/lib/libcxx/include/__tuple/tuple_like_ext.h ===
SHA256: 00eb4edc83fd8b5eec8ed0259829f9d08e32b9cd801ab77d9eb427c31c9d80c7
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TUPLE_TUPLE_LIKE_EXT_H


=== system/lib/libcxx/include/__tuple/tuple_like_no_subrange.h ===
SHA256: f02bf0857f3c852bb5ebeb1bbd08aefa90339e92d32e9a22842a73fd9ba30b83
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// This is equivalent to the exposition-only type trait `pair-like`, except that it is false for specializations of

// `ranges::subrange`. This is more useful than the pair-like concept in the standard because every use of `pair-like`

// excludes `ranges::subrange`.

// _LIBCPP_STD_VER >= 20

// _LIBCPP___TUPLE_TUPLE_LIKE_NO_SUBRANGE_H


=== system/lib/libcxx/include/__tuple/tuple_size.h ===
SHA256: fda08251a54e5acb5d167c317b1a0d1345e245505046d17e798a237689783414
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_CXX03_LANG

// _LIBCPP___TUPLE_TUPLE_SIZE_H


=== system/lib/libcxx/include/__tuple/tuple_types.h ===
SHA256: 24ec73242f8c1a629de8c253322bd922b3d8a292095ccae59355bf1f37f299e3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TUPLE_TUPLE_TYPES_H


=== system/lib/libcxx/include/__type_traits/add_cv_quals.h ===
SHA256: 46a8b3f465886b14c1022b4ef01c27e99bfffc9c4710c7033e9ae749295e21d1
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_ADD_CV_H


=== system/lib/libcxx/include/__type_traits/add_pointer.h ===
SHA256: c25f8672934ccd24a622e476fc74f2b3006a1e5f13710bc5ac001059b5af7b58
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS)

// _LIBCPP___TYPE_TRAITS_ADD_POINTER_H


=== system/lib/libcxx/include/__type_traits/add_reference.h ===
SHA256: 54d581bc52f40716aef077c8c7caa60db011fd2f0cb671f44e7e3b857f3c8bbc
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_ADD_REFERENCE_H


=== system/lib/libcxx/include/__type_traits/aligned_storage.h ===
SHA256: e54ba7ec51b165710893ac3b59a8eb9dbeb4bb13c60bfe3ba1e8bb1d8f31bfc6
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_ALIGNED_STORAGE_H


=== system/lib/libcxx/include/__type_traits/aligned_union.h ===
SHA256: 66f556fc73acb2ae295591b27957ab81cc6004499629fd03d3dfc017f235056e
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_ALIGNED_UNION_H


=== system/lib/libcxx/include/__type_traits/alignment_of.h ===
SHA256: 2ff234792c067672636d83653c1bfe071ee706425d2400e4755b52fea6ac5668
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_ALIGNMENT_OF_H


=== system/lib/libcxx/include/__type_traits/can_extract_key.h ===
SHA256: b8ddc385b7c969e8deebf523d58e5a4214eae7561c41085db7cb18ba447208b2
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// These traits are used in __tree and __hash_table

// __can_extract_map_key uses true_type/false_type instead of the tags.

// It returns true if _Key != _ContainerValueTy (the container is a map not a set)

// and _ValTy == _Key.

// This specialization returns __extract_key_fail_tag for non-map containers

// because _Key == _ContainerValueTy

// _LIBCPP___TYPE_TRAITS_CAN_EXTRACT_KEY_H


=== system/lib/libcxx/include/__type_traits/common_reference.h ===
SHA256: cad43b316d9e1b209fc53f4781ba109de2a6ead9fc2d6f4e403282923a9b99b0
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// common_reference

// Let COND_RES(X, Y) be:

// Let `XREF(A)` denote a unary alias template `T` such that `T<U>` denotes the same type as `U`

// with the addition of `A`'s cv and reference qualifiers, for a non-reference cv-unqualified type

// `U`.

// [Note: `XREF(A)` is `__xref<A>::template __apply`]

// Given types A and B, let X be remove_reference_t<A>, let Y be remove_reference_t<B>,

// and let COMMON-REF(A, B) be:

//    If A and B are both lvalue reference types, COMMON-REF(A, B) is

//    COND-RES(COPYCV(X, Y)&, COPYCV(Y, X)&) if that type exists and is a reference type.

// clang-format off

// clang-format on

//    Otherwise, let C be remove_reference_t<COMMON-REF(X&, Y&)>&&. ...

//    .... If A and B are both rvalue reference types, C is well-formed, and

//    is_convertible_v<A, C> && is_convertible_v<B, C> is true, then COMMON-REF(A, B) is C.

// clang-format off

// clang-format on

//    Otherwise, let D be COMMON-REF(const X&, Y&). ...

//    ... If A is an rvalue reference and B is an lvalue reference and D is well-formed and

//    is_convertible_v<A, D> is true, then COMMON-REF(A, B) is D.

// clang-format off

// clang-format on

//    Otherwise, if A is an lvalue reference and B is an rvalue reference, then

//    COMMON-REF(A, B) is COMMON-REF(B, A).

//    Otherwise, COMMON-REF(A, B) is ill-formed.

// Note C: For the common_reference trait applied to a parameter pack [...]

// bullet 1 - sizeof...(T) == 0

// bullet 2 - sizeof...(T) == 1

// bullet 3 - sizeof...(T) == 2

// sub-bullet 1 - Let R be COMMON-REF(T1, T2). If T1 and T2 are reference types, R is well-formed, and

// is_convertible_v<add_pointer_t<T1>, add_pointer_t<R>> && is_convertible_v<add_pointer_t<T2>, add_pointer_t<R>> is

// true, then the member typedef type denotes R.

// sub-bullet 2 - Otherwise, if basic_common_reference<remove_cvref_t<T1>, remove_cvref_t<T2>, XREF(T1), XREF(T2)>::type

// is well-formed, then the member typedef `type` denotes that type.

// sub-bullet 3 - Otherwise, if COND-RES(T1, T2) is well-formed,

// then the member typedef `type` denotes that type.

// sub-bullet 4 & 5 - Otherwise, if common_type_t<T1, T2> is well-formed,

//                    then the member typedef `type` denotes that type.

//                  - Otherwise, there shall be no member `type`.

// bullet 4 - If there is such a type `C`, the member typedef type shall denote the same type, if

//            any, as `common_reference_t<C, Rest...>`.

// bullet 5 - Otherwise, there shall be no member `type`.

// _LIBCPP_STD_VER >= 20

// _LIBCPP___TYPE_TRAITS_COMMON_REFERENCE_H


=== system/lib/libcxx/include/__type_traits/common_type.h ===
SHA256: cae9cf4521d0516234874905b777a373fd7aab667232d1fa70a61aa4cf5dbc73
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Let COND_RES(X, Y) be:

// sub-bullet 4 - "if COND_RES(CREF(D1), CREF(D2)) denotes a type..."

// sub-bullet 3 - "if decay_t<decltype(false ? declval<D1>() : declval<D2>())> ..."

// bullet 1 - sizeof...(Tp) == 0

// bullet 2 - sizeof...(Tp) == 1

// bullet 3 - sizeof...(Tp) == 2

// sub-bullet 1 - "If is_same_v<T1, D1> is false or ..."

// bullet 4 - sizeof...(Tp) > 2

// _LIBCPP___TYPE_TRAITS_COMMON_TYPE_H


=== system/lib/libcxx/include/__type_traits/conditional.h ===
SHA256: 0a022b14b1be66a397e4e244aea1671dd95aec52c88a7a938b61094efeffe8fd
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Helper so we can use "conditional_t" in all language versions.

// _LIBCPP___TYPE_TRAITS_CONDITIONAL_H


=== system/lib/libcxx/include/__type_traits/conjunction.h ===
SHA256: c1664a9b0620730d8645ac68853c280bc3de735edf4fc740dd04c286d71b3140
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _And always performs lazy evaluation of its arguments.

//

// However, `_And<_Pred...>` itself will evaluate its result immediately (without having to

// be instantiated) since it is an alias, unlike `conjunction<_Pred...>`, which is a struct.

// If you want to defer the evaluation of `_And<_Pred...>` itself, use `_Lazy<_And, _Pred...>`.

// _LIBCPP_STD_VER >= 17

// _LIBCPP___TYPE_TRAITS_CONJUNCTION_H


=== system/lib/libcxx/include/__type_traits/container_traits.h ===
SHA256: cfc0db419243be636ba38c98e54981733e0338da97de8402e20827addce53b84
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// // __container_traits is a general purpose utility containing traits describing various containers operations.

// It currently only has one trait: `__emplacement_has_strong_exception_safety_guarantee`, but it's

// intended to be extended in the future.

//

// These traits should only be used for optimization or QoI purposes. In particular, since this is a libc++ internal

// mechanism, no user-defined containers should be expected to specialize these traits (in fact it would be illegal for

// them to do so). Hence, when using these traits to implement something, make sure that a container that fails to

// specialize these traits does not result in non-conforming code.

//

// When a trait is nonsensical for a type, this class still provides a fallback value for that trait.

// For example, `std::array` does not support `insert` or `emplace`, so

// `__emplacement_has_strong_exception_safety_guarantee` is false for such types.

// A trait that tells whether a single element insertion/emplacement via member function

// `insert(...)` or `emplace(...)` has strong exception guarantee, that is, if the function

// exits via an exception, the original container is unaffected

// A trait that tells whether a container supports `reserve(n)` member function.

// _LIBCPP___TYPE_TRAITS_CONTAINER_TRAITS_H


=== system/lib/libcxx/include/__type_traits/copy_cv.h ===
SHA256: 87a6ed1b79d1d078ec7eab8ceb8336f6353dbfd18e7253cf94f0ee7611786d7b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Let COPYCV(FROM, TO) be an alias for type TO with the addition of FROM's

// top-level cv-qualifiers.

// _LIBCPP___TYPE_TRAITS_COPY_CV_H


=== system/lib/libcxx/include/__type_traits/copy_cvref.h ===
SHA256: d5c4e466562d61471f3e28afba82e66fe77a5dbff0d009ae2a85a35630ef18ea
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_COPY_CVREF_H


=== system/lib/libcxx/include/__type_traits/datasizeof.h ===
SHA256: 6470002fa8904594d2789966324d7efb3f519a4bfe9ad4397f85e4b9036440a2
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// This trait provides the size of a type excluding any tail padding.

//

// It is useful in contexts where performing an operation using the full size of the class (including padding) may

// have unintended side effects, such as overwriting a derived class' member when writing the tail padding of a class

// through a pointer-to-base.

// TODO: Enable this again once #94816 is fixed.

// _FirstPaddingByte<> is sometimes non-standard layout.

// It is conditionally-supported to use __builtin_offsetof in that case, but GCC and Clang allow it.

// __has_extension(datasizeof)

// _LIBCPP___TYPE_TRAITS_DATASIZEOF_H


=== system/lib/libcxx/include/__type_traits/decay.h ===
SHA256: 2954dec2f67b37b27bf26f717a4d1b346f8ec996a9b3fbfb0fd5392615cae9e6
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_DECAY_H


=== system/lib/libcxx/include/__type_traits/dependent_type.h ===
SHA256: 8228ef6c853aa11fa0166cff6551c18908e9d01300d7dbcfc2836c116b709758
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_DEPENDENT_TYPE_H


=== system/lib/libcxx/include/__type_traits/desugars_to.h ===
SHA256: f184eca70687df4a3113582566a4f1ade87cc378a590add01defe5ecf58ad0c3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Tags to represent the canonical operations.

// syntactically, the operation is equivalent to calling `a == b`

// syntactically, the operation is equivalent to calling `a + b`

// syntactically, the operation is equivalent to calling `a < b`

// syntactically, the operation is equivalent to calling `a > b`

// syntactically, the operation is equivalent to calling `a < b`, and these expressions

// have to be true for any `a` and `b`:

// - `(a < b) == (b > a)`

// - `(!(a < b) && !(b < a)) == (a == b)`

// For example, this is satisfied for std::less on integral types, but also for ranges::less on all types due to

// additional semantic requirements on that operation.

// This class template is used to determine whether an operation "desugars"

// (or boils down) to a given canonical operation.

//

// For example, `std::equal_to<>`, our internal `std::__equal_to` helper and

// `ranges::equal_to` are all just fancy ways of representing a transparent

// equality operation, so they all desugar to `__equal_tag`.

//

// This is useful to optimize some functions in cases where we know e.g. the

// predicate being passed is actually going to call a builtin operator, or has

// some specific semantics.

// For the purpose of determining whether something desugars to something else,

// we disregard const and ref qualifiers on the operation itself.

// _LIBCPP___TYPE_TRAITS_DESUGARS_TO_H


=== system/lib/libcxx/include/__type_traits/detected_or.h ===
SHA256: e231c0b26ebaade3ac73b137628377b074ff3d31ce85b5dfc44256f917c3a157
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_DETECTED_OR_H


=== system/lib/libcxx/include/__type_traits/disjunction.h ===
SHA256: 6adbfddde06305f699114ad7df054d36d2b16b32f613eec073d4dd43b68c099a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _Or always performs lazy evaluation of its arguments.

//

// However, `_Or<_Pred...>` itself will evaluate its result immediately (without having to

// be instantiated) since it is an alias, unlike `disjunction<_Pred...>`, which is a struct.

// If you want to defer the evaluation of `_Or<_Pred...>` itself, use `_Lazy<_Or, _Pred...>`

// or `disjunction<_Pred...>` directly.

// _LIBCPP_STD_VER >= 17

// _LIBCPP___TYPE_TRAITS_DISJUNCTION_H


=== system/lib/libcxx/include/__type_traits/enable_if.h ===
SHA256: e1146435700e53985c2ddf9b6218dd3ad6c71743688a1ee037881b68447de4ca
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_ENABLE_IF_H


=== system/lib/libcxx/include/__type_traits/extent.h ===
SHA256: adc9eb1dc77c65cd390b220934f468e85980309436a95971e14c0ceae43ff5b7
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __has_builtin(__array_extent)

// __has_builtin(__array_extent)

// _LIBCPP___TYPE_TRAITS_EXTENT_H


=== system/lib/libcxx/include/__type_traits/has_unique_object_representation.h ===
SHA256: b42c05ea5036fb59d3f3b561f62d9c5e4f3b7b768dc99799b9482d1adf16d2a6
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_HAS_UNIQUE_OBJECT_REPRESENTATION_H


=== system/lib/libcxx/include/__type_traits/has_virtual_destructor.h ===
SHA256: 67f60d0a10c5f158fde79119bf924bbeaf3359c68b24e70d5ef536e979ec87a6
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_HAS_VIRTUAL_DESTRUCTOR_H


=== system/lib/libcxx/include/__type_traits/integer_traits.h ===
SHA256: 741ee53c13a767307ac1dbeee8c6a4a63dcf7a36979f4af7c17a1dc06e126c11
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// This trait is to determine whether a type is a /signed integer type/

// See [basic.fundamental]/p1

// This trait is to determine whether a type is an /unsigned integer type/

// See [basic.fundamental]/p2

// This isn't called __integer, because an integer type according to [basic.fundamental]/p11 is the same as an integral

// type. An integral type is _not_ the same set of types as signed and unsigned integer types combined.

// _LIBCPP___TYPE_TRAITS_INTEGER_TRAITS_H


=== system/lib/libcxx/include/__type_traits/integral_constant.h ===
SHA256: bc1a92ae8550e3c480d90ea583b79524d6c0ba0ef5faa4c3abf4afd1378437ea
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_INTEGRAL_CONSTANT_H


=== system/lib/libcxx/include/__type_traits/invoke.h ===
SHA256: 98a22394223259499a3284fba736d4a0755aad4a2b5f9de4013768d92d71ab82
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// This file defines the following libc++-internal API (back-ported to C++03):

//

// template <class... Args>

// decltype(auto) __invoke(Args&&... args) noexcept(noexcept(std::invoke(std::forward<Args>(args...)))) {

//   return std::invoke(std::forward<Args>(args)...);

// }

//

// template <class Ret, class... Args>

// Ret __invoke_r(Args&&... args) {

//   return std::invoke_r(std::forward<Args>(args)...);

// }

//

// template <class Func, class... Args>

// struct __is_invocable : is_invocable<Func, Args...> {};

//

// template <class Func, class... Args>

// inline const bool __is_invocable_v = is_invocable_v<Func, Args...>;

//

// template <class Ret, class Func, class... Args>

// inline const bool __is_invocable_r_v = is_invocable_r_v<Ret, Func, Args...>;

//

// template <class Func, class... Args>

// inline const bool __is_nothrow_invocable_v = is_nothrow_invocable_v<Func, Args...>;

//

// template <class Func, class... Args>

// inline const bool __is_nothrow_invocable_r_v = is_nothrow_invocable_r_v<Func, Args...>;

//

// template <class Func, class... Args>

// struct __invoke_result : invoke_result {};

//

// template <class Func, class... Args>

// using __invoke_result_t = invoke_result_t<Func, Args...>;

// __has_builtin(__builtin_invoke)

// __invoke forward declarations

// fall back - none of the bullets

// bullets 1, 2 and 3

// clang-format off

// bullets 4, 5 and 6

// bullet 7

// clang-format on

// __invokable

// FIXME: Check that _Ret, _Fp, and _Args... are all complete types, cv void,

// or incomplete array types as required by the standard.

// __has_builtin(__builtin_invoke_r)

// is_invocable

// is_nothrow_invocable

// _LIBCPP___TYPE_TRAITS_INVOKE_H


=== system/lib/libcxx/include/__type_traits/is_abstract.h ===
SHA256: 35787743ae513887cc52461561afaacc0c1d783dd16d4a756a663654bbc0ff01
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_ABSTRACT_H


=== system/lib/libcxx/include/__type_traits/is_aggregate.h ===
SHA256: ae4cb22a61664d420b3f92ef4195357301b233dd6e674abfd3daee83237c9817
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___TYPE_TRAITS_IS_AGGREGATE_H


=== system/lib/libcxx/include/__type_traits/is_allocator.h ===
SHA256: eab72540c4b6edb6dbe426e6c313308de43e3ee4a724fd39f60f955156142058
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_IS_ALLOCATOR_H


=== system/lib/libcxx/include/__type_traits/is_always_bitcastable.h ===
SHA256: 5ce3a1ad69ab4b7a6b82ff6934353e825597cbc54f165b6adb493b74460ea3fc
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Checks whether an object of type `From` can always be bit-cast to an object of type `To` and represent a valid value

// of type `To`. In other words, `From` and `To` have the same value representation and the set of values of `From` is

// a subset of the set of values of `To`.

//

// Note that types that cannot be assigned to each other using built-in assignment (e.g. arrays) might still be

// considered bit-castable.

// clang-format off

// First, the simple case -- `From` and `To` are the same object type.

// Beyond the simple case, we say that one type is "always bit-castable" to another if:

// - (1) `From` and `To` have the same value representation, and in addition every possible value of `From` has

//   a corresponding value in the `To` type (in other words, the set of values of `To` is a superset of the set of

//   values of `From`);

// - (2) When the corresponding values are not the same value (as, for example, between an unsigned and a signed

//   integer, where a large positive value of the unsigned integer corresponds to a negative value in the signed

//   integer type), the value of `To` that results from a bitwise copy of `From` is the same what would be

//   produced by the built-in assignment (if it were defined for the two types, to which there are minor

//   exceptions, e.g. built-in arrays).

//

// In practice, that means:

// - all integral types (except `bool`, see below) -- that is, character types and `int` types, both signed and

//   unsigned...

// - as well as arrays of such types...

// - ...that have the same size.

//

// Other trivially-copyable types can't be validly bit-cast outside of their own type:

// - floating-point types normally have different sizes and thus aren't bit-castable between each other (fails

// #1);

// - integral types and floating-point types use different representations, so for example bit-casting an integral

//   `1` to `float` results in a very small less-than-one value, unlike built-in assignment that produces `1.0`

//   (fails #2);

// - booleans normally use only a single bit of their object representation; bit-casting an integer to a boolean

//   will result in a boolean object with an incorrect representation, which is undefined behavior (fails #2).

//   Bit-casting from a boolean into an integer, however, is valid;

// - enumeration types may have different ranges of possible values (fails #1);

// - for pointers, it is not guaranteed that pointers to different types use the same set of values to represent

//   addresses, and the conversion results are explicitly unspecified for types with different alignments

//   (fails #1);

// - for structs and unions it is impossible to determine whether the set of values of one of them is a subset of

//   the other (fails #1);

// - there is no need to consider `nullptr_t` for practical purposes.

// clang-format on

// _LIBCPP___TYPE_TRAITS_IS_ALWAYS_BITCASTABLE_H


=== system/lib/libcxx/include/__type_traits/is_arithmetic.h ===
SHA256: 04983384c4beb1765c6e4736873f606cd1a259d7c8d335f4812e8af48e0cec83
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_ARITHMETIC_H


=== system/lib/libcxx/include/__type_traits/is_array.h ===
SHA256: 7f3191cb5ece660bf2bf1075543ddb53ad4b7c43dca89959ea723e872edc7f8c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_ARRAY_H


=== system/lib/libcxx/include/__type_traits/is_assignable.h ===
SHA256: b4f4ddcf1d552fe1e276e764b56a23850bf41da3fd023f81a694702962bd9c51
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_ASSIGNABLE_H


=== system/lib/libcxx/include/__type_traits/is_base_of.h ===
SHA256: 5de0e1fe39822912c88549b90f40ce6f0fbce2ee125ee92d5a4f48c7dd597559
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_BASE_OF_H


=== system/lib/libcxx/include/__type_traits/is_bounded_array.h ===
SHA256: 78a0297dba13944dd955350cdc9d62ea75d1d0e2400d1fe4bf91cf055f8a102d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_BOUNDED_ARRAY_H


=== system/lib/libcxx/include/__type_traits/is_callable.h ===
SHA256: 92f629a5b2900dc30ccc5f06d800dd06b203cd8fead96bab3625ecfe6c35b54b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_CALLABLE_H


=== system/lib/libcxx/include/__type_traits/is_char_like_type.h ===
SHA256: 9678bd464b9cc93bc6ce180df711a1400dbe6d7e345cf96cd47dda621ce2612a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_CHAR_LIKE_TYPE_H


=== system/lib/libcxx/include/__type_traits/is_class.h ===
SHA256: c6f5854dfb7338ee1a0b865aa2962abfed352d3b51c489f0fe7c8618cc62d789
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_CLASS_H


=== system/lib/libcxx/include/__type_traits/is_compound.h ===
SHA256: e69c3549d27e4284649fb0126855696858315a4e8cf0c186c527c1d7ec74d05d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __has_builtin(__is_compound)

// __has_builtin(__is_compound)

// _LIBCPP___TYPE_TRAITS_IS_COMPOUND_H


=== system/lib/libcxx/include/__type_traits/is_const.h ===
SHA256: 1661364960350d9bfe50ff848dc5b81333ced2c5e3219492eebf8360279aef45
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_CONST_H


=== system/lib/libcxx/include/__type_traits/is_constant_evaluated.h ===
SHA256: 8da9d47af89ceae85e2b395dab809cedf98c9dfa8837d96804ab449c037bd8c3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_CONSTANT_EVALUATED_H


=== system/lib/libcxx/include/__type_traits/is_constructible.h ===
SHA256: 977ec35da299048aa3657a264f8034e79c02be99ee2bfee85d779f1120294668
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_IS_CONSTRUCTIBLE_H


=== system/lib/libcxx/include/__type_traits/is_convertible.h ===
SHA256: 18f942e759105a905254f880e5a03f377c641f9c0c8b81dc89d819a3205248de
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___TYPE_TRAITS_IS_CONVERTIBLE_H


=== system/lib/libcxx/include/__type_traits/is_core_convertible.h ===
SHA256: 7875dfbb855242d2620731ca826a6a9d5f50a7bc9696bef78ff9349f078cfaa5
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// [conv.general]/3 says "E is convertible to T" whenever "T t=E;" is well-formed.

// We can't test for that, but we can test implicit convertibility by passing it

// to a function. Notice that __is_core_convertible<void,void> is false,

// and __is_core_convertible<immovable-type,immovable-type> is true in C++17 and later.

// _LIBCPP_STD_VER >= 20

// _LIBCPP___TYPE_TRAITS_IS_CORE_CONVERTIBLE_H


=== system/lib/libcxx/include/__type_traits/is_destructible.h ===
SHA256: 1e38c94f49c102cb3b13404e84ba088f079443fc0f040b5c4063a558c7075e88
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __has_builtin(__is_destructible)

//  if it's a reference, return true

//  if it's a function, return false

//  if it's   void,     return false

//  if it's an array of unknown bound, return false

//  Otherwise, return "declval<_Up&>().~_Up()" is well-formed

//    where _Up is remove_all_extents<_Tp>::type

// __has_builtin(__is_destructible)

// _LIBCPP___TYPE_TRAITS_IS_DESTRUCTIBLE_H


=== system/lib/libcxx/include/__type_traits/is_empty.h ===
SHA256: 4a846495c2e82e44cc0b36091b28c5f2323f582000f0f5661e9d8f187ec017e1
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_EMPTY_H


=== system/lib/libcxx/include/__type_traits/is_enum.h ===
SHA256: 3a814c6e94530228423599705d2ff1b035920ce5b6400674344ed491638de779
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 23

// _LIBCPP___TYPE_TRAITS_IS_ENUM_H


=== system/lib/libcxx/include/__type_traits/is_equality_comparable.h ===
SHA256: f87434b9285a9ff1887ffba0b977453a6d287793c32cd4cc0da343f89ef6e30b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// A type is_trivially_equality_comparable if the expression `a == b` is equivalent to `std::memcmp(&a, &b, sizeof(T))`

// (with `a` and `b` being of type `T`). For the case where we compare two object of the same type, we can use

// __is_trivially_equality_comparable. We have special-casing for pointers which point to the same type ignoring

// cv-qualifications and comparing to void-pointers.

//

// The following types are not trivially equality comparable:

// floating-point types: different bit-patterns can compare equal. (e.g 0.0 and -0.0)

// enums: The user is allowed to specialize operator== for enums

// pointers that don't have the same type (ignoring cv-qualifiers): pointers to virtual bases are equality comparable,

//   but don't have the same bit-pattern. An exception to this is comparing to a void-pointer. There the bit-pattern is

//   always compared.

// objects with padding bytes: since objects with padding bytes may compare equal, even though their object

//   representation may not be equivalent.

// __has_builtin(__is_trivially_equality_comparable)

// TODO: Use is_pointer_inverconvertible_base_of

// _LIBCPP___TYPE_TRAITS_IS_EQUALITY_COMPARABLE_H


=== system/lib/libcxx/include/__type_traits/is_execution_policy.h ===
SHA256: 0c42bda021eeb7cdbe5e27f4262b7215cec744e774240cde82699d50fca3398a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace execution

// TODO: Remove default argument once algorithms are using the new backend dispatching

// Removes the "parallel" part of an execution policy.

// For example, turns par_unseq into unseq, and par into seq.

// _LIBCPP_STD_VER >= 17

// _LIBCPP___TYPE_TRAITS_IS_EXECUTION_POLICY_H


=== system/lib/libcxx/include/__type_traits/is_final.h ===
SHA256: a8bc4e7991182b41a3eaf7c6c59a81d6b68e837c21604922a5ccc89c53839cd2
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_FINAL_H


=== system/lib/libcxx/include/__type_traits/is_floating_point.h ===
SHA256: 6295b35d5a4f87188cdf55f798032531d970a5ceffa904584e345cf26f3d746d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// clang-format off

// clang-format on

// _LIBCPP___TYPE_TRAITS_IS_FLOATING_POINT_H


=== system/lib/libcxx/include/__type_traits/is_function.h ===
SHA256: 14bf2b3e55c908a02312f75098868b2781f93a8059696a9ceeed4072c1c061f1
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_FUNCTIONAL_H


=== system/lib/libcxx/include/__type_traits/is_fundamental.h ===
SHA256: 42cd912e2e8d033584cdfbaf5daccee9e8ad56f1ebbbdacaa02eb9000c071752
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __has_builtin(__is_fundamental)

// __has_builtin(__is_fundamental)

// _LIBCPP___TYPE_TRAITS_IS_FUNDAMENTAL_H


=== system/lib/libcxx/include/__type_traits/is_implicit_lifetime.h ===
SHA256: 7b57aacc776035beba3cacdf7635c6dbf42e400a7ea2066cff849361b8f489f2
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_IMPLICIT_LIFETIME_H


=== system/lib/libcxx/include/__type_traits/is_implicitly_default_constructible.h ===
SHA256: 36191cc0571c4e90ea6ce10df2d430a3d30ae5a20f08363c493bc63ddcdd83e6
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// First of all, we can't implement this check in C++03 mode because the {}

// default initialization syntax isn't valid.

// Second, we implement the trait in a funny manner with two defaulted template

// arguments to workaround Clang's PR43454.

// !C++03

// _LIBCPP___TYPE_TRAITS_IS_IMPLICITLY_DEFAULT_CONSTRUCTIBLE_H


=== system/lib/libcxx/include/__type_traits/is_integral.h ===
SHA256: 1519de36ca5d6edf62871b2c080a91065f460ea48e6af38daeb5b1aaa9865d86
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// clang-format off

// clang-format on

// __has_builtin(__is_integral)

// _LIBCPP___TYPE_TRAITS_IS_INTEGRAL_H


=== system/lib/libcxx/include/__type_traits/is_literal_type.h ===
SHA256: 7b20b64688e8499ceacec29f3a0e5a98c25e91f8f655ab01e48ab7bb60de301b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)

// _LIBCPP___TYPE_TRAITS_IS_LITERAL_TYPE


=== system/lib/libcxx/include/__type_traits/is_member_pointer.h ===
SHA256: ef56611b228f6e1a3e21a9a0021aab9708f1183df117edc89231f5f155cd4cd4
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_MEMBER_POINTER_H


=== system/lib/libcxx/include/__type_traits/is_nothrow_assignable.h ===
SHA256: b66f5257a7086c00a28f4b292977fa5a4e4c09ee12d3513d39243f67a63cb47d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_NOTHROW_ASSIGNABLE_H


=== system/lib/libcxx/include/__type_traits/is_nothrow_constructible.h ===
SHA256: 00a0e6bf1bbdf47458428b98b23374fb2506a2b3329a161ca4850868c31853f7
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_NOTHROW_CONSTRUCTIBLE_H


=== system/lib/libcxx/include/__type_traits/is_nothrow_destructible.h ===
SHA256: 8df34ef9466ba580399213050f696f41c7bde308591f33b04ea80122891d91e2
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __has_builtin(__is_nothrow_destructible)

// _LIBCPP___TYPE_TRAITS_IS_NOTHROW_DESTRUCTIBLE_H


=== system/lib/libcxx/include/__type_traits/is_null_pointer.h ===
SHA256: e217bf0b114f62c869834c23faa4fecc10ab4e4d0f6e3d2a3d09d550a4f67f92
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 14

// _LIBCPP___TYPE_TRAITS_IS_NULL_POINTER_H


=== system/lib/libcxx/include/__type_traits/is_object.h ===
SHA256: 211818438a53ed3f50aca9cc9389709916cc8adc9e379ea6cd31e4fc1af19183
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_OBJECT_H


=== system/lib/libcxx/include/__type_traits/is_pod.h ===
SHA256: 2005f3ec923660eb89590a3d8b8ffe075aa0b2375fe39d10d87177ca3718c43e
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_POD_H


=== system/lib/libcxx/include/__type_traits/is_pointer.h ===
SHA256: d4fc63c365a495477a76b660f8db07ea6c98b25c28266d9273cbd6de0bdda9e3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_POINTER_H


=== system/lib/libcxx/include/__type_traits/is_polymorphic.h ===
SHA256: 9eb2acdb718651cdddac2842cdc322a377abcd26df2dd48c70510ebf1a81e10d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_POLYMORPHIC_H


=== system/lib/libcxx/include/__type_traits/is_primary_template.h ===
SHA256: 65650049663cf6a1436ea7438e160f8111f18e981626c50a72993a5440faa94b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_PRIMARY_TEMPLATE_H


=== system/lib/libcxx/include/__type_traits/is_reference.h ===
SHA256: 07a75363dd634bd9e640db3bb3e9d08f587b81e3f683446dd4c88d53529cb120
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __has_builtin(__is_lvalue_reference)

// __has_builtin(__is_lvalue_reference)

// _LIBCPP___TYPE_TRAITS_IS_REFERENCE_H


=== system/lib/libcxx/include/__type_traits/is_reference_wrapper.h ===
SHA256: 1cee86d0487544d155e0ac26ce3088f4b85701f681e03597b56c59fd8f09d93f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_ENABLE_IF_H


=== system/lib/libcxx/include/__type_traits/is_referenceable.h ===
SHA256: 0199a91ddde378ce36450e98e78959299ba5b624cc635d5434f882acff52445e
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_REFERENCEABLE_H


=== system/lib/libcxx/include/__type_traits/is_replaceable.h ===
SHA256: 80b300f2defcfcf0a473a35b06e383ea0a98dcdf44633725a1468580176589d9
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// A type is replaceable if, with `x` and `y` being different objects, `x = std::move(y)` is equivalent to:

//

//  std::destroy_at(&x)

//  std::construct_at(&x, std::move(y))

//

// This allows turning a move-assignment into a sequence of destroy + move-construct, which

// is often more efficient. This is especially relevant when the move-construct is in fact

// part of a trivial relocation from somewhere else, in which case there is a huge win.

//

// Note that this requires language support in order to be really effective, but we

// currently emulate the base template with something very conservative.

// Determines whether an allocator member of a container is replaceable.

//

// First, we require the allocator type to be considered replaceable. If not, then something fishy might be

// happening. Assuming the allocator type is replaceable, we conclude replaceability of the allocator as a

// member of the container if the allocator always compares equal (in which case propagation doesn't matter),

// or if the allocator always propagates on assignment, which is required in order for move construction and

// assignment to be equivalent.

// _LIBCPP___TYPE_TRAITS_IS_REPLACEABLE_H


=== system/lib/libcxx/include/__type_traits/is_same.h ===
SHA256: a786aaceae7534bfaffa74475b9675b52ffa8111e81f7ecc872a0a2c58f138c9
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _IsSame<T,U> has the same effect as is_same<T,U> but instantiates fewer types:

// is_same<A,B> and is_same<C,D> are guaranteed to be different types, but

// _IsSame<A,B> and _IsSame<C,D> are the same type (namely, false_type).

// Neither GCC nor Clang can mangle the __is_same builtin, so _IsSame

// mustn't be directly used anywhere that contributes to name-mangling

// (such as in a dependent return type).

// _LIBCPP___TYPE_TRAITS_IS_SAME_H


=== system/lib/libcxx/include/__type_traits/is_scalar.h ===
SHA256: 431ece2dfe7cf7a0d77aa1459d860bafc3a0f73c20fd1e445d680ce7c5d1678f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __has_builtin(__is_scalar)

// clang-format off

// clang-format on

// __has_builtin(__is_scalar)

// _LIBCPP___TYPE_TRAITS_IS_SCALAR_H


=== system/lib/libcxx/include/__type_traits/is_signed.h ===
SHA256: 3e981a96482a2cafeccbbf6086e6f119b74cdaae5b0965e498f5ea3e3314d6c8
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __has_builtin(__is_signed)

// __has_builtin(__is_signed)

// _LIBCPP___TYPE_TRAITS_IS_SIGNED_H


=== system/lib/libcxx/include/__type_traits/is_specialization.h ===
SHA256: 97aa27b586bc556ca96394689c36fb78e2bc9cfc58863e9b2fa2df1436ef1b62
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// This contains parts of P2098R1 but is based on MSVC STL's implementation.

//

// The paper has been rejected

//   We will not pursue P2098R0 (std::is_specialization_of) at this time; we'd

//   like to see a solution to this problem, but it requires language evolution

//   too.

//

// Since it is expected a real solution will be provided in the future only the

// minimal part is implemented.

//

// Note a cvref qualified _Tp is never considered a specialization.

// true if and only if _Tp is a specialization of _Template

// _LIBCPP_STD_VER >= 17

// _LIBCPP___TYPE_TRAITS_IS_SPECIALIZATION


=== system/lib/libcxx/include/__type_traits/is_standard_layout.h ===
SHA256: faf6cf6bb7e466ff3c2e7fa5783760414410e891c2bc2eb8b8774dca7fc03b06
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_STANDARD_LAYOUT_H


=== system/lib/libcxx/include/__type_traits/is_swappable.h ===
SHA256: 6efee5530ff8667ae30293fc9b0e01b98941c41dc141ef71899d8e16730529c3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// ALL generic swap overloads MUST already have a declaration available at this point.

// C++03 doesn't have noexcept, so things are never nothrow swappable

// _LIBCPP_STD_VER >= 17

// _LIBCPP___TYPE_TRAITS_IS_SWAPPABLE_H


=== system/lib/libcxx/include/__type_traits/is_trivial.h ===
SHA256: e7d8a87e5ef317938b70e185d453a9f60ce9dad07bb7f6bc836fa05eeceb8bef
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_TRIVIAL_H


=== system/lib/libcxx/include/__type_traits/is_trivially_assignable.h ===
SHA256: 57fd64a462b32a9751b3d03212c862eb42a5b49521cfdfa4726ecc617f1565ac
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_ASSIGNABLE_H


=== system/lib/libcxx/include/__type_traits/is_trivially_constructible.h ===
SHA256: 4105ca9fdf285b61befd54eac7d5a66353c2dc9e670ad08660a2d14453e75cca
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_CONSTRUCTIBLE_H


=== system/lib/libcxx/include/__type_traits/is_trivially_copyable.h ===
SHA256: 77dd6ee9281322fb0f8a5f791af6a9394cf6ee35ac74632a09f798ffe2561484
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_COPYABLE_H


=== system/lib/libcxx/include/__type_traits/is_trivially_destructible.h ===
SHA256: c257c01eb72fc9538a1178a13d6e532ad2d5d7b3c0e948cef2ea14f238d78f61
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __has_builtin(__is_trivially_destructible)

// _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_DESTRUCTIBLE_H


=== system/lib/libcxx/include/__type_traits/is_trivially_lexicographically_comparable.h ===
SHA256: cde66a713ad65b8212dbb755ede76d584509698d31a49c19e1d3800ca53f9c58
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// A type is_trivially_lexicographically_comparable if the expression `a <=> b` (or their pre-C++20 equivalents) is

// equivalent to `std::memcmp(&a, &b, sizeof(T))` (with `a` and `b` being of type `T`). There is currently no builtin to

// tell us whether that's the case for arbitrary types, so we can only do this for known types. Specifically, these are

// currently unsigned integer types with a sizeof(T) == 1.

//

// bool is trivially lexicographically comparable, because e.g. false <=> true is valid code. Furthermore, the standard

// says that [basic.fundamental] "Type bool is a distinct type that has the same object representation, value

// representation, and alignment requirements as an implementation-defined unsigned integer type. The values of type

// bool are true and false."

// This means that bool has to be unsigned and has exactly two values. This means that having anything other than the

// `true` or `false` value representations in a bool is UB.

//

// The following types are not trivially lexicographically comparable:

// signed integer types: `char(-1) < char(1)`, but memcmp compares `unsigned char`s

// unsigned integer types with sizeof(T) > 1: depending on the endianness, the LSB might be the first byte to be

//                                            compared. This means that when comparing unsigned(129) and unsigned(2)

//                                            using memcmp(), the result would be that 2 > 129.

// _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_LEXICOGRAPHICALLY_COMPARABLE_H


=== system/lib/libcxx/include/__type_traits/is_trivially_relocatable.h ===
SHA256: 96ab460136026bfa757a974293b02b9cb3d07a7a35a1c6e0764c13c9a360cda8
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// A type is trivially relocatable if a move construct + destroy of the original object is equivalent to

// `memcpy(dst, src, sizeof(T))`.

//

// Note that we don't use the __is_trivially_relocatable Clang builtin right now because it does not

// implement the semantics of any current or future trivial relocation proposal and it can lead to

// incorrect optimizations on some platforms (Windows) and supported compilers (AppleClang).

// _LIBCPP___TYPE_TRAITS_IS_TRIVIALLY_RELOCATABLE_H


=== system/lib/libcxx/include/__type_traits/is_unbounded_array.h ===
SHA256: b74c77caa37414436c150b5a65240a9f97b6a651734d0e8c086e858397098b05
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_UNBOUNDED_ARRAY_H


=== system/lib/libcxx/include/__type_traits/is_union.h ===
SHA256: 8b1ed77a7c926780bc9c8e410f76940d8674f980c76ad4daa8c9ba382eb75ce3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_UNION_H


=== system/lib/libcxx/include/__type_traits/is_unqualified.h ===
SHA256: c9f2173aba57dac53202ab03d2cab85016030f8a5c127b5c350ca94786caf234
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_UNQUALIFIED_H


=== system/lib/libcxx/include/__type_traits/is_unsigned.h ===
SHA256: 7b4464a218f32f8f2c0a908ba95495185775bba4a3fed222e41a075a1759452c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __has_builtin(__is_unsigned)

// __has_builtin(__is_unsigned)

// _LIBCPP___TYPE_TRAITS_IS_UNSIGNED_H


=== system/lib/libcxx/include/__type_traits/is_valid_expansion.h ===
SHA256: a0ba5c76688683163a3818b72f29cd802e1698db56f3a1e33189dbaf7c3a52ed
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_VALID_EXPANSION_H


=== system/lib/libcxx/include/__type_traits/is_void.h ===
SHA256: 81f028d7d85b44bd98897ec0b8ba48ea7775a09fa7fc7f79cb08598ea9bebcac
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_VOID_H


=== system/lib/libcxx/include/__type_traits/is_volatile.h ===
SHA256: 22b9e22f11e4ee03adae97b6a27d053e75c18e9b1e2b013a0f15d1bed97dd957
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_IS_VOLATILE_H


=== system/lib/libcxx/include/__type_traits/lazy.h ===
SHA256: 2c936f87731a4a3971847c54dbb99aae0c77ec5eaa4598bd9b5e7aa6219a74a2
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_LAZY_H


=== system/lib/libcxx/include/__type_traits/make_32_64_or_128_bit.h ===
SHA256: d0f38ae07b3e4e87ef3a02155ee6bbb115c32f46f983fc54b1d5ea62b0f9a083
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/// Helper to promote an integral to smallest 32, 64, or 128 bit representation.

///

/// The restriction is the same as the integral version of to_char.

// clang-format off

/* else */

/* else */

// clang-format on

// _LIBCPP___TYPE_TRAITS_MAKE_32_64_OR_128_BIT_H


=== system/lib/libcxx/include/__type_traits/make_const_lvalue_ref.h ===
SHA256: 7f06c113f10a66c1888c75d1afe43b7b87f2b77bb388622e00b58d182d909860
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_MAKE_CONST_LVALUE_REF_H


=== system/lib/libcxx/include/__type_traits/make_signed.h ===
SHA256: 02267cb58c9e00a38edf7623a8974c5874ec89b1a8fef6cb713e93a3a63f25a6
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// clang-format off

// clang-format on

// __has_builtin(__make_signed)

// _LIBCPP___TYPE_TRAITS_MAKE_SIGNED_H


=== system/lib/libcxx/include/__type_traits/make_unsigned.h ===
SHA256: fa6732be816377e896f626441d57ef32008c8b529a2452894be7582aa5d511f0
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// clang-format off

// clang-format on

// __has_builtin(__make_unsigned)

// _LIBCPP___TYPE_TRAITS_MAKE_UNSIGNED_H


=== system/lib/libcxx/include/__type_traits/maybe_const.h ===
SHA256: 5f97b07aebe38da75d99b3e64445f846923a9f7dd3f875238d09713582ae842f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_MAYBE_CONST_H


=== system/lib/libcxx/include/__type_traits/nat.h ===
SHA256: c0a3e7a7d8a0b183cff37090645142ffe5e90b7d31ba6bf3387968f7a58ee954
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_NAT_H


=== system/lib/libcxx/include/__type_traits/negation.h ===
SHA256: bee187ed859f072ec9da9d8b6c4c3d592254a2157c477d1afcae48e5baed053c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___TYPE_TRAITS_NEGATION_H


=== system/lib/libcxx/include/__type_traits/promote.h ===
SHA256: cd4f5e81d3dca4af80a7aae73a9c315b1d0f94a6584b63df86972a5142bda07d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_PROMOTE_H


=== system/lib/libcxx/include/__type_traits/rank.h ===
SHA256: a841120a1c21bec6249747d2a6b03d5a9f58046067b7427f74a797cc65701305
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __has_builtin(__array_rank)

// _LIBCPP___TYPE_TRAITS_RANK_H


=== system/lib/libcxx/include/__type_traits/reference_constructs_from_temporary.h ===
SHA256: dc20d7f4d980926384cfad92f238cda3f2c3141e2b58c381d3f0e8ae2f4606d9
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// TODO(LLVM 22): Remove this as all supported compilers should have __reference_constructs_from_temporary implemented.

// _LIBCPP___TYPE_TRAITS_REFERENCE_CONSTRUCTS_FROM_TEMPORARY_H


=== system/lib/libcxx/include/__type_traits/reference_converts_from_temporary.h ===
SHA256: f9d67cdf68c2492520408744dfbef7ba4f76e16383d7eb582391c12ac2c826e8
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_REFERENCE_CONVERTS_FROM_TEMPORARY_H


=== system/lib/libcxx/include/__type_traits/remove_all_extents.h ===
SHA256: 32aa66947f65f8101d5aedde63fd981ebef913c4f8d48fab0be7927250cc774d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_REMOVE_ALL_EXTENTS_H


=== system/lib/libcxx/include/__type_traits/remove_const.h ===
SHA256: cff3a93c4ddff74ebee16a093583f36eebfe12cdb18ba3358d990dd12e945093
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __has_builtin(__remove_const)

// _LIBCPP___TYPE_TRAITS_REMOVE_CONST_H


=== system/lib/libcxx/include/__type_traits/remove_const_ref.h ===
SHA256: f6a499c7d0c9a0a23ac176018bbaf71f5a0739e23be6254557fcb0d555ea4c89
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_REMOVE_CONST_REF_H


=== system/lib/libcxx/include/__type_traits/remove_cv.h ===
SHA256: 76d2bcf641580f423c25d50b16088ee8cb880d20f80a511f1ffe03483035b7cf
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_REMOVE_CV_H


=== system/lib/libcxx/include/__type_traits/remove_cvref.h ===
SHA256: feca0afc99b7b89d7e721d24a4931c1de92703b6f8453ddd52b6868bb5f5e6a3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __has_builtin(__remove_cvref)

// _LIBCPP___TYPE_TRAITS_REMOVE_CVREF_H


=== system/lib/libcxx/include/__type_traits/remove_extent.h ===
SHA256: c02dd7e2825bf11ae6b54a2aa297da8b3a6f4a18e604745da1b75fa1e9a66c0f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_REMOVE_EXTENT_H


=== system/lib/libcxx/include/__type_traits/remove_pointer.h ===
SHA256: 7fc5d4befbc548dbb00d71e59e48ce2cfec594a0e6900fbfc37b5dcf0aa8459f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// clang-format off

// clang-format on

// !defined(_LIBCPP_WORKAROUND_OBJCXX_COMPILER_INTRINSICS) && __has_builtin(__remove_pointer)

// _LIBCPP___TYPE_TRAITS_REMOVE_POINTER_H


=== system/lib/libcxx/include/__type_traits/remove_reference.h ===
SHA256: 15e033053b1e90f341b46a3edd1e84d413bf165ff27f60c8043a92b67b86e56a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __has_builtin(__remove_reference_t)

// _LIBCPP___TYPE_TRAITS_REMOVE_REFERENCE_H


=== system/lib/libcxx/include/__type_traits/remove_volatile.h ===
SHA256: 91d1d959559a97adbb2edc07e894b90040d5db1b1373f684abc931afff283a54
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __has_builtin(__remove_volatile)

// _LIBCPP___TYPE_TRAITS_REMOVE_VOLATILE_H


=== system/lib/libcxx/include/__type_traits/result_of.h ===
SHA256: e98abf41f0eb66351eb86e0f26a074ccc953fa7b15cbbcdcdb022bc5909c18a8
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// result_of

// _LIBCPP_STD_VER >= 14

// _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS)

// _LIBCPP___TYPE_TRAITS_RESULT_OF_H


=== system/lib/libcxx/include/__type_traits/strip_signature.h ===
SHA256: 69a8c6cd265eae5a5e0d61188817f7424549ed398ad4f73bdcaf14de223d1731
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// defined(__cpp_static_call_operator) && __cpp_static_call_operator >= 202207L

// clang-format off

// clang-format on

// _LIBCPP_STD_VER >= 17

// _LIBCPP___TYPE_TRAITS_STRIP_SIGNATURE_H


=== system/lib/libcxx/include/__type_traits/type_identity.h ===
SHA256: f537ef1527bb8c00132137e8c59b5a8ca9e4e1e735f61de9f0e792db1c39fac5
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_TYPE_IDENTITY_H


=== system/lib/libcxx/include/__type_traits/type_list.h ===
SHA256: ba601b4fab2fb84b43322f07e86eaa8724d7359f00ada9fb484e6708a8c9ba7f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_TYPE_LIST_H


=== system/lib/libcxx/include/__type_traits/underlying_type.h ===
SHA256: 0e098209e995d6563fbb2772a60ee8c4c9ce6a3fa37ae3f7efe90f2aac175b18
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// GCC doesn't SFINAE away when using __underlying_type directly

// _LIBCPP___TYPE_TRAITS_UNDERLYING_TYPE_H


=== system/lib/libcxx/include/__type_traits/unwrap_ref.h ===
SHA256: fb7eef8c55951a14af38a391e16fbbc0db127b59ced75702331af01fe2db361f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___TYPE_TRAITS_UNWRAP_REF_H


=== system/lib/libcxx/include/__type_traits/void_t.h ===
SHA256: 87d7aefd93485048c5b14d825fb3a8aeacf3791a559cb758e1acf5d525791358
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___TYPE_TRAITS_VOID_T_H


=== system/lib/libcxx/include/__utility/as_const.h ===
SHA256: 4023bfdd33096996d3e0b5fd14c1234f5564298de49a51552ac71cb2feb635a3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___UTILITY_AS_CONST_H


=== system/lib/libcxx/include/__utility/as_lvalue.h ===
SHA256: 633cb4815f856517d39ed5bedf7419dad1ef107823e30b62ccdb315ce39e2960
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// !_LIBCPP_CXX03_LANG

// _LIBCPP___UTILITY_AS_LVALUE_H


=== system/lib/libcxx/include/__utility/auto_cast.h ===
SHA256: 03387eccc20273c433c5f1ab17cfa4d5b6ec9cfed096f6b8a2b651e3f3f12b9d
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___UTILITY_AUTO_CAST_H


=== system/lib/libcxx/include/__utility/cmp.h ===
SHA256: b393ae1c2f4ec63acefb1288ad936299d7bac7c6cddba436fd87364d1ff82565
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___UTILITY_CMP_H


=== system/lib/libcxx/include/__utility/convert_to_integral.h ===
SHA256: a0aea113c50269ea68073d1213f11f80ae8f4c4d5f2fac0ce39f6d6a3687f8bf
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___UTILITY_CONVERT_TO_INTEGRAL_H


=== system/lib/libcxx/include/__utility/declval.h ===
SHA256: 4d7bc6b962cf0b3c43f8125c9b4e30bc5237f9b400d3792814c13a86c5a3cf75
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Suppress deprecation notice for volatile-qualified return type resulting

// from volatile-qualified types _Tp.

// _LIBCPP___UTILITY_DECLVAL_H


=== system/lib/libcxx/include/__utility/element_count.h ===
SHA256: bba1d71f39d5f96a42593d6c7b26240359d48de4274dc9272c89276933ce284e
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Type used to encode that a function takes an integer that represents a number

// of elements as opposed to a number of bytes.

// _LIBCPP___UTILITY_ELEMENT_COUNT_H


=== system/lib/libcxx/include/__utility/empty.h ===
SHA256: 22301ff062605f9dc3d716ca1dbcd3c79657d1d26f873de1e2543a1c94c39e17
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___UTILITY_EMPTY_H


=== system/lib/libcxx/include/__utility/exception_guard.h ===
SHA256: 90613259c5cce6ed23c916e683637221c52afcb5350e7e4d497e058c69c79b41
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __exception_guard is a helper class for writing code with the strong exception guarantee.

//

// When writing code that can throw an exception, one can store rollback instructions in an

// exception guard so that if an exception is thrown at any point during the lifetime of the

// exception guard, it will be rolled back automatically. When the exception guard is done, one

// must mark it as being complete so it isn't rolled back when the exception guard is destroyed.

//

// Exception guards are not default constructible, they can't be copied or assigned to, but

// they can be moved around for convenience.

//

// __exception_guard is a no-op in -fno-exceptions mode to produce better code-gen. This means

// that we don't provide the strong exception guarantees. However, Clang doesn't generate cleanup

// code with exceptions disabled, so even if we wanted to provide the strong exception guarantees

// we couldn't. This is also only relevant for constructs with a stack of

// -fexceptions > -fno-exceptions > -fexceptions code, since the exception can't be caught where

// exceptions are disabled. While -fexceptions > -fno-exceptions is quite common

// (e.g. libc++.dylib > -fno-exceptions), having another layer with exceptions enabled seems a lot

// less common, especially one that tries to catch an exception through -fno-exceptions code.

//

// __exception_guard can help greatly simplify code that would normally be cluttered by

// `#if _LIBCPP_HAS_EXCEPTIONS`. For example:

//

//    template <class Iterator, class Size, class OutputIterator>

//    Iterator uninitialized_copy_n(Iterator iter, Size n, OutputIterator out) {

//        typedef typename iterator_traits<Iterator>::value_type value_type;

//        __exception_guard guard([start=out, &out] {

//            std::destroy(start, out);

//        });

//

//        for (; n > 0; ++iter, ++out, --n) {

//            ::new ((void*)std::addressof(*out)) value_type(*iter);

//        }

//        guard.__complete();

//        return out;

//    }

//

// _LIBCPP___UTILITY_EXCEPTION_GUARD_H


=== system/lib/libcxx/include/__utility/exchange.h ===
SHA256: 2edc9e6ec4f0324ece73429d028374c12b28d0543b7cde0aee4e5fd32b98c078
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 14

// _LIBCPP___UTILITY_EXCHANGE_H


=== system/lib/libcxx/include/__utility/forward.h ===
SHA256: cef4095815918f2b94476a80fc8224f0efd9119b4b703f8c4e6314ba32e000ac
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___UTILITY_FORWARD_H


=== system/lib/libcxx/include/__utility/forward_like.h ===
SHA256: 6795c5341c19a3d21b631212c75ed5b88d7811bb9de974ae7e3e9ac46671f024
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// This function is used for `deducing this` cases where you want to make sure the operation is performed on the class

// itself and not on a derived class. For example

//   struct S {

//     template <class Self>

//     void func(Self&& self) {

//       // This will always call `do_something` of S instead of any class derived from S.

//       std::__forward_as<Self, S>(self).do_something();

//     }

//   };

// _LIBCPP_STD_VER >= 23

// _LIBCPP___UTILITY_FORWARD_LIKE_H


=== system/lib/libcxx/include/__utility/in_place.h ===
SHA256: df440ba07658d202597dcb755eec4c8c2bd1b02bf33b52a0e08c7f60c24bd4d9
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 17

// _LIBCPP___UTILITY_IN_PLACE_H


=== system/lib/libcxx/include/__utility/integer_sequence.h ===
SHA256: ecbecf1bd6489e7fc229c8b7c44edfc66c57892e5a6c42d40322371e23a48275
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Executes __func for every element in an index_sequence.

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 14

// _LIBCPP___UTILITY_INTEGER_SEQUENCE_H


=== system/lib/libcxx/include/__utility/is_pointer_in_range.h ===
SHA256: 3544a7e4d4622f737eca7d2adf5edde9ec384d9be7d145f3f5df5c54edb91238
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// If this is not a constant during constant evaluation we know that __ptr is not part of the allocation where

// [__begin, __end) is.

// _LIBCPP___UTILITY_IS_POINTER_IN_RANGE_H


=== system/lib/libcxx/include/__utility/is_valid_range.h ===
SHA256: d5641e07d4c1bbfefcd9bfa4e03e3d14bcddc450adb53ce3fb86e2ec34c89462
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// If this is not a constant during constant evaluation, that is because __first and __last are not

// part of the same allocation. If they are part of the same allocation, we must still make sure they

// are ordered properly.

// _LIBCPP___UTILITY_IS_VALID_RANGE_H


=== system/lib/libcxx/include/__utility/move.h ===
SHA256: 6a821e0b29977cf11890b20ee571e398aa32a1039d47d57d26b591097068aa28
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___UTILITY_MOVE_H


=== system/lib/libcxx/include/__utility/no_destroy.h ===
SHA256: b32da1853ab4ab5915e4b2b0d11427fee30f482c204c70dc42d527efdd012660
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// This class stores an object of type _Tp but never destroys it.

//

// This is akin to using __attribute__((no_destroy)), except that it is possible

// to control the lifetime of the object with more flexibility by deciding e.g.

// whether to initialize the object at construction or to defer to a later

// initialization using __emplace.

// _LIBCPP___UTILITY_NO_DESTROY_H


=== system/lib/libcxx/include/__utility/pair.h ===
SHA256: 28ee2f80a5d61a596a77e4588ab03b7a9780da06ff956a40018703ebfb4b1496
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Extension: This is provided in C++03 because it allows properly handling the

//            assignment to a pair containing references, which would be a hard

//            error otherwise.

// http://wg21.link/P1951

// _LIBCPP_STD_VER >= 23

// Prior to C++23, we provide an approximation of constructors and assignment operators from

// pair-like types. This was historically provided as an extension.

// from std::tuple

// from std::array

// _LIBCPP_STD_VER < 23

// _LIBCPP_CXX03_LANG

// [pairs.spec], specialized algorithms

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 23

// _LIBCPP_STD_VER >= 14

// _LIBCPP___UTILITY_PAIR_H


=== system/lib/libcxx/include/__utility/piecewise_construct.h ===
SHA256: 82b044fc726202a1122a11350ee915b0c6b5c345dcdde01695145b55f40508ed
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___UTILITY_PIECEWISE_CONSTRUCT_H


=== system/lib/libcxx/include/__utility/priority_tag.h ===
SHA256: 2fda43ce288edfc90262f37665a6edc971697b8371a6034f2aa8a8633432b745
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___UTILITY_PRIORITY_TAG_H


=== system/lib/libcxx/include/__utility/private_constructor_tag.h ===
SHA256: 6bf59ef475428a901aea789ff07a36a9ffb9f50f3c9abf0d49c718d3aeb6d1e4
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// This tag allows defining non-standard exposition-only constructors while

// preventing users from being able to use them, since this reserved-name tag

// needs to be used.

// _LIBCPP__UTILITY_PRIVATE_CONSTRUCTOR_TAG_H


=== system/lib/libcxx/include/__utility/rel_ops.h ===
SHA256: 88e441c9bcda4c62f346569714f9c9dfbd7bfafca2e1620893a1385c0ec11423
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace rel_ops

// _LIBCPP___UTILITY_REL_OPS_H


=== system/lib/libcxx/include/__utility/scope_guard.h ===
SHA256: 1595b827e198ae9abff0213eed0e778d744c0d6fc810cde40c4bbe02e5a4ee45
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// C++14 doesn't have mandatory RVO, so we have to provide a declaration even though no compiler will ever generate

// a call to the move constructor.

// _LIBCPP___UTILITY_SCOPE_GUARD_H


=== system/lib/libcxx/include/__utility/small_buffer.h ===
SHA256: 735c75922743314bf41a14b3d250910a7405a08c71970adbce279ef69836136b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __small_buffer is a helper class to perform the well known SBO (small buffer optimization). It is mainly useful to

// allow type-erasing classes like move_only_function to store small objects in a local buffer without requiring an

// allocation.

//

// This small buffer class only allows storing trivially relocatable objects inside the local storage to allow

// __small_buffer to be trivially relocatable itself. Since the buffer doesn't know what's stored inside it, the user

// has to manage the object's lifetime, in particular the destruction of the object.

// Relocates the buffer - __delete() should never be called on a moved-from __small_buffer

// _LIBCPP_STD_VER >= 23

// _LIBCPP___UTILITY_SMALL_BUFFER_H


=== system/lib/libcxx/include/__utility/swap.h ===
SHA256: 21799a6a2c9346b3f594a09b74bc5117f3f0b920a4faba08a78d22cb66bf713a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___UTILITY_SWAP_H


=== system/lib/libcxx/include/__utility/to_underlying.h ===
SHA256: 290802472f7ec85daa89f6dca26a3b751275fee673b9b20b798887c72c9efcf7
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// !_LIBCPP_CXX03_LANG

// _LIBCPP___UTILITY_TO_UNDERLYING_H


=== system/lib/libcxx/include/__utility/unreachable.h ===
SHA256: 4cf2e18ce377540c44f45780d74ff5d6634227192a1c6dba6cedb5436cfa1834
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___UTILITY_UNREACHABLE_H


=== system/lib/libcxx/include/__variant/monostate.h ===
SHA256: 04747a991724f53655d3052f292e03b968d3557d643f1ee46eeec7e4e74ac219
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP_STD_VER >= 20

// return a fundamentally attractive random value.

// _LIBCPP_STD_VER >= 17

// _LIBCPP___VARIANT_MONOSTATE_H


=== system/lib/libcxx/include/__vector/comparison.h ===
SHA256: ec1e167199db33c1b108a354008478676dc4a2a9f1a3a003b5358ef298ef370e
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER <= 17

// _LIBCPP_STD_VER <= 17

// _LIBCPP___VECTOR_COMPARISON_H


=== system/lib/libcxx/include/__vector/container_traits.h ===
SHA256: 98fd234cb724ae7621c6a9c398ca720178c8f1912028c5e1cf414787aaf871af
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// http://eel.is/c++draft/vector.modifiers#2

//  If an exception is thrown other than by the copy constructor, move constructor, assignment operator, or move

//  assignment operator of T or by any InputIterator operation, there are no effects. If an exception is thrown while

//  inserting a single element at the end and T is Cpp17CopyInsertable or is_nothrow_move_constructible_v<T> is true,

//  there are no effects. Otherwise, if an exception is thrown by the move constructor of a non-Cpp17CopyInsertable T,

//  the effects are unspecified.

// _LIBCPP___VECTOR_CONTAINER_TRAITS_H


=== system/lib/libcxx/include/__vector/erase.h ===
SHA256: 81f9f55a7e26b3d54967eece7215568b9556b4c920d875e22620a164709cd044
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_STD_VER >= 20

// _LIBCPP___VECTOR_ERASE_H


=== system/lib/libcxx/include/__vector/pmr.h ===
SHA256: c9bba3b7a775294b1880b4476b98f5446cb143d230434653e7d25d0afeef0453
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace pmr

// _LIBCPP___VECTOR_PMR_H


=== system/lib/libcxx/include/__vector/swap.h ===
SHA256: 0fe1aabe2f751959559c11ddb4b1277df411d0fd931a3f2a9f179c74b123d887
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP___VECTOR_SWAP_H


=== system/lib/libcxx/include/__vector/vector.h ===
SHA256: cb1f3e8af52b52058dc84765d2a02e948ffb09c680a490068146c0b6156ecb66
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// These headers define parts of vectors definition, since they define ADL functions or class specializations.

/* = allocator<_Tp> */

//

// Types

//

// Users might provide custom allocators, and prior to C++20 we have no existing way to detect whether the allocator's

// pointer type is contiguous (though it has to be by the Standard). Using the wrapper type ensures the iterator is

// considered contiguous.

// A vector containers the following members which may be trivially relocatable:

// - pointer: may be trivially relocatable, so it's checked

// - allocator_type: may be trivially relocatable, so it's checked

// vector doesn't contain any self-references, so it's trivially relocatable if its members are.

//

// [vector.cons], construct/copy/destroy

//

// !_LIBCPP_CXX03_LANG

//

// Iterators

//

//

// [vector.capacity], capacity

//

//

// element access

//

//

// [vector.data], data access

//

//

// [vector.modifiers], modifiers

//

//  Allocate space for __n objects

//  throws length_error if __n > max_size()

//  throws (probably bad_alloc) if memory run out

//  Precondition:  __begin_ == __end_ == __cap_ == nullptr

//  Precondition:  __n > 0

//  Postcondition:  capacity() >= __n

//  Postcondition:  size() == 0

// The `_Iterator` in `*_with_size` functions can be input-only only if called from `*_range` (since C++23).

// Otherwise, `_Iterator` is a forward iterator.

// Handles input-only sized ranges for insert_range

// Bound the iterator according to the capacity, rather than the size.

//

// Vector guarantees that iterators stay valid as long as no reallocation occurs even if new elements are inserted

// into the container; for these cases, we need to make sure that the newly-inserted elements can be accessed

// through the bounded iterator without failing checks. The downside is that the bounded iterator won't catch

// access that is logically out-of-bounds, i.e., goes beyond the size, but is still within the capacity. With the

// current implementation, there is no connection between a bounded iterator and its associated container, so we

// don't have a way to update existing valid iterators when the container is resized and thus have to go with

// a laxer approach.

// _LIBCPP_ABI_BOUNDED_ITERATORS_IN_VECTOR

// Bound the iterator according to the capacity, rather than the size.

// _LIBCPP_ABI_BOUNDED_ITERATORS_IN_VECTOR

// The following functions are no-ops outside of AddressSanitizer mode.

// We call annotations for every allocator, unless explicitly disabled.

//

// To disable annotations for a particular allocator, change value of

// __asan_annotate_container_with_allocator to false.

// For more details, see the "Using libc++" documentation page or

// the documentation for __sanitizer_annotate_contiguous_container.

// __swap_out_circular_buffer relocates the objects in [__begin_, __end_) into the front of __v and swaps the buffers of

// *this and __v. It is assumed that __v provides space for exactly (__end_ - __begin_) objects in the front. This

// function has a strong exception guarantee.

// All the objects have been destroyed by relocating them.

// __swap_out_circular_buffer relocates the objects in [__begin_, __p) into the front of __v, the objects in

// [__p, __end_) into the back of __v and swaps the buffers of *this and __v. It is assumed that __v provides space for

// exactly (__p - __begin_) objects in the front and space for at least (__end_ - __p) objects in the back. This

// function has a strong exception guarantee if __begin_ == __p || __end_ == __p.

// Relocate [__p, __end_) first to avoid having a hole in [__begin_, __end_)

// in case something in [__begin_, __p) throws.

// The objects in [__p, __end_) have been destroyed by relocating them.

// All the objects have been destroyed by relocating them.

//  Precondition:  __new_size > capacity()

//  Default constructs __n objects starting at __end_

//  throws if construction throws

//  Precondition:  __n > 0

//  Precondition:  size() + __n <= capacity()

//  Postcondition:  size() == size() + __n

//  Copy constructs __n objects starting at __end_ from __x

//  throws if construction throws

//  Precondition:  __n > 0

//  Precondition:  size() + __n <= capacity()

//  Postcondition:  size() == old size() + __n

//  Postcondition:  [i] == __x for all i in [size() - __n, __n)

//  Default constructs __n objects starting at __end_

//  throws if construction throws

//  Postcondition:  size() == size() + __n

//  Exception safety: strong.

//  Default constructs __n objects starting at __end_

//  throws if construction throws

//  Postcondition:  size() == size() + __n

//  Exception safety: strong.

// this can throw

// _LIBCPP_HAS_EXCEPTIONS

// The Standard mandates shrink_to_fit() does not increase the capacity.

// With equal capacity keep the existing buffer. This avoids extra work

// due to swapping the elements.

// _LIBCPP_HAS_EXCEPTIONS

//    __v.emplace_back(std::forward<_Args>(__args)...);

// has `__off` positions available at the front

// Release the guard once objects in [__old_last_, __end_) have been successfully relocated.

// _LIBCPP_STD_VER >= 20

// _LIBCPP___VECTOR_VECTOR_H


=== system/lib/libcxx/include/__vector/vector_bool.h ===
SHA256: f634e4036bcabdfd3cdd975ae046e7b99a0ec104268a404ae9683335f3272d24
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// TODO: This is a workaround for https://github.com/llvm/llvm-project/issues/131814

// These headers define parts of vectors definition, since they define ADL functions or class specializations.

// !_LIBCPP_CXX03_LANG

// The `_Iterator` in `*_with_size` functions can be input-only only if called from `*_range` (since C++23).

// Otherwise, `_Iterator` is a forward iterator.

//  Allocate space for __n objects

//  throws length_error if __n > max_size()

//  throws (probably bad_alloc) if memory run out

//  Precondition:  __begin_ == __end_ == __cap_ == nullptr

//  Precondition:  __n > 0

//  Postcondition:  capacity() >= __n

//  Postcondition:  size() == 0

//  Precondition:  __new_size > capacity()

//  Default constructs __n objects starting at __end_

//  Precondition:  size() + __n <= capacity()

//  Postcondition:  size() == size() + __n

// Ensure uninitialized leading bits in the last word are set to zero

// Ensure uninitialized leading bits in the last word are set to zero

// _LIBCPP_CXX03_LANG

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// Flip each storage word entirely, including the last potentially partial word.

// The unused bits in the last word are safe to flip as they won't be accessed.

// do middle whole words

// do last partial word

// _LIBCPP___VECTOR_VECTOR_BOOL_H


=== system/lib/libcxx/include/__vector/vector_bool_formatter.h ===
SHA256: 60aec95ec7168ddf59e89173adeac68e4a48ee77bab567ee8919296b6aa4162a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Since is-vector-bool-reference is only used once it's inlined here.

// _LIBCPP_STD_VER >= 23

// _LIBCPP___VECTOR_VECTOR_BOOL_FORMATTER_H


=== system/lib/libcxx/include/complex.h ===
SHA256: e1c48c3ee6244c9057d08aee7e9bc3ee2cbd41cc1ffeabda95bc110f0ecd1731
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*
    complex.h synopsis

#include <ccomplex>

*/

// defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

// _LIBCPP_COMPLEX_H


=== system/lib/libcxx/include/ctype.h ===
SHA256: e65211aa7eece99a6914ae5ad59b3316a6ab35aa5166a6464d9b62361aed0b7c
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*
    ctype.h synopsis

int isalnum(int c);
int isalpha(int c);
int isblank(int c);  // C99
int iscntrl(int c);
int isdigit(int c);
int isgraph(int c);
int islower(int c);
int isprint(int c);
int ispunct(int c);
int isspace(int c);
int isupper(int c);
int isxdigit(int c);
int tolower(int c);
int toupper(int c);
*/

// defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

// _LIBCPP_CTYPE_H


=== system/lib/libcxx/include/errno.h ===
SHA256: fc53c07b50ea8ecd717a7f29270f692473cfb019ad6ef831e67c2fd765fbbe08
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*
    errno.h synopsis

Macros:

    EDOM
    EILSEQ  // C99
    ERANGE
    errno

*/

// defined(EOWNERDEAD)

// defined(EOWNERDEAD)

// !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)

//  supply errno values likely to be missing, particularly on Windows

//  Windows Mobile doesn't appear to define these:

// __cplusplus

// defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

// _LIBCPP_ERRNO_H


=== system/lib/libcxx/include/experimental/__simd/aligned_tag.h ===
SHA256: bb76b08a77dfdcf59763da86c1d885bd1598478a22948f70988fc038a12dd760
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// memory alignment

// namespace parallelism_v2

// _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)

// _LIBCPP_EXPERIMENTAL___SIMD_ALIGNED_TAG_H


=== system/lib/libcxx/include/experimental/__simd/declaration.h ===
SHA256: de87037b090a1f0b0f2fa94abd11d6253063c419f6574476361c80ea76bc1b61
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// TODO: support more targets

// TODO: make this platform dependent

// TODO: make this platform dependent

// TODO: make this platform dependent

// TODO: make this platform dependent

// TODO: make this platform dependent

// namespace simd_abi

// namespace parallelism_v2

// _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)

// _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H


=== system/lib/libcxx/include/experimental/__simd/reference.h ===
SHA256: 7c7638b131d7dc538d141cb8d9c1b8e7c5699cbb8f3700b25d328beca0d87c23
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Note: This approach might not fully align with the specification,

// which might be a wording defect. (https://wg21.link/N4808 section 9.6.3)

// Note: All legal vectorizable types support operator++/--.

// There doesn't seem to be a way to trigger the constraint.

// Therefore, no SFINAE check is added here.

// namespace parallelism_v2

// _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)

// _LIBCPP_EXPERIMENTAL___SIMD_REFERENCE_H


=== system/lib/libcxx/include/experimental/__simd/scalar.h ===
SHA256: a7cdfc730e0320a55f00e10ed418ac8ba70aa0492698e56c1b3429d482173008
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace simd_abi

// namespace parallelism_v2

// _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)

// _LIBCPP_EXPERIMENTAL___SIMD_SCALAR_H


=== system/lib/libcxx/include/experimental/__simd/simd.h ===
SHA256: b2132730dba39193bfc591b2b33f5689260dca4a7842e8ce552e875c49eb311a
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// unary operators for integral _Tp

// class template simd [simd.class]

// TODO: implement simd class

// explicit conversion from and to implementation-defined types

// broadcast constructor

// implicit type conversion constructor

// generator constructor

// load constructor

// copy functions

// scalar access [simd.subscr]

// simd unary operators

// namespace parallelism_v2

// _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)

// _LIBCPP_EXPERIMENTAL___SIMD_SIMD_H


=== system/lib/libcxx/include/experimental/__simd/simd_mask.h ===
SHA256: 4c75b02a20693d24bb3693448c7b65c3e4127a1ec136b0ff2515c70e03da6172
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// class template simd_mask [simd.mask.class]

// TODO: implement simd_mask class

// explicit conversion from and to implementation-defined types

// broadcast constructor

// implicit type conversion constructor

// load constructor

// copy functions

// scalar access [simd.mask.subscr]

// namespace parallelism_v2

// _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)

// _LIBCPP_EXPERIMENTAL___SIMD_SIMD_MASK_H


=== system/lib/libcxx/include/experimental/__simd/traits.h ===
SHA256: b1eedaeb2e3eb272875872ad5a547fde06edd4b4dfff7054e96f85ad63fa1d11
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// traits [simd.traits]

// namespace parallelism_v2

// _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)

// _LIBCPP_EXPERIMENTAL___SIMD_TRAITS_H


=== system/lib/libcxx/include/experimental/__simd/utility.h ===
SHA256: 2262b28edd3296d0c9ba6861d9e46446393ecef29b363265add2b2b3bc86f2c8
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace parallelism_v2

// _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)

// _LIBCPP_EXPERIMENTAL___SIMD_UTILITY_H


=== system/lib/libcxx/include/experimental/__simd/vec_ext.h ===
SHA256: f1467de6e5e4b93026c00f3e370e4d11179608e257fe2c317a6cb62d8c93d560
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace simd_abi

// namespace parallelism_v2

// _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)

// _LIBCPP_EXPERIMENTAL___SIMD_VEC_EXT_H


=== system/lib/libcxx/include/fenv.h ===
SHA256: e9d8526e5f598c8d72e93912a42a060afd58a3486ed154d651e0892958a48fa0
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*
    fenv.h synopsis

This entire header is C99 / C++0X

Macros:

    FE_DIVBYZERO
    FE_INEXACT
    FE_INVALID
    FE_OVERFLOW
    FE_UNDERFLOW
    FE_ALL_EXCEPT
    FE_DOWNWARD
    FE_TONEAREST
    FE_TOWARDZERO
    FE_UPWARD
    FE_DFL_ENV

Types:

    fenv_t
    fexcept_t

int feclearexcept(int excepts);
int fegetexceptflag(fexcept_t* flagp, int excepts);
int feraiseexcept(int excepts);
int fesetexceptflag(const fexcept_t* flagp, int excepts);
int fetestexcept(int excepts);
int fegetround();
int fesetround(int round);
int fegetenv(fenv_t* envp);
int feholdexcept(fenv_t* envp);
int fesetenv(const fenv_t* envp);
int feupdateenv(const fenv_t* envp);


*/

// extern "C++"

// defined(__cplusplus)

// defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

// _LIBCPP_FENV_H


=== system/lib/libcxx/include/float.h ===
SHA256: f40e5d57ecd44f9d55fdf3d2566828997144f4ef88db4a83edcb4fe7b47c0f93
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*
    float.h synopsis

Macros:

    FLT_ROUNDS
    FLT_EVAL_METHOD     // C99
    FLT_RADIX

    FLT_MANT_DIG
    DBL_MANT_DIG
    LDBL_MANT_DIG

    FLT_HAS_SUBNORM     // C11
    DBL_HAS_SUBNORM     // C11
    LDBL_HAS_SUBNORM    // C11

    DECIMAL_DIG         // C99
    FLT_DECIMAL_DIG     // C11
    DBL_DECIMAL_DIG     // C11
    LDBL_DECIMAL_DIG    // C11

    FLT_DIG
    DBL_DIG
    LDBL_DIG

    FLT_MIN_EXP
    DBL_MIN_EXP
    LDBL_MIN_EXP

    FLT_MIN_10_EXP
    DBL_MIN_10_EXP
    LDBL_MIN_10_EXP

    FLT_MAX_EXP
    DBL_MAX_EXP
    LDBL_MAX_EXP

    FLT_MAX_10_EXP
    DBL_MAX_10_EXP
    LDBL_MAX_10_EXP

    FLT_MAX
    DBL_MAX
    LDBL_MAX

    FLT_EPSILON
    DBL_EPSILON
    LDBL_EPSILON

    FLT_MIN
    DBL_MIN
    LDBL_MIN

    FLT_TRUE_MIN        // C11
    DBL_TRUE_MIN        // C11
    LDBL_TRUE_MIN       // C11

*/

// __cplusplus

// defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

// _LIBCPP_FLOAT_H


=== system/lib/libcxx/include/inttypes.h ===
SHA256: d3e1d4e9e3d5039b3a4e8399a166043a9f689093084380f5eab1d59eb0f16210
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// AIX system headers need inttypes.h to be re-enterable while _STD_TYPES_T

// is defined until an inclusion of it without _STD_TYPES_T occurs, in which

// case the header guard macro is defined.

// _STD_TYPES_T

/*
    inttypes.h synopsis

This entire header is C99 / C++0X

#include <stdint.h>  // <cinttypes> includes <cstdint>

Macros:

    PRId8
    PRId16
    PRId32
    PRId64

    PRIdLEAST8
    PRIdLEAST16
    PRIdLEAST32
    PRIdLEAST64

    PRIdFAST8
    PRIdFAST16
    PRIdFAST32
    PRIdFAST64

    PRIdMAX
    PRIdPTR

    PRIi8
    PRIi16
    PRIi32
    PRIi64

    PRIiLEAST8
    PRIiLEAST16
    PRIiLEAST32
    PRIiLEAST64

    PRIiFAST8
    PRIiFAST16
    PRIiFAST32
    PRIiFAST64

    PRIiMAX
    PRIiPTR

    PRIo8
    PRIo16
    PRIo32
    PRIo64

    PRIoLEAST8
    PRIoLEAST16
    PRIoLEAST32
    PRIoLEAST64

    PRIoFAST8
    PRIoFAST16
    PRIoFAST32
    PRIoFAST64

    PRIoMAX
    PRIoPTR

    PRIu8
    PRIu16
    PRIu32
    PRIu64

    PRIuLEAST8
    PRIuLEAST16
    PRIuLEAST32
    PRIuLEAST64

    PRIuFAST8
    PRIuFAST16
    PRIuFAST32
    PRIuFAST64

    PRIuMAX
    PRIuPTR

    PRIx8
    PRIx16
    PRIx32
    PRIx64

    PRIxLEAST8
    PRIxLEAST16
    PRIxLEAST32
    PRIxLEAST64

    PRIxFAST8
    PRIxFAST16
    PRIxFAST32
    PRIxFAST64

    PRIxMAX
    PRIxPTR

    PRIX8
    PRIX16
    PRIX32
    PRIX64

    PRIXLEAST8
    PRIXLEAST16
    PRIXLEAST32
    PRIXLEAST64

    PRIXFAST8
    PRIXFAST16
    PRIXFAST32
    PRIXFAST64

    PRIXMAX
    PRIXPTR

    SCNd8
    SCNd16
    SCNd32
    SCNd64

    SCNdLEAST8
    SCNdLEAST16
    SCNdLEAST32
    SCNdLEAST64

    SCNdFAST8
    SCNdFAST16
    SCNdFAST32
    SCNdFAST64

    SCNdMAX
    SCNdPTR

    SCNi8
    SCNi16
    SCNi32
    SCNi64

    SCNiLEAST8
    SCNiLEAST16
    SCNiLEAST32
    SCNiLEAST64

    SCNiFAST8
    SCNiFAST16
    SCNiFAST32
    SCNiFAST64

    SCNiMAX
    SCNiPTR

    SCNo8
    SCNo16
    SCNo32
    SCNo64

    SCNoLEAST8
    SCNoLEAST16
    SCNoLEAST32
    SCNoLEAST64

    SCNoFAST8
    SCNoFAST16
    SCNoFAST32
    SCNoFAST64

    SCNoMAX
    SCNoPTR

    SCNu8
    SCNu16
    SCNu32
    SCNu64

    SCNuLEAST8
    SCNuLEAST16
    SCNuLEAST32
    SCNuLEAST64

    SCNuFAST8
    SCNuFAST16
    SCNuFAST32
    SCNuFAST64

    SCNuMAX
    SCNuPTR

    SCNx8
    SCNx16
    SCNx32
    SCNx64

    SCNxLEAST8
    SCNxLEAST16
    SCNxLEAST32
    SCNxLEAST64

    SCNxFAST8
    SCNxFAST16
    SCNxFAST32
    SCNxFAST64

    SCNxMAX
    SCNxPTR

Types:

    imaxdiv_t

intmax_t  imaxabs(intmax_t j);
imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);
intmax_t  strtoimax(const char* restrict nptr, char** restrict endptr, int base);
uintmax_t strtoumax(const char* restrict nptr, char** restrict endptr, int base);
intmax_t  wcstoimax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);
uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);

*/

/* C99 stdlib (e.g. glibc < 2.18) does not provide format macros needed
   for C++11 unless __STDC_FORMAT_MACROS is defined
*/

// __cplusplus

// defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

// _LIBCPP_INTTYPES_H


=== system/lib/libcxx/include/math.h ===
SHA256: 4b16c82333ac977df4edd5484afa13eeeba02386e87b281b68785d5897f69f7e
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*
    math.h synopsis

Macros:

    HUGE_VAL
    HUGE_VALF               // C99
    HUGE_VALL               // C99
    INFINITY                // C99
    NAN                     // C99
    FP_INFINITE             // C99
    FP_NAN                  // C99
    FP_NORMAL               // C99
    FP_SUBNORMAL            // C99
    FP_ZERO                 // C99
    FP_FAST_FMA             // C99
    FP_FAST_FMAF            // C99
    FP_FAST_FMAL            // C99
    FP_ILOGB0               // C99
    FP_ILOGBNAN             // C99
    MATH_ERRNO              // C99
    MATH_ERREXCEPT          // C99
    math_errhandling        // C99

Types:

    float_t                 // C99
    double_t                // C99

// C90

floating_point abs(floating_point x);

floating_point acos (arithmetic x);
float          acosf(float x);
long double    acosl(long double x);

floating_point asin (arithmetic x);
float          asinf(float x);
long double    asinl(long double x);

floating_point atan (arithmetic x);
float          atanf(float x);
long double    atanl(long double x);

floating_point atan2 (arithmetic y, arithmetic x);
float          atan2f(float y, float x);
long double    atan2l(long double y, long double x);

floating_point ceil (arithmetic x);
float          ceilf(float x);
long double    ceill(long double x);

floating_point cos (arithmetic x);
float          cosf(float x);
long double    cosl(long double x);

floating_point cosh (arithmetic x);
float          coshf(float x);
long double    coshl(long double x);

floating_point exp (arithmetic x);
float          expf(float x);
long double    expl(long double x);

floating_point fabs (arithmetic x);
float          fabsf(float x);
long double    fabsl(long double x);

floating_point floor (arithmetic x);
float          floorf(float x);
long double    floorl(long double x);

floating_point fmod (arithmetic x, arithmetic y);
float          fmodf(float x, float y);
long double    fmodl(long double x, long double y);

floating_point frexp (arithmetic value, int* exp);
float          frexpf(float value, int* exp);
long double    frexpl(long double value, int* exp);

floating_point ldexp (arithmetic value, int exp);
float          ldexpf(float value, int exp);
long double    ldexpl(long double value, int exp);

floating_point log (arithmetic x);
float          logf(float x);
long double    logl(long double x);

floating_point log10 (arithmetic x);
float          log10f(float x);
long double    log10l(long double x);

floating_point modf (floating_point value, floating_point* iptr);
float          modff(float value, float* iptr);
long double    modfl(long double value, long double* iptr);

floating_point pow (arithmetic x, arithmetic y);
float          powf(float x, float y);
long double    powl(long double x, long double y);

floating_point sin (arithmetic x);
float          sinf(float x);
long double    sinl(long double x);

floating_point sinh (arithmetic x);
float          sinhf(float x);
long double    sinhl(long double x);

floating_point sqrt (arithmetic x);
float          sqrtf(float x);
long double    sqrtl(long double x);

floating_point tan (arithmetic x);
float          tanf(float x);
long double    tanl(long double x);

floating_point tanh (arithmetic x);
float          tanhf(float x);
long double    tanhl(long double x);

//  C99

bool signbit(arithmetic x);

int fpclassify(arithmetic x);

bool isfinite(arithmetic x);
bool isinf(arithmetic x);
bool isnan(arithmetic x);
bool isnormal(arithmetic x);

bool isgreater(arithmetic x, arithmetic y);
bool isgreaterequal(arithmetic x, arithmetic y);
bool isless(arithmetic x, arithmetic y);
bool islessequal(arithmetic x, arithmetic y);
bool islessgreater(arithmetic x, arithmetic y);
bool isunordered(arithmetic x, arithmetic y);

floating_point acosh (arithmetic x);
float          acoshf(float x);
long double    acoshl(long double x);

floating_point asinh (arithmetic x);
float          asinhf(float x);
long double    asinhl(long double x);

floating_point atanh (arithmetic x);
float          atanhf(float x);
long double    atanhl(long double x);

floating_point cbrt (arithmetic x);
float          cbrtf(float x);
long double    cbrtl(long double x);

floating_point copysign (arithmetic x, arithmetic y);
float          copysignf(float x, float y);
long double    copysignl(long double x, long double y);

floating_point erf (arithmetic x);
float          erff(float x);
long double    erfl(long double x);

floating_point erfc (arithmetic x);
float          erfcf(float x);
long double    erfcl(long double x);

floating_point exp2 (arithmetic x);
float          exp2f(float x);
long double    exp2l(long double x);

floating_point expm1 (arithmetic x);
float          expm1f(float x);
long double    expm1l(long double x);

floating_point fdim (arithmetic x, arithmetic y);
float          fdimf(float x, float y);
long double    fdiml(long double x, long double y);

floating_point fma (arithmetic x, arithmetic y, arithmetic z);
float          fmaf(float x, float y, float z);
long double    fmal(long double x, long double y, long double z);

floating_point fmax (arithmetic x, arithmetic y);
float          fmaxf(float x, float y);
long double    fmaxl(long double x, long double y);

floating_point fmin (arithmetic x, arithmetic y);
float          fminf(float x, float y);
long double    fminl(long double x, long double y);

floating_point hypot (arithmetic x, arithmetic y);
float          hypotf(float x, float y);
long double    hypotl(long double x, long double y);

int ilogb (arithmetic x);
int ilogbf(float x);
int ilogbl(long double x);

floating_point lgamma (arithmetic x);
float          lgammaf(float x);
long double    lgammal(long double x);

long long llrint (arithmetic x);
long long llrintf(float x);
long long llrintl(long double x);

long long llround (arithmetic x);
long long llroundf(float x);
long long llroundl(long double x);

floating_point log1p (arithmetic x);
float          log1pf(float x);
long double    log1pl(long double x);

floating_point log2 (arithmetic x);
float          log2f(float x);
long double    log2l(long double x);

floating_point logb (arithmetic x);
float          logbf(float x);
long double    logbl(long double x);

long lrint (arithmetic x);
long lrintf(float x);
long lrintl(long double x);

long lround (arithmetic x);
long lroundf(float x);
long lroundl(long double x);

double      nan (const char* str);
float       nanf(const char* str);
long double nanl(const char* str);

floating_point nearbyint (arithmetic x);
float          nearbyintf(float x);
long double    nearbyintl(long double x);

floating_point nextafter (arithmetic x, arithmetic y);
float          nextafterf(float x, float y);
long double    nextafterl(long double x, long double y);

floating_point nexttoward (arithmetic x, long double y);
float          nexttowardf(float x, long double y);
long double    nexttowardl(long double x, long double y);

floating_point remainder (arithmetic x, arithmetic y);
float          remainderf(float x, float y);
long double    remainderl(long double x, long double y);

floating_point remquo (arithmetic x, arithmetic y, int* pquo);
float          remquof(float x, float y, int* pquo);
long double    remquol(long double x, long double y, int* pquo);

floating_point rint (arithmetic x);
float          rintf(float x);
long double    rintl(long double x);

floating_point round (arithmetic x);
float          roundf(float x);
long double    roundl(long double x);

floating_point scalbln (arithmetic x, long ex);
float          scalblnf(float x, long ex);
long double    scalblnl(long double x, long ex);

floating_point scalbn (arithmetic x, int ex);
float          scalbnf(float x, int ex);
long double    scalbnl(long double x, int ex);

floating_point tgamma (arithmetic x);
float          tgammaf(float x);
long double    tgammal(long double x);

floating_point trunc (arithmetic x);
float          truncf(float x);
long double    truncl(long double x);

*/

// We support including .h headers inside 'extern "C"' contexts, so switch

// back to C++ linkage before including these C++ headers.

// fpclassify relies on implementation-defined constants, so we can't move it to a detail header

// fpclassify

// template on non-double overloads to make them weaker than same overloads from MSVC runtime

// namespace __math

// The MSVC runtime already provides these functions as templates

// _LIBCPP_MSVCRT

// We have to provide double overloads for <math.h> to work on platforms that don't provide the full set of math

// functions. To make the overload set work with multiple functions that take the same arguments, we make our overloads

// templates. Functions are preferred over function templates during overload resolution, which means that our overload

// will only be selected when the C library doesn't provide one.

// extern "C++"

// __cplusplus

// defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

// _LIBCPP_MATH_H

// This include lives outside the header guard in order to support an MSVC

// extension which allows users to do:

//

// #define _USE_MATH_DEFINES

// #include <math.h>

//

// and receive the definitions of mathematical constants, even if <math.h>

// has previously been included.

// _LIBCPP_MATH_H


=== system/lib/libcxx/include/stdatomic.h ===
SHA256: 810022608fcadf372a3f8601a0dc921be6a4b1f8e7979495fa9fc456ece374f1
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*
    stdatomic.h synopsis

template<class T>
  using std-atomic = std::atomic<T>;        // exposition only

#define _Atomic(T) std-atomic<T>

#define ATOMIC_BOOL_LOCK_FREE see below
#define ATOMIC_CHAR_LOCK_FREE see below
#define ATOMIC_CHAR16_T_LOCK_FREE see below
#define ATOMIC_CHAR32_T_LOCK_FREE see below
#define ATOMIC_WCHAR_T_LOCK_FREE see below
#define ATOMIC_SHORT_LOCK_FREE see below
#define ATOMIC_INT_LOCK_FREE see below
#define ATOMIC_LONG_LOCK_FREE see below
#define ATOMIC_LLONG_LOCK_FREE see below
#define ATOMIC_POINTER_LOCK_FREE see below

using std::memory_order                // see below
using std::memory_order_relaxed        // see below
using std::memory_order_consume        // see below
using std::memory_order_acquire        // see below
using std::memory_order_release        // see below
using std::memory_order_acq_rel        // see below
using std::memory_order_seq_cst        // see below

using std::atomic_flag                 // see below

using std::atomic_bool                 // see below
using std::atomic_char                 // see below
using std::atomic_schar                // see below
using std::atomic_uchar                // see below
using std::atomic_short                // see below
using std::atomic_ushort               // see below
using std::atomic_int                  // see below
using std::atomic_uint                 // see below
using std::atomic_long                 // see below
using std::atomic_ulong                // see below
using std::atomic_llong                // see below
using std::atomic_ullong               // see below
using std::atomic_char8_t              // see below
using std::atomic_char16_t             // see below
using std::atomic_char32_t             // see below
using std::atomic_wchar_t              // see below
using std::atomic_int8_t               // see below
using std::atomic_uint8_t              // see below
using std::atomic_int16_t              // see below
using std::atomic_uint16_t             // see below
using std::atomic_int32_t              // see below
using std::atomic_uint32_t             // see below
using std::atomic_int64_t              // see below
using std::atomic_uint64_t             // see below
using std::atomic_int_least8_t         // see below
using std::atomic_uint_least8_t        // see below
using std::atomic_int_least16_t        // see below
using std::atomic_uint_least16_t       // see below
using std::atomic_int_least32_t        // see below
using std::atomic_uint_least32_t       // see below
using std::atomic_int_least64_t        // see below
using std::atomic_uint_least64_t       // see below
using std::atomic_int_fast8_t          // see below
using std::atomic_uint_fast8_t         // see below
using std::atomic_int_fast16_t         // see below
using std::atomic_uint_fast16_t        // see below
using std::atomic_int_fast32_t         // see below
using std::atomic_uint_fast32_t        // see below
using std::atomic_int_fast64_t         // see below
using std::atomic_uint_fast64_t        // see below
using std::atomic_intptr_t             // see below
using std::atomic_uintptr_t            // see below
using std::atomic_size_t               // see below
using std::atomic_ptrdiff_t            // see below
using std::atomic_intmax_t             // see below
using std::atomic_uintmax_t            // see below

using std::atomic_is_lock_free                         // see below
using std::atomic_load                                 // see below
using std::atomic_load_explicit                        // see below
using std::atomic_store                                // see below
using std::atomic_store_explicit                       // see below
using std::atomic_exchange                             // see below
using std::atomic_exchange_explicit                    // see below
using std::atomic_compare_exchange_strong              // see below
using std::atomic_compare_exchange_strong_explicit     // see below
using std::atomic_compare_exchange_weak                // see below
using std::atomic_compare_exchange_weak_explicit       // see below
using std::atomic_fetch_add                            // see below
using std::atomic_fetch_add_explicit                   // see below
using std::atomic_fetch_sub                            // see below
using std::atomic_fetch_sub_explicit                   // see below
using std::atomic_fetch_or                             // see below
using std::atomic_fetch_or_explicit                    // see below
using std::atomic_fetch_xor                            // see below
using std::atomic_fetch_xor_explicit                   // see below
using std::atomic_fetch_and                            // see below
using std::atomic_fetch_and_explicit                   // see below
using std::atomic_flag_test_and_set                    // see below
using std::atomic_flag_test_and_set_explicit           // see below
using std::atomic_flag_clear                           // see below
using std::atomic_flag_clear_explicit                  // see below

using std::atomic_thread_fence                         // see below
using std::atomic_signal_fence                         // see below

*/

// Before C++23, we include the next <stdatomic.h> on the path to avoid hijacking

// the header. We do this because Clang has historically shipped a <stdatomic.h>

// header that would be available in all Standard modes, and we don't want to

// break that use case.

// defined(__cplusplus) && _LIBCPP_STD_VER >= 23

// defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

// _LIBCPP_STDATOMIC_H


=== system/lib/libcxx/include/stdbool.h ===
SHA256: 802dba16f0aa1b816e6483b3beeb487d82838b3c9ce450e2bafec1868d5fbb7c
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*
    stdbool.h synopsis

Macros:

    __bool_true_false_are_defined

*/

// defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

// _LIBCPP_STDBOOL_H


=== system/lib/libcxx/include/stddef.h ===
SHA256: 31d900d6916b90696290f7191b6135d397e1a0fc6f3218b408b9f2abd87ffa48
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*
    stddef.h synopsis

Macros:

    offsetof(type,member-designator)
    NULL

Types:

    ptrdiff_t
    size_t
    max_align_t // C++11
    nullptr_t

*/

// Note: This include is outside of header guards because we sometimes get included multiple times

//       with different defines and the underlying <stddef.h> will know how to deal with that.

// defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

// _LIBCPP_STDDEF_H


=== system/lib/libcxx/include/stdio.h ===
SHA256: d6722336708b2f485b3d05d99f42f5d80fdef3a46e081c62214168d44ef727a0
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*
    stdio.h synopsis

Macros:

    BUFSIZ
    EOF
    FILENAME_MAX
    FOPEN_MAX
    L_tmpnam
    NULL
    SEEK_CUR
    SEEK_END
    SEEK_SET
    TMP_MAX
    _IOFBF
    _IOLBF
    _IONBF
    stderr
    stdin
    stdout

Types:

FILE
fpos_t
size_t

int remove(const char* filename);
int rename(const char* old, const char* new);
FILE* tmpfile(void);
char* tmpnam(char* s);
int fclose(FILE* stream);
int fflush(FILE* stream);
FILE* fopen(const char* restrict filename, const char* restrict mode);
FILE* freopen(const char* restrict filename, const char * restrict mode,
              FILE * restrict stream);
void setbuf(FILE* restrict stream, char* restrict buf);
int setvbuf(FILE* restrict stream, char* restrict buf, int mode, size_t size);
int fprintf(FILE* restrict stream, const char* restrict format, ...);
int fscanf(FILE* restrict stream, const char * restrict format, ...);
int printf(const char* restrict format, ...);
int scanf(const char* restrict format, ...);
int snprintf(char* restrict s, size_t n, const char* restrict format, ...);    // C99
int sprintf(char* restrict s, const char* restrict format, ...);
int sscanf(const char* restrict s, const char* restrict format, ...);
int vfprintf(FILE* restrict stream, const char* restrict format, va_list arg);
int vfscanf(FILE* restrict stream, const char* restrict format, va_list arg);  // C99
int vprintf(const char* restrict format, va_list arg);
int vscanf(const char* restrict format, va_list arg);                          // C99
int vsnprintf(char* restrict s, size_t n, const char* restrict format,         // C99
              va_list arg);
int vsprintf(char* restrict s, const char* restrict format, va_list arg);
int vsscanf(const char* restrict s, const char* restrict format, va_list arg); // C99
int fgetc(FILE* stream);
char* fgets(char* restrict s, int n, FILE* restrict stream);
int fputc(int c, FILE* stream);
int fputs(const char* restrict s, FILE* restrict stream);
int getc(FILE* stream);
int getchar(void);
char* gets(char* s);  // removed in C++14
int putc(int c, FILE* stream);
int putchar(int c);
int puts(const char* s);
int ungetc(int c, FILE* stream);
size_t fread(void* restrict ptr, size_t size, size_t nmemb,
             FILE* restrict stream);
size_t fwrite(const void* restrict ptr, size_t size, size_t nmemb,
              FILE* restrict stream);
int fgetpos(FILE* restrict stream, fpos_t* restrict pos);
int fseek(FILE* stream, long offset, int whence);
int fsetpos(FILE*stream, const fpos_t* pos);
long ftell(FILE* stream);
void rewind(FILE* stream);
void clearerr(FILE* stream);
int feof(FILE* stream);
int ferror(FILE* stream);
void perror(const char* s);
*/

// The inclusion of the system's <stdio.h> is intentionally done once outside of any include

// guards because some code expects to be able to include the underlying system header multiple

// times to get different definitions based on the macros that are set before inclusion.

// __cplusplus

// _LIBCPP_STDIO_H

// defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)


=== system/lib/libcxx/include/stdlib.h ===
SHA256: 9c4f5e0b45402e668facad3a0e0531c8f6b6aac99fad4cdc07d9aa83f6489d9c
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*
    stdlib.h synopsis

Macros:

    EXIT_FAILURE
    EXIT_SUCCESS
    MB_CUR_MAX
    NULL
    RAND_MAX

Types:

    size_t
    div_t
    ldiv_t
    lldiv_t                                                               // C99

double    atof (const char* nptr);
int       atoi (const char* nptr);
long      atol (const char* nptr);
long long atoll(const char* nptr);                                        // C99
double             strtod  (const char* restrict nptr, char** restrict endptr);
float              strtof  (const char* restrict nptr, char** restrict endptr); // C99
long double        strtold (const char* restrict nptr, char** restrict endptr); // C99
long               strtol  (const char* restrict nptr, char** restrict endptr, int base);
long long          strtoll (const char* restrict nptr, char** restrict endptr, int base); // C99
unsigned long      strtoul (const char* restrict nptr, char** restrict endptr, int base);
unsigned long long strtoull(const char* restrict nptr, char** restrict endptr, int base); // C99
int rand(void);
void srand(unsigned int seed);
void* calloc(size_t nmemb, size_t size);
void free(void* ptr);
void* malloc(size_t size);
void* realloc(void* ptr, size_t size);
void abort(void);
int atexit(void (*func)(void));
void exit(int status);
void _Exit(int status);
char* getenv(const char* name);
int system(const char* string);
void* bsearch(const void* key, const void* base, size_t nmemb, size_t size,
              int (*compar)(const void *, const void *));
void qsort(void* base, size_t nmemb, size_t size,
           int (*compar)(const void *, const void *));
int         abs(      int j);
long        abs(     long j);
long long   abs(long long j);                                             // C++0X
long       labs(     long j);
long long llabs(long long j);                                             // C99
div_t     div(      int numer,       int denom);
ldiv_t    div(     long numer,      long denom);
lldiv_t   div(long long numer, long long denom);                          // C++0X
ldiv_t   ldiv(     long numer,      long denom);
lldiv_t lldiv(long long numer, long long denom);                          // C99
int mblen(const char* s, size_t n);
int mbtowc(wchar_t* restrict pwc, const char* restrict s, size_t n);
int wctomb(char* s, wchar_t wchar);
size_t mbstowcs(wchar_t* restrict pwcs, const char* restrict s, size_t n);
size_t wcstombs(char* restrict s, const wchar_t* restrict pwcs, size_t n);
int at_quick_exit(void (*func)(void))                                     // C++11
void quick_exit(int status);                                              // C++11
void *aligned_alloc(size_t alignment, size_t size);                       // C11

*/

// The inclusion of the system's <stdlib.h> is intentionally done once outside of any include

// guards because some code expects to be able to include the underlying system header multiple

// times to get different definitions based on the macros that are set before inclusion.

// abs

// div

// MSVCRT already has the correct prototype in <stdlib.h> if __cplusplus is defined

// _LIBCPP_MSVCRT

// extern "C++"

// __cplusplus

// _LIBCPP_STDLIB_H

// defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)


=== system/lib/libcxx/include/string.h ===
SHA256: 9e6f3b3d0a59f913f6a193b8689d3f77e7b23418dc124cfdeb8028eb7c1a5dfe
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*
    string.h synopsis

Macros:

    NULL

Types:

    size_t

void* memcpy(void* restrict s1, const void* restrict s2, size_t n);
void* memmove(void* s1, const void* s2, size_t n);
char* strcpy (char* restrict s1, const char* restrict s2);
char* strncpy(char* restrict s1, const char* restrict s2, size_t n);
char* strcat (char* restrict s1, const char* restrict s2);
char* strncat(char* restrict s1, const char* restrict s2, size_t n);
int memcmp(const void* s1, const void* s2, size_t n);
int strcmp (const char* s1, const char* s2);
int strncmp(const char* s1, const char* s2, size_t n);
int strcoll(const char* s1, const char* s2);
size_t strxfrm(char* restrict s1, const char* restrict s2, size_t n);
const void* memchr(const void* s, int c, size_t n);
      void* memchr(      void* s, int c, size_t n);
const char* strchr(const char* s, int c);
      char* strchr(      char* s, int c);
size_t strcspn(const char* s1, const char* s2);
const char* strpbrk(const char* s1, const char* s2);
      char* strpbrk(      char* s1, const char* s2);
const char* strrchr(const char* s, int c);
      char* strrchr(      char* s, int c);
size_t strspn(const char* s1, const char* s2);
const char* strstr(const char* s1, const char* s2);
      char* strstr(      char* s1, const char* s2);
char* strtok(char* restrict s1, const char* restrict s2);
void* memset(void* s, int c, size_t n);
char* strerror(int errnum);
size_t strlen(const char* s);

*/

// MSVCRT, GNU libc and its derivates may already have the correct prototype in

// <string.h>. This macro can be defined by users if their C library provides

// the right signature.

// extern "C++"

// defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

// _LIBCPP_STRING_H


=== system/lib/libcxx/include/tgmath.h ===
SHA256: 30680102e65185cf826f0c3a29458028ee5bbea7ad88c4fa9b00714ae96b5f20
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*
    tgmath.h synopsis

#include <ctgmath>

*/

// defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

// _LIBCPP_TGMATH_H


=== system/lib/libcxx/include/uchar.h ===
SHA256: 94db4f0ff85191573f26d66a0a4c9881eb9201cd4e0a20d11c9fa8aceb0d06ea
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*
    uchar.h synopsis // since C++11

Macros:

    __STDC_UTF_16__
    __STDC_UTF_32__

Types:

  mbstate_t
  size_t

size_t mbrtoc8(char8_t* pc8, const char* s, size_t n, mbstate_t* ps);     // since C++20
size_t c8rtomb(char* s, char8_t c8, mbstate_t* ps);                       // since C++20
size_t mbrtoc16(char16_t* pc16, const char* s, size_t n, mbstate_t* ps);
size_t c16rtomb(char* s, char16_t c16, mbstate_t* ps);
size_t mbrtoc32(char32_t* pc32, const char* s, size_t n, mbstate_t* ps);
size_t c32rtomb(char* s, char32_t c32, mbstate_t* ps);

*/

// Some platforms don't implement <uchar.h> and we don't want to give a hard

// error on those platforms. When the platform doesn't provide <uchar.h>, at

// least include <stddef.h> so we get the declaration for size_t, and try to

// get the declaration of mbstate_t too.

// _LIBCPP_CXX03_LANG

// __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

// _LIBCPP_UCHAR_H


=== system/lib/libcxx/include/wchar.h ===
SHA256: ca378b500889d4c08eba9f52af5f0d60becdd21fd45d9c3981ff461a0e7f3fab
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*
    wchar.h synopsis

Macros:

    NULL
    WCHAR_MAX
    WCHAR_MIN
    WEOF

Types:

    mbstate_t
    size_t
    tm
    wint_t

int fwprintf(FILE* restrict stream, const wchar_t* restrict format, ...);
int fwscanf(FILE* restrict stream, const wchar_t* restrict format, ...);
int swprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, ...);
int swscanf(const wchar_t* restrict s, const wchar_t* restrict format, ...);
int vfwprintf(FILE* restrict stream, const wchar_t* restrict format, va_list arg);
int vfwscanf(FILE* restrict stream, const wchar_t* restrict format, va_list arg);  // C99
int vswprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, va_list arg);
int vswscanf(const wchar_t* restrict s, const wchar_t* restrict format, va_list arg);  // C99
int vwprintf(const wchar_t* restrict format, va_list arg);
int vwscanf(const wchar_t* restrict format, va_list arg);  // C99
int wprintf(const wchar_t* restrict format, ...);
int wscanf(const wchar_t* restrict format, ...);
wint_t fgetwc(FILE* stream);
wchar_t* fgetws(wchar_t* restrict s, int n, FILE* restrict stream);
wint_t fputwc(wchar_t c, FILE* stream);
int fputws(const wchar_t* restrict s, FILE* restrict stream);
int fwide(FILE* stream, int mode);
wint_t getwc(FILE* stream);
wint_t getwchar();
wint_t putwc(wchar_t c, FILE* stream);
wint_t putwchar(wchar_t c);
wint_t ungetwc(wint_t c, FILE* stream);
double wcstod(const wchar_t* restrict nptr, wchar_t** restrict endptr);
float wcstof(const wchar_t* restrict nptr, wchar_t** restrict endptr);         // C99
long double wcstold(const wchar_t* restrict nptr, wchar_t** restrict endptr);  // C99
long wcstol(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);
long long wcstoll(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);  // C99
unsigned long wcstoul(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);
unsigned long long wcstoull(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);  // C99
wchar_t* wcscpy(wchar_t* restrict s1, const wchar_t* restrict s2);
wchar_t* wcsncpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);
wchar_t* wcscat(wchar_t* restrict s1, const wchar_t* restrict s2);
wchar_t* wcsncat(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);
int wcscmp(const wchar_t* s1, const wchar_t* s2);
int wcscoll(const wchar_t* s1, const wchar_t* s2);
int wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n);
size_t wcsxfrm(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);
const wchar_t* wcschr(const wchar_t* s, wchar_t c);
      wchar_t* wcschr(      wchar_t* s, wchar_t c);
size_t wcscspn(const wchar_t* s1, const wchar_t* s2);
size_t wcslen(const wchar_t* s);
const wchar_t* wcspbrk(const wchar_t* s1, const wchar_t* s2);
      wchar_t* wcspbrk(      wchar_t* s1, const wchar_t* s2);
const wchar_t* wcsrchr(const wchar_t* s, wchar_t c);
      wchar_t* wcsrchr(      wchar_t* s, wchar_t c);
size_t wcsspn(const wchar_t* s1, const wchar_t* s2);
const wchar_t* wcsstr(const wchar_t* s1, const wchar_t* s2);
      wchar_t* wcsstr(      wchar_t* s1, const wchar_t* s2);
wchar_t* wcstok(wchar_t* restrict s1, const wchar_t* restrict s2, wchar_t** restrict ptr);
const wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n);
      wchar_t* wmemchr(      wchar_t* s, wchar_t c, size_t n);
int wmemcmp(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);
wchar_t* wmemcpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);
wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n);
wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n);
size_t wcsftime(wchar_t* restrict s, size_t maxsize, const wchar_t* restrict format,
                const tm* restrict timeptr);
wint_t btowc(int c);
int wctob(wint_t c);
int mbsinit(const mbstate_t* ps);
size_t mbrlen(const char* restrict s, size_t n, mbstate_t* restrict ps);
size_t mbrtowc(wchar_t* restrict pwc, const char* restrict s, size_t n, mbstate_t* restrict ps);
size_t wcrtomb(char* restrict s, wchar_t wc, mbstate_t* restrict ps);
size_t mbsrtowcs(wchar_t* restrict dst, const char** restrict src, size_t len,
                 mbstate_t* restrict ps);
size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
                 mbstate_t* restrict ps);

*/

// We define this here to support older versions of glibc <wchar.h> that do

// not define this for clang.

// The inclusion of the system's <wchar.h> is intentionally done once outside of any include

// guards because some code expects to be able to include the underlying system header multiple

// times to get different definitions based on the macros that are set before inclusion.

// provide mbstate_t

// provide size_t

// Determine whether we have const-correct overloads for wcschr and friends.

// extern "C"

// __cplusplus && (_LIBCPP_MSVCRT || __MVS__)

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP_WCHAR_H

// defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)


=== system/lib/libcxx/include/wctype.h ===
SHA256: b966ee953d885f0b0958235e93c6612db544f9529ed3e02b4bcc8f01ddf90ed5
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*
    wctype.h synopsis

Macros:

    WEOF

Types:

    wint_t
    wctrans_t
    wctype_t

int iswalnum(wint_t wc);
int iswalpha(wint_t wc);
int iswblank(wint_t wc);  // C99
int iswcntrl(wint_t wc);
int iswdigit(wint_t wc);
int iswgraph(wint_t wc);
int iswlower(wint_t wc);
int iswprint(wint_t wc);
int iswpunct(wint_t wc);
int iswspace(wint_t wc);
int iswupper(wint_t wc);
int iswxdigit(wint_t wc);
int iswctype(wint_t wc, wctype_t desc);
wctype_t wctype(const char* property);
wint_t towlower(wint_t wc);
wint_t towupper(wint_t wc);
wint_t towctrans(wint_t wc, wctrans_t desc);
wctrans_t wctrans(const char* property);

*/

// TODO:

// In the future, we should unconditionally include_next <wctype.h> here and instead

// have a mode under which the library does not need libc++'s <wctype.h> or <cwctype>

// at all (i.e. a mode without wchar_t). As it stands, we need to do that to completely

// bypass the using declarations in <cwctype> when we did not include <wctype.h>.

// Otherwise, a using declaration like `using ::wint_t` in <cwctype> will refer to

// nothing (with using_if_exists), and if we include another header that defines one

// of these declarations (e.g. <wchar.h>), the second `using ::wint_t` with using_if_exists

// will fail because it does not refer to the same declaration.

// __cplusplus

// defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)

// _LIBCPP_WCTYPE_H


=== system/lib/libcxx/src/algorithm.cpp ===
SHA256: 32d0eded6a24dcf1e5d4968e7a8e9902b459084bbe08d681dc14bf093ce53f9a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// log(0) is undefined, so don't try computing the depth

// Only use bitset partitioning for arithmetic types.  We should also check

// that the default comparator is in use so that we are sure that there are no

// branches in the comparator.

// clang-format off

// clang-format on


=== system/lib/libcxx/src/any.cpp ===
SHA256: f26f7a5806686d401fdacffa339cbe52a5964e9444e0cec23fcdd91fb7d3c58d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace std

//  Preserve std::experimental::any_bad_cast for ABI compatibility

//  Even though it no longer exists in a header file


=== system/lib/libcxx/src/atomic.cpp ===
SHA256: dca7d1b4d6fc256b8290d677dd4f163c4acccd63df107a9c86bd4cdf3a3e4bff
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// libc++ uses SYS_futex as a universal syscall name. However, on 32 bit architectures

// with a 64 bit time_t, we need to specify SYS_futex_time64.

// OpenBSD has no indirect syscalls

// <- Add other operating systems here

// Baseline needs no new headers

/* timeout is specified in microseconds */

// https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/sys/ulock.h#L82

/*
 * Since __cxx_contention_t is int64_t even on 32bit FreeBSD
 * platforms, we have to use umtx ops that work on the long type, and
 * limit its use to architectures where long and int64_t are synonyms.
 */

// <- Add other operating systems here

// Baseline is just a timed backoff

// __linux__

/* < there's no magic in this number */

/*  aim to avoid false sharing */

/* Given an atomic to track contention and an atomic to actually wait on, which may be
   the same atomic, we try to detect contention to avoid spuriously calling the platform. */

// We only call 'wake' if we consumed a contention bit here.

/*__contention_state*/

// We will monitor this value.

// https://github.com/llvm/llvm-project/issues/109290

// There are no platform guarantees of a memory barrier in the platform wait implementation

// We sleep as long as the monitored value hasn't changed.

/* When the incoming atomic is the wrong size for the platform wait size, need to
   launder the value sequence through an atomic from our table. */

// The value sequence laundering happens on the next line below.

/* when laundering, we can't handle notify_one */

/* When the incoming atomic happens to be the platform wait size, we still need to use the
   table for the contention detection, but we can use the atomic directly for the wait. */

// This function is never used, but still exported for ABI compatibility.


=== system/lib/libcxx/src/barrier.cpp ===
SHA256: f627c04b8dbdb3eb2bdb927cfbf5c97c2a1cd80dfea5315aabd74c7f3f328ce2
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/* naturally-align the heap state */

// I'm 1 in 1, go to next __round

// I'm 1 in 2, done with arrival

// I'm 2 in 2, go to next __round


=== system/lib/libcxx/src/bind.cpp ===
SHA256: caba738eeaa4d08d5db0372bea32133b1c02b307b7f9578b6b7ffa860b6a08f2
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace placeholders


=== system/lib/libcxx/src/call_once.cpp ===
SHA256: 0b736a909e2f73fb6fcb1d39118addcc46eeff43dbdcce800d130f92608ec02b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// If dispatch_once_f ever handles C++ exceptions, and if one can get to it

// without illegal macros (unexpected macros not beginning with _UpperCase or

// __lowercase), and if it stops spinning waiting threads, then call_once should

// call into dispatch_once_f instead of here. Relevant radar this code needs to

// keep in sync with:  7741191.

// !_LIBCPP_HAS_THREADS

// !_LIBCPP_HAS_THREADS


=== system/lib/libcxx/src/charconv.cpp ===
SHA256: 347b5c9eaa719e28554cb911be699afd2ff6dc40d5d0c12eaee9522e830a82d1
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __itoa

// _LIBCPP_ABI_DO_NOT_EXPORT_TO_CHARS_BASE_10

// The original version of floating-point to_chars was written by Microsoft and

// contributed with the following license.

// Copyright (c) Microsoft Corporation.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// This implementation is dedicated to the memory of Mary and Thavatchai.


=== system/lib/libcxx/src/chrono.cpp ===
SHA256: cd19429b65fbefed0e6e5290ce80312f310f5ae0e650d2db4c0ec15225e91003
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// As part of monotonic clock support on z/OS we need macro _LARGE_TIME_API

// to be defined before any system header to include definition of struct timespec64.

// errno

// gettimeofdayMonotonic

// clock_gettime and CLOCK_{MONOTONIC,REALTIME,MONOTONIC_RAW}

// _POSIX_TIMERS

// for gettimeofday and timeval

// OpenBSD and GPU do not have a fully conformant suite of POSIX timers, but

// it does have clock_gettime and CLOCK_MONOTONIC which is all we need.

// defined(_LIBCPP_WIN32API)

//

// system_clock

//

// Pretend we're inside a system header so the compiler doesn't flag the use of the init_priority

// attribute with a value that's reserved for the implementation (we're the implementation).

// namespace

// FILETIME is in 100ns units

// The Windows epoch is Jan 1 1601, the Unix epoch Jan 1 1970.

//

// steady_clock

//

// Warning:  If this is not truly steady, then it is non-conforming.  It is

//  better for it to not exist and have the rest of libc++ use system_clock

//  instead.

//

// On Apple platforms, only CLOCK_UPTIME_RAW, CLOCK_MONOTONIC_RAW or

// mach_absolute_time are able to time functions in the nanosecond range.

// Furthermore, only CLOCK_MONOTONIC_RAW is truly monotonic, because it

// also counts cycles when the system is asleep. Thus, it is the only

// acceptable implementation of steady_clock.

// https://msdn.microsoft.com/en-us/library/windows/desktop/ms644905(v=vs.85).aspx says:

//    If the function fails, the return value is zero. <snip>

//    On systems that run Windows XP or later, the function will always succeed

//      and will thus never return zero.

// Implicitly link against the vDSO system call ABI without

// requiring the final link to specify -lzircon explicitly when

// statically linking libc++.

// _LIBCPP_HAS_MONOTONIC_CLOCK

// namespace chrono


=== system/lib/libcxx/src/condition_variable.cpp ===
SHA256: 60f9ac564007c3b0b2e6d667fc5d72990f6ba79eed6d199600930a86291a0be5
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// ~condition_variable is defined elsewhere.

// If this thread was not created using std::thread then it will not have

// previously allocated.


=== system/lib/libcxx/src/condition_variable_destructor.cpp ===
SHA256: 4c579e99ab9ff84829da34c85813e43d372786094afed27955dc0ab150bdcf65
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Define ~condition_variable.

//

// On some platforms ~condition_variable has been made trivial and the

// definition is only provided for ABI compatibility.


=== system/lib/libcxx/src/error_category.cpp ===
SHA256: 236d878ed42578f1599dae12d0b7b5f44acc146f9f5af2b92f29c5b54008193a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// class error_category


=== system/lib/libcxx/src/exception.cpp ===
SHA256: e41a2b2d0ee0c8a88b082c81f9df2743bb96ac21081dce017f6eba37393646e2
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/libcxx/src/expected.cpp ===
SHA256: dc228b460c618785340e674e93858e1030a02a65693fe8b325871e558e16dd9c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/libcxx/src/experimental/chrono_exception.cpp ===
SHA256: cc8a6fc795a2e73d1750bf5bda0a27347fea323241874e3e1156467967107435
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// key function

// key function

// namespace chrono


=== system/lib/libcxx/src/experimental/include/tzdb/time_zone_private.h ===
SHA256: 60ec8f603ed80d3443b266087dcbf97aa7faf600d894f8d60427379f6bddcf89
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html

// Note the first line has a name + __continuation, the other lines

// are just __continuations. So there is always at least one item in

// the vector.

// Continuations often depend on a set of rules. The rules are stored in

// parallel data structurs in tzdb_list. From the time_zone it's not possible

// to find its associated tzdb entry and thus not possible to find its

// associated rules. Therefore a link to the rules in stored in this class.

// namespace chrono

// _LIBCPP_SRC_INCLUDE_TZDB_TIME_ZONE_PRIVATE_H


=== system/lib/libcxx/src/experimental/include/tzdb/types_private.h ===
SHA256: 5682323b386a034753d4cddf244d8d91f8771cd87d1604451c824c63a15c975e
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html

// TODO TZDB

// The helper classes in this header have no constructor but are loaded with

// dedicated parse functions. In the original design this header was public and

// the parsing was done in the dylib. In that design having constructors would

// expand the ABI interface. Since this header is now in the dylib that design

// should be reconsidered. (For now the design is kept as is, in case this

// header needs to be public for unforseen reasons.)

// Sun>=8   first Sunday on or after the eighth

// Sun<=25  last Sunday on or before the 25th

// The on field has a few alternative presentations

//  5        the fifth of the month

//  lastSun  the last Sunday in the month

//  lastMon  the last Monday in the month

//  Sun>=8   first Sunday on or after the eighth

//  Sun<=25  last Sunday on or before the 25th

// The names of the fields match the fields of a Rule.

// TODO TZDB use flat_map;

// Non-owning link to the RULE entries.

// The RULES is either a SAVE or a NAME.

// The size_t is used as cache. After loading the rules they are

// sorted and remain stable, then an index in the vector can be

// used.

// If this field contains - then standard time always

// applies. This is indicated by the monostate.

// TODO TZDB Investigate implantation the size_t based caching.

/*, size_t*/

// TODO TZDB the until field can contain more than just a year.

// Parts of the UNTIL, the optional parts are default initialized

//    optional<year> __until_;

// namespace chrono::__tz

// __LIBCPP_SRC_INCLUDE_TZDB_TYPES_PRIVATE_H


=== system/lib/libcxx/src/experimental/include/tzdb/tzdb_list_private.h ===
SHA256: 785492b47e4cc6afa8cef7dd936e2ee7043d9bc1d9a7552db3cca06e3e4aa96a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html

// When threads are not available the locking is not required.

// When threads are available, we use std::mutex over std::shared_mutex

// due to the increased overhead of std::shared_mutex.

// See shared_mutex_vs_mutex.bench.cpp

//===----------------------------------------------------------------------===//

//                          Private API

//===----------------------------------------------------------------------===//

// The tzdb_list stores a list of "tzdb" entries.

//

// The public tzdb database does not store the RULE entries of the IANA

// database. These entries are considered an implementation detail. Since most

// of the tzdb_list interface is exposed as "a list of tzdb entries" it's not

// possible to use a helper struct that stores a tzdb and the RULE database.

// Instead this class stores these in parallel forward lists.

//

// Since the nodes of a forward_list are stable it's possible to store pointers

// and references to these nodes.

//  forward_list<T>::end does not access the list, so no need to take a lock.

// Loads the tzdbs

// pre: The caller ensures the locking, if needed, is done.

// namespace chrono

// _LIBCPP_SRC_INCLUDE_TZDB_TZDB_LIST_PRIVATE_H


=== system/lib/libcxx/src/experimental/include/tzdb/tzdb_private.h ===
SHA256: ed4c3ab528204a10ca03cb439a4f38dc64fcfbfbeb2aa54db7a13d60c4e24717
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html

// namespace chrono

// _LIBCPP_SRC_INCLUDE_TZDB_TZ_PRIVATE_H


=== system/lib/libcxx/src/experimental/keep.cpp ===
SHA256: 93ebc40a499a59116e30e93bedfad271ccd94189b225c4f1a6b73cc27c624990
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Empty file just to make sure we produce a libc++experimental.a library even

// when there isn't anything in it.


=== system/lib/libcxx/src/experimental/log_hardening_failure.cpp ===
SHA256: acbc171dc65a1bbdc3deb4e3c81327a0298c825eb485825f279fbd2276fe7fac
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __BIONIC__

// Always log the message to `stderr` in case the platform-specific system calls fail.

// Show error in logcat. The latter two arguments are ignored on Android.


=== system/lib/libcxx/src/experimental/time_zone.cpp ===
SHA256: d0801502b49bcb3324c03fb6af455903f1ff981c40b1544d5de774a4b47cee2a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html

// TODO TZDB look at optimizations

//

// The current algorithm is correct but not efficient. For example, in a named

// rule based continuation finding the next rule does quite a bit of work,

// returns the next rule and "forgets" its state. This could be better.

//

// It would be possible to cache lookups. If a time for a zone is calculated its

// sys_info could be kept and the next lookup could test whether the time is in

// a "known" sys_info. The wording in the Standard hints at this slowness by

// "suggesting" this could be implemented on the user's side.

// TODO TZDB look at removing quirks

//

// The code has some special rules to adjust the timing at the continuation

// switches. This works correctly, but some of the places feel odd. It would be

// good to investigate this further and see whether all quirks are needed or

// that there are better fixes.

//

// These quirks often use a 12h interval; this is the scan interval of zdump,

// which implies there are no sys_info objects with a duration of less than 12h.

// Work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120502

// TODO(LLVM 23): When upgrading to GCC 16 this can be removed

// TODO TZDB remove debug printing

//===----------------------------------------------------------------------===//

//                           Details

//===----------------------------------------------------------------------===//

// Can the returned sys_info object be merged with

// Return type for helper function to get a sys_info.

// - The expected result returns the "best" sys_info object. This object can be

//   before the requested time. Sometimes sys_info objects from different

//   continuations share their offset, save, and abbrev and these objects are

//   merged to one sys_info object. The __can_merge flag determines whether the

//   current result can be merged with the next result.

// - The unexpected result means no sys_info object was found and the time is

//   the time to be used for the next search iteration.

// When the value does not match the predicate it's equal and a valid result

// was found.

// Format based on https://data.iana.org/time-zones/tz-how-to.html

//

// 1  a time zone abbreviation that is a string of three or more characters that

//    are either ASCII alphanumerics, "+", or "-"

// 2  the string "%z", in which case the "%z" will be replaced by a numeric time

//    zone abbreviation

// 3  a pair of time zone abbreviations separated by a slash ('/'), in which

//    case the first string is the abbreviation for the standard time name and

//    the second string is the abbreviation for the daylight saving time name

// 4  a string containing "%s", in which case the "%s" will be replaced by the

//    text in the appropriate Rule's LETTER column, and the resulting string

//    should be a time zone abbreviation

//

// Rule 1 is not strictly validated since America/Barbados uses a two letter

// abbreviation AT.

// For a named rule based continuation the SAVE depends on the RULE

// active at the end. This should be determined separately.

// Does UNTIL contain the magic value for the last continuation?

// Holds the UNTIL time for a continuation with a named rule.

//

// Unlike continuations with an fixed SAVE named rules have a variable SAVE.

// This means when the UNTIL uses the local wall time the actual UNTIL value can

// only be determined when the SAVE is known. This class holds that abstraction.

// The last continuation of a ZONE has no UNTIL which basically is

// until the end of _local_ time. This value is expressed by

// sys_seconds::max(). Subtracting the SAVE leaves large value.

// However SAVE can be negative, which would add a value to maximum

// leading to undefined behaviour. In practice this often results in

// an overflow to a very small value.

// Gives the unadjusted until value, this is useful when the SAVE is not known

// at all.

// Returns the UNTIL adjusted for SAVE.

// Local time and standard time behave the same. This is not

// correct. Local time needs to adjust for the current saved time.

// To know the saved time the rules need to be known and sorted.

// This needs a time so to avoid the chicken and egg adjust the

// saving of the local time later.

// Returns the letters field for a time before the first rule.

//

// Per https://data.iana.org/time-zones/tz-how-to.html

// One wrinkle, not fully explained in zic.8.txt, is what happens when switching

// to a named rule. To what values should the SAVE and LETTER data be

// initialized?

//

// 1 If at least one transition has happened, use the SAVE and LETTER data from

//   the most recent.

// 2 If switching to a named rule before any transition has happened, assume

//   standard time (SAVE zero), and use the LETTER data from the earliest

//   transition with a SAVE of zero.

//

// This function implements case 2.

//

//

//

// Determines the information based on the continuation and the rules.

//

// There are several special cases to take into account

//

// === Entries before the first rule becomes active ===

// Asia/Hong_Kong

//   9 - JST 1945 N 18 2        // (1)

//   8 HK HK%sT                 // (2)

//   R HK 1946 o - Ap 21 0 1 S  // (3)

// There (1) is active until Novemer 18th 1945 at 02:00, after this time

// (2) becomes active. The first rule entry for HK (3) becomes active

// from April 21st 1945 at 01:00. In the period between (2) is active.

// This entry has an offset.

// This entry has no save, letters, or dst flag. So in the period

// after (1) and until (3) no rule entry is associated with the time.

// Returns the sys_info object for a time before the first rule.

// When this first rule has a SAVE of 0s the sys_info for the time before the

// first rule and for the first rule are identical and will be merged.

// The end used when SAVE != 0s

// The end used when SAVE == 0s the times are merged

// Returns the first rule after __time.

// Note that a rule can be "active" in multiple years, this may result in an

// infinite loop where the same rule is returned every time, use __current to

// guard against that.

//

// When no next rule exists the returned time will be sys_seconds::max(). This

// can happen in practice. For example,

//

//   R So 1945 o - May 24 2 2 M

//   R So 1945 o - S 24 3 1 S

//   R So 1945 o - N 18 2s 0 -

//

// Has 3 rules that are all only active in 1945.

// Note it would probably be better to store the pairs in a vector and then

// use min() to get the smallest element

// Note this evaluates all rules which is a waste of effort; when the entries

// are beyond the current year's "next year" (where "next year" is not always

// year + 1) the algorithm should end.

// Adding the current entry for the current year may lead to infinite

// loops due to the SAVE adjustment. Skip these entries.

// When no rule is selected the time before the first rule and the first rule

// should not be merged.

// There can be two constitutive rules that are the same. For example,

// Hong Kong

//

// R HK 1973 o - D 30 3:30 1 S          (R1)

// R HK 1965 1976 - Ap Su>=16 3:30 1 S  (R2)

//

// 1973-12-29 19:30:00 R1 becomes active.

// 1974-04-20 18:30:00 R2 becomes active.

// Both rules have a SAVE of 1 hour and LETTERS are S for both of them.

// Returns the first rule of a set of rules.

// This is not always the first of the listed rules. For example

//   R Sa 2008 2009 - Mar Su>=8 0 0 -

//   R Sa 2007 2008 - O Su>=8 0 1 -

// The transition in October 2007 happens before the transition in March 2008.

// Avoid selecting a time before the start of the continuation

// The time sought is very likely inside the current rule.

// When the continuation's UNTIL uses the local clock there are edge cases

// where this is not true.

//

// Start to walk the rules to find the proper one.

//

// For now we just walk all the rules TODO TZDB investigate whether a smarter

// algorithm would work.

// Ignore small steps, this happens with America/Punta_Arenas for the

// transition

// -4:42:46 - SMT 1927 S

// -5 x -05/-04 1932 S

// ...

//

// R x 1927 1931 - S 1 0 1 -

// R x 1928 1932 - Ap 1 0 0 -

//

// America/Punta_Arenas  Thu Sep  1 04:42:45 1927 UT = Thu Sep  1 00:42:45 1927 -04 isdst=1 gmtoff=-14400

// America/Punta_Arenas  Sun Apr  1 03:59:59 1928 UT = Sat Mar 31 23:59:59 1928 -04 isdst=1 gmtoff=-14400

// America/Punta_Arenas  Sun Apr  1 04:00:00 1928 UT = Sat Mar 31 23:00:00 1928 -05 isdst=0 gmtoff=-18000

//

// Without this there will be a transition

//   [1927-09-01 04:42:45, 1927-09-01 05:00:00) -05:00:00 0min -05

// Europe/Berlin

// 1 c CE%sT 1945 May 24 2          (C1)

// 1 So CE%sT 1946                  (C2)

//

// R c 1944 1945 - Ap M>=1 2s 1 S   (R1)

//

// R So 1945 o - May 24 2 2 M       (R2)

//

// When C2 becomes active the time would be before the first rule R2,

// giving a 1 hour sys_info.

// See above for America/Asuncion

// another fix for America/Punta_Arenas when not at the start of the

// sys_info object.

// Z America/Argentina/Buenos_Aires -3:53:48 - LMT 1894 O 31

// -4:16:48 - CMT 1920 May

// -4 - -04 1930 D

// -4 A -04/-03 1969 O 5

// -3 A -03/-02 1999 O 3

// -4 A -04/-03 2000 Mar 3

// ...

//

// ...

// R A 1989 1992 - O Su>=15 0 1 -

// R A 1999 o - O Su>=1 0 1 -

// R A 2000 o - Mar 3 0 0 -

// R A 2007 o - D 30 0 1 -

// ...

// The 1999 switch uses the same rule, but with a different stdoff.

//   R A 1999 o - O Su>=1 0 1 -

//     stdoff -3 -> 1999-10-03 03:00:00

//     stdoff -4 -> 1999-10-03 04:00:00

// This generates an invalid entry and this is evaluated as a transition.

// Looking at the zdump like output in libc++ this generates jumps in

// the UTC time.

// The transition from one continuation to the next continuation may result in

// two constitutive continuations with the same "offset" information.

// [time.zone.info.sys]/3

//   The begin and end data members indicate that, for the associated time_zone

//   and time_point, the offset and abbrev are in effect in the range

//   [begin, end). This information can be used to efficiently iterate the

//   transitions of a time_zone.

//

// Note that this does considers a change in the SAVE field not to be a

// different sys_info, zdump does consider this different.

//   LWG XXXX The sys_info range should be affected by save

// matches the behaviour of the Standard and zdump.

//

// Iff the "offsets" are the same '__current.__end' is replaced with

// '__next.__end', which effectively merges the two objects in one object. The

// function returns true if a merge occurred.

//===----------------------------------------------------------------------===//

//                           Public API

//===----------------------------------------------------------------------===//

// true iff __result.has_value() is true and

// __result.begin <= __time < __result.end is true.

// Iterates over the Zone entry and its continuations. Internally the Zone

// entry is split in a Zone information and the first continuation. The last

// continuation has no UNTIL field. This means the loop should always find a

// continuation.

//

// For more information on background of zone information please consult the

// following information

//   [zic manual](https://www.man7.org/linux/man-pages/man8/zic.8.html)

//   [tz source info](https://data.iana.org/time-zones/tz-how-to.html)

//   On POSIX systems the zdump tool can be useful:

//     zdump -v Asia/Hong_Kong

//   Gives all transitions in the Hong Kong time zone.

//

// During iteration the result for the current continuation is returned. If

// no continuation is applicable it will return the end time as "error". When

// two continuations are contiguous and contain the "same" information these

// ranges are merged as one range.

// The merging requires keeping any result that occurs before __time,

// likewise when a valid result is found the algorithm needs to test the next

// continuation to see whether it can be merged. For example, Africa/Ceuta

// Continuations

//  0 s WE%sT 1929                   (C1)

//  0 - WET 1967                     (C2)

//  0 Sp WE%sT 1984 Mar 16           (C3)

//

// Rules

//  R s 1926 1929 - O Sa>=1 24s 0 -  (R1)

//

//  R Sp 1967 o - Jun 3 12 1 S       (R2)

//

// The rule R1 is the last rule used in C1. The rule R2 is the first rule in

// C3. Since R2 is the first rule this means when a continuation uses this

// rule its value prior to R2 will be SAVE 0 LETTERS of the first entry with a

// SAVE of 0, in this case WET.

// This gives the following changes in the information.

//   1928-10-07 00:00:00 C1 R1 becomes active: offset 0 save 0 abbrev WET

//   1929-01-01 00:00:00 C2    becomes active: offset 0 save 0 abbrev WET

//   1967-01-01 00:00:00 C3    becomes active: offset 0 save 0 abbrev WET

//   1967-06-03 12:00:00 C3 R2 becomes active: offset 0 save 1 abbrev WEST

//

// The first 3 entries are contiguous and contain the same information, this

// means the period [1928-10-07 00:00:00, 1967-06-03 12:00:00) should be

// returned in one sys_info object.

// Filters out dummy entries

// Z America/Argentina/Buenos_Aires -3:53:48 - LMT 1894 O 31

// ...

// -4 A -04/-03 2000 Mar 3 (C1)

// -3 A -03/-02            (C2)

//

// ...

// R A 2000 o - Mar 3 0 0 -

// R A 2007 o - D 30 0 1 -

// ...

//

// This results in an entry

//   [2000-03-03 03:00:00, 2000-03-03 04:00:00) -10800s 60min -03

// for [C1 & R1, C1, R2) which due to the end of the continuation is an

// one hour "sys_info". Instead the entry should be ignored and replaced

// by [C2 & R1, C2 & R2) which is the proper range

//   "[2000-03-03 03:00:00, 2007-12-30 03:00:00) -02:00:00 60min -02

// First entry found, always keep it.

// The results are merged, update the result state. This may

// "overwrite" a valid sys_info object with another valid sys_info

// object.

// Here things get interesting:

// For example, America/Argentina/San_Luis

//

//   -3 A -03/-02 2008 Ja 21           (C1)

//   -4 Sa -04/-03 2009 O 11           (C2)

//

//   R A 2007 o - D 30 0 1 -           (R1)

//

//   R Sa 2007 2008 - O Su>=8 0 1 -    (R2)

//

// Based on C1 & R1 the end time of C1 is 2008-01-21 03:00:00

// Based on C2 & R2 the end time of C1 is 2008-01-21 02:00:00

// In this case the earlier time is the real time of the transition.

// However the algorithm used gives 2008-01-21 03:00:00.

//

// So we need to calculate the previous UNTIL in the current context and

// see whether it's earlier.

// The results could not be merged.

// - When we have a valid result that result is the final result.

// - Otherwise the result we had is before __time and the result we got

//   is at a later time (possibly valid). This result is always better

//   than the previous result.

// Europe/Berlin

// 1 c CE%sT 1945 May 24 2          (C1)

// 1 So CE%sT 1946                  (C2)

//

// R c 1944 1945 - Ap M>=1 2s 1 S   (R1)

//

// R So 1945 o - May 24 2 2 M       (R2)

//

// When C2 becomes active the time would be before the first rule R2,

// giving a 1 hour sys_info. This is not valid and the results need

// merging.

// When the UTC gap between the rules is due to the change of

// offsets adjust the new time to remove the gap.

// Is the "__local_time" present in "__first" and "__second". If so the

// local_info has an ambiguous result.

// Determines the result of the "__local_time". This expects the object

// "__first" to be earlier in time than "__second".

// |--------|

//        |------|

//         ^

// |--------|

//          |------|

//         ^

// |--------|

//             |------|

//           ^

// |--------|

//          |------|

//           ^

/* An example of a typical year with a DST switch displayed in local time.
   *
   * At the first of April the time goes forward one hour. This means the
   * time marked with ~~ is not a valid local time. This is represented by the
   * nonexistent value in local_info.result.
   *
   * At the first of November the time goes backward one hour. This means the
   * time marked with ^^ happens twice. This is represented by the ambiguous
   * value in local_info.result.
   *
   * 2020.11.01                  2021.04.01              2021.11.01
   * offset +05                  offset +05              offset +05
   * save    0s                  save    1h              save    0s
   * |------------//----------|
   *                             |---------//--------------|
   *                                                    |-------------
   *                           ~~                        ^^
   *
   * These shifts can happen due to changes in the current time zone for a
   * location. For example, Indian/Kerguelen switched only once. In 1950 from an
   * offset of 0 hours to an offset of +05 hours.
   *
   * During all these shifts the UTC time will not have gaps.
   */

// The code needs to determine the system time for the local time. There is no

// information available. Assume the offset between system time and local time

// is 0s. This gives an initial estimate.

// At this point the offset can be used to determine an estimate for the local

// time. Before doing that, determine the offset and validate whether the

// local time is the range [chrono::local_seconds::min(),

// chrono::local_seconds::max()).

// Based on the information found in the sys_info, the local time can be

// converted to a system time. This resulting time can be in the following

// locations of the sys_info:

//

//                             |---------//--------------|

//                           1   2.1      2.2         2.3  3

//

// 1. The estimate is before the returned sys_info object.

//    The result is either non-existent or unique in the previous sys_info.

// 2. The estimate is in the sys_info object

//    - If the sys_info begin is not sys_seconds::min(), then it might be at

//      2.1 and could be ambiguous with the previous or unique.

//    - If sys_info end is not sys_seconds::max(), then it might be at 2.3

//      and could be ambiguous with the next or unique.

//    - Else it is at 2.2 and always unique. This case happens when a

//      time zone has no transitions. For example, UTC or GMT+1.

// 3. The estimate is after the returned sys_info object.

//    The result is either non-existent or unique in the next sys_info.

//

// There is no specification where the "middle" starts. Similar issues can

// happen when sys_info objects are "short", then "unique in the next" could

// become "ambiguous in the next and the one following". Theoretically there

// is the option of the following time-line

//

// |------------|

//           |----|

//       |-----------------|

//

// However the local_info object only has 2 sys_info objects, so this option

// is not tested.

// Case 1 before __info

// Case 3 after __info

// Case 2 in __info

// Case 2.1 Not at the beginning, when not ambiguous the result should test

// case 2.3.

// At the end so it's case 2.2

// This tests case 2.2 or case 2.3.

// namespace chrono


=== system/lib/libcxx/src/experimental/tzdb.cpp ===
SHA256: 996fa4a5920f18c1ba1b1f3f8d494ef28c96d5f89b6203df8acdf531f9372d6c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html

// Contains a parser for the IANA time zone data files.

//

// These files can be found at https://data.iana.org/time-zones/ and are in the

// public domain. Information regarding the input can be found at

// https://data.iana.org/time-zones/tz-how-to.html and

// https://man7.org/linux/man-pages/man8/zic.8.html.

//

// As indicated at https://howardhinnant.github.io/date/tz.html#Installation

// For Windows another file seems to be required

// https://raw.githubusercontent.com/unicode-org/cldr/master/common/supplemental/windowsZones.xml

// This file seems to contain the mapping of Windows time zone name to IANA

// time zone names.

//

// However this article mentions another way to do the mapping on Windows

// https://devblogs.microsoft.com/oldnewthing/20210527-00/?p=105255

// This requires Windows 10 Version 1903, which was released in May of 2019

// and considered end of life in December 2020

// https://learn.microsoft.com/en-us/lifecycle/announcements/windows-10-1903-end-of-servicing

//

// TODO TZDB Implement the Windows mapping in tzdb::current_zone

// This function is weak so it can be overriden in the tests. The

// declaration is in the test header test/support/test_tzdb.h

//===----------------------------------------------------------------------===//

//                           Details

//===----------------------------------------------------------------------===//

// In order to avoid possible overflows we limit the accepted range.

// Most values parsed are expected to be very small:

// - 8784 hours in a year

// - 31 days in a month

// - year no real maximum, these values are expected to be less than

//   the range of the year type.

//

// However the leapseconds use a seconds after epoch value. Using an

// int would run into an overflow in 2038. By using a 64-bit value

// the range is large enough for the bilions of years. Limiting that

// range slightly to make the code easier is not an issue.

//===----------------------------------------------------------------------===//

//                          Calendar

//===----------------------------------------------------------------------===//

// TZDB allows the shortest unique name.

// TZDB allows the shortest unique name.

// The m is minimum, even when that is ambiguous.

//===----------------------------------------------------------------------===//

//                        TZDB fields

//===----------------------------------------------------------------------===//

// Negative is either a negative value or a single -.

// The latter means 0 and the parsing is complete.

// Truncate the digits.

// case sensitive

// case sensitive

// Canonicalize "-" to "" since they are equivalent in the specification.

// A single -  is not a SAVE but a special case.

// Note STDOFF is specified as

//   This field has the same format as the AT and SAVE fields of rule lines;

// These fields have different suffix letters, these letters seem

// not to be used so do not allow any of them.

//===----------------------------------------------------------------------===//

//                   Time Zone Database entries

//===----------------------------------------------------------------------===//

// The first line in tzdata.zi contains

//    # version YYYYw

// The parser expects this pattern

// #\s*version\s*\(.*)

// This part is not documented.

// Typically rules are in contiguous order in the database.

// But there are exceptions, some rules are interleaved.

// The first line must be valid, continuations are optional.

// The file stores dates since 1 January 1900, 00:00:00, we want

// seconds since 1 January 1970.

// The Standard requires the leap seconds to be sorted. The file

// leap-seconds.list usually provides them in sorted order, but that is not

// guaranteed so we ensure it here.

// The database should contain the number of seconds inserted by a leap

// second (1 or -1). So the difference between the two elements is stored.

// std::ranges::views::adjacent has not been implemented yet.

// There are two files with the leap second information

// - leapseconds as specified by zic

// - leap-seconds.list the source data

// The latter is much easier to parse, it seems Howard shares that

// opinion.

// TODO TZDB Implement this on Windows.

// ifdef _WIN32

// The path may be a relative path, in that case convert it to an absolute

// path based on the proper initial directory.

// On POSIX systems there are several ways to configure the time zone.

// In order of priority they are:

// - TZ environment variable

//   https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08

//   The documentation is unclear whether or not it's allowed to

//   change time zone information. For example the TZ string

//     MST7MDT

//   this is an entry in tzdata.zi. The value

//     MST

//   is also an entry. Is it allowed to use the following?

//     MST-3

//   Even when this is valid there is no time_zone record in the

//   database. Since the library would need to return a valid pointer,

//   this means the library needs to allocate and leak a pointer.

//

// - The time zone name is the target of the symlink /etc/localtime

//   relative to /usr/share/zoneinfo/

//

// - The file /etc/timezone. This text file contains the name of the time

//   zone.

//

// On Linux systems it seems /etc/timezone is deprecated and being phased out.

// This file is used when /etc/localtime does not exist, or when it exists but

// is not a symlink. For more information and links see

// https://github.com/llvm/llvm-project/issues/105634

// Ignore invalid names in the environment.

// ifdef _WIN32

//===----------------------------------------------------------------------===//

//                           Public API

//===----------------------------------------------------------------------===//

// namespace chrono


=== system/lib/libcxx/src/experimental/tzdb_list.cpp ===
SHA256: 46c4f7694e46cdf787ebd19951e9fc37d2592403266624195bfb418c14d36abb
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// For information see https://libcxx.llvm.org/DesignDocs/TimeZone.html

// namespace chrono


=== system/lib/libcxx/src/filesystem/directory_entry.cpp ===
SHA256: 31d078ca4c1aa52cb2b7e62697db01658cd2d8273985930f898bfb71608f7194
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// we have a symlink

// Get the information about the linked entity.

// Ignore errors from stat, since we don't want errors regarding symlink

// resolution to be reported to the user.

// If we failed to resolve the link, then only partially populate the

// cache.

// Otherwise, we resolved the link, potentially as not existing.

// That's OK.

// Attempt to extract the mtime, and fail if it's not representable using

// file_time_type. For now we ignore the error, as we'll report it when

// the value is actually used.


=== system/lib/libcxx/src/filesystem/directory_iterator.cpp ===
SHA256: 1c1db855e0ac6081eedac45f924e4950a919f9346cfc58428f2fea07b8dcc8f7
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// for DIR & friends

// directory_iterator

// recursive_directory_iterator


=== system/lib/libcxx/src/filesystem/error.h ===
SHA256: b9fb4dfb352150c8fdd2744154402b350d4b793cb885c3cc2b5770dfebacce98
//===----------------------------------------------------------------------===////

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===////

// __libcpp_unreachable

// ERROR_* macros

// On windows, libc functions use errno, but system functions use GetLastError.

// So, callers need to be careful which of these next functions they call!

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// namespace detail

// FILESYSTEM_ERROR_H


=== system/lib/libcxx/src/filesystem/file_descriptor.h ===
SHA256: 6d6aca69879eb18ae93a6b3fced823c8184fab0c031ebfe0bb887bd33491fd59
//===----------------------------------------------------------------------===////

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===////

// for DIR & friends

// values for fchmodat

// defined(_LIBCPP_WIN32API)

// Unlike in lstat, hitting "unknown" here simply means that the underlying

// filesystem doesn't support d_type. Report is as 'none' so we correctly

// set the cache to empty.

// defined(DT_BLK)

// zero errno in order to detect errors

// _LIBCPP_WIN32API

// Read-only

// Write

// !_LIBCPP_WIN32API

//                       POSIX HELPERS

// TODO: most of the filesystem implementation uses native Win32 calls

// (mostly via posix_compat.h). However, here we use the C-runtime APIs to

// open a file, because we subsequently pass the C-runtime fd to

// `std::[io]fstream::__open(int fd)` in order to implement copy_file.

//

// Because we're calling the windows C-runtime, win32 error codes are

// translated into C error numbers by the C runtime, and returned in errno,

// rather than being accessible directly via GetLastError.

//

// Ideally copy_file should be calling the Win32 CopyFile2 function, which

// works on paths, not open files -- at which point this FileDescriptor type

// will no longer be needed on windows at all.

// FIXME: shouldn't this return an error_code?

// else

// http://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html

// FD must be open and good.

// namespace detail

// FILESYSTEM_FILE_DESCRIPTOR_H


=== system/lib/libcxx/src/filesystem/filesystem_clock.cpp ===
SHA256: 2847265a6e1a72fbc6539e7d10bc96e9f5eda5b41ef33657e43182a08352ca4c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _POSIX_TIMERS

// for gettimeofday and timeval


=== system/lib/libcxx/src/filesystem/filesystem_error.cpp ===
SHA256: bc19bb7cb03024ede499a24d4635f25ae2baebd8aa009d9e65eeef14c2aa1411
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/libcxx/src/filesystem/format_string.h ===
SHA256: f4162385c962d5d56c1bd414dcbb21457a23bf90bdd88f8c8da5349b78704eb1
//===----------------------------------------------------------------------===////

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===////

// we did not provide a long enough buffer on our first attempt. The

// return value is the number of bytes (excluding the null byte) that are

// needed for formatting.

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// namespace detail

// FILESYSTEM_FORMAT_STRING_H


=== system/lib/libcxx/src/filesystem/int128_builtins.cpp ===
SHA256: 2fa7207d96aae2975ac36c68d9c6c745f35cb0178e4d248cc0c0e9fff2bd86bf
/*===-- int128_builtins.cpp - Implement __muloti4 --------------------------===
 *
 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 * See https://llvm.org/LICENSE.txt for license information.
 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 *
 * ===----------------------------------------------------------------------===
 *
 * This file implements __muloti4, and is stolen from the compiler_rt library.
 *
 * FIXME: we steal and re-compile it into filesystem, which uses __int128_t,
 * and requires this builtin when sanitized. See llvm.org/PR30643
 *
 * ===----------------------------------------------------------------------===
 */


=== system/lib/libcxx/src/filesystem/operations.cpp ===
SHA256: abf614b854f372a656ef87727c05c6ac784baeb1825684b3bdbb812862a6e22d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/* values for fchmodat */

// since Linux 4.5 and FreeBSD 13, but the Linux libc wrapper is only provided by glibc >= 2.27 and musl

// sendfile and copy_file_range need to fall back

// to the fstream implementation for special files

// do nothing

// do nothing

// create directory to with attributes from 'from'.

// This assumes that __open didn't reset the error code.

// a zero-length file is either empty, or not copyable by this syscall

// return early to avoid the syscall cost

// do not modify the fd positions as copy_file_impl_sendfile may be called after a partial copy

// a zero-length file is either empty, or not copyable by this syscall

// return early to avoid the syscall cost

// however, we can't afford this luxury in the no-locale build,

// as we can't utilize the fstream impl to copy empty files

// If we have copy_file_range or sendfile, try both in succession (if available).

// If both fail, fall back to using fstream.

// EINVAL: src and dst are the same file (this is not cheaply

// detectable from userspace)

// EINVAL: copy_file_range is unsupported for this file type by the

// underlying filesystem

// ENOTSUP: undocumented, can arise with old kernels and NFS

// EOPNOTSUPP: filesystem does not implement copy_file_range

// ETXTBSY: src or dst is an active swapfile (nonsensical, but allowed

// with normal copying)

// EXDEV: src and dst are on different filesystems that do not support

// cross-fs copy_file_range

// ENOENT: undocumented, can arise with CIFS

// ENOSYS: unsupported by kernel or blocked by seccomp

// EINVAL: unsupported file type

// since iostreams are unavailable in the no-locale build, just fail after a failed sendfile

// copy_file_impl implementation

// end anonymous namespace

// namespace detail

// Don't truncate right away. We may not be opening the file we originally

// looked at; we'll check this later.

// Check that the file we initially stat'ed is equivalent to the one

// we opened.

// FIXME: report this better.

// Set the permissions and truncate the file we opened.

// FIXME: Remove the dest file if we failed, and it didn't exist previously.

// Common extension outside of POSIX getcwd() spec, without needing to

// preallocate a buffer. Also supported by a number of other POSIX libcs.

// Note: POSIX mandates that modifying `errno` is thread-safe.

// `pathconf` returns `-1` without an error to indicate no limit.

// Preallocated buffer, don't free the buffer in the second unique_ptr

// below.

// is_regular_file(p) == true

// This implementation has a race condition between determining the

// last access time and attempting to set it to the same value using

// ::utimes

// TODO(hardening): double-check this assertion -- it might be a valid (if rare) case when the permissions are

// unknown.

// Note that `ret` returning `0` would work, resulting in a valid empty string being returned.

// We currently have two implementations of `__remove_all`. The first one is general and

// used on platforms where we don't have access to the `openat()` family of POSIX functions.

// That implementation uses `directory_iterator`, however it is vulnerable to some race

// conditions, see https://reviews.llvm.org/D118134 for details.

//

// The second implementation is used on platforms where `openat()` & friends are available,

// and it threads file descriptors through recursive calls to avoid such race conditions.

// namespace

// !REMOVE_ALL_USE_DIRECTORY_ITERATOR

// First, try to open the path as a directory.

// If that worked, iterate over the contents of the directory and

// remove everything in it, recursively.

// Note: `::closedir` will also close the associated file descriptor, so

// there should be no call to `close(fd)`.

// we're done iterating through the directory

// Then, remove the now-empty directory itself.

// the contents of the directory + the directory itself

// If we failed to open `p` because it didn't exist, it's not an

// error -- it might have moved or have been deleted already.

// If opening `p` failed because it wasn't a directory, remove it as

// a normal file instead. Note that `openat()` can return either ENOTDIR

// or ELOOP depending on the exact reason of the failure. On FreeBSD it

// may return EMLINK instead of ELOOP, contradicting POSIX.

/* flags = */

// Otherwise, it's a real error -- we don't remove anything.

// namespace

// REMOVE_ALL_USE_DIRECTORY_ITERATOR

// Multiply with overflow checking.

// GetTempPathW returns a path with a trailing slash, which we

// shouldn't include for consistency.


=== system/lib/libcxx/src/filesystem/path.cpp ===
SHA256: e6f13a0b5a2925da2a720d0017927a7989cb3ed2f8a1a7a2796fc8c8560a4131
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

///////////////////////////////////////////////////////////////////////////////

//                            path definitions

///////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////

// path.decompose

// Determine if we have a root path but not a relative path. In that case

// return *this.

// Otherwise remove a single element from the end of the path, and return

// a string representing that path

////////////////////////////////////////////////////////////////////////////

// path.gen

// Guess as to how many elements the path has to avoid reallocating.

// Track the total size of the parts as we collect them. This allows the

// resulting path to reserve the correct amount of memory.

// Build a stack containing the remaining elements of the path, popping off

// elements which occur before a '..' entry.

// Add all non-dot and non-dot-dot elements to the stack of elements.

// Only push a ".." element if there are no elements preceding the "..",

// or if the preceding element is itself "..".

// [fs.path.generic]p6.8: If the path is empty, add a dot.

// [fs.path.generic]p6.7: If the last filename is dot-dot, remove any

// trailing directory-separator.

// perform root-name/root-directory mismatch checks

// Find the first mismatching element

// If there is no mismatch, return ".".

// Otherwise, determine the number of elements, 'n', which are not dot or

// dot-dot minus the number of dot-dot elements.

// if n == 0 and (a == end() || a->empty()), returns path("."); otherwise

// return a path constructed with 'n' dot-dot elements, followed by the

// elements of '*this' after the mismatch.

// FIXME: Reserve enough room in Result that it won't have to re-allocate.

////////////////////////////////////////////////////////////////////////////

// path.comparisons

////////////////////////////////////////////////////////////////////////////

// path.nonmembers

////////////////////////////////////////////////////////////////////////////

// path.itr

////////////////////////////////////////////////////////////////////////////

// Windows path conversions


=== system/lib/libcxx/src/filesystem/path_parser.h ===
SHA256: 78d878551d487d40ba91dd931efafd25ceab1bd41ad6a7c26cd62f5d8048fe8e
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Zero is a special sentinel value used by default constructed iterators.

// S cannot be '0' or PS_BeforeBegin.

// we're decrementing the begin

// Try to consume a trailing separator or root directory first.

/// \brief Return a view with the "preferred representation" of the current

///   element. For example trailing separators are represented as a '.'

/// \brief Return a pointer to the first character after the currently

///   lexed element.

/// \brief Return a pointer to the first character in the currently lexed

///   element.

// Consume all consecutive separators.

// Consume exactly N separators, or return nullptr.

// Iterating backwards and consumed all the rest of the input.

// Check if the start of the string would have been considered

// a root name.

// namespace parser

// PATH_PARSER_H


=== system/lib/libcxx/src/filesystem/posix_compat.h ===
SHA256: 98d04aa7bbaad33100e4a44905e6d8dd8233d21055c7e854c78a262230d09ba8
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// POSIX-like portability helper functions.

//

// These generally behave like the proper posix functions, with these

// exceptions:

// - On Windows, they take paths in wchar_t* form, instead of char* form.

// - The symlink() function is split into two frontends, symlink_file()

//   and symlink_dir().

// - Errors should be retrieved with get_last_error, not errno.

//

// These are provided within an anonymous namespace within the detail

// namespace - callers need to include this header and call them as

// detail::function(), regardless of platform.

//

// This struct isn't defined in the normal Windows SDK, but only in the

// Windows Driver Kit.

// Various C runtime header sets provide more or less of these. As we

// provide our own implementation, undef all potential defines from the

// C runtime headers and provide a complete set of macros of our own.

// Read-only

// Write

// Only expected to be used with us allocating the buffer.

// Only expected to be used with us allocating the buffer.

// \\?\X: -> X:

// \\?\UNC\server -> \\server

/*fd*/

// If the file is a symlink, and we are supposed to operate on the target

// of the symlink, we need to open a handle to it, without the

// FILE_FLAG_OPEN_REPARSE_POINT flag, to open the destination of the

// symlink, and operate on it via the handle.

// For a non-symlink, or if operating on the symlink itself instead of

// its target, we can use SetFileAttributesW, saving a few calls.

// name_offset/length are expressed in bytes, not in wchar_t

// namespace detail

// POSIX_COMPAT_H


=== system/lib/libcxx/src/filesystem/time_utils.h ===
SHA256: b264875005a9a897e6b547d579959e7c9e808528dc3841efd9ffaaf488a4bf0d
//===----------------------------------------------------------------------===////

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===////

// for ::utimes as used in __last_write_time

// We can use the presence of UTIME_OMIT to detect platforms that provide utimensat.

// Various C runtime versions (UCRT, or the legacy msvcrt.dll used by

// some mingw toolchains) provide different stat function implementations,

// with a number of limitations with respect to what we want from the

// stat function. Instead provide our own which does exactly what we want,

// along with our own stat structure and flag macros.

// FILE_ID_INFO::VolumeSerialNumber

// FILE_ID_INFO::FileId

// There were 369 years and 89 leap days from the Windows epoch

// (1601) to the Unix epoch (1970).

// Static assert that these values properly round trip.

// This kinda sucks, but it's what happens when we don't have __int128_t.

// tm.tv_sec < 0

// The tv_nsec and tv_usec fields must not be negative so adjust accordingly

// !_LIBCPP_WIN32API

// _LIBCPP_HAS_FILESYSTEM

// namespace detail

// FILESYSTEM_TIME_UTILS_H


=== system/lib/libcxx/src/fstream.cpp ===
SHA256: a11eda3d54d0ac6a53c622b1164e1ff1b5369c9aa786bd54e6762082022259fb
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Confirm that `HANDLE` is `void*` as implemented in `basic_filebuf`

// https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/get-osfhandle?view=msvc-170


=== system/lib/libcxx/src/functional.cpp ===
SHA256: 2b283558da7d4e2e32db8fb3fef9e0c20ad259182cc72561cf318f9d6557b5d8
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/libcxx/src/future.cpp ===
SHA256: 67ed09a7a89fb5f9581607380ac8f892481e323c0288c0a8662eac493867c494
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// For backwards compatibility with C++11 (LWG 2056)

// _LIBCPP_HAS_EXCEPTIONS


=== system/lib/libcxx/src/hash.cpp ===
SHA256: 1d5dd63a8ed59a79f945a8b3be6361819bd7ab0b6873a5d4c145ef2e19a58cdc
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// handle all next_prime(i) for i in [1, 210), special case 0

// potential primes = 210*k + indices[i], k >= 1

//   these numbers are not divisible by 2, 3, 5 or 7

//   (or any integer 2 <= j <= 10 for that matter).

// namespace

// Returns:  If n == 0, returns 0.  Else returns the lowest prime number that

// is greater than or equal to n.

//

// The algorithm creates a list of small primes, plus an open-ended list of

// potential primes.  All prime numbers are potential prime numbers.  However

// some potential prime numbers are not prime.  In an ideal world, all potential

// prime numbers would be prime.  Candidate prime numbers are chosen as the next

// highest potential prime.  Then this number is tested for prime by dividing it

// by all potential prime numbers less than the sqrt of the candidate.

//

// This implementation defines potential primes as those numbers not divisible

// by 2, 3, 5, and 7.  Other (common) implementations define potential primes

// as those not divisible by 2.  A few other implementations define potential

// primes as those not divisible by 2 or 3.  By raising the number of small

// primes which the potential prime is not divisible by, the set of potential

// primes more closely approximates the set of prime numbers.  And thus there

// are fewer potential primes to search, and fewer potential primes to divide

// against.

// If n is small enough, search in small_primes

// Else n > largest small_primes

// Check for overflow

// Start searching list of potential primes: L * k0 + indices[in]

// Select first potential prime >= n

//   Known a-priori n >= L

// Divide n by all primes or potential primes (i) until:

//    1.  The division is even, so try next potential prime.

//    2.  The i > sqrt(n), in which case n is prime.

// It is known a-priori that n is not divisible by 2, 3, 5 or 7,

//    so don't test those (j == 5 ->  divide by 11 first).  And the

//    potential primes start with 211, so don't test against the last

//    small prime.

// n wasn't divisible by small primes, try potential primes

// This will loop i to the next "plane" of potential primes

// n is not prime.  Increment n to next potential prime.


=== system/lib/libcxx/src/include/apple_availability.h ===
SHA256: 5e4920e7d642b44c64c487c54e3ad71628cc5c59be5ab43043ba20c279ce6d97
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __ENVIRONMENT_.*_VERSION_MIN_REQUIRED__

// __APPLE__

// _LIBCPP_SRC_INCLUDE_APPLE_AVAILABILITY_H


=== system/lib/libcxx/src/include/atomic_support.h ===
SHA256: c01d71b5a8fe48773f3670166030284b1050413e22f24bf21bb8c64637036f9e
//===----------------------------------------------------------------------===////

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===////

// for __libcpp_relaxed_load

// _LIBCPP_HAS_THREADS

// _LIBCPP_HAS_THREADS

// namespace

// ATOMIC_SUPPORT_H


=== system/lib/libcxx/src/include/config_elast.h ===
SHA256: 066c960d0c2741d5bb164816d5583bf92a40dd6f690fa567e3cc8a7ebd4e269c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Note: _LIBCPP_ELAST needs to be defined only on platforms

// where strerror/strerror_r can't handle out-of-range errno values.

// No _LIBCPP_ELAST needed for LLVM libc

// No _LIBCPP_ELAST needed on NuttX

// No _LIBCPP_ELAST needed on Fuchsia

// No _LIBCPP_ELAST needed on WASI

// No _LIBCPP_ELAST needed on Emscripten

// No _LIBCPP_ELAST needed on Apple

// Warn here so that the person doing the libcxx port has an easier time:

// _LIBCPP_CONFIG_ELAST


=== system/lib/libcxx/src/include/from_chars_floating_point.h ===
SHA256: bde0bd08fe3c08e0839c0e0efac521caa308a661caca7cd4e6ac467ebff2534b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// These headers are in the shared LLVM-libc header library.

// Included for the _Floating_type_traits class

// Parses an infinity string.

// Valid strings are case insensitive and contain INF or INFINITY.

//

// - __first is the first argument to std::from_chars. When the string is invalid

//   this value is returned as ptr in the result.

// - __last is the last argument of std::from_chars.

// - __value is the value argument of std::from_chars,

// - __ptr is the current position is the input string. This is points beyond

//   the initial I character.

// - __negative whether a valid string represents -inf or +inf.

// At this point the result is valid and contains INF.

// When the remaining part contains INITY this will be consumed. Otherwise

// only INF is consumed. For example INFINITZ will consume INF and ignore

// INITZ.

//

//

//

//

//

// Parses a nan string.

// Valid strings are case insensitive and contain INF or INFINITY.

//

// - __first is the first argument to std::from_chars. When the string is invalid

//   this value is returned as ptr in the result.

// - __last is the last argument of std::from_chars.

// - __value is the value argument of std::from_chars,

// - __ptr is the current position is the input string. This is points beyond

//   the initial N character.

// - __negative whether a valid string represents -nan or +nan.

// At this point the result is valid and contains NAN. When the remaining

// part contains ( n-char-sequence_opt ) this will be consumed. Otherwise

// only NAN is consumed. For example NAN(abcd will consume NAN and ignore

// (abcd.

// Parses the hex constant part of the hexadecimal floating-point value.

// - input start of buffer given to from_chars

// - __n the number of elements in the buffer

// - __offset where to start parsing. The input can have an optional sign, the

//   offset starts after this sign.

// this means that __input[__offset] points to a second decimal point, ending the number.

// When the exponent is not present the result of the struct contains

// __offset, 0, false. This allows using the results unconditionally, the

// __present is important for the scientific notation, where the value is

// mandatory.

// an exponent always needs at least one digit.

//

// leading whitespace is not allowed.

// __result.error contains the errno value, 0 or ERANGE these are not interesting.

// If the number of characters parsed is 0 it means there was no number.

// the assumption of a valid exponent was not true, undo eating the exponent character.

// Here we do this operation as int64 to avoid overflow.

// C17 7.12.1/6

// The result underflows if the magnitude of the mathematical result is so

// small that the mathematical result cannot be represented, without

// extraordinary roundoff error, in an object of the specified type.237) If

// the result underflows, the function returns an implementation-defined

// value whose magnitude is no greater than the smallest normalized positive

// number in the specified type; if the integer expression math_errhandling

// & MATH_ERRNO is nonzero, whether errno acquires the value ERANGE is

// implementation-defined; if the integer expression math_errhandling &

// MATH_ERREXCEPT is nonzero, whether the "underflow" floating-point

// exception is raised is implementation-defined.

//

// LLVM-LIBC sets ERAGNE for subnormal values

//

// [charconv.from.chars]/1

//   ... If the parsed value is not in the range representable by the type of

//   value, value is unmodified and the member ec of the return value is

//   equal to errc::result_out_of_range. ...

//

// Undo the ERANGE for subnormal values.

// Implements from_chars for decimal floating-point values.

// __first forwarded from from_chars

// __last forwarded from from_chars

// __value forwarded from from_chars

// __fmt forwarded from from_chars

// __ptr the start of the buffer to parse. This is after the optional sign character.

// __negative should __value be set to a negative value?

//

// This function and __from_chars_floating_point_decimal are similar. However

// the similar parts are all in helper functions. So the amount of code

// duplication is minimal.

// Parses the hex constant part of the decimal float value.

// - input start of buffer given to from_chars

// - __n the number of elements in the buffer

// - __offset where to start parsing. The input can have an optional sign, the

//   offset starts after this sign.

// this means that __input[__offset] points to a second decimal point, ending the number.

// Implements from_chars for decimal floating-point values.

// __first forwarded from from_chars

// __last forwarded from from_chars

// __value forwarded from from_chars

// __fmt forwarded from from_chars

// __ptr the start of the buffer to parse. This is after the optional sign character.

// __negative should __value be set to a negative value?

// LWG3456 Pattern used by std::from_chars is underspecified

// This changes fixed to ignore a possible exponent instead of making its

// existance an error.

// [charconv.from.chars]/6.2 if fmt has chars_format::scientific set but not chars_format::fixed,

// the otherwise optional exponent part shall appear;

// This function expects to parse a positive value. This means it does not

// take a __first, __n as arguments, since __first points to '-' for

// negative values.

// [charconv.from.chars]

//   [Note 1: If the pattern allows for an optional sign, but the string has

//   no digit characters following the sign, no characters match the pattern.

//   -- end note]

// This is true for integrals, floating point allows -.0

// [charconv.from.chars]/6.2

//   if fmt has chars_format::scientific set but not chars_format::fixed, the

//   otherwise optional exponent part shall appear;

// Since INF/NAN do not have an exponent this value is not valid.

//

// LWG3456 Pattern used by std::from_chars is underspecified

// Does not address this point, but proposed option B does solve this issue,

// Both MSVC STL and libstdc++ implement this this behaviour.

// NOTE: The pointer passed here will be parsed in the default C locale.

// This is standard behavior (see https://eel.is/c++draft/charconv.from.chars), but may be unexpected.

//_LIBCPP_SRC_INCLUDE_FROM_CHARS_FLOATING_POINT_H


=== system/lib/libcxx/src/include/overridable_function.h ===
SHA256: e08033caa78bc2c707678686171f3675b93b7d4ecd15d94102c9bfd0f3b4e4fd
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file provides the std::__is_function_overridden utility, which allows checking

// whether an overridable function (typically a weak symbol) like `operator new`

// has been overridden by a user or not.

//

// This is a low-level utility which does not work on all platforms, since it needs

// to make assumptions about the object file format in use. Furthermore, it requires

// the "base definition" of the function (the one we want to check whether it has been

// overridden) to be defined using the _LIBCPP_OVERRIDABLE_FUNCTION macro.

//

// This currently works with Mach-O files (used on Darwin) and with ELF files (used on Linux

// and others). On platforms where we know how to implement this detection, the macro

// _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION is defined to 1, and it is defined to 0 on

// other platforms. The _LIBCPP_OVERRIDABLE_FUNCTION macro is defined to perform a normal

// function definition on unsupported platforms so that it can be used to define functions

// regardless of whether detection is actually supported.

//

// How does this work?

// -------------------

//

// Let's say we want to check whether a weak function `f` has been overridden by the user.

// The general mechanism works by placing `f`'s definition (in the libc++ built library)

// inside a special section, which we do using the `__section__` attribute via the

// _LIBCPP_OVERRIDABLE_FUNCTION macro.

//

// Then, when comes the time to check whether the function has been overridden, we take

// the address of the function and we check whether it falls inside the special function

// we created. This can be done by finding pointers to the start and the end of the section

// (which is done differently for ELF and Mach-O), and then checking whether `f` falls

// within those bounds. If it falls within those bounds, then `f` is still inside the

// special section and so it is the version we defined in the libc++ built library, i.e.

// it was not overridden. Otherwise, it was overridden by the user because it falls

// outside of the section.

//

// Important note

// --------------

//

// This mechanism should never be used outside of the libc++ built library. In particular,

// attempting to use this within the libc++ headers will not work at all because we don't

// want to be defining special sections inside user's executables which use our headers.

//

// Declare two dummy bytes and give them these special `__asm` values. These values are

// defined by the linker, which means that referring to `&__lcxx_override_start` will

// effectively refer to the address where the section starts (and same for the end).

// Now get a uintptr_t out of these locations, and out of the function pointer.

// We must pass a void* to ptrauth_strip since it only accepts a pointer type. Also, in particular,

// we must NOT pass a function pointer, otherwise we will strip the function pointer, and then attempt

// to authenticate and re-sign it when casting it to a uintptr_t again, which will fail because we just

// stripped the function pointer. See rdar://122927845.

// Finally, the function was overridden if it falls outside of the section's bounds.

// The NVPTX linker cannot create '__start/__stop' sections.

// This is very similar to what we do for Mach-O above. The ELF linker will implicitly define

// variables with those names corresponding to the start and the end of the section.

//

// See https://stackoverflow.com/questions/16552710/how-do-you-get-the-start-and-end-addresses-of-a-custom-elf-section

// We must pass a void* to ptrauth_strip since it only accepts a pointer type. See full explanation above.

// _LIBCPP_SRC_INCLUDE_OVERRIDABLE_FUNCTION_H


=== system/lib/libcxx/src/include/refstring.h ===
SHA256: 2c9e402b26a5bfe953caf666b5ab098880894dedeb1627062bbe0a94e854027f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// MacOS and iOS used to ship with libstdc++, and still support old applications

// linking against libstdc++. The libc++ and libstdc++ exceptions are supposed

// to be ABI compatible, such that they can be thrown from one library and caught

// in the other.

//

// For that reason, we must look for libstdc++ in the same process and if found,

// check the string stored in the exception object to see if it is the GCC empty

// string singleton before manipulating the reference count. This is done so that

// if an exception is created with a zero-length string in libstdc++, libc++abi

// won't try to delete the memory.

// namespace

// namespace __refstring_imp

// _LIBCPP_REFSTRING_H


=== system/lib/libcxx/src/include/ryu/common.h ===
SHA256: 5d0df36eb16d08610f226cc206fe1dcabbfe23bde33a481068381312401baed3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Copyright (c) Microsoft Corporation.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// Copyright 2018 Ulf Adams

// Copyright (c) Microsoft Corporation. All rights reserved.

// Boost Software License - Version 1.0 - August 17th, 2003

// Permission is hereby granted, free of charge, to any person or organization

// obtaining a copy of the software and accompanying documentation covered by

// this license (the "Software") to use, reproduce, display, distribute,

// execute, and transmit the Software, and to prepare derivative works of the

// Software, and to permit third-parties to whom the Software is furnished to

// do so, all subject to the following:

// The copyright notices in the Software and this entire statement, including

// the above license grant, this restriction and the following disclaimer,

// must be included in all copies of the Software, in whole or in part, and

// all derivative works of the Software, unless such copies or derivative

// works are solely in the form of machine-executable object code generated by

// a source language processor.

// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT

// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE

// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,

// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

// DEALINGS IN THE SOFTWARE.

// Avoid formatting to keep the changes with the original code minimal.

// clang-format off

// Function precondition: __v is not a 10-digit number.

// (f2s: 9 digits are sufficient for round-tripping.)

// (d2fixed: We print 9-digit blocks.)

// Returns __e == 0 ? 1 : ceil(log_2(5^__e)).

// This approximation works up to the point that the multiplication overflows at __e = 3529.

// If the multiplication were done in 64 bits, it would fail at 5^4004 which is just greater

// than 2^9297.

// Returns floor(log_10(2^__e)).

// The first value this approximation fails for is 2^1651 which is just greater than 10^297.

// Returns floor(log_10(5^__e)).

// The first value this approximation fails for is 5^2621 which is just greater than 10^1832.

// clang-format on

// _LIBCPP_SRC_INCLUDE_RYU_COMMON_H


=== system/lib/libcxx/src/include/ryu/d2fixed.h ===
SHA256: eb44884fccbbfc39e21d9744fae1edc7f2cd2f1a2c59dacf2ac81cf4d62f6a3f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Copyright (c) Microsoft Corporation.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// Copyright 2018 Ulf Adams

// Copyright (c) Microsoft Corporation. All rights reserved.

// Boost Software License - Version 1.0 - August 17th, 2003

// Permission is hereby granted, free of charge, to any person or organization

// obtaining a copy of the software and accompanying documentation covered by

// this license (the "Software") to use, reproduce, display, distribute,

// execute, and transmit the Software, and to prepare derivative works of the

// Software, and to permit third-parties to whom the Software is furnished to

// do so, all subject to the following:

// The copyright notices in the Software and this entire statement, including

// the above license grant, this restriction and the following disclaimer,

// must be included in all copies of the Software, in whole or in part, and

// all derivative works of the Software, unless such copies or derivative

// works are solely in the form of machine-executable object code generated by

// a source language processor.

// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT

// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE

// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,

// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

// DEALINGS IN THE SOFTWARE.

// Avoid formatting to keep the changes with the original code minimal.

// clang-format off

// clang-format on

// _LIBCPP_SRC_INCLUDE_RYU_D2FIXED_H


=== system/lib/libcxx/src/include/ryu/d2fixed_full_table.h ===
SHA256: b68007164e979c0cca68b19f52057065b412395d819c9900810e1729f1991726
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Copyright (c) Microsoft Corporation.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// Copyright 2018 Ulf Adams

// Copyright (c) Microsoft Corporation. All rights reserved.

// Boost Software License - Version 1.0 - August 17th, 2003

// Permission is hereby granted, free of charge, to any person or organization

// obtaining a copy of the software and accompanying documentation covered by

// this license (the "Software") to use, reproduce, display, distribute,

// execute, and transmit the Software, and to prepare derivative works of the

// Software, and to permit third-parties to whom the Software is furnished to

// do so, all subject to the following:

// The copyright notices in the Software and this entire statement, including

// the above license grant, this restriction and the following disclaimer,

// must be included in all copies of the Software, in whole or in part, and

// all derivative works of the Software, unless such copies or derivative

// works are solely in the form of machine-executable object code generated by

// a source language processor.

// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT

// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE

// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,

// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

// DEALINGS IN THE SOFTWARE.

// Avoid formatting to keep the changes with the original code minimal.

// clang-format off

// clang-format on

// _LIBCPP_SRC_INCLUDE_RYU_D2FIXED_FULL_TABLE_H


=== system/lib/libcxx/src/include/ryu/d2s.h ===
SHA256: 46fad5fe88cd9a9986ed4a9c8bad0c302b4f3076cebd731bad14fa4a7714a566
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Copyright (c) Microsoft Corporation.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// Copyright 2018 Ulf Adams

// Copyright (c) Microsoft Corporation. All rights reserved.

// Boost Software License - Version 1.0 - August 17th, 2003

// Permission is hereby granted, free of charge, to any person or organization

// obtaining a copy of the software and accompanying documentation covered by

// this license (the "Software") to use, reproduce, display, distribute,

// execute, and transmit the Software, and to prepare derivative works of the

// Software, and to permit third-parties to whom the Software is furnished to

// do so, all subject to the following:

// The copyright notices in the Software and this entire statement, including

// the above license grant, this restriction and the following disclaimer,

// must be included in all copies of the Software, in whole or in part, and

// all derivative works of the Software, unless such copies or derivative

// works are solely in the form of machine-executable object code generated by

// a source language processor.

// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT

// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE

// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,

// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

// DEALINGS IN THE SOFTWARE.

// Avoid formatting to keep the changes with the original code minimal.

// clang-format off

// clang-format on

// _LIBCPP_SRC_INCLUDE_RYU_DS2_H


=== system/lib/libcxx/src/include/ryu/d2s_full_table.h ===
SHA256: 50206d8a5d1d9f05f0041a79f450490e88251961dd8c0df93106cbf67f4fae96
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Copyright (c) Microsoft Corporation.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// Copyright 2018 Ulf Adams

// Copyright (c) Microsoft Corporation. All rights reserved.

// Boost Software License - Version 1.0 - August 17th, 2003

// Permission is hereby granted, free of charge, to any person or organization

// obtaining a copy of the software and accompanying documentation covered by

// this license (the "Software") to use, reproduce, display, distribute,

// execute, and transmit the Software, and to prepare derivative works of the

// Software, and to permit third-parties to whom the Software is furnished to

// do so, all subject to the following:

// The copyright notices in the Software and this entire statement, including

// the above license grant, this restriction and the following disclaimer,

// must be included in all copies of the Software, in whole or in part, and

// all derivative works of the Software, unless such copies or derivative

// works are solely in the form of machine-executable object code generated by

// a source language processor.

// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT

// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE

// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,

// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

// DEALINGS IN THE SOFTWARE.

// Avoid formatting to keep the changes with the original code minimal.

// clang-format off

// clang-format on

// _LIBCPP_SRC_INCLUDE_RYU_D2S_FULL_TABLE_H


=== system/lib/libcxx/src/include/ryu/d2s_intrinsics.h ===
SHA256: 5fdbfa56dfeb2fd5f445111bf6cb9cc5410e309220043fdc8c8f20450b27f3bb
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Copyright (c) Microsoft Corporation.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// Copyright 2018 Ulf Adams

// Copyright (c) Microsoft Corporation. All rights reserved.

// Boost Software License - Version 1.0 - August 17th, 2003

// Permission is hereby granted, free of charge, to any person or organization

// obtaining a copy of the software and accompanying documentation covered by

// this license (the "Software") to use, reproduce, display, distribute,

// execute, and transmit the Software, and to prepare derivative works of the

// Software, and to permit third-parties to whom the Software is furnished to

// do so, all subject to the following:

// The copyright notices in the Software and this entire statement, including

// the above license grant, this restriction and the following disclaimer,

// must be included in all copies of the Software, in whole or in part, and

// all derivative works of the Software, unless such copies or derivative

// works are solely in the form of machine-executable object code generated by

// a source language processor.

// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT

// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE

// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,

// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

// DEALINGS IN THE SOFTWARE.

// Avoid formatting to keep the changes with the original code minimal.

// clang-format off

// For the __shiftright128 intrinsic, the shift value is always

// modulo 64.

// In the current implementation of the double-precision version

// of Ryu, the shift value is always < 64.

// (The shift value is in the range [49, 58].)

// Check this here in case a future change requires larger shift

// values. In this case this function needs to be adjusted.

// ^^^ intrinsics available ^^^ / vvv __int128 available vvv

// We have __uint128 support in clang or gcc

// In the current implementation of the double-precision version

// of Ryu, the shift value is always < 64.

// (The shift value is in the range [49, 58].)

// Check this here in case a future change requires larger shift

// values. In this case this function needs to be adjusted.

// For x64 128-bit shfits using the `shrd` instruction and two 64-bit

// registers, the shift value is modulo 64.  Thus the `& 63` is free.

// ^^^ __int128 available ^^^ / vvv intrinsics unavailable vvv

// TRANSITION, VSO-634761

// The casts here help MSVC to avoid calls to the __allmul library function.

// We don't need to handle the case __dist >= 64 here (see above).

// ^^^ 64-bit ^^^ / vvv 32-bit vvv

// Avoid a 64-bit shift by taking advantage of the range of shift values.

// ^^^ 32-bit ^^^

// ^^^ intrinsics unavailable ^^^

// Returns the high 64 bits of the 128-bit product of __a and __b.

// Reuse the __ryu_umul128 implementation.

// Optimizers will likely eliminate the instructions used to compute the

// low part of the product.

// On 32-bit platforms, compilers typically generate calls to library

// functions for 64-bit divisions, even if the divisor is a constant.

//

// TRANSITION, LLVM-37932

//

// The functions here perform division-by-constant using multiplications

// in the same way as 64-bit compilers would do.

//

// NB:

// The multipliers and shift values are the ones generated by clang x64

// for expressions like x/5, x/10, etc.

// Avoid 64-bit math as much as possible.

// Returning static_cast<uint32_t>(__x - 1000000000 * __div1e9(__x)) would

// perform 32x64-bit multiplication and 64-bit subtraction.

// __x and 1000000000 * __div1e9(__x) are guaranteed to differ by

// less than 10^9, so their highest 32 bits must be identical,

// so we can truncate both sides to uint32_t before subtracting.

// We can also simplify static_cast<uint32_t>(1000000000 * __div1e9(__x)).

// We can truncate before multiplying instead of after, as multiplying

// the highest 32 bits of __div1e9(__x) can't affect the lowest 32 bits.

// ^^^ 32-bit ^^^ / vvv 64-bit vvv

// ^^^ 64-bit ^^^

// Returns true if __value is divisible by 5^__p.

// I tried a case distinction on __p, but there was no performance difference.

// Returns true if __value is divisible by 2^__p.

// __builtin_ctzll doesn't appear to be faster here.

// clang-format on

// _LIBCPP_SRC_INCLUDE_RYU_DS2_INTRINSICS_H


=== system/lib/libcxx/src/include/ryu/digit_table.h ===
SHA256: b9e50c0b5506de9d104fbae85272bf9e3b1987df840d3ece5d566c5921e76ec2
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Copyright (c) Microsoft Corporation.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// Copyright 2018 Ulf Adams

// Copyright (c) Microsoft Corporation. All rights reserved.

// Boost Software License - Version 1.0 - August 17th, 2003

// Permission is hereby granted, free of charge, to any person or organization

// obtaining a copy of the software and accompanying documentation covered by

// this license (the "Software") to use, reproduce, display, distribute,

// execute, and transmit the Software, and to prepare derivative works of the

// Software, and to permit third-parties to whom the Software is furnished to

// do so, all subject to the following:

// The copyright notices in the Software and this entire statement, including

// the above license grant, this restriction and the following disclaimer,

// must be included in all copies of the Software, in whole or in part, and

// all derivative works of the Software, unless such copies or derivative

// works are solely in the form of machine-executable object code generated by

// a source language processor.

// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT

// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE

// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,

// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

// DEALINGS IN THE SOFTWARE.

// A table of all two-digit numbers. This is used to speed up decimal digit

// generation by copying pairs of digits into the final output.

//

// In order to minimize the diff in the Ryu code between MSVC STL and libc++

// the code uses the name __DIGIT_TABLE. In order to avoid code duplication it

// reuses the table already available in libc++.

// _LIBCPP_SRC_INCLUDE_RYU_DIGIT_TABLE_H


=== system/lib/libcxx/src/include/ryu/f2s.h ===
SHA256: 0685f0962c4121afa0f99603484d73dfccbadc54348fe8919d87f6242107471b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Copyright (c) Microsoft Corporation.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// Copyright 2018 Ulf Adams

// Copyright (c) Microsoft Corporation. All rights reserved.

// Boost Software License - Version 1.0 - August 17th, 2003

// Permission is hereby granted, free of charge, to any person or organization

// obtaining a copy of the software and accompanying documentation covered by

// this license (the "Software") to use, reproduce, display, distribute,

// execute, and transmit the Software, and to prepare derivative works of the

// Software, and to permit third-parties to whom the Software is furnished to

// do so, all subject to the following:

// The copyright notices in the Software and this entire statement, including

// the above license grant, this restriction and the following disclaimer,

// must be included in all copies of the Software, in whole or in part, and

// all derivative works of the Software, unless such copies or derivative

// works are solely in the form of machine-executable object code generated by

// a source language processor.

// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT

// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE

// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,

// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

// DEALINGS IN THE SOFTWARE.

// Avoid formatting to keep the changes with the original code minimal.

// clang-format off

// clang-format on

// _LIBCPP_SRC_INCLUDE_RYU_FS2_H


=== system/lib/libcxx/src/include/ryu/ryu.h ===
SHA256: f2ee014117048b62d243898821b75d37f65a59688d3c929734632a147f2dba6f
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Copyright (c) Microsoft Corporation.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// Copyright 2018 Ulf Adams

// Copyright (c) Microsoft Corporation. All rights reserved.

// Boost Software License - Version 1.0 - August 17th, 2003

// Permission is hereby granted, free of charge, to any person or organization

// obtaining a copy of the software and accompanying documentation covered by

// this license (the "Software") to use, reproduce, display, distribute,

// execute, and transmit the Software, and to prepare derivative works of the

// Software, and to permit third-parties to whom the Software is furnished to

// do so, all subject to the following:

// The copyright notices in the Software and this entire statement, including

// the above license grant, this restriction and the following disclaimer,

// must be included in all copies of the Software, in whole or in part, and

// all derivative works of the Software, unless such copies or derivative

// works are solely in the form of machine-executable object code generated by

// a source language processor.

// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT

// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE

// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,

// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

// DEALINGS IN THE SOFTWARE.

// Avoid formatting to keep the changes with the original code minimal.

// clang-format off

// for _umul128(), __shiftright128(), _BitScanForward{,64}

// defined(_MSC_VER)

// https://github.com/ulfjack/ryu/tree/59661c3/ryu

// !_MSC_VER

// C11 7.21.6.1 "The fprintf function"/5:

// "A negative precision argument is taken as if the precision were omitted."

// /8: "e,E [...] if the precision is missing, it is taken as 6"

// Match ' to fix compilation with GCC in C++11 mode

// _Precision is ok.

// Avoid integer overflow.

// (This defensive check is slightly nonconformant; it can be carefully improved in the future.)

// C11 7.21.6.1 "The fprintf function"/5:

// "A negative precision argument is taken as if the precision were omitted."

// /8: "f,F [...] If the precision is missing, it is taken as 6"

// Match ' to fix compilation with GCC in C++11 mode

// _Precision is ok.

// Avoid integer overflow.

// (This defensive check is slightly nonconformant; it can be carefully improved in the future.)

// clang-format on

// _LIBCPP_SRC_INCLUDE_RYU_RYU_H


=== system/lib/libcxx/src/include/sso_allocator.h ===
SHA256: f529f1440e67b2ec9519ccc66f45f0efe445e880a34f95705e17ef731e0b6590
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_SSO_ALLOCATOR_H


=== system/lib/libcxx/src/include/to_chars_floating_point.h ===
SHA256: 16b3b4882654a6f0ef6a450bd158eb32720b8586f1cbcaafa06e84765bbda601
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Copyright (c) Microsoft Corporation.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// This implementation is dedicated to the memory of Mary and Thavatchai.

// Avoid formatting to keep the changes with the original code minimal.

// clang-format off

// __itoa

// vvvvvvvvvv DERIVED FROM corecrt_internal_fltintrn.h vvvvvvvvvv

// ^^^^^^^^^^ DERIVED FROM corecrt_internal_fltintrn.h ^^^^^^^^^^

// FUNCTION to_chars (FLOATING-POINT TO STRING)

// * Determine the effective _Precision.

// * Later, we'll decrement _Precision when printing each hexit after the decimal point.

// The hexits after the decimal point correspond to the explicitly stored fraction bits.

// float explicitly stores 23 fraction bits. 23 / 4 == 5.75, which is 6 hexits.

// double explicitly stores 52 fraction bits. 52 / 4 == 13, which is 13 hexits.

// C11 7.21.6.1 "The fprintf function"/5: "A negative precision argument is taken as if the precision were

// omitted." /8: "if the precision is missing and FLT_RADIX is a power of 2, then the precision is sufficient

// for an exact representation of the value"

// * Extract the _Ieee_mantissa and _Ieee_exponent.

// * Prepare the _Adjusted_mantissa. This is aligned to hexit boundaries,

// * with the implicit bit restored (0 for zero values and subnormal values, 1 for normal values).

// * Also calculate the _Unbiased_exponent. This unifies the processing of zero, subnormal, and normal values.

// align to hexit boundary (23 isn't divisible by 4)

// already aligned (52 is divisible by 4)

// zero or subnormal

// implicit bit is 0

// zero

// C11 7.21.6.1 "The fprintf function"/8: "If the value is zero, the exponent is zero."

// subnormal

// normal

// implicit bit is 1

// _Unbiased_exponent is within [-126, 127] for float, [-1022, 1023] for double.

// * Decompose _Unbiased_exponent into _Sign_character and _Absolute_exponent.

// _Absolute_exponent is within [0, 127] for float, [0, 1023] for double.

// * Perform a single bounds check.

// _Precision might be enormous; avoid integer overflow by testing it separately.

// leading hexit

// possible decimal point

// excluding `+ _Precision`, hexits after decimal point

// "p+" or "p-"

// exponent

// * Perform rounding when we've been asked to omit hexits.

// _Precision is within [0, 5] for float, [0, 12] for double.

// _Dropped_bits is within [4, 24] for float, [4, 52] for double.

// Perform rounding by adding an appropriately-shifted bit.

// This can propagate carries all the way into the leading hexit. Examples:

// "0.ff9" rounded to a precision of 2 is "1.00".

// "1.ff9" rounded to a precision of 2 is "2.00".

// Note that the leading hexit participates in the rounding decision. Examples:

// "0.8" rounded to a precision of 0 is "0".

// "1.8" rounded to a precision of 0 is "2".

// Reference implementation with suboptimal codegen:

// bool _Should_round_up(bool _Lsb_bit, bool _Round_bit, bool _Has_tail_bits) {

//    // If there are no insignificant set bits, the value is exactly-representable and should not be rounded.

//    //

//    // If there are insignificant set bits, we need to round according to round_to_nearest.

//    // We need to handle two cases: we round up if either [1] the value is slightly greater

//    // than the midpoint between two exactly-representable values or [2] the value is exactly the midpoint

//    // between two exactly-representable values and the greater of the two is even (this is "round-to-even").

//    return _Round_bit && (_Has_tail_bits || _Lsb_bit);

//}

// const bool _Lsb_bit       = (_Adjusted_mantissa & (_Uint_type{1} << _Dropped_bits)) != 0;

// const bool _Round_bit     = (_Adjusted_mantissa & (_Uint_type{1} << (_Dropped_bits - 1))) != 0;

// const bool _Has_tail_bits = (_Adjusted_mantissa & ((_Uint_type{1} << (_Dropped_bits - 1)) - 1)) != 0;

// const bool _Should_round = _Should_round_up(_Lsb_bit, _Round_bit, _Has_tail_bits);

// _Adjusted_mantissa += _Uint_type{_Should_round} << _Dropped_bits;

// Example for optimized implementation: Let _Dropped_bits be 8.

//          Bit index: ...[8]76543210

// _Adjusted_mantissa: ...[L]RTTTTTTT (not depicting known details, like hexit alignment)

// By focusing on the bit at index _Dropped_bits, we can avoid unnecessary branching and shifting.

// Bit index: ...[8]76543210

//  _Lsb_bit: ...[L]RTTTTTTT

//  Bit index: ...9[8]76543210

// _Round_bit: ...L[R]TTTTTTT0

// We can detect (without branching) whether any of the trailing bits are set.

// Due to _Should_round below, this computation will be used if and only if R is 1, so we can assume that here.

//      Bit index: ...9[8]76543210

//     _Round_bit: ...L[1]TTTTTTT0

// _Has_tail_bits: ....[H]........

// If all of the trailing bits T are 0, then `_Round_bit - 1` will produce 0 for H (due to R being 1).

// If any of the trailing bits T are 1, then `_Round_bit - 1` will produce 1 for H (due to R being 1).

// Finally, we can use _Should_round_up() logic with bitwise-AND and bitwise-OR,

// selecting just the bit at index _Dropped_bits. This is the appropriately-shifted bit that we want.

// This rounding technique is dedicated to the memory of Peppermint. =^..^=

// * Print the leading hexit, then mask it away.

// * Print the decimal point and trailing hexits.

// C11 7.21.6.1 "The fprintf function"/8:

// "if the precision is zero and the # flag is not specified, no decimal-point character appears."

// 24 for float, 52 for double

// _Precision is the number of hexits that still need to be printed.

// We're completely done with this phase.

// Otherwise, we need to keep printing hexits.

// We've finished printing _Adjusted_mantissa, so all remaining hexits are '0'.

// Mask away the hexit that we just printed, then keep looping.

// (We skip this when breaking out of the loop above, because _Adjusted_mantissa isn't used later.)

// * Print the exponent.

// C11 7.21.6.1 "The fprintf function"/8: "The exponent always contains at least one digit, and only as many more

// digits as necessary to represent the decimal exponent of 2."

// Performance note: We should take advantage of the known ranges of possible exponents.

// We've already printed '-' if necessary, so uint32_t _Absolute_exponent avoids testing that again.

// This prints "1.728p+0" instead of "2.e5p-1".

// This prints "0.000002p-126" instead of "1p-149" for float.

// This prints "0.0000000000001p-1022" instead of "1p-1074" for double.

// This prioritizes being consistent with printf's de facto behavior (and hex-precision's behavior)

// over minimizing the number of characters printed.

// zero detected; write "0p+0" and return

// C11 7.21.6.1 "The fprintf function"/8: "If the value is zero, the exponent is zero."

// Special-casing zero is necessary because of the exponent.

// implicit bit

// subnormal

// normal

// Performance note: Consider avoiding per-character bounds checking when there's plenty of space.

// The fraction bits are all 0. Trim them away, including the decimal point.

// The hexits after the decimal point correspond to the explicitly stored fraction bits.

// float explicitly stores 23 fraction bits. 23 / 4 == 5.75, so we'll print at most 6 hexits.

// double explicitly stores 52 fraction bits. 52 / 4 == 13, so we'll print at most 13 hexits.

// align to hexit boundary (23 isn't divisible by 4)

// 23 fraction bits + 1 alignment bit

// already aligned (52 is divisible by 4)

// 52 fraction bits

// do-while: The condition _Adjusted_mantissa != 0 is initially true - we have nonzero fraction bits and we've

// printed the decimal point. Each iteration, we print a hexit, mask it away, and keep looping if we still have

// nonzero fraction bits. If there would be trailing '0' hexits, this trims them. If there wouldn't be trailing

// '0' hexits, the same condition works (as we print the final hexit and mask it away); we don't need to test

// _Number_of_bits_remaining.

// C11 7.21.6.1 "The fprintf function"/8: "The exponent always contains at least one digit, and only as many more

// digits as necessary to represent the decimal exponent of 2."

// Performance note: We should take advantage of the known ranges of possible exponents.

// float: _Unbiased_exponent is within [-126, 127].

// double: _Unbiased_exponent is within [-1022, 1023].

// We've already printed '-' if necessary, so static_cast<uint32_t> avoids testing that again.

// For general precision, we can use lookup tables to avoid performing trial formatting.

// For a simple example, imagine counting the number of digits D in an integer, and needing to know

// whether D is less than 3, equal to 3/4/5/6, or greater than 6. We could use a lookup table:

// D | Largest integer with D digits

// 2 |      99

// 3 |     999

// 4 |   9'999

// 5 |  99'999

// 6 | 999'999

// 7 | table end

// Looking up an integer in this table with lower_bound() will work:

// * Too-small integers, like 7, 70, and 99, will cause lower_bound() to return the D == 2 row. (If all we care

//   about is whether D is less than 3, then it's okay to smash the D == 1 and D == 2 cases together.)

// * Integers in [100, 999] will cause lower_bound() to return the D == 3 row, and so forth.

// * Too-large integers, like 1'000'000 and above, will cause lower_bound() to return the end of the table. If we

//   compute D from that index, this will be considered D == 7, which will activate any "greater than 6" logic.

// Floating-point is slightly more complicated.

// The ordinary lookup tables are for X within [-5, 38] for float, and [-5, 308] for double.

// (-5 absorbs too-negative exponents, outside the P > X >= -4 criterion. 38 and 308 are the maximum exponents.)

// Due to the P > X condition, we can use a subset of the table for X within [-5, P - 1], suitably clamped.

// When P is small, rounding can affect X. For example:

// For P == 1, the largest double with X == 0 is: 9.4999999999999982236431605997495353221893310546875

// For P == 2, the largest double with X == 0 is: 9.949999999999999289457264239899814128875732421875

// For P == 3, the largest double with X == 0 is: 9.9949999999999992184029906638897955417633056640625

// Exponent adjustment is a concern for P within [1, 7] for float, and [1, 15] for double (determined via

// brute force). While larger values of P still perform rounding, they can't trigger exponent adjustment.

// This is because only values with repeated '9' digits can undergo exponent adjustment during rounding,

// and floating-point granularity limits the number of consecutive '9' digits that can appear.

// So, we need special lookup tables for small values of P.

// These tables have varying lengths due to the P > X >= -4 criterion. For example:

// For P == 1, need table entries for X: -5, -4, -3, -2, -1, 0

// For P == 2, need table entries for X: -5, -4, -3, -2, -1, 0, 1

// For P == 3, need table entries for X: -5, -4, -3, -2, -1, 0, 1, 2

// For P == 4, need table entries for X: -5, -4, -3, -2, -1, 0, 1, 2, 3

// We can concatenate these tables for compact storage, using triangular numbers to access them.

// The table for P begins at index (P - 1) * (P + 10) / 2 with length P + 5.

// For both the ordinary and special lookup tables, after an index I is returned by lower_bound(), X is I - 5.

// We need to special-case the floating-point value 0.0, which is considered to have X == 0.

// Otherwise, the lookup tables would consider it to have a highly negative X.

// Finally, because we're working with positive floating-point values,

// representation comparisons behave identically to floating-point comparisons.

// The following code generated the lookup tables for the scientific exponent X. Don't remove this code.

// cl /EHsc /nologo /W4 /MT /O2 /std:c++17 generate_tables.cpp && generate_tables

// Find the beginning of the false partition in [first, last).

// [first, last) is partitioned when all of the true values occur before all of the false values.

// more than enough

// C11 7.21.6.1 "The fprintf function"/8 performs trial formatting with scientific precision P - 1.

// advance past 'e'

// advance past '+' which from_chars() won't parse

// MaxP performs no rounding during trial formatting

// well below 9.5e-5, otherwise arbitrary

// one bit above Limits::max()

// MaxSpecialP is affected by exponent adjustment

// 0

// zero detected; write "0" and return; _Precision is irrelevant due to zero-trimming

// C11 7.21.6.1 "The fprintf function"/5:

// "A negative precision argument is taken as if the precision were omitted."

// /8: "g,G [...] Let P equal the precision if nonzero, 6 if the precision is omitted,

// or 1 if the precision is zero."

// Performance note: It's possible to rewrite this for branchless codegen,

// but profiling will be necessary to determine whether that's faster.

// _Precision is ok.

// Avoid integer overflow.

// Due to general notation's zero-trimming behavior, we can simply clamp _Precision.

// This is further clamped below.

// _Precision is now the Standard's P.

// /8: "Then, if a conversion with style E would have an exponent of X:

// - if P > X >= -4, the conversion is with style f (or F) and precision P - (X + 1).

// - otherwise, the conversion is with style e (or E) and precision P - 1."

// /8: "Finally, [...] any trailing zeros are removed from the fractional portion of the result

// and the decimal-point character is removed if there is no fractional portion remaining."

// Profiling indicates that linear search is faster than binary search for small tables.

// Performance note: lambda captures may have a small performance cost.

// threshold determined via profiling

// Performance note: it might (or might not) be faster to modify Ryu Printf to perform zero-trimming.

// Such modifications would involve a fairly complicated state machine (notably, both '0' and '9' digits would

// need to be buffered, due to rounding), and that would have performance costs due to increased branching.

// Here, we're using a simpler approach: writing into a local buffer, manually zero-trimming, and then copying into

// the output range. The necessary buffer size is reasonably small, the zero-trimming logic is simple and fast,

// and the final copying is also fast.

// cases: 0x1.fffffep-126f and 0x1.fffffffffffffp-1022

// cases: 0x1.fffffep-14f and 0x1.fffffffffffffp-14

// cases: 0x1.fffffep-126f and 0x1.fffffffffffffp-1022

// Note that _Max_output_length is determined by scientific notation and is more than enough for fixed notation.

// 0x1.fffffep+127f is 39 digits, plus 1 for '.', plus _Max_fixed_precision for '0' digits, equals 77.

// 0x1.fffffffffffffp+1023 is 309 digits, plus 1 for '.', plus _Max_fixed_precision for '0' digits, equals 376.

// e.g. "1.234"

// e.g. "e-05"

// number of digits printed after the decimal point, before trimming

// Write into the local buffer.

// Clamping _Effective_precision allows _Buffer to be as small as possible, and increases efficiency.

// If we printed a decimal point followed by digits, perform zero-trimming.

// will stop at '.' or a nonzero digit

// Copy the significand to the output range.

// Copy the exponent to the output range.

// plain overload must pass chars_format{} internally

// sign bit detected; write minus sign and clear sign bit

// inf/nan detected; write appropriate string and return

// When a NaN value has the sign bit set, the quiet bit set, and all other mantissa bits cleared,

// the UCRT interprets it to mean "indeterminate", and indicates this by printing "-nan(ind)".

// avoid MSVC warning C4715: not all control paths return a value

// clang-format on

// _LIBCPP_SRC_INCLUDE_TO_CHARS_FLOATING_POINT_H


=== system/lib/libcxx/src/ios.cpp ===
SHA256: 1c26a8fe9e565af612953459c6f0f3e4a2a9abde47f76ab5eecff470812c1dfe
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_ELAST

// ios_base::failure

// ios_base locale

// locale

// xalloc

// Precondition: __req_size > __current_cap

// register_callback

// Avoid UB when not properly initialized. See ios_base::ios_base for

// more information.

// iostate

// init

// If we can't acquire the needed resources, throw bad_alloc (can't set badbit)

// Don't alter *this until all needed resources are acquired

// Got everything we need.  Copy everything but __rdstate_, __rdbuf_ and __exceptions_

// *this is uninitialized

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS


=== system/lib/libcxx/src/ios.instantiations.cpp ===
SHA256: 056091dc3a95f5e6a978fb7c0f4f41dce9affe9d84de16597cc90a008a73f597
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Original explicit instantiations provided in the library

// Additional instantiations added later. Whether programs rely on these being

// available is protected by _LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1.

// Add more here if needed...


=== system/lib/libcxx/src/iostream.cpp ===
SHA256: 407e529051d4fa1edd445db2b139438fb51ab84ae0253d028fcdeb8e43d037c7
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// The stream has to be the first element, since that's referenced by the stream declarations in <iostream>

// These definitions and the declarations in <iostream> technically cause ODR violations, since they have different

// types (stream_data and {i,o}stream respectively). This means that <iostream> should never be included in this TU.

// _LIBCPP_HAS_WIDE_CHARACTERS

// Pretend we're inside a system header so the compiler doesn't flag the use of the init_priority

// attribute with a value that's reserved for the implementation (we're the implementation).

// On Windows the TLS storage for locales needs to be initialized before we create

// the standard streams, otherwise it may not be alive during program termination

// when we flush the streams.

// forces initialization of locale TLS

// gets initialized once


=== system/lib/libcxx/src/locale.cpp ===
SHA256: 6584d01dbb6016cce99a4aabe80d10443a268e025b52e0f0a4d6c831b9cc0599
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// for __lc_ctype_ptr

// On Linux, wint_t and wchar_t have different signed-ness, and this causes

// lots of noise in the build log, but no bugs that I know of.

// In theory this could create a race condition. In practice

// the race condition is non-fatal since it will just create

// a little resource leak. Better approach would be appreciated.

// __cloc_defined

// FIXME: Handle the more complicated cases, such as when the locale has

// different names for different categories.

// namespace

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// _LIBCPP_HAS_EXCEPTIONS

// locale

// We don't do reference counting on the classic locale.

// It's never destroyed anyway, but atomic reference counting may be very

// expensive in parallel applications. The classic locale is used by default

// in all streams. Note: if a new global locale is installed, then we lose

// the benefit of no reference counting.

// initialized below in classic()

// executed exactly once on first initialization of `classic_locale`

// locale::facet

// locale::id

// template <> class collate_byname<char>

// template <> class collate_byname<wchar_t>

// _LIBCPP_HAS_WIDE_CHARACTERS

// template <> class ctype<wchar_t>;

// _LIBCPP_HAS_WIDE_CHARACTERS

// template <> class ctype<char>;

// clang-format off

// clang-format on

// Newlib has a 257-entry table in ctype_.c, where (char)0 starts at [1].

// Platform not supported: abort so the person doing the port knows what to

// fix

// template <> class ctype_byname<char>

// template <> class ctype_byname<wchar_t>

// _LIBCPP_HAS_WIDE_CHARACTERS

// template <> class codecvt<char, char, mbstate_t>

// template <> class codecvt<wchar_t, char, mbstate_t>

// look for first internal null in frm

// loop over all null-terminated sequences in frm

// save state in case it is needed to recover to_nxt on error

// need to recover to_nxt

// set up next null terminated sequence

// Try to write the terminating null

// on error

// is there room?

// write it

// look for next null in frm

// look for first internal null in frm

// loop over all null-terminated sequences in frm

// save state in case it is needed to recover to_nxt on error

// need to recover to_nxt

// set up next null terminated sequence

// Try to write the terminating null

// on error

// look for next null in frm

// on error

// is there room?

// write it

// stateless encoding

// there are no known constant length encodings

// which take more than 1 char to form a wchar_t

// _LIBCPP_HAS_WIDE_CHARACTERS

//                                     Valid UTF ranges

//     UTF-32               UTF-16                          UTF-8               # of code points

//                     first      second       first   second    third   fourth

// 000000 - 00007F  0000 - 007F               00 - 7F                                 127

// 000080 - 0007FF  0080 - 07FF               C2 - DF, 80 - BF                       1920

// 000800 - 000FFF  0800 - 0FFF               E0 - E0, A0 - BF, 80 - BF              2048

// 001000 - 00CFFF  1000 - CFFF               E1 - EC, 80 - BF, 80 - BF             49152

// 00D000 - 00D7FF  D000 - D7FF               ED - ED, 80 - 9F, 80 - BF              2048

// 00D800 - 00DFFF                invalid

// 00E000 - 00FFFF  E000 - FFFF               EE - EF, 80 - BF, 80 - BF              8192

// 010000 - 03FFFF  D800 - D8BF, DC00 - DFFF  F0 - F0, 90 - BF, 80 - BF, 80 - BF   196608

// 040000 - 0FFFFF  D8C0 - DBBF, DC00 - DFFF  F1 - F3, 80 - BF, 80 - BF, 80 - BF   786432

// 100000 - 10FFFF  DBC0 - DBFF, DC00 - DFFF  F4 - F4, 80 - 8F, 80 - BF, 80 - BF    65536

// if (wc < 0x110000)

// if (wc <= 0xFFFF)

// template <> class codecvt<char16_t, char, mbstate_t>

// template <> class codecvt<char16_t, char8_t, mbstate_t>

// template <> class codecvt<char32_t, char, mbstate_t>

// template <> class codecvt<char32_t, char8_t, mbstate_t>

// __codecvt_utf8<wchar_t>

// _LIBCPP_HAS_WIDE_CHARACTERS

// __codecvt_utf8<char16_t>

// __codecvt_utf8<char32_t>

// __codecvt_utf16<wchar_t, false>

// __codecvt_utf16<wchar_t, true>

// _LIBCPP_HAS_WIDE_CHARACTERS

// __codecvt_utf16<char16_t, false>

// __codecvt_utf16<char16_t, true>

// __codecvt_utf16<char32_t, false>

// __codecvt_utf16<char32_t, true>

// __codecvt_utf8_utf16<wchar_t>

// _LIBCPP_HAS_WIDE_CHARACTERS

// __codecvt_utf8_utf16<char16_t>

// __codecvt_utf8_utf16<char32_t>

// __narrow_to_utf8<16>

// __narrow_to_utf8<32>

// __widen_from_utf8<16>

// __widen_from_utf8<32>

// _LIBCPP_HAS_WIDE_CHARACTERS

// https://www.fileformat.info/info/unicode/char/202f/index.htm

// https://www.fileformat.info/info/unicode/char/a0/index.htm

// _LIBCPP_HAS_WIDE_CHARACTERS

// First convert the MBS into a wide char then attempt to narrow it using

// wctob_l.

// FIXME: Work around specific multibyte sequences that we can reasonably

// translate into a different single byte.

// narrow non-breaking space

// non-breaking space

// _LIBCPP_HAS_WIDE_CHARACTERS

// FIXME: Work around specific multibyte sequences that we can reasonably

// translate into a different single byte.

// _LIBCPP_HAS_WIDE_CHARACTERS

// numpunct<char> && numpunct<wchar_t>

// numpunct_byname<char>

// localization for truename and falsename is not available

// numpunct_byname<wchar_t>

// localization for truename and falsename is not available

// _LIBCPP_HAS_WIDE_CHARACTERS

// num_get helpers

//  if the grouping pattern is empty _or_ there are no grouping bits, then do nothing

//  we always have at least a single entry in [__g, __g_end); the end of the input sequence

// time_get

// time_get_byname

// _LIBCPP_HAS_WIDE_CHARACTERS

// __weeks_

// __months_

// __am_pm_

// __weeks_

// __months_

// __am_pm_

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP_HAS_WIDE_CHARACTERS

// _LIBCPP_HAS_WIDE_CHARACTERS

// time_put

// _LIBCPP_HAS_WIDE_CHARACTERS

// moneypunct_byname

// Comments on case branches reflect 'C11 7.11.2.1 The localeconv

// function'. "Space between sign and symbol or value" means that

// if the sign is adjacent to the symbol, there's a space between

// them, and otherwise there's a space between the sign and value.

//

// C11's localeconv specifies that the fourth character of an

// international curr_symbol is used to separate the sign and

// value when sep_by_space says to do so. C++ can't represent

// that, so we just use a space.  When sep_by_space says to

// separate the symbol and value-or-sign with a space, we rearrange the

// curr_symbol to put its spacing character on the correct side of

// the symbol.

//

// We also need to avoid adding an extra space between the sign

// and value when the currency symbol is suppressed (by not

// setting showbase).  We match glibc's strfmon by interpreting

// sep_by_space==1 as "omit the space when the currency symbol is

// absent".

//

// Users who want to get this right should use ICU instead.

// value before curr_symbol

// Move the separator to before the symbol, to place it

// between the value and symbol.

// Parentheses surround the quantity and currency symbol.

// Any space appears in the symbol.

// No space separates the currency symbol and value.

// This case may have changed between C99 and C11;

// assume the currency symbol matches the intention.

// Space between sign and currency or value.

// The "sign" is two parentheses, so no space here either.

// Space between currency-and-sign or currency and value.

// We insert the space into the symbol instead of

// setting pat.field[2]=space so that when

// showbase is not set, the space goes away too.

// The sign string precedes the quantity and currency symbol.

// No space separates the currency symbol and value.

// Space between currency-and-sign or currency and value.

// We insert the space into the symbol instead of

// setting pat.field[2]=space so that when

// showbase is not set, the space goes away too.

// Space between sign and currency or value.

// Remove the separator from the symbol, since it

// has already appeared after the sign.

// The sign string succeeds the quantity and currency symbol.

// No space separates the currency symbol and value.

// Space between currency-and-sign or currency and value.

// We insert the space into the symbol instead of

// setting pat.field[1]=space so that when

// showbase is not set, the space goes away too.

// Space between sign and currency or value.

// Remove the separator from the symbol, since it

// should not be removed if showbase is absent.

// The sign string immediately precedes the currency symbol.

// No space separates the currency symbol and value.

// Space between currency-and-sign or currency and value.

// Remove the separator from the symbol, since it

// has already appeared before the sign.

// Space between sign and currency or value.

// We insert the space into the symbol instead of

// setting pat.field[2]=space so that when

// showbase is not set, the space goes away too.

// The sign string immediately succeeds the currency symbol.

// No space separates the currency symbol and value.

// Space between currency-and-sign or currency and value.

// We insert the space into the symbol instead of

// setting pat.field[1]=space so that when

// showbase is not set, the space goes away too.

// Space between sign and currency or value.

// Remove the separator from the symbol, since it

// should not disappear when showbase is absent.

// curr_symbol before value

// Parentheses surround the quantity and currency symbol.

// Any space appears in the symbol.

// No space separates the currency symbol and value.

// This case may have changed between C99 and C11;

// assume the currency symbol matches the intention.

// Space between sign and currency or value.

// The "sign" is two parentheses, so no space here either.

// Space between currency-and-sign or currency and value.

// We insert the space into the symbol instead of

// setting pat.field[2]=space so that when

// showbase is not set, the space goes away too.

// The sign string precedes the quantity and currency symbol.

// No space separates the currency symbol and value.

// Space between currency-and-sign or currency and value.

// We insert the space into the symbol instead of

// setting pat.field[2]=space so that when

// showbase is not set, the space goes away too.

// Space between sign and currency or value.

// Remove the separator from the symbol, since it

// has already appeared after the sign.

// The sign string succeeds the quantity and currency symbol.

// No space separates the currency symbol and value.

// Space between currency-and-sign or currency and value.

// We insert the space into the symbol instead of

// setting pat.field[1]=space so that when

// showbase is not set, the space goes away too.

// Space between sign and currency or value.

// Remove the separator from the symbol, since it

// will appear before the sign.

// The sign string immediately precedes the currency symbol.

// No space separates the currency symbol and value.

// Space between currency-and-sign or currency and value.

// We insert the space into the symbol instead of

// setting pat.field[2]=space so that when

// showbase is not set, the space goes away too.

// Space between sign and currency or value.

// Remove the separator from the symbol, since it

// has already appeared after the sign.

// The sign string immediately succeeds the currency symbol.

// No space separates the currency symbol and value.

// Space between currency-and-sign or currency and value.

// Remove the separator from the symbol, since it

// should not disappear when showbase is absent.

// Space between sign and currency or value.

// We insert the space into the symbol instead of

// setting pat.field[1]=space so that when

// showbase is not set, the space goes away too.

// Assume the positive and negative formats will want spaces in

// the same places in curr_symbol since there's no way to

// represent anything else.

// _LIBCPP_MSVCRT

// !_LIBCPP_MSVCRT

// _LIBCPP_MSVCRT

// !_LIBCPP_MSVCRT

// Assume the positive and negative formats will want spaces in

// the same places in curr_symbol since there's no way to

// represent anything else.

// _LIBCPP_MSVCRT

// !_LIBCPP_MSVCRT

// Assume the positive and negative formats will want spaces in

// the same places in curr_symbol since there's no way to

// represent anything else.

// _LIBCPP_MSVCRT

// !_LIBCPP_MSVCRT

// _LIBCPP_MSVCRT

// !_LIBCPP_MSVCRT

// Assume the positive and negative formats will want spaces in

// the same places in curr_symbol since there's no way to

// represent anything else.

// _LIBCPP_MSVCRT

// !_LIBCPP_MSVCRT

// _LIBCPP_HAS_WIDE_CHARACTERS

// Legacy ABI __num_get functions - the new ones are _LIBCPP_HIDE_FROM_ABI


=== system/lib/libcxx/src/memory.cpp ===
SHA256: 348c84cd8cd885d5eb65433ad652bdedc97440dd042230abef6b1a1533ecb743
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_SHARED_PTR_DEFINE_LEGACY_INLINE_FUNCTIONS

// NOTE: The acquire load here is an optimization of the very

// common case where a shared pointer is being destructed while

// having no other contended references.

//

// BENEFIT: We avoid expensive atomic stores like XADD and STREX

// in a common case.  Those instructions are slow and do nasty

// things to caches.

//

// IS THIS SAFE?  Yes.  During weak destruction, if we see that we

// are the last reference, we know that no-one else is accessing

// us. If someone were accessing us, then they would be doing so

// while the last shared / weak_ptr was being destructed, and

// that's undefined anyway.

//

// If we see anything other than a 0, then we have possible

// contention, and need to use an atomicrmw primitive.

// The same arguments don't apply for increment, where it is legal

// (though inadvisable) to share shared_ptr references between

// threads, and have them all get copied at once.  The argument

// also doesn't apply for __release_shared, because an outstanding

// weak_ptr::lock() could read / modify the shared count.

// no need to do this store, because we are about

// to destroy everything.

//__libcpp_atomic_store(&__shared_weak_owners_, -1, _AO_Release);

// _LIBCPP_HAS_THREADS


=== system/lib/libcxx/src/memory_resource.cpp ===
SHA256: 7a34a07030e9227e6b3e71716aec6a73952235c45125e3aa8089fe92ed9fdf2f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// memory_resource

// new_delete_resource()

// null_memory_resource()

// Pretend we're inside a system header so the compiler doesn't flag the use of the init_priority

// attribute with a value that's reserved for the implementation (we're the implementation).

// namespace

// default_memory_resource()

// TODO: Can a weaker ordering be used?

// 23.12.5, mem.res.pool

// The request to deallocate memory ends up being a no-op, likely resulting in a memory leak.

// A pointer to allocated storage (6.6.4.4.1) with a size of at least bytes.

// The size and alignment of the allocated memory shall meet the requirements for

// a class derived from memory_resource (23.12).

// If the pool selected for a block of size bytes is unable to satisfy the memory request

// from its own internal data structures, it will call upstream_resource()->allocate()

// to obtain more memory. If bytes is larger than that which the largest pool can handle,

// then memory will be allocated using upstream_resource()->allocate().

// Returns the memory at p to the pool. It is unspecified if,

// or under what circumstances, this operation will result in

// a call to upstream_resource()->deallocate().

// 23.12.6, mem.res.monotonic.buffer

// only for __initial_descriptor.

// if __initial_descriptor.__cur_ equals nullptr, means no available buffer given when ctor.

// here we just return nullptr, let the caller do the next handling.

// Allocate a brand-new chunk.

// namespace pmr


=== system/lib/libcxx/src/mutex.cpp ===
SHA256: e458015dc1dd19969bc811b2865b7c5d7ea36f4a345cd7b232bb8343299caef4
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// ~mutex is defined elsewhere

// recursive_mutex

// timed_mutex

// recursive_timed_mutex


=== system/lib/libcxx/src/mutex_destructor.cpp ===
SHA256: 33be4d7e44eef4c14af20cb4a04c78f4b8ec0d77f326b94b01592c5555a306c8
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Define ~mutex.

//

// On some platforms ~mutex has been made trivial and the definition is only

// provided for ABI compatibility.

//

// In order to avoid ODR violations within libc++ itself, we need to ensure

// that *nothing* sees the non-trivial mutex declaration. For this reason

// we re-declare the entire class in this file instead of using

// _LIBCPP_BUILDING_LIBRARY to change the definition in the headers.

// !NEEDS_MUTEX_DESTRUCTOR


=== system/lib/libcxx/src/new.cpp ===
SHA256: 577f431626811d06993c0b81f9d3042a278573b64bdf6d5ec114dfea21002671
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// The code below is copied as-is into libc++abi's libcxxabi/src/stdlib_new_delete.cpp

// file. The version in this file is the canonical one.

// ------------------ BEGIN COPY ------------------

// Implement all new and delete operators as weak definitions

// in this shared library, so that they can be overridden by programs

// that define non-weak copies of the functions.

// If malloc fails and there is a new_handler,

// call it to try free up memory.

// Try allocating memory. If allocation fails and there is a new_handler,

// call it to try free up memory, and try again until it succeeds, or until

// the new_handler decides to terminate.

// _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION

// ------------------ END COPY ------------------

// !__GLIBCXX__ && !_LIBCPP_ABI_VCRUNTIME


=== system/lib/libcxx/src/new_handler.cpp ===
SHA256: 0b17697b569d4a4cc9b3c2f97ef69fdf8d6cac72de9871489456c5d9235b1bbf
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// nothing to do, we use the one from libc++abi

// nothing to do, we use the one from libstdc++/libsupc++

// purposefully not versioned

// namespace std

// _LIBPCPP_DEFINE_NEW_HANDLER


=== system/lib/libcxx/src/new_helpers.cpp ===
SHA256: 82b6b57506edc48dcbb13eaa5bf533e680167f983a2a2cf85064c003cb8cdb38
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// purposefully not versioned

// !LIBSTDCXX

// namespace std


=== system/lib/libcxx/src/optional.cpp ===
SHA256: c5cc3bb8a6b28ac6da23580223f3bc31a853f1431a5e76110e342a43ae836136
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace std

//  Preserve std::experimental::bad_optional_access for ABI compatibility

//  Even though it no longer exists in a header file

// Get the key function ~bad_optional_access() into the dylib


=== system/lib/libcxx/src/ostream.cpp ===
SHA256: d6d55652b11b601b2b499679a517aa648a4927d37ac80ac219345fbda5bd7420
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// dynamic_cast requires RTTI, this only affects users whose vendor builds

// the dylib with RTTI disabled. It does not affect users who build with RTTI

// disabled but use a dylib where the RTTI is enabled.

//

// Returning a nullptr means the stream is not considered a terminal and the

// special terminal handling is not done. The terminal handling is mainly of

// importance on Windows.

// _LIBCPP_HAS_RTTI


=== system/lib/libcxx/src/print.cpp ===
SHA256: c0f246d480da3409cd3256123c9b499f5881840ea140cb70c1ec5992a1b513c3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Note the Standard does this in one call, but it's unclear whether

// an invalid handle is allowed when calling GetConsoleMode.

//

// https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/get-osfhandle?view=msvc-170

// https://learn.microsoft.com/en-us/windows/console/getconsolemode

// https://learn.microsoft.com/en-us/windows/console/writeconsole

// clang-format aid

// _LIBCPP_HAS_WIDE_CHARACTERS

// !_LIBCPP_WIN32API


=== system/lib/libcxx/src/pstl/libdispatch.cpp ===
SHA256: 613dfc8d9c316fe6c8e98d4575b0b219cb3f12f28d03cd6fc15671d9d195d018
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace __pstl::__libdispatch


=== system/lib/libcxx/src/random.cpp ===
SHA256: 5cf9184b7516de4ae1cd22e72a2b9c404d815886665949b7887e3db3e094d1cf
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Must be defined before including stdlib.h to enable rand_s().

// defined(_LIBCPP_USING_WIN32_RANDOM)

// Implicitly link against the vDSO system call ABI without

// requiring the final link to specify -lzircon explicitly when

// statically linking libc++.

// The system call cannot fail.  It returns only when the bits are ready.


=== system/lib/libcxx/src/random_shuffle.cpp ===
SHA256: c05f288b5234ff6b9db0983f87648acbeaa46a00eb064739068b851ade7f13e9
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/libcxx/src/regex.cpp ===
SHA256: 756e18bae5e37bc7385fb79240e2d4eb8597694f911e6760b3b321ce2a9c3bd0
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// EBCDIC IBM-1047

// Sorted via the EBCDIC collating sequence

// ASCII

// namespace


=== system/lib/libcxx/src/ryu/d2fixed.cpp ===
SHA256: e182d7b5a2cc2a59d25955cb41319ed8ec22ae43acc4434d04e82295a03d4fae
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Copyright (c) Microsoft Corporation.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// Copyright 2018 Ulf Adams

// Copyright (c) Microsoft Corporation. All rights reserved.

// Boost Software License - Version 1.0 - August 17th, 2003

// Permission is hereby granted, free of charge, to any person or organization

// obtaining a copy of the software and accompanying documentation covered by

// this license (the "Software") to use, reproduce, display, distribute,

// execute, and transmit the Software, and to prepare derivative works of the

// Software, and to permit third-parties to whom the Software is furnished to

// do so, all subject to the following:

// The copyright notices in the Software and this entire statement, including

// the above license grant, this restriction and the following disclaimer,

// must be included in all copies of the Software, in whole or in part, and

// all derivative works of the Software, unless such copies or derivative

// works are solely in the form of machine-executable object code generated by

// a source language processor.

// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT

// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE

// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,

// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

// DEALINGS IN THE SOFTWARE.

// Avoid formatting to keep the changes with the original code minimal.

// clang-format off

// Returns the low 64 bits of the high 128 bits of the 256-bit product of a and b.

// unused

// unused

// After multiplying, we're going to shift right by 29, then truncate to uint32_t.

// This means that we need only 29 + 32 = 61 bits, so we can truncate to uint64_t before shifting.

// For uint32_t truncation, see the __mod1e9() comment in d2s_intrinsics.h.

// ^^^ intrinsics available ^^^

// 64

// 0

// 128

// 64

// 192

// 128

// 0

// unused

// 64

// 128

// __high1 + __c1 can't overflow, so compare against __low2

// 192

// __dist: [0, 52]

// ^^^ intrinsics available ^^^ / vvv intrinsics unavailable vvv

// __j: [128, 160)

// __j: [160, 192)

// ^^^ intrinsics unavailable ^^^

// TRANSITION, LLVM-38217

// TRANSITION, LLVM-38217

// TRANSITION, LLVM-38217

// +1 for ceil, +16 for mantissa, +8 to round up when dividing by 9

// Case distinction; exit early for the easy cases.

// leading zero

// possible decimal point

// zeroes after decimal point

// Decode __bits into mantissa and exponent.

// Temporary: __j is usually around 128, and by shifting a bit, we push it to 128 or above, which is

// a slightly faster code path in __mulShift_mod1e9. Instead, we can just increase the multipliers.

// 0 = don't round up; 1 = round up unconditionally; 2 = round up if odd.

// If the remaining digits are all 0, then we might as well use memset.

// No rounding required in this case.

// Temporary: __j is usually around 128, and by shifting a bit, we push it to 128 or above, which is

// a slightly faster code path in __mulShift_mod1e9. Instead, we can just increase the multipliers.

// Is m * 10^(additionalDigits + 1) / 2^(-__e2) integer?

// Case distinction; exit early for the easy cases.

// leading zero

// possible decimal point

// zeroes after decimal point

// "e+00"

// Decode __bits into mantissa and exponent.

// Temporary: __j is usually around 128, and by shifting a bit, we push it to 128 or above, which is

// a slightly faster code path in __mulShift_mod1e9. Instead, we can just increase the multipliers.

// +1 for decimal point

// Temporary: __j is usually around 128, and by shifting a bit, we push it to 128 or above, which is

// a slightly faster code path in __mulShift_mod1e9. Instead, we can just increase the multipliers.

// +1 for decimal point

// 0 = don't round up; 1 = round up unconditionally; 2 = round up if odd.

// Is m * 2^__e2 * 10^(__precision + 1 - __exp) integer?

// __precision was already increased by 1, so we don't need to write + 1 here.

// +1 for decimal point

// Keep going.

// "e+NNN"

// "e+NN"

// clang-format on


=== system/lib/libcxx/src/ryu/d2s.cpp ===
SHA256: a2c7c814c5a5d98a60643ba7b107084189f7181f66da45177f4e56c0f8ffe6af
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Copyright (c) Microsoft Corporation.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// Copyright 2018 Ulf Adams

// Copyright (c) Microsoft Corporation. All rights reserved.

// Boost Software License - Version 1.0 - August 17th, 2003

// Permission is hereby granted, free of charge, to any person or organization

// obtaining a copy of the software and accompanying documentation covered by

// this license (the "Software") to use, reproduce, display, distribute,

// execute, and transmit the Software, and to prepare derivative works of the

// Software, and to permit third-parties to whom the Software is furnished to

// do so, all subject to the following:

// The copyright notices in the Software and this entire statement, including

// the above license grant, this restriction and the following disclaimer,

// must be included in all copies of the Software, in whole or in part, and

// all derivative works of the Software, unless such copies or derivative

// works are solely in the form of machine-executable object code generated by

// a source language processor.

// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT

// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE

// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,

// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

// DEALINGS IN THE SOFTWARE.

// Avoid formatting to keep the changes with the original code minimal.

// clang-format off

// We need a 64x128-bit multiplication and a subsequent 128-bit shift.

// Multiplication:

//   The 64-bit factor is variable and passed in, the 128-bit factor comes

//   from a lookup table. We know that the 64-bit factor only has 55

//   significant bits (i.e., the 9 topmost bits are zeros). The 128-bit

//   factor only has 124 significant bits (i.e., the 4 topmost bits are

//   zeros).

// Shift:

//   In principle, the multiplication result requires 55 + 124 = 179 bits to

//   represent. However, we then shift this value to the right by __j, which is

//   at least __j >= 115, so the result is guaranteed to fit into 179 - 115 = 64

//   bits. This means that we only need the topmost 64 significant bits of

//   the 64x128-bit multiplication.

//

// There are several ways to do this:

// 1. Best case: the compiler exposes a 128-bit type.

//    We perform two 64x64-bit multiplications, add the higher 64 bits of the

//    lower result to the higher result, and shift by __j - 64 bits.

//

//    We explicitly cast from 64-bit to 128-bit, so the compiler can tell

//    that these are only 64-bit inputs, and can map these to the best

//    possible sequence of assembly instructions.

//    x64 machines happen to have matching assembly instructions for

//    64x64-bit multiplications and 128-bit shifts.

//

// 2. Second best case: the compiler exposes intrinsics for the x64 assembly

//    instructions mentioned in 1.

//

// 3. We only have 64x64 bit instructions that return the lower 64 bits of

//    the result, i.e., we have to use plain C.

//    Our inputs are less than the full width, so we have three options:

//    a. Ignore this fact and just implement the intrinsics manually.

//    b. Split both into 31-bit pieces, which guarantees no internal overflow,

//       but requires extra work upfront (unless we change the lookup table).

//    c. Split only the first factor into 31-bit pieces, which also guarantees

//       no internal overflow, but requires extra work since the intermediate

//       results are not perfectly aligned.

// __m is maximum 55 bits

// 128

// 64

// 64

// 0

// overflow into __high1

// ^^^ intrinsics available ^^^ / vvv intrinsics unavailable vvv

// TRANSITION, VSO-634761

// __m is maximum 55 bits

// overflow into __hi

// ^^^ intrinsics unavailable ^^^

// This is slightly faster than a loop.

// The average output length is 16.38 digits, so we check high-to-low.

// Function precondition: __v is not an 18, 19, or 20-digit number.

// (17 digits are sufficient for round-tripping.)

// A floating decimal representing m * 10^e.

// We subtract 2 so that the bounds computation has 2 additional bits.

// Step 2: Determine the interval of valid decimal representations.

// Implicit bool -> int conversion. True is 1, false is 0.

// We would compute __mp and __mm like this:

// uint64_t __mp = 4 * __m2 + 2;

// uint64_t __mm = __mv - 1 - __mmShift;

// Step 3: Convert to a decimal power base using 128-bit arithmetic.

// I tried special-casing __q == 0, but there was no effect on performance.

// This expression is slightly faster than max(0, __log10Pow2(__e2) - 1).

// This should use __q <= 22, but I think 21 is also safe. Smaller values

// may still be safe, but it's more difficult to reason about them.

// Only one of __mp, __mv, and __mm can be a multiple of 5, if any.

// Same as min(__e2 + (~__mm & 1), __pow5Factor(__mm)) >= __q

// <=> __e2 + (~__mm & 1) >= __q && __pow5Factor(__mm) >= __q

// <=> true && __pow5Factor(__mm) >= __q, since __e2 >= __q.

// Same as min(__e2 + 1, __pow5Factor(__mp)) >= __q.

// This expression is slightly faster than max(0, __log10Pow5(-__e2) - 1).

// {__vr,__vp,__vm} is trailing zeros if {__mv,__mp,__mm} has at least __q trailing 0 bits.

// __mv = 4 * __m2, so it always has at least two trailing 0 bits.

// __mm = __mv - 1 - __mmShift, so it has 1 trailing 0 bit iff __mmShift == 1.

// __mp = __mv + 2, so it always has at least one trailing 0 bit.

// TRANSITION(ulfjack): Use a tighter bound here.

// We need to compute min(ntz(__mv), __pow5Factor(__mv) - __e2) >= __q - 1

// <=> ntz(__mv) >= __q - 1 && __pow5Factor(__mv) - __e2 >= __q - 1

// <=> ntz(__mv) >= __q - 1 (__e2 is negative and -__e2 >= __q)

// <=> (__mv & ((1 << (__q - 1)) - 1)) == 0

// We also need to make sure that the left shift does not overflow.

// Step 4: Find the shortest decimal representation in the interval of valid representations.

// On average, we remove ~2 digits.

// General case, which happens rarely (~0.7%).

// Round even if the exact number is .....50..0.

// We need to take __vr + 1 if __vr is outside bounds or we need to round up.

// Specialized for the common case (~99.3%). Percentages below are relative to this.

// Optimization: remove two digits at a time (~86.2%).

// Loop iterations below (approximately), without optimization above:

// 0: 0.03%, 1: 13.8%, 2: 70.6%, 3: 14.0%, 4: 1.40%, 5: 0.14%, 6+: 0.02%

// Loop iterations below (approximately), with optimization above:

// 0: 70.6%, 1: 27.8%, 2: 1.40%, 3: 0.14%, 4+: 0.02%

// We need to take __vr + 1 if __vr is outside bounds or we need to round up.

// Step 5: Print the decimal representation.

// Value | Fixed   | Scientific

// 1e-3  | "0.001" | "1e-03"

// 1e4   | "10000" | "1e+04"

// Value   | Fixed       | Scientific

// 1234e-7 | "0.0001234" | "1.234e-04"

// 1234e5  | "123400000" | "1.234e+08"

// C11 7.21.6.1 "The fprintf function"/8:

// "Let P equal [...] 6 if the precision is omitted [...].

// Then, if a conversion with style E would have an exponent of X:

// - if P > X >= -4, the conversion is with style f [...].

// - otherwise, the conversion is with style e [...]."

// Example: _Output == 1729, __olength == 4

// _Ryu_exponent | Printed  | _Whole_digits | _Total_fixed_length  | Notes

// --------------|----------|---------------|----------------------|---------------------------------------

//             2 | 172900   |  6            | _Whole_digits        | Ryu can't be used for printing

//             1 | 17290    |  5            | (sometimes adjusted) | when the trimmed digits are nonzero.

// --------------|----------|---------------|----------------------|---------------------------------------

//             0 | 1729     |  4            | _Whole_digits        | Unified length cases.

// --------------|----------|---------------|----------------------|---------------------------------------

//            -1 | 172.9    |  3            | __olength + 1        | This case can't happen for

//            -2 | 17.29    |  2            |                      | __olength == 1, but no additional

//            -3 | 1.729    |  1            |                      | code is needed to avoid it.

// --------------|----------|---------------|----------------------|---------------------------------------

//            -4 | 0.1729   |  0            | 2 - _Ryu_exponent    | C11 7.21.6.1 "The fprintf function"/8:

//            -5 | 0.01729  | -1            |                      | "If a decimal-point character appears,

//            -6 | 0.001729 | -2            |                      | at least one digit appears before it."

// cases "172900" and "1729"

// Rounding can affect the number of digits.

// For example, 1e23 is exactly "99999999999999991611392" which is 23 digits instead of 24.

// We can use a lookup table to detect this and adjust the total length.

// _Whole_digits doesn't need to be adjusted because these cases won't refer to it later.

// case "17.29"

// case "0.001729"

// case "172900"

// 10^22 is the largest power of 10 that's exactly representable as a double.

// Ryu generated X: __v.__mantissa * 10^_Ryu_exponent

// __v.__mantissa == 2^_Trailing_zero_bits * (__v.__mantissa >> _Trailing_zero_bits)

// 10^_Ryu_exponent == 2^_Ryu_exponent * 5^_Ryu_exponent

// _Trailing_zero_bits is [0, 56] (aside: because 2^56 is the largest power of 2

// with 17 decimal digits, which is double's round-trip limit.)

// _Ryu_exponent is [1, 22].

// Normalization adds [2, 52] (aside: at least 2 because the pre-normalized mantissa is at least 5).

// This adds up to [3, 130], which is well below double's maximum binary exponent 1023.

// Therefore, we just need to consider (__v.__mantissa >> _Trailing_zero_bits) * 5^_Ryu_exponent.

// If that product would exceed 53 bits, then X can't be exactly represented as a double.

// (That's not a problem for round-tripping, because X is close enough to the original double,

// but X isn't mathematically equal to the original double.) This requires a high-precision fallback.

// If the product is 53 bits or smaller, then X can be exactly represented as a double (and we don't

// need to re-synthesize it; the original double must have been X, because Ryu wouldn't produce the

// same output for two different doubles X and Y). This allows Ryu's output to be used (zero-filled).

// (2^53 - 1) / 5^0 (for indexing), (2^53 - 1) / 5^1, ..., (2^53 - 1) / 5^22

// __v.__mantissa is guaranteed nonzero

// ^^^ 64-bit ^^^ / vvv 32-bit vvv

// nonzero here

// ^^^ 32-bit ^^^

// Print the integer exactly.

// Performance note: This will redundantly perform bounds checking.

// Performance note: This will redundantly decompose the IEEE representation.

// _Can_use_ryu

// Print the decimal digits, left-aligned within [_First, _First + _Total_fixed_length).

// cases "1729", "17.29", and "0.001729"

// Print the decimal digits, right-aligned within [_First, _First + _Total_fixed_length).

// We prefer 32-bit operations, even on 64-bit platforms.

// We have at most 17 digits, and uint32_t can store 9 digits.

// If _Output doesn't fit into uint32_t, we cut off 8 digits,

// so the rest will fit into uint32_t.

// Expensive 64-bit division.

// TRANSITION, LLVM-38217

// case "172900" with _Can_use_ryu

// Performance note: it might be more efficient to do this immediately after setting _Mid.

// case "1729"

// Done!

// case "17.29"

// Performance note: moving digits might not be optimal.

// case "0.001729"

// Performance note: a larger memset() followed by overwriting '.' might be more efficient.

// digits + possible decimal point

// + scientific exponent

// Print the decimal digits.

// We prefer 32-bit operations, even on 64-bit platforms.

// We have at most 17 digits, and uint32_t can store 9 digits.

// If _Output doesn't fit into uint32_t, we cut off 8 digits,

// so the rest will fit into uint32_t.

// Expensive 64-bit division.

// TRANSITION, LLVM-38217

// We can't use memcpy here: the decimal dot goes between these two digits.

// Print decimal point if needed.

// Print the exponent.

// f = __m2 * 2^__e2 >= 2^53 is an integer.

// Ignore this case for now.

// f < 1.

// Since 2^52 <= __m2 < 2^53 and 0 <= -__e2 <= 52: 1 <= f = __m2 / 2^-__e2 < 2^53.

// Test if the lower -__e2 bits of the significand are 0, i.e. whether the fraction is 0.

// f is an integer in the range [1, 2^53).

// Note: __mantissa might contain trailing (decimal) 0's.

// Note: since 2^53 < 10^16, there is no need to adjust __decimalLength17().

// Step 1: Decode the floating-point number, and unify normalized and subnormal cases.

// Case distinction; exit early for the easy cases.

// Print "0" for chars_format::fixed, chars_format::general, and chars_format{}.

// Decode __bits into mantissa and exponent.

// const uint64_t _Mantissa2 = __ieeeMantissa | (1ull << __DOUBLE_MANTISSA_BITS); // restore implicit bit

// bias and normalization

// Normal values are equal to _Mantissa2 * 2^_Exponent2.

// (Subnormals are different, but they'll be rejected by the _Exponent2 test here, so they can be ignored.)

// For nonzero integers, _Exponent2 >= -52. (The minimum value occurs when _Mantissa2 * 2^_Exponent2 is 1.

// In that case, _Mantissa2 is the implicit 1 bit followed by 52 zeros, so _Exponent2 is -52 to shift away

// the zeros.) The dense range of exactly representable integers has negative or zero exponents

// (as positive exponents make the range non-dense). For that dense range, Ryu will always be used:

// every digit is necessary to uniquely identify the value, so Ryu must print them all.

// Positive exponents are the non-dense range of exactly representable integers. This contains all of the values

// for which Ryu can't be used (and a few Ryu-friendly values). We can save time by detecting positive

// exponents here and skipping Ryu. Calling __d2fixed_buffered_n() with precision 0 is valid for all integers

// (so it's okay if we call it with a Ryu-friendly value).

// For small integers in the range [1, 2^53), __v.__mantissa might contain trailing (decimal) zeros.

// For scientific notation we need to move these zeros into the exponent.

// (This is not needed for fixed-point notation, so it might be beneficial to trim

// trailing zeros in __to_chars only if needed - once fixed-point notation output is implemented.)

// clang-format on


=== system/lib/libcxx/src/ryu/f2s.cpp ===
SHA256: 6b20f690d560361141cc99032e40bf6be39b3e46b11c169fc0a2f478135a119b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Copyright (c) Microsoft Corporation.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// Copyright 2018 Ulf Adams

// Copyright (c) Microsoft Corporation. All rights reserved.

// Boost Software License - Version 1.0 - August 17th, 2003

// Permission is hereby granted, free of charge, to any person or organization

// obtaining a copy of the software and accompanying documentation covered by

// this license (the "Software") to use, reproduce, display, distribute,

// execute, and transmit the Software, and to prepare derivative works of the

// Software, and to permit third-parties to whom the Software is furnished to

// do so, all subject to the following:

// The copyright notices in the Software and this entire statement, including

// the above license grant, this restriction and the following disclaimer,

// must be included in all copies of the Software, in whole or in part, and

// all derivative works of the Software, unless such copies or derivative

// works are solely in the form of machine-executable object code generated by

// a source language processor.

// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT

// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE

// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,

// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

// DEALINGS IN THE SOFTWARE.

// Avoid formatting to keep the changes with the original code minimal.

// clang-format off

// Returns true if __value is divisible by 5^__p.

// Returns true if __value is divisible by 2^__p.

// __builtin_ctz doesn't appear to be faster here.

// The casts here help MSVC to avoid calls to the __allmul library

// function.

// On 32-bit platforms we can avoid a 64-bit shift-right since we only

// need the upper 32 bits of the result and the shift value is > 32.

// ^^^ 32-bit ^^^ / vvv 64-bit vvv

// ^^^ 64-bit ^^^

// A floating decimal representing m * 10^e.

// We subtract 2 so that the bounds computation has 2 additional bits.

// Step 2: Determine the interval of valid decimal representations.

// Implicit bool -> int conversion. True is 1, false is 0.

// Step 3: Convert to a decimal power base using 64-bit arithmetic.

// We need to know one removed digit even if we are not going to loop below. We could use

// __q = X - 1 above, except that would require 33 bits for the result, and we've found that

// 32-bit arithmetic is faster even on 64-bit machines.

// The largest power of 5 that fits in 24 bits is 5^10, but __q <= 9 seems to be safe as well.

// Only one of __mp, __mv, and __mm can be a multiple of 5, if any.

// {__vr,__vp,__vm} is trailing zeros if {__mv,__mp,__mm} has at least __q trailing 0 bits.

// __mv = 4 * __m2, so it always has at least two trailing 0 bits.

// __mm = __mv - 1 - __mmShift, so it has 1 trailing 0 bit iff __mmShift == 1.

// __mp = __mv + 2, so it always has at least one trailing 0 bit.

// TRANSITION(ulfjack): Use a tighter bound here.

// Step 4: Find the shortest decimal representation in the interval of valid representations.

// General case, which happens rarely (~4.0%).

// TRANSITION, LLVM-23106

// Round even if the exact number is .....50..0.

// We need to take __vr + 1 if __vr is outside bounds or we need to round up.

// Specialized for the common case (~96.0%). Percentages below are relative to this.

// Loop iterations below (approximately):

// 0: 13.6%, 1: 70.7%, 2: 14.1%, 3: 1.39%, 4: 0.14%, 5+: 0.01%

// We need to take __vr + 1 if __vr is outside bounds or we need to round up.

// Print the integer _Mantissa2 * 2^_Exponent2 exactly.

// For nonzero integers, _Exponent2 >= -23. (The minimum value occurs when _Mantissa2 * 2^_Exponent2 is 1.

// In that case, _Mantissa2 is the implicit 1 bit followed by 23 zeros, so _Exponent2 is -23 to shift away

// the zeros.) The dense range of exactly representable integers has negative or zero exponents

// (as positive exponents make the range non-dense). For that dense range, Ryu will always be used:

// every digit is necessary to uniquely identify the value, so Ryu must print them all.

// Positive exponents are the non-dense range of exactly representable integers.

// This contains all of the values for which Ryu can't be used (and a few Ryu-friendly values).

// Performance note: Long division appears to be faster than losslessly widening float to double and calling

// __d2fixed_buffered_n(). If __f2fixed_buffered_n() is implemented, it might be faster than long division.

// because __ieeeExponent <= 254

// Manually represent _Mantissa2 * 2^_Exponent2 as a large integer. _Mantissa2 is always 24 bits

// (due to the implicit bit), while _Exponent2 indicates a shift of at most 104 bits.

// 24 + 104 equals 128 equals 4 * 32, so we need exactly 4 32-bit elements.

// We use a little-endian representation, visualized like this:

// << left shift <<

// most significant

// _Data[3] _Data[2] _Data[1] _Data[0]

//                   least significant

//                   >> right shift >>

// _Maxidx is the index of the most significant nonzero element.

// _Mantissa2's 24 bits don't cross an element boundary

// _Mantissa2's 24 bits cross an element boundary

// If Ryu hasn't determined the total output length, we need to buffer the digits generated from right to left

// by long division. The largest possible float is: 340'282346638'528859811'704183484'516925440

// From left to right, we're going to print:

// _Data[0] will be [1, 10] digits.

// Then if _Filled_blocks > 0:

// _Blocks[_Filled_blocks - 1], ..., _Blocks[0] will be 0-filled 9-digit blocks.

// If the integer is actually large, perform long division.

// Otherwise, skip to printing _Data[0].

// Loop invariant: _Maxidx != 0 (i.e. the integer is actually large)

// Process less significant elements.

// Initially, _Remainder is at most 10^9 - 1.

// Now, _Remainder is at most (10^9 - 1) * 2^32 + 2^32 - 1, simplified to 10^9 * 2^32 - 1.

// floor((10^9 * 2^32 - 1) / 10^9) == 2^32 - 1, so uint32_t _Quotient is lossless.

// _Remainder is at most 10^9 - 1 again.

// For uint32_t truncation, see the __mod1e9() comment in d2s_intrinsics.h.

// Store a 0-filled 9-digit block.

// Is the large integer shrinking?

// log2(10^9) is 29.9, so we can't shrink by more than one element.

// We've finished long division. Now we need to print _Data[0].

// Print _Data[0]. While it's up to 10 digits,

// which is more than Ryu generates, the code below can handle this.

// Print 0-filled 9-digit blocks.

// Step 5: Print the decimal representation.

// Value | Fixed   | Scientific

// 1e-3  | "0.001" | "1e-03"

// 1e4   | "10000" | "1e+04"

// Value   | Fixed       | Scientific

// 1234e-7 | "0.0001234" | "1.234e-04"

// 1234e5  | "123400000" | "1.234e+08"

// C11 7.21.6.1 "The fprintf function"/8:

// "Let P equal [...] 6 if the precision is omitted [...].

// Then, if a conversion with style E would have an exponent of X:

// - if P > X >= -4, the conversion is with style f [...].

// - otherwise, the conversion is with style e [...]."

// Example: _Output == 1729, __olength == 4

// _Ryu_exponent | Printed  | _Whole_digits | _Total_fixed_length  | Notes

// --------------|----------|---------------|----------------------|---------------------------------------

//             2 | 172900   |  6            | _Whole_digits        | Ryu can't be used for printing

//             1 | 17290    |  5            | (sometimes adjusted) | when the trimmed digits are nonzero.

// --------------|----------|---------------|----------------------|---------------------------------------

//             0 | 1729     |  4            | _Whole_digits        | Unified length cases.

// --------------|----------|---------------|----------------------|---------------------------------------

//            -1 | 172.9    |  3            | __olength + 1        | This case can't happen for

//            -2 | 17.29    |  2            |                      | __olength == 1, but no additional

//            -3 | 1.729    |  1            |                      | code is needed to avoid it.

// --------------|----------|---------------|----------------------|---------------------------------------

//            -4 | 0.1729   |  0            | 2 - _Ryu_exponent    | C11 7.21.6.1 "The fprintf function"/8:

//            -5 | 0.01729  | -1            |                      | "If a decimal-point character appears,

//            -6 | 0.001729 | -2            |                      | at least one digit appears before it."

// cases "172900" and "1729"

// Rounding can affect the number of digits.

// For example, 1e11f is exactly "99999997952" which is 11 digits instead of 12.

// We can use a lookup table to detect this and adjust the total length.

// _Whole_digits doesn't need to be adjusted because these cases won't refer to it later.

// case "17.29"

// case "0.001729"

// case "172900"

// 10^10 is the largest power of 10 that's exactly representable as a float.

// Ryu generated X: __v.__mantissa * 10^_Ryu_exponent

// __v.__mantissa == 2^_Trailing_zero_bits * (__v.__mantissa >> _Trailing_zero_bits)

// 10^_Ryu_exponent == 2^_Ryu_exponent * 5^_Ryu_exponent

// _Trailing_zero_bits is [0, 29] (aside: because 2^29 is the largest power of 2

// with 9 decimal digits, which is float's round-trip limit.)

// _Ryu_exponent is [1, 10].

// Normalization adds [2, 23] (aside: at least 2 because the pre-normalized mantissa is at least 5).

// This adds up to [3, 62], which is well below float's maximum binary exponent 127.

// Therefore, we just need to consider (__v.__mantissa >> _Trailing_zero_bits) * 5^_Ryu_exponent.

// If that product would exceed 24 bits, then X can't be exactly represented as a float.

// (That's not a problem for round-tripping, because X is close enough to the original float,

// but X isn't mathematically equal to the original float.) This requires a high-precision fallback.

// If the product is 24 bits or smaller, then X can be exactly represented as a float (and we don't

// need to re-synthesize it; the original float must have been X, because Ryu wouldn't produce the

// same output for two different floats X and Y). This allows Ryu's output to be used (zero-filled).

// (2^24 - 1) / 5^0 (for indexing), (2^24 - 1) / 5^1, ..., (2^24 - 1) / 5^10

// __v.__mantissa is guaranteed nonzero

// restore implicit bit

// bias and normalization

// Performance note: We've already called Ryu, so this will redundantly perform buffering and bounds checking.

// _Can_use_ryu

// Print the decimal digits, left-aligned within [_First, _First + _Total_fixed_length).

// cases "1729", "17.29", and "0.001729"

// Print the decimal digits, right-aligned within [_First, _First + _Total_fixed_length).

// TRANSITION, LLVM-38217

// case "172900" with _Can_use_ryu

// Performance note: it might be more efficient to do this immediately after setting _Mid.

// case "1729"

// Done!

// case "17.29"

// Performance note: moving digits might not be optimal.

// case "0.001729"

// Performance note: a larger memset() followed by overwriting '.' might be more efficient.

// digits + possible decimal point + scientific exponent

// Print the decimal digits.

// TRANSITION, LLVM-38217

// We can't use memcpy here: the decimal dot goes between these two digits.

// Print decimal point if needed.

// Print the exponent.

// Step 1: Decode the floating-point number, and unify normalized and subnormal cases.

// Case distinction; exit early for the easy cases.

// Print "0" for chars_format::fixed, chars_format::general, and chars_format{}.

// Decode __bits into mantissa and exponent.

// When _Fmt == chars_format::fixed and the floating-point number is a large integer,

// it's faster to skip Ryu and immediately print the integer exactly.

// restore implicit bit

// bias and normalization

// Normal values are equal to _Mantissa2 * 2^_Exponent2.

// (Subnormals are different, but they'll be rejected by the _Exponent2 test here, so they can be ignored.)

// clang-format on


=== system/lib/libcxx/src/shared_mutex.cpp ===
SHA256: aed355371e37deb408d6d59195670b2b7c8368ae2af54192e8d77e470e66b4a4
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Shared Mutex Base

// Exclusive ownership

// Shared ownership

// Shared Timed Mutex

// These routines are here for ABI stability


=== system/lib/libcxx/src/std_stream.h ===
SHA256: 852fcbb090e5729367c1f441a801dbe7351070aecd9e5aa1bb0ff3a151cc3cd6
// -*- C++ -*-

//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __stdinbuf

// On Windows, in wchar_t mode, ignore the codecvt from the locale by

// default and assume noconv; this passes wchar_t through unmodified from

// getwc. If the user sets a custom locale with imbue(), that gets honored,

// the IO is done with getc() and converted with the provided codecvt.

// __stdoutbuf

// On Windows, in wchar_t mode, ignore the codecvt from the locale by

// default and assume noconv; this passes wchar_t through unmodified to

// fputwc, which handles it correctly depending on the actual mode of the

// output stream. If the user sets a custom locale with imbue(), that

// gets honored.

// fputwc works regardless of wide/narrow mode of stdout, while

// fwrite of wchar_t only works if the stream actually has been set

// into wide mode.

// For wchar_t on Windows, don't call fwrite(), but write characters one

// at a time with fputwc(); that works both when stdout is in the default

// mode and when it is set to Unicode mode.

// _LIBCPP_STD_STREAM_H


=== system/lib/libcxx/src/stdexcept.cpp ===
SHA256: 1ebd64bc015d00799f6373d9b1a47a57e95143a06bbd7e488c7c866d970e4872
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//


=== system/lib/libcxx/src/string.cpp ===
SHA256: c3005540d04e444f7f3fe8baab65e8d0ce1bca89794b6387f414c3f90e0a1c55
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// The struct isn't declared anymore in the headers. It's only here for ABI compatibility.

// _LIBCPP_ABI_DO_NOT_EXPORT_BASIC_STRING_COMMON

// Define legacy ABI functions

// ---------------------------

// _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION

// as_integer

// string

// Use long as no Standard string to integer exists.

// wstring

// Use long as no Stantard string to integer exists.

// _LIBCPP_HAS_WIDE_CHARACTERS

// as_float

// _LIBCPP_HAS_WIDE_CHARACTERS

// unnamed namespace

// _LIBCPP_HAS_WIDE_CHARACTERS

// to_string

// as_string

// Assume this is advice of how much space we need.

// _LIBCPP_HAS_WIDE_CHARACTERS

//  numeric_limits::digits10 returns value less on 1 than desired for unsigned numbers.

//  For example, for 1-byte unsigned value digits10 is 2 (999 can not be represented),

//  so we need +1 here.

// +1 for minus, +1 for digits10

// unnamed namespace


=== system/lib/libcxx/src/strstream.cpp ===
SHA256: ef1f0e29848addb728eb51d3866124929c6f445efb6f2bac723cff25ddd8385a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// min(pbase, newpos), newpos, epptr()

// min(pbase, newpos), newpos, epptr()


=== system/lib/libcxx/src/support/ibm/mbsnrtowcs.cpp ===
SHA256: 0999615c35a8605333451af97aeb3fea88f20fb93f6d757421528307f741f861
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// size_t

// mbstate_t

// MB_LEN_MAX

// wmemcpy

// Returns the number of wide characters found in the multi byte sequence `src`

// (of `src_size_bytes`), that fit in the buffer `dst` (of `max_dest_chars`

// elements size). The count returned excludes the null terminator.

// When `dst` is NULL, no characters are copied to `dst`.

// Returns (size_t) -1 when an invalid sequence is encountered.

// Leaves *`src` pointing to the next character to convert or NULL

// if a null character was converted from *`src`.

// If `dst` is null then `max_dest_chars` should be ignored according to the

// standard. Setting `max_dest_chars` to a large value has this effect.

// Converts one multi byte character.

// If result (char_size) is greater than 0, it's the size in bytes of that character.

// If result (char_size) is zero, it indicates that the null character has been found.

// Otherwise, it's an error and errno may be set.

// dst has enough space to translate in-place.

/*
       * dst may not have enough space, so use a temporary buffer.
       *
       * We need to save a copy of the conversion state
       * here so we can restore it if the multibyte
       * character is too long for the buffer.
       */

// Multi-byte sequence for character won't fit.

// The buffer was used, so we need copy the translation to dst.

// Don't do anything to change errno from here on.


=== system/lib/libcxx/src/support/ibm/wcsnrtombs.cpp ===
SHA256: 44cdb06c541ab4c6deb2c7addf8849ea41765c90826af3ec65251d9a440b874e
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// mbstate_t

// MB_LEN_MAX

// MB_CUR_MAX, size_t

// memcpy

// Converts `max_source_chars` from the wide character buffer pointer to by *`src`,

// into the multi byte character sequence buffer stored at `dst`, which must be

// `dst_size_bytes` bytes in size. Returns the number of bytes in the sequence

// converted from *src, excluding the null terminator.

// Returns (size_t) -1 if an error occurs and sets errno.

// If `dst` is NULL, `dst_size_bytes` is ignored and no bytes are copied to `dst`.

// If `dst` is null then `dst_size_bytes` should be ignored according to the

// standard. Setting dst_size_bytes to a large value has this effect.

// dst has enough space to translate in-place.

/*
       * dst may not have enough space, so use a temporary buffer.
       *
       * We need to save a copy of the conversion state
       * here so we can restore it if the multibyte
       * character is too long for the buffer.
       */

// Multi-byte sequence for character won't fit.

// The buffer was used, so we need copy the translation to dst.

// result (char_size) contains the size of the multi-byte-sequence converted.

// Otherwise, result (char_size) is (size_t) -1 and wcrtomb() sets the errno.


=== system/lib/libcxx/src/support/ibm/xlocale_zos.cpp ===
SHA256: 97c1064962eb60e2e0b36feb6ee421fa68cdd445fa0c8c431fe6607ab48c9f29
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __cplusplus

// Maintain current locale name(s) to restore later.

// Check for errors.

// Create new locale.

// Copy base when it will not be overwritten.

// Restore current locale.

// Maintain current locale name(s).

// Set locales and check for errors.

// Construct and return previous locale.

// current_loc_name might be a comma-separated locale name list.

// Tokenize locale name list.

// Skip LC_TOD.

// __cplusplus


=== system/lib/libcxx/src/support/win32/compiler_rt_shims.cpp ===
SHA256: eb4a3b46b2285f1227e957fe37c343a6d53b5992119ac65da29c5152045865b9
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// This file reimplements builtins that are normally provided by compiler-rt, which is

// not provided on Windows. This should go away once compiler-rt is shipped on Windows.

//


=== system/lib/libcxx/src/support/win32/locale_win32.cpp ===
SHA256: b2d4c7f89885757ccdd0e6a08514594071357f19583e48bd3c832937e35e923c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// std::localeconv() & friends

// va_start & friends

// std::vsnprintf & friends

// std::strtof & friends

// std::strftime

// wide char manipulation

//

// Locale management

//

// FIXME: base and mask currently unused. Needs manual work to construct the new locale

/*mask*/

/*base*/

//

// Strtonum functions

//

//

// Character manipulation functions

//

//

// Other functions

//

// FIXME: Remove usage of internal CRT function and globals.

// Like sprintf, but when return value >= 0 it returns

// a pointer to a malloc'd string in *sptr.

// If return >= 0, use free to delete *sptr.

// Query the count required.

// If we haven't used exactly what was required, something is wrong.

// Maybe bug in vsnprintf. Report the error and return.

// All good. This is returning memory to the caller not freeing it.

// namespace __locale


=== system/lib/libcxx/src/support/win32/support.cpp ===
SHA256: 6a009882655599f104ca8b8380889fa7f63c11ca7f20d723d462a9e844fd3fc1
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// va_start, va_end

// size_t

// vsprintf, vsnprintf

// malloc

// strcpy, wcsncpy

// mbstate_t

// Returns >= 0: the number of wide characters found in the

// multi byte sequence src (of src_size_bytes), that fit in the buffer dst

// (of max_dest_chars elements size). The count returned excludes the

// null terminator. When dst is NULL, no characters are copied

// and no "out" parameters are updated.

// Returns (size_t) -1: an incomplete sequence encountered.

// Leaves *src pointing the next character to convert or NULL

// if a null character was converted from *src.

// const size_t invalid_sequence = static_cast<size_t>(-1);

// If dst is null then max_dest_chars should be ignored according to the

// standard.  Setting max_dest_chars to a large value has this effect.

// Converts one multi byte character.

// if result > 0, it's the size in bytes of that character.

// othewise if result is zero it indicates the null character has been found.

// otherwise it's an error and errno may be set.

// Don't do anything to change errno from here on.

// Converts max_source_chars from the wide character buffer pointer to by *src,

// into the multi byte character sequence buffer stored at dst which must be

// dst_size_bytes bytes in size.

// Returns >= 0: the number of bytes in the sequence

// converted from *src, excluding the null terminator.

// Returns size_t(-1) if an error occurs, also sets errno.

// If dst is NULL dst_size_bytes is ignored and no bytes are copied to dst

// and no "out" parameters are updated.

// const size_t invalid_sequence = static_cast<size_t>(-1);

// If dst is null then dst_size_bytes should be ignored according to the

// standard.  Setting dest_remaining to a large value has this effect.

// If result is zero there is no error and char_size contains the

// size of the multi-byte-sequence converted.

// Otherwise result indicates an errno type error.


=== system/lib/libcxx/src/support/win32/thread_win32.cpp ===
SHA256: 50376df0e01fa8341896a5783757bbcb30457a76a6387846db9ffee7e15371f8
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Mutex

// Condition Variable

// Execute Once

// Thread ID

// Thread

// round-up to the nearest millisecond

// FIXME(compnerd) this should be an alertable sleep (WFSO or SleepEx)

// Thread Local Storage


=== system/lib/libcxx/src/system_error.cpp ===
SHA256: 82b3bf2367d76f7a5fde7824b53289fd55115794fd01ad1976a02247e50187e2
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace

//  GLIBC also uses 1024 as the maximum buffer size internally.

// Only one of the two following functions will be used, depending on

// the return type of strerror_r:

// For the GNU variant, a char* return value:

// GNU always returns a string pointer in its return value. The

// string might point to either the input buffer, or a static

// buffer, but we don't care which.

// For the POSIX variant: an int return value.

// The POSIX variant either:

// - fills in the provided buffer and returns 0

// - returns a positive error value, or

// - returns -1 and fills in errno with an error value.

// Only handle EINVAL. Other errors abort.

// FIXME maybe? 'strerror_buff_size' is likely to exceed the

// maximum error size so ERANGE shouldn't be returned.

// This function handles both GNU and POSIX variants, dispatching to

// one of the two above functions.

// Preserve errno around the call. (The C++ standard requires that

// system_error functions not modify errno).

// If we didn't get any message, print one now.

// _LIBCPP_HAS_THREADS

// namespace

// _LIBCPP_ELAST

// _LIBCPP_ELAST

// Remap windows error codes to generic error codes if possible.

// _LIBCPP_ELAST

// error_condition

// error_code

// system_error

// The above could also handle the no-exception case, but for size, avoid referencing system_category() unnecessarily.


=== system/lib/libcxx/src/thread.cpp ===
SHA256: 027d8f3ca049a7d1718e0701391c18c989169ef10900227a392a1270edb910e4
//===------------------------- thread.cpp----------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// for sysconf

// Do not create libpthread dependency

// sysconf returns -1 if the name is invalid, the option does not exist or

// does not have a definite limit.

// if sysconf returns some other negative number, we have no idea

// what is going on. Default to something safe.

// defined(CTL_HW) && defined(HW_NCPU)

// TODO: grovel through /proc or check cpuid on x86 and similar

// instructions on other architectures.

// Means not computable [thread.thread.static]

// defined(CTL_HW) && defined(HW_NCPU)

// namespace this_thread

// Even though __thread_specific_ptr's destructor doesn't actually destroy

// anything (see comments there), we can't call it at all because threads may

// outlive the static variable and calling its destructor means accessing an

// object outside of its lifetime, which is UB.

// __thread_struct_imp

// __thread_struct


=== system/lib/libcxx/src/typeinfo.cpp ===
SHA256: 484f7fe899ac0c9101b0b9cc2d320030a4f72aa3ced68131071858722bdfd6c6
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// TODO(compnerd) cache demangled &__data.__decorated_name[1]

// _LIBCPP_ABI_MICROSOFT

// FIXME: Remove the _LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY configuration.


=== system/lib/libcxx/src/valarray.cpp ===
SHA256: f525bff94558b7ae0f7fd31bd101219e4485b12e8dbf5a79a3ddcda9d4ec35af
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// These two symbols are part of the v1 ABI but not part of the >=v2 ABI.


=== system/lib/libcxx/src/variant.cpp ===
SHA256: 1409f5559f84668a585b0cedb83d854dc3802dfeb03eefb184bf6f0735e19c90
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// namespace std


=== system/lib/libcxx/src/vector.cpp ===
SHA256: 87b2758e8fc5f967156cc42e81a72235fcb93126e9a0f6d62162878fda927629
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// _LIBCPP_ABI_DO_NOT_EXPORT_VECTOR_BASE_COMMON


=== system/lib/libcxx/src/verbose_abort.cpp ===
SHA256: 27b9fe60fb3210e118711bbe09229be2846b14b55517462bbeac9977f9c8d99c
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __BIONIC__

// Write message to stderr. We do this before formatting into a

// buffer so that we still get some information out if that fails.

// TODO(sbc): Add newline here unconditionally. libc++ seems inconsistent about strings

// passed to __libcpp_verbose_abort. The _LIBCPP_VERBOSE_ABORT macro seems to never use

// newlines, but _LIBCPP_ASSERTION_HANDLER does include a newline.

// Format the arguments into an allocated buffer for CrashReport & friends.

// We leak the buffer on purpose, since we're about to abort() anyway.

// Note that we should technically synchronize accesses here (by e.g. taking a lock),

// however concretely we're only setting a pointer, so the likelihood of a race here

// is low.

// Show error in tombstone.

// Show error in logcat.


=== system/lib/libcxxabi/include/__cxxabi_config.h ===
SHA256: 89b25940fbc47b64747e867cb0b023e04a4c9151a577cd45bf636d56b81a4422
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// wasm32 follows the arm32 ABI convention of using 32-bit guard.

// ____CXXABI_CONFIG_H


=== system/lib/libcxxabi/include/cxxabi.h ===
SHA256: 3c2ca8786f9419e1151a5fe92b8dbdcdadf0bde3011e7154d60b172b67ff4ebc
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*
 * This header provides the interface to the C++ ABI as defined at:
 *       https://itanium-cxx-abi.github.io/cxx-abi/
 */

// forward declaration

// forward declaration

// runtime routines use C calling conventions, but are in __cxxabiv1 namespace

// 2.4.2 Allocating the Exception Object

// This function is an LLVM extension, which mirrors the same extension in libsupc++ and libcxxrt

// In Wasm, a destructor returns its argument

// 2.4.3 Throwing the Exception Object

// 2.5.3 Exception Handlers

// GNU extension

// Calls `terminate` with the current exception being caught. This function is used by GCC when a `noexcept` function

// throws an exception inside a try/catch block and doesn't catch it.

// 2.5.4 Rethrowing Exceptions

// 2.6 Auxiliary Runtime APIs

// 3.2.6 Pure Virtual Function API

// 3.2.7 Deleted Virtual Function API

// 3.3.2 One-time Construction API

// 3.3.3 Array Construction and Destruction API

// 3.3.5.3 Runtime API

// These functions are part of the C++ ABI, but they are not defined in libc++abi:

//    int __cxa_atexit(void (*)(void *), void *, void *);

//    void __cxa_finalize(void *);

// 3.4 Demangler API

// Apple additions to support C++ 0x exception_ptr class

// These are primitives to wrap a smart pointer around an exception object

// Apple extension to support std::uncaught_exception()

// Linux and Fuchsia TLS support. Not yet an official part of the Itanium ABI.

// https://sourceware.org/glibc/wiki/Destructor%20support%20for%20thread_local%20variables

// extern "C"

// namespace __cxxabiv1

// __cplusplus

// __CXXABI_H


=== system/lib/libcxxabi/src/__cpp_exception.S ===
SHA256: 220771d0cb43005197fd3f6481553b6baee0355ec91baea821737d4236fcbddc
/*
 * Copyright 2025 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 *
 * Define the `__cpp_exception` Wasm EH tag which is used to implmenent C++
 * exception handling in LLVM.
 */

#ifdef __wasm_exception_handling__

#ifdef __wasm64__
#define PTR i64
#else
#define PTR i32
#endif

.globl __cpp_exception
.tagtype __cpp_exception PTR
__cpp_exception:

#endif // !__wasm_exception_handling__



=== system/lib/libcxxabi/src/abort_message.cpp ===
SHA256: 4f09052dd4352a7792633c632e17e2a42808e471f5d62471bb65b55b95998833
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __BIONIC__

// Write message to stderr. We do this before formatting into a

// variable-size buffer so that we still get some information if

// formatting into the variable-sized buffer fails.

// Just trap in a non-debug build. These internal libcxxabi assertions are

// very rare, and it's not worth linking in vfprintf stdio support or

// even minimal logging for them, as we'll have a proper call stack, which

// will show a call into "abort_message", and can help debugging. (In a

// debug build that won't be inlined.)

// Format the arguments into an allocated buffer. We leak the buffer on

// purpose, since we're about to abort() anyway.

// Show error in tombstone.

// Show error in logcat.

// __BIONIC__


=== system/lib/libcxxabi/src/abort_message.h ===
SHA256: a5d95a89ae7013a171d3f7688f70f7b71e870ff85f2144c250782c399cff20de
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// __ABORT_MESSAGE_H_


=== system/lib/libcxxabi/src/aix_state_tab_eh.inc ===
SHA256: c7d1a49b267e6b13e48e2a7e80d273aceba1dded60d4185e55ff74eb92b70c31
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//  This file implements the personality and helper functions for the state

//  table based EH used by IBM legacy compilers xlC and xlclang++ on AIX.

//

//===----------------------------------------------------------------------===//

/*
  The legacy IBM xlC and xlclang++ compilers use the state table for EH
  instead of the range table. Destructors, or addresses of the possible catch
  sites or cleanup code are specified in the state table which is a finite
  state machine (FSM). Each function that has a state table also has an
  autolocal state variable. The state variable represents the current state
  of the function for EH and is found through the traceback table of the
  function during unwinding, which is located at the end of each function.
  The FSM is an array of state entries. Each state entry has the following
  fields:

  * offset/address/pointer - the offset used to locate the object, or the
    address of a global object, or the address of the next state if it is an
    old conditional state change entry;
  * dtor/landing pad - address of the destructor function to invoke,
    or address of the catch block or cleanup code in the user code to branch to;
  * element count/action flag - the number of elements or the flag for actions;
  * element size - if the object is an array this is the size of one element
    of the array;
  * flags - flags used to control how fields in the entry are interpreted;
  * next state - the state to execute next after the action for this state is
    performed. The value of zero indicates the end of the state for this
    function.

  The following is the description of 'element count/action flag' field.
+-----------------------------------------------------------------------------+
| value |      description       |                  action                    |
+-------+------------------------+--------------------------------------------+
| > 1   |   object is an array   | calls __cxa_vec_cleanup to run dtor for    |
|       |                        | each member of the array                   |
+-------+------------------------+--------------------------------------------+
| 1, 0  |   object is a scalar   | calls dtor for the object                  |
+-------+------------------------+--------------------------------------------+
|  -1   |      begin catch       | branches to the handler which performes    |
|       |                        | catch-match. If there is no catch that     |
|       |                        | matches the exception it will be rethrown  |
+-------+------------------------+--------------------------------------------+
|  -2   |       end catch        | ends current catch block and continues     |
|       |                        | attempting to catch the exception          |
+-------+------------------------+--------------------------------------------+
|  -3   |   delete the object    | calls the delete function of the object    |
+-------+------------------------+--------------------------------------------+
|  -4   |      cleanup label     | branches to the user code for cleaning up  |
+-------+------------------------+--------------------------------------------+
*/

// Macros for debugging the state table parsing.

// NDEBUG

// Definition of flags for the state table entry field 'action flag'.

// Definition of flags for the state table entry field 'flags'.

// Object was thrown from a function where

// the return value optimization was used.

// State table entry is an indirect state

// change, dereference the address in

// offset as int for the target state.

// This is deprecated. This indicates

// the address is direct. (static local).

// State table entry is an indirect state

// change, dereference the address in

// offset as int for the target state.

// The temporary is an automatic. State

// change is used in cases such as

// (b?(T1(),foo()):(T2(),foo())),throw 42;

// which causes a conditional state change

// so that we know if T1 or T2 need to be

// destroyed.

// The address of the object for the

// cleanup action is based on the

// StateVariable::thisValue.

// The object is of a virtual base class.

// FSMEntry::address is the address of

// a global object.

// The finite state machine to be walked.

// Offset of the object within its stack frame or containing object.

// Address of a global object.

// Address of the next state if it is an old conditional state change entry.

// Address of the destructor function with 1 argument.

// Address of the destructor function with 2 arguments.

// The address of the catch block or cleanup code.

// The flag for actions (when the value is negative).

// The element count (when the value is positive or zero).

// Magic number of the state table.

// Actually table[numberOfStates].

// The state variable on the stack.

// namespace

// State table magic number

// State table generated by xlC compiler.

// State table generated by early version xlC compiler.

// State table generated by xlclang++ compiler.

// Flag to destructor indicating to free

// virtual bases, don't delete object.

// 'destructor' holds a function pointer to delete().

// Get the frame address of the current function from its traceback table

// which is at the end of each function.

// default frame pointer == SP.

// Keep looking forward until a word of 0 is found. The traceback

// table starts at the following word.

// Skip field parminfo if it exists.

// Skip field tb_offset if it exists.

// Skip field hand_mask if it exists.

// Skip fields ctl_info and ctl_info_disp if they exist.

// Skip fields name_len and name if exist.

// Calculate the object address from the FSM entry.

// Initialize results to found nothing but an error.

// Check for consistent actions.

// Do Phase 1

// None of these flags should be set during Phase 1.

//   Client error

// _UA_HANDLER_FRAME should only be set if phase 1 found a handler.

// If _UA_FORCE_UNWIND is set, phase 1 shouldn't have happened.

//    Client error

// Neither _UA_SEARCH_PHASE nor _UA_CLEANUP_PHASE is set.

//   Client error

// Start scan by getting state table address.

// The state is not correct - give up on this routine.

// Parse the state table.

// Something is wrong with the state table we found.

// We should never get here.

// Print the state table for debugging purposes.

// Print out the FSM table.

// Start walking the state table. Use a local copy of state->state so when

// we return from search phase we don't change the state number.

// Found a catch handler.

// xlC catch handlers cannot be entered because they use a

// proprietary EH runtime that is not interoperable.

// xlclang++ compiled frames use CXA-abi EH calls and any catch

// block will include a catch(...) block so it is safe to assume that

// the handler is found without checking the catch match. The

// catch(...) block will rethrow the exception if there isn't a

// match.

// Deprecated conditional expression.

// We are done this iteration of the loop, since

// we changed a state.

// We are done this iteration of the loop, since we

// changed the state.

// Go to the next state.

// Start walking the state table.

// Perform action according to the currFSMEntry->actionFlag,

// except when flag is FSMEntryFlag::conditionalStateChange or

// FSMEntryFlag::oldConditionalStateChange.

// We are done with this iteration of the loop, since we changed a state.

// A conditional state table entry holds the address of a local

// that holds the next state.

// We are done with this iteration of the loop, since we changed a state.

// We need to invoke the virtual base destructor. This must be

// a frame from the legacy xlC compiler as the xlclang++ compiler

// generates inline cleanup code rather than specifying

// the destructor via the state table.

// An extra indirect to get to the object according to the object

// model used by the xlC compiler.

// We need to invoke the virtual base delete function. This must be

// a frame from the legacy xlC compiler as the xlclang++ compiler

// generates inline cleanup code rather than specifying

// the delete function via the state table.

// An extra indirect to get to the object according to the object

// model used by the xlC compiler.

// End of action switching.

// Go to next state.

// It is possible that no state table entry specify how to handle

// this exception. By spec, terminate it immediately.

// Personality routine for EH using the state table.

// Phase 1 search:  All we're looking for in phase 1 is a handler that

//   halts unwinding

// Phase 2 cleanup:

// Store the address of unwind_exception in the stack field

// reserved for compilers (SP + 3 * sizeof(uintptr_t)) in the stack of

// the caller of the function containing the landing pad (within the link

// area for the call to the latter) for __xlc_exception_handle()

// to retrieve when it is called by the landing pad.

// Jump to the handler.

// Did not find a handler. Return the results of the scan. Normally

// _URC_CONTINUE_UNWIND, but could have been _URC_FATAL_PHASE2_ERROR.

// We were called improperly: neither a phase 1 or phase 2 search.

// namespace __state_table_eh

// The following are EH helper functions for xlclang++ compiled code.

// __xlc_catch_matchv2

// Check whether the thrown object matches the catch handler's exception

// declaration. If there is a match, the function returns true with adjusted

// address of the thrown object. Otherwise, returns false.

// Walk to the __cxa_dependent_exception primary exception for the

// exception object and its type_info.

// Get the type info for the thrown type and this catch clause and

// see if the catch caluse can catch that type.

// __xlc_throw_badexception

// This function is for xlclang++. It allocates and throws a bad_exception.

// During unwinding for this bad_exception, the previous exception which is

// not matching the throw spec will be cleaned up. Thus having the same

// effect as replace the top most exception (which is bad) with a bad_exception.

// skip_non_cxx_eh_aware_frames

// This function skips non-C++ EH aware stack frames by unwinding from the

// stack frame pointed by 'Sp' and returns the first C++ EH aware stack frame

// found. 'Pc' is an instruction address inside the function that owns the

// stack frame pointed to by 'Sp'.

// Loop until a C++ EH aware frame is found or the return address is 0,

// which is the return address of the startup function '__start'.

// Keep looking forward until a word of 0 is found. The traceback

// table starts at the following word.

// A stack frame with a C++ state table is C++ EH aware.

// Move up one stack frame.

// Get the value of the LR (saved, prior to incrementing the SP, by the

// prolog of the function just inspected) from the frame.

// This should not happen.

// __xlc_exception_handle

// This function is for xlclang++. It returns the address of the exception

// object stored in the reserved field in the stack of the caller of the

// function that calls __xlc_exception_handle() (within the link area for the

// call to the latter). The address is stored by the personality routine for

// xlclang++ compiled code. If __xlc_exception_handle() is called by

// non-C++ EH aware functions, their frames are skipped until a C++ EH aware

// frame is found.

// Note: make sure __xlc_exception_handle() is a non-leaf function. Currently

// it calls skip_non_cxx_eh_aware_frames(), which in turn calls abort().

// Get the SP of this function, i.e., __xlc_exception_handle().

// Move one frame up to the frame of the caller of __xlc_exception_handle().

// Get the return address of this function, i.e., __xlc_exception_handle().

// Skip non-C++ EH aware frames and get the first C++ EH aware frame.

// Get the SP of the caller of the C++ EH aware caller.

// Retrieve the exception object in the stack slot saved by the personality.

// xlclang++ may generate calls to __Deleted_Virtual.

// __catchThrownException is called during AIX library initialization and

// termination to handle exceptions.  An implementation is also provided in

// libC.a(shrcore.o).  This implementation is provided for applications that

// link with -lc++ (the xlclang++ or ibm-clang++ link default.)

// function which may fail

// cleanup function

// parameter to cleanup function

// control exception throwing and termination

// No cleanup and rethrow is effectively no-op.

// Avoid the catch handler when possible to allow exceptions generated

// from xlC binaries to flow through.

// FAILED

// extern "C"

// __cxxabiv1


=== system/lib/libcxxabi/src/cxa_aux_runtime.cpp ===
SHA256: 05fb65ba6f3c4f559b994a6f98709ee14075756fd354ebed66d728c926c44c8f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

// This file implements the "Auxiliary Runtime APIs"

// https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html#cxx-aux

//===----------------------------------------------------------------------===//

// extern "C"

// abi


=== system/lib/libcxxabi/src/cxa_default_handlers.cpp ===
SHA256: ada97c5adba6b8a798c2ac4585284cb1c870f9fa49f49d0aed87678f56423894
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

// This file implements the default terminate_handler, unexpected_handler and

// new_handler.

//===----------------------------------------------------------------------===//

// std::abort

// from libc++

// If there is no uncaught exception, just note that we're terminating

// If we're terminating due to a foreign exception

// We're about to abort(), this memory can never be freed; so it's fine

// to just return a raw pointer

// If the uncaught exception can be caught with std::exception&

// Include the what() message from the exception

// Else just note that we're terminating due to an exception

// !_LIBCXXABI_NO_EXCEPTIONS

// !_LIBCXXABI_NO_EXCEPTIONS

// !LIBCXXABI_SILENT_TERMINATE

// !LIBCXXABI_SILENT_TERMINATE

//

// Global variables that hold the pointers to the current handler

//


=== system/lib/libcxxabi/src/cxa_demangle.cpp ===
SHA256: 2693c9d841b50fa60a5d92b265d59faa32e675de7c947b6c0e6f3ed62551188f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// FIXME: (possibly) incomplete list of features that clang mangles that this

// file does not yet support:

//   - C++ modules TS

// <discriminator> := _ <non-negative number>      # when number < 10

//                 := __ <non-negative number> _   # when number >= 10

//  extension      := decimal-digit+               # at the end of string

// parse but ignore discriminator

// Overload used when T is exactly 'bool', not merely convertible to 'bool'.

// unnamed namespace

//===----------------------------------------------------------------------===//

// Code beyond this point should not be synchronized with LLVM.

//===----------------------------------------------------------------------===//

// __cxxabiv1


=== system/lib/libcxxabi/src/cxa_exception.cpp ===
SHA256: dab23fb091be1dc82ea38bba0c29f4719793061e8eac18e86fa148b7e4d65a0b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//  This file implements the "Exception Handling APIs"

//  https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html

//

//===----------------------------------------------------------------------===//

// for std::terminate

// for memset

// from libc++

// +---------------------------+-----------------------------+---------------+

// | __cxa_exception           | _Unwind_Exception CLNGC++\0 | thrown object |

// +---------------------------+-----------------------------+---------------+

//                                                           ^

//                                                           |

//   +-------------------------------------------------------+

//   |

// +---------------------------+-----------------------------+

// | __cxa_dependent_exception | _Unwind_Exception CLNGC++\1 |

// +---------------------------+-----------------------------+

//  Utility routines

// Note:  This is never called when exception_header is masquerading as a

//        __cxa_dependent_exception.

//  Get the exception object from the unwind pointer.

//  Relies on the structure layout, where the unwind pointer is right in

//  front of the user's exception object

// Round s up to next multiple of a.

//  Is it one of ours?

// On x86 and some ARM unwinders, unwind_exception->exception_class is

// a uint64_t. On other ARM unwinders, it is a char[8].

// See: http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038b/IHI0038B_ehabi.pdf

// So we just copy it into a uint64_t to be sure.

//  This does not need to be atomic

//  This does not need to be atomic

/*
    If reason isn't _URC_FOREIGN_EXCEPTION_CAUGHT, then the terminateHandler
    stored in exc is called.  Otherwise the exceptionDestructor stored in
    exc is called, and then the memory for the exception is deallocated.

    This is never called for a __cxa_dependent_exception.
*/

// Just in case there exists a dependent exception that is pointing to this,

//    check the reference count and only destroy this if that count goes to zero.

//  Section 2.5.3 says:

//      * For purposes of this ABI, several things are considered exception handlers:

//      ** A terminate() call due to a throw.

//  and

//      * Upon entry, Following initialization of the catch parameter,

//          a handler must call:

//      * void *__cxa_begin_catch(void *exceptionObject );

// Return the offset of the __cxa_exception header from the start of the

// allocated buffer. If __cxa_exception's alignment is smaller than the maximum

// useful alignment for the target machine, padding has to be inserted before

// the header to ensure the thrown object that follows the header is

// sufficiently aligned. This happens if _Unwind_exception isn't double-word

// aligned (on Darwin, for example).

// Compute the maximum alignment for the target machine.

//  Allocate a __cxa_exception object, and zero-fill it.

//  Reserve "thrown_size" bytes on the end for the user's exception

//  object. Zero-fill the object. If memory can't be allocated, call

//  std::terminate. Return a pointer to the memory to be used for the

//  user's exception object.

// Allocate extra space before the __cxa_exception header to ensure the

// start of the thrown object is sufficiently aligned.

//  Free a __cxa_exception object allocated with __cxa_allocate_exception.

// Compute the size of the padding before the header.

// In Wasm, a destructor returns its argument

//  This function shall allocate a __cxa_dependent_exception and

//  return a pointer to it. (Really to the object, not past its' end).

//  Otherwise, it will work like __cxa_allocate_exception.

//  This function shall free a dependent_exception.

//  It does not affect the reference count of the primary exception.

// 2.4.3 Throwing the Exception Object

/*
After constructing the exception object with the throw argument value,
the generated code calls the __cxa_throw runtime library routine. This
routine never returns.

The __cxa_throw routine will do the following:

* Obtain the __cxa_exception header from the thrown exception object address,
which can be computed as follows:
 __cxa_exception *header = ((__cxa_exception *) thrown_exception - 1);
* Save the current unexpected_handler and terminate_handler in the __cxa_exception header.
* Save the tinfo and dest arguments in the __cxa_exception header.
* Set the exception_class field in the unwind header. This is a 64-bit value
representing the ASCII string "XXXXC++\0", where "XXXX" is a
vendor-dependent string. That is, for implementations conforming to this
ABI, the low-order 4 bytes of this 64-bit value will be "C++\0".
* Increment the uncaught_exception flag.
* Call _Unwind_RaiseException in the system unwind library, Its argument is the
pointer to the thrown exception, which __cxa_throw itself received as an argument.
__Unwind_RaiseException begins the process of stack unwinding, described
in Section 2.5. In special cases, such as an inability to find a
handler, _Unwind_RaiseException may return. In that case, __cxa_throw
will call terminate, assuming that there was no handler for the
exception.
*/

// extern "C"

// In Wasm, a destructor returns its argument

// Not atomically, since globals are thread-local

// This is a newly allocated exception, no need for thread safety.

// Inform the ASan runtime that now might be a good time to clean stuff up.

// In debug mode, call a JS library function to use WebAssembly.Exception JS

// API, which enables us to include stack traces

//  This only happens when there is no handler, or some unexpected unwinding

//     error happens.

// 2.5.3 Exception Handlers

/*
The adjusted pointer is computed by the personality routine during phase 1
  and saved in the exception header (either __cxa_exception or
  __cxa_dependent_exception).

  Requires:  exception is native
*/

/*
The routine to be called before the cleanup.  This will save __cxa_exception in
__cxa_eh_globals, so that __cxa_end_cleanup() can recover later.
*/

// If the propagatingExceptions stack is not empty, since we can't

// chain the foreign exception, terminate it.

/*
The routine to be called after the cleanup has been performed.  It will get the
propagating __cxa_exception from __cxa_eh_globals, and continue the stack
unwinding with _Unwind_Resume.

According to ARM EHABI 8.4.1, __cxa_end_cleanup() should not clobber any
register, thus we have to write this function in assembly so that we can save
{r1, r2, r3}.  We don't have to save r0 because it is the return value and the
first argument to _Unwind_Resume().  The function also saves/restores r4 to
keep the stack aligned and to provide a temp register.  _Unwind_Resume never
returns and we need to keep the original lr so just branch to it.  When
targeting bare metal, the function also clobbers ip/r12 to hold the address of
_Unwind_Resume, which may be too far away for an ordinary branch.
*/

// It seems that __cxa_begin_cleanup() is not called properly.

// We have no choice but terminate the program now.

// defined(_LIBCXXABI_ARM_EHABI)

/*
This routine can catch foreign or native exceptions.  If native, the exception
can be a primary or dependent variety.  This routine may remain blissfully
ignorant of whether the native exception is primary or dependent.

If the exception is native:
* Increment's the exception's handler count.
* Push the exception on the stack of currently-caught exceptions if it is not
  already there (from a rethrow).
* Decrements the uncaught_exception count.
* Returns the adjusted pointer to the exception object, which is stored in
  the __cxa_exception by the personality routine.

If the exception is foreign, this means it did not originate from one of throw
routines.  The foreign exception does not necessarily have a __cxa_exception
header.  However we can catch it here with a catch (...), or with a call
to terminate or unexpected during unwinding.
* Do not try to increment the exception's handler count, we don't know where
  it is.
* Push the exception on the stack of currently-caught exceptions only if the
  stack is empty.  The foreign exception has no way to link to the current
  top of stack.  If the stack is not empty, call terminate.  Even with an
  empty stack, this is hacked in by pushing a pointer to an imaginary
  __cxa_exception block in front of the foreign exception.  It would be better
  if the __cxa_eh_globals structure had a stack of _Unwind_Exception, but it
  doesn't.  It has a stack of __cxa_exception (which has a next* in it).
* Do not decrement the uncaught_exception count because we didn't increment it
  in __cxa_throw (or one of our rethrow functions).
* If we haven't terminated, assume the exception object is just past the
  _Unwind_Exception and return a pointer to that.
*/

// exception_header is a hackish offset from a foreign exception, but it

//   works as long as we're careful not to try to access any __cxa_exception

//   parts.

// Remove the exception object from the linked list of exceptions that the z/OS unwinder

// maintains before adding it to the libc++abi list of caught exceptions.

// The libc++abi will manage the lifetime of the exception from this point forward.

// Increment the handler count, removing the flag about being rethrown

//  place the exception on the top of the stack if it's not already

//    there by a previous rethrow

// Not atomically, since globals are thread-local

// Else this is a foreign exception

// If the caughtExceptions stack is not empty, terminate

// Push the foreign exception on to the stack

/*
Upon exit for any reason, a handler must call:
    void __cxa_end_catch ();

This routine can be called for either a native or foreign exception.
For a native exception:
* Locates the most recently caught exception and decrements its handler count.
* Removes the exception from the caught exception stack, if the handler count goes to zero.
* If the handler count goes down to zero, and the exception was not re-thrown
  by throw, it locates the primary exception (which may be the same as the one
  it's handling) and decrements its reference count. If that reference count
  goes to zero, the function destroys the exception. In any case, if the current
  exception is a dependent exception, it destroys that.

For a foreign exception:
* If it has been rethrown, there is nothing to do.
* Otherwise delete the exception and pop the catch stack to empty.
*/

// __cxa_get_globals called in __cxa_begin_catch

// If we've rethrown a foreign exception, then globals->caughtExceptions

//    will have been made an empty stack by __cxa_rethrow() and there is

//    nothing more to be done.  Do nothing!

// This is a native exception

//  The exception has been rethrown by __cxa_rethrow, so don't delete it

//  Remove from the chain of uncaught exceptions

// but don't destroy

// Keep handlerCount negative in case there are nested catch's

//   that need to be told that this exception is rethrown.  Don't

//   erase this rethrow flag until the exception is recaught.

// The native exception has not been rethrown

//  Remove from the chain of uncaught exceptions

// Destroy this exception, being careful to distinguish

//    between dependent and primary exceptions

// Reset exception_header to primaryException and deallocate the dependent exception

// Destroy the primary exception only if its referenceCount goes to 0

//    (this decrement must be atomic)

// The foreign exception has not been rethrown.  Pop the stack

//    and delete it.  If there are nested catch's and they try

//    to touch a foreign exception in any way, that is undefined

//     behavior.  They likely can't since the only way to catch

//     a foreign exception is with catch (...)!

// Note:  exception_header may be masquerading as a __cxa_dependent_exception

//        and that's ok.  exceptionType is there too.

//        However watch out for foreign exceptions.  Return null for them.

//  get the current exception

//  If there have never been any exceptions, there are none now.

//  No current exception

// 2.5.4 Rethrowing Exceptions

/*  This routine can rethrow native or foreign exceptions.
If the exception is native:
* marks the exception object on top of the caughtExceptions stack
  (in an implementation-defined way) as being rethrown.
* If the caughtExceptions stack is empty, it calls terminate()
  (see [C++FDIS] [except.throw], 15.1.8).
* It then calls _Unwind_RaiseException which should not return
   (terminate if it does).
  Note:  exception_header may be masquerading as a __cxa_dependent_exception
         and that's ok.
*/

// throw; called outside of a exception handler

//  Mark the exception as being rethrown (reverse the effects of __cxa_begin_catch)

//  __cxa_end_catch will remove this exception from the caughtExceptions stack if necessary

// this is a foreign exception

// The only way to communicate to __cxa_end_catch that we've rethrown

//   a foreign exception, so don't delete us, is to pop the stack here

//   which must be empty afterwards.  Then __cxa_end_catch will do

//   nothing

// In debug mode, call a JS library function to use WebAssembly.Exception JS

// API, which enables us to include stack traces

//  If we get here, some kind of unwinding error has occurred.

//  There is some weird code generation bug happening with

//     Apple clang version 4.0 (tags/Apple/clang-418.0.2) (based on LLVM 3.1svn)

//     If we call failed_throw here.  Turns up with -O2 or higher, and -Os.

// Foreign exception: can't get exception_header->terminateHandler

/*
    If thrown_object is not null, atomically increment the referenceCount field
    of the __cxa_exception header associated with the thrown object referred to
    by thrown_object.

    Requires:  If thrown_object is not NULL, it is a native exception.
*/

/*
    If thrown_object is not null, atomically decrement the referenceCount field
    of the __cxa_exception header associated with the thrown object referred to
    by thrown_object.  If the referenceCount drops to zero, destroy and
    deallocate the exception.

    Requires:  If thrown_object is not NULL, it is a native exception.
*/

/*
    Returns a pointer to the thrown object (if any) at the top of the
    caughtExceptions stack.  Atomically increment the exception's referenceCount.
    If there is no such thrown object or if the thrown object is foreign,
    returns null.

    We can use __cxa_get_globals_fast here to get the globals because if there have
    been no exceptions thrown, ever, on this thread, we can return NULL without
    the need to allocate the exception-handling globals.
*/

//  get the current exception

//  If there are no globals, there is no exception

//  No current exception

// Can't capture a foreign exception (no way to refcount it)

/*
    If reason isn't _URC_FOREIGN_EXCEPTION_CAUGHT, then the terminateHandler
    stored in exc is called.  Otherwise the referenceCount stored in the
    primary exception is decremented, destroying the primary if necessary.
    Finally the dependent exception is destroyed.
*/

/*
    If thrown_object is not null, allocate, initialize and throw a dependent
    exception.
*/

// thrown_object guaranteed to be native because

//   __cxa_current_primary_exception returns NULL for foreign exceptions

// In debug mode, call a JS library function to use

// WebAssembly.Exception JS API, which enables us to include stack

// traces

// Some sort of unwinding error.  Note that terminate is a handler.

// If we return client will call terminate()

// This does not report foreign exceptions in flight

// extern "C"

// abi


=== system/lib/libcxxabi/src/cxa_exception.h ===
SHA256: 902ccca946fc4a9979399340ac4ad070dd904212784f9929cb77c5e37ccb71a3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//  This file implements the "Exception Handling APIs"

//  https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html

//

//===----------------------------------------------------------------------===//

// for std::unexpected_handler and std::terminate_handler

// In wasm, destructors return 'this' as in ARM

// Add padding to ensure that the size of __cxa_exception is a multiple of

// the maximum useful alignment for the target machine.  This ensures that

// the thrown object that follows has that correct alignment.

// CLNGC++\0

// CLNGC++\1

// mask for CLNGC++

// Now _Unwind_Exception is marked with __attribute__((aligned)),

// which implies __cxa_exception is also aligned. Insert padding

// in the beginning of the struct, rather than before unwindHeader.

// This is a new field to support C++11 exception_ptr.

// For binary compatibility it is at the start of this

// struct which is prepended to the object thrown in

// __cxa_allocate_exception.

//  Manage the exception object itself.

// In Wasm, a destructor returns its argument

// This is a new field to support C++11 exception_ptr.

// For binary compatibility it is placed where the compiler

// previously added padding to 64-bit align unwindHeader.

// http://sourcery.mentor.com/archives/cxx-abi-dev/msg01924.html

// The layout of this structure MUST match the layout of __cxa_exception, with

// primaryException instead of referenceCount.

// padding.

// Verify the negative offsets of different fields.

// !__EMSCRIPTEN_EXCEPTIONS__

// namespace __cxxabiv1

// _CXA_EXCEPTION_H


=== system/lib/libcxxabi/src/cxa_exception_emscripten.cpp ===
SHA256: d779e4e00c0181aa0d0eb2a7e0c69aadcade2ec37774e39d221fdcfdc98cebf7
//===-------------------- cxa_exception_emscripten.cpp --------------------===//

//

//  Most code in the file is directly copied from cxa_exception.cpp.

//  TODO(sbc): consider merging them

//

//  Notable changes:

//   __cxa_allocate_exception doesn't add get_cxa_exception_offset

//    __cxa_decrement_exception_refcount doesn't call the destructor if rethrown

//  Both of these changes are mirrored from the historical JS implementation of

//  these functions.

//

//===----------------------------------------------------------------------===//

// Define to enable extra debugging on stderr.

// Until recently, Rust's `rust_eh_personality` for emscripten referred to this

// symbol. If Emscripten doesn't provide it, there will be errors when linking

// rust. The rust personality function is never called so we can just abort.

// We need this to support old versions of Rust.

// https://github.com/rust-lang/rust/pull/97888

// TODO: Remove this when Rust doesn't need it anymore.

//  Utility routines

// Note:  This is never called when exception_header is masquerading as a

//        __cxa_dependent_exception.

// Round s up to next multiple of a.

//  Allocate a __cxa_exception object, and zero-fill it.

//  Reserve "thrown_size" bytes on the end for the user's exception

//  object. Zero-fill the object. If memory can't be allocated, call

//  std::terminate. Return a pointer to the memory to be used for the

//  user's exception object.

//  Free a __cxa_exception object allocated with __cxa_allocate_exception.

// Compute the size of the padding before the header.

/*
    If thrown_object is not null, atomically increment the referenceCount field
    of the __cxa_exception header associated with the thrown object referred to
    by thrown_object.

    Requires:  If thrown_object is not NULL, it is a native exception.
*/

/*
    If thrown_object is not null, atomically decrement the referenceCount field
    of the __cxa_exception header associated with the thrown object referred to
    by thrown_object.  If the referenceCount drops to zero, destroy and
    deallocate the exception.

    Requires:  If thrown_object is not NULL, it is a native exception.
*/

// extern "C"

// abi

// __EMSCRIPTEN__


=== system/lib/libcxxabi/src/cxa_exception_js_utils.cpp ===
SHA256: 8d35d1fde3a73b51fac110386f333868f7599d0b63d11bf5838199dcf4507150
// #include <stdint.h>

// #include <stdlib.h>

//  Utility routines

// Note:  This is never called when exception_header is masquerading as a

//        __cxa_dependent_exception.

//  Get the exception object from the unwind pointer.

//  Relies on the structure layout, where the unwind pointer is right in

//  front of the user's exception object

// Given a thrown_object, puts the information about its type and message into

// 'type' and 'message' output parameters. 'type' will contain the string

// representation of the type of the exception, e.g., 'int'. 'message' will

// contain the result of 'std::exception::what()' method if the type of the

// exception is a subclass of std::exception; otherwise it will be NULL. The

// caller is responsible for freeing 'type' buffer and also 'message' buffer, if

// it is not NULL.

// can_catch can adjust thrown_object ptr, so rerun it

// Returns a message saying that execution was terminated due to an exception.

// This message is freshly malloc'd and should be freed.

// extern "C"

// namespace __cxxabiv1

// __EMSCRIPTEN__


=== system/lib/libcxxabi/src/cxa_exception_storage.cpp ===
SHA256: 7de17cefbedbf94d7282fe3cde0e23e592b90c1d5e50db5d63009d7cfc877721
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//  This file implements the storage for the "Caught Exception Stack"

//  https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html#cxx-exc-stack

//

//===----------------------------------------------------------------------===//

// extern "C"

// namespace __cxxabiv1

// namespace

// extern "C"

// namespace __cxxabiv1

//  In general, we treat all threading errors as fatal.

//  We cannot call std::terminate() because that will in turn

//  call __cxa_get_globals() and cause infinite recursion.

// namespace

// Try to get the globals for this thread

// If this is the first time we've been asked for these globals, create them

// Note that this implementation will reliably return NULL if not

// preceded by a call to __cxa_get_globals().  This is an extension

// to the Itanium ABI and is taken advantage of in several places in

// libc++abi.

// First time through, create the key.

// extern "C"

// namespace __cxxabiv1


=== system/lib/libcxxabi/src/cxa_guard.cpp ===
SHA256: 97dbc2a48acb2233301bd7c11717cda173b23c73e7da64eb1710332c3b19f54d
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Tell the implementation that we're building the actual implementation

// (and not testing it)

/*
    This implementation must be careful to not call code external to this file
    which will turn around and try to call __cxa_guard_acquire reentrantly.
    For this reason, the headers of this file are as restricted as possible.
    Previous implementations of this code for __APPLE__ have used
    std::__libcpp_mutex_lock and the abort_message utility without problem. This
    implementation also uses std::__libcpp_condvar_wait which has tested
    to not be a problem.
*/

// extern "C"

// __cxxabiv1


=== system/lib/libcxxabi/src/cxa_guard_impl.h ===
SHA256: 9c9c4313da6fdddf3ec8e187e07eef22b8c4eec40c59dd7c0d9065fece81d0e6
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/* cxa_guard_impl.h - Implements the C++ runtime support for function local
 * static guards.
 * The layout of the guard object is the same across ARM and Itanium.
 *
 * The first "guard byte" (which is checked by the compiler) is set only upon
 * the completion of cxa release.
 *
 * The second "init byte" does the rest of the bookkeeping. It tracks if
 * initialization is complete or pending, and if there are waiting threads.
 *
 * If the guard variable is 64-bits and the platforms supplies a 32-bit thread
 * identifier, it is used to detect recursive initialization. The thread ID of
 * the thread currently performing initialization is stored in the second word.
 *
 *  Guard Object Layout:
 * ---------------------------------------------------------------------------
 * | a+0: guard byte | a+1: init byte | a+2: unused ... | a+4: thread-id ... |
 * ---------------------------------------------------------------------------
 *
 * Note that we don't do what the ABI docs suggest (put a mutex in the guard
 * object which we acquire in cxa_guard_acquire and release in
 * cxa_guard_release). Instead we use the init byte to imitate that behaviour,
 * but without actually holding anything mutex related between aquire and
 * release/abort.
 *
 *  Access Protocol:
 *    For each implementation the guard byte is checked and set before accessing
 *    the init byte.
 *
 *  Overall Design:
 *    The implementation was designed to allow each implementation to be tested
 *    independent of the C++ runtime or platform support.
 *
 */

// from libc++

// To make testing possible, this header is included from both cxa_guard.cpp

// and a number of tests.

//

// For this reason we place everything in an anonymous namespace -- even though

// we're in a header. We want the actual implementation and the tests to have

// unique definitions of the types in this header (since the tests may depend

// on function local statics).

//

// To enforce this either `BUILDING_CXA_GUARD` or `TESTING_CXA_GUARD` must be

// defined when including this file. Only `src/cxa_guard.cpp` should define

// the former.

// Use an anonymous namespace to ensure that the tests and actual implementation

// have unique definitions of these symbols.

//===----------------------------------------------------------------------===//

//                          Misc Utilities

//===----------------------------------------------------------------------===//

//===----------------------------------------------------------------------===//

//                       PlatformGetThreadID

//===----------------------------------------------------------------------===//

//===----------------------------------------------------------------------===//

//                          GuardByte

//===----------------------------------------------------------------------===//

/// Manages reads and writes to the guard byte.

/// The guard byte portion of cxa_guard_acquire. Returns true if

/// initialization has already been completed.

// if guard_byte is non-zero, we have already completed initialization

// (i.e. release has been called)

/// The guard byte portion of cxa_guard_release.

/// The guard byte portion of cxa_guard_abort.

// Nothing to do

//===----------------------------------------------------------------------===//

//                       InitByte Implementations

//===----------------------------------------------------------------------===//

//

// Each initialization byte implementation supports the following methods:

//

//  InitByte(uint8_t* _init_byte_address, uint32_t* _thread_id_address)

//    Construct the InitByte object, initializing our member variables

//

//  bool acquire()

//    Called before we start the initialization. Check if someone else has already started, and if

//    not to signal our intent to start it ourselves. We determine the current status from the init

//    byte, which is one of 4 possible values:

//      COMPLETE:           Initialization was finished by somebody else. Return true.

//      PENDING:            Somebody has started the initialization already, set the WAITING bit,

//                          then wait for the init byte to get updated with a new value.

//      (PENDING|WAITING):  Somebody has started the initialization already, and we're not the

//                          first one waiting. Wait for the init byte to get updated.

//      UNSET:              Initialization hasn't successfully completed, and nobody is currently

//                          performing the initialization. Set the PENDING bit to indicate our

//                          intention to start the initialization, and return false.

//    The return value indicates whether initialization has already been completed.

//

//  void release()

//    Called after successfully completing the initialization. Update the init byte to reflect

//    that, then if anybody else is waiting, wake them up.

//

//  void abort()

//    Called after an error is thrown during the initialization. Reset the init byte to UNSET to

//    indicate that we're no longer performing the initialization, then if anybody is waiting, wake

//    them up so they can try performing the initialization.

//

//===----------------------------------------------------------------------===//

//                    Single Threaded Implementation

//===----------------------------------------------------------------------===//

/// InitByteNoThreads - Doesn't use any inter-thread synchronization when

/// managing reads and writes to the init byte.

/// The init byte portion of cxa_guard_acquire. Returns true if

/// initialization has already been completed.

/// The init byte portion of cxa_guard_release.

/// The init byte portion of cxa_guard_abort.

/// The address of the byte used during initialization.

//===----------------------------------------------------------------------===//

//                     Global Mutex Implementation

//===----------------------------------------------------------------------===//

// !defined(_LIBCXXABI_HAS_NO_THREADS)

/// InitByteGlobalMutex - Uses a global mutex and condition variable (common to

/// all static local variables) to manage reads and writes to the init byte.

/// The init byte portion of cxa_guard_acquire. Returns true if

/// initialization has already been completed.

// Check for possible recursive initialization.

// Wait until the pending bit is not set.

/// The init byte portion of cxa_guard_release.

/// The init byte portion of cxa_guard_abort.

/// The address of the byte used during initialization.

/// An optional address storing an identifier for the thread performing initialization.

/// It's used to detect recursive initialization.

//===----------------------------------------------------------------------===//

//                         Futex Implementation

//===----------------------------------------------------------------------===//

/// InitByteFutex - Uses a futex to manage reads and writes to the init byte.

/*_init_byte_address & ~0x3*/

/// The init byte portion of cxa_guard_acquire. Returns true if

/// initialization has already been completed.

// Check for recursive initialization

// This compare exchange can fail for several reasons

// (1) another thread finished the whole thing before we got here

// (2) another thread set the waiting bit we were trying to thread

// (3) another thread had an exception and failed to finish

// (1) success, via someone else's work!

// (3) someone else, bailed on doing the work, retry from the start!

// (2) the waiting bit got set, so we are happy to keep waiting

/// The init byte portion of cxa_guard_release.

/// The init byte portion of cxa_guard_abort.

/// Use the futex to wait on the current guard variable. Futex expects a

/// 32-bit 4-byte aligned address as the first argument, so we use the 4-byte

/// aligned address that encompasses the init byte (i.e. the address of the

/// raw guard object that was passed to __cxa_guard_acquire/release/abort).

// Unsafe to use unless has_thread_id_support

/// the 4-byte-aligned address that encompasses the init byte (i.e. the

/// address of the raw guard object).

/// Create the expected integer value for futex `wait(int* addr, int expected)`.

/// We pass the base address as the first argument, So this function creates

/// an zero-initialized integer  with `b` copied at the correct offset.

//===----------------------------------------------------------------------===//

//                          GuardObject

//===----------------------------------------------------------------------===//

/// Co-ordinates between GuardByte and InitByte.

/// ARM Constructor

/// Itanium Constructor

/// Implements __cxa_guard_acquire.

// Use short-circuit evaluation to avoid calling init_byte.acquire when

// guard_byte.acquire returns true. (i.e. don't call it when we know from

// the guard byte that initialization has already been completed)

/// Implements __cxa_guard_release.

// Update guard byte first, so if somebody is woken up by init_byte.release

// and comes all the way back around to __cxa_guard_acquire again, they see

// it as having completed initialization.

/// Implements __cxa_guard_abort.

//===----------------------------------------------------------------------===//

//                          Convenience Classes

//===----------------------------------------------------------------------===//

/// NoThreadsGuard - Manages initialization without performing any inter-thread

/// synchronization.

/// GlobalMutexGuard - Manages initialization using a global mutex and

/// condition variable.

/// FutexGuard - Manages initialization using atomics and the futex syscall for

/// waiting and waking.

//===----------------------------------------------------------------------===//

//

//===----------------------------------------------------------------------===//

// TODO(EricWF): We should prefer the futex implementation when available. But

// it should be done in a separate step from adding the implementation.

// namespace

// namespace __cxxabiv1

// LIBCXXABI_SRC_INCLUDE_CXA_GUARD_IMPL_H


=== system/lib/libcxxabi/src/cxa_handlers.cpp ===
SHA256: a9191199f946c45deb136354c4666b301773be9488b5bda5f43237d84f01f064
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

// This file implements the functionality associated with the terminate_handler,

// unexpected_handler, and new_handler.

//===----------------------------------------------------------------------===//

// from libc++

// unexpected handler should not return

// _LIBCXXABI_NO_EXCEPTIONS

// handler should not return

// handler should not throw exception

// _LIBCXXABI_NO_EXCEPTIONS

// If there might be an uncaught exception

// std


=== system/lib/libcxxabi/src/cxa_handlers.h ===
SHA256: 2c87e313acb5a9e8a48374cd431da69c98fb2c9ad2c70be82fe7fbed122d00fe
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

// This file implements the functionality associated with the terminate_handler,

//   unexpected_handler, and new_handler.

//===----------------------------------------------------------------------===//

// std

/*

    At some point in the future these three symbols will become
    C++11 atomic variables:

    extern std::atomic<std::terminate_handler>  __cxa_terminate_handler;
    extern std::atomic<std::unexpected_handler> __cxa_unexpected_handler;
    extern std::atomic<std::new_handler>        __cxa_new_handler;

    This change will not impact their ABI.  But it will allow for a
    portable performance optimization.

*/

// extern "C"

// _CXA_HANDLERS_H


=== system/lib/libcxxabi/src/cxa_noexception.cpp ===
SHA256: d7056ce373f76b46a319f40eeb816c669fa6ba98b8e2d5c7cb14bdaab365f477
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//  This file implements the "Exception Handling APIs"

//  https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html

//

//===----------------------------------------------------------------------===//

// Support functions for the no-exceptions libc++ library

// for std::terminate

// Under emscripten this code is also linked when building when

// DISABLE_EXCEPTION_CATCHING is set but DISABLE_EXCEPTION_THROWING is not.

// TODO(sbc): Perhaps just call std::terminate here. It could

// just be some test code that needs updating.

//  Free a __cxa_exception object allocated with __cxa_allocate_exception.

// Compute the size of the padding before the header.

// This function is called from make_exception_ptr in libcxx unless

// -fno-exceptions is not given. We have definitions of this function in

// cxa_exception.cpp and cxa_exception_emscripten.cpp, but unlike other

// platforms, we use those files only when one of Emscripten EH or Wasm EH is

// used, and we use this cxa_noexceptions.cpp in case of -fignore-exceptions,

// which is our default. So we add a definition here to prevent a link failure.

// extern "C"

// provide dummy implementations for the 'no exceptions' case.

// abi


=== system/lib/libcxxabi/src/cxa_personality.cpp ===
SHA256: 076ffbe48ec997fe5307df638981af3905524278b006ffaa782f849f47bb30c6
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//  This file implements the "Exception Handling APIs"

//  https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html

//  http://www.intel.com/design/itanium/downloads/245358.htm

//

//===----------------------------------------------------------------------===//

// TODO: This is a temporary workaround for libc++abi to recognize that it's being

// built against LLVM's libunwind. LLVM's libunwind started reporting _LIBUNWIND_VERSION

// in LLVM 15 -- we can remove this workaround after shipping LLVM 17. Once we remove

// this workaround, it won't be possible to build libc++abi against libunwind headers

// from LLVM 14 and before anymore.

/*
    Exception Header Layout:

+---------------------------+-----------------------------+---------------+
| __cxa_exception           | _Unwind_Exception CLNGC++\0 | thrown object |
+---------------------------+-----------------------------+---------------+
                                                          ^
                                                          |
  +-------------------------------------------------------+
  |
+---------------------------+-----------------------------+
| __cxa_dependent_exception | _Unwind_Exception CLNGC++\1 |
+---------------------------+-----------------------------+

    Exception Handling Table Layout:

+-----------------+--------+
| lpStartEncoding | (char) |
+---------+-------+--------+---------------+-----------------------+
| lpStart | (encoded with lpStartEncoding) | defaults to funcStart |
+---------+-----+--------+-----------------+---------------+-------+
| ttypeEncoding | (char) | Encoding of the type_info table |
+---------------+-+------+----+----------------------------+----------------+
| classInfoOffset | (ULEB128) | Offset to type_info table, defaults to null |
+-----------------++--------+-+----------------------------+----------------+
| callSiteEncoding | (char) | Encoding for Call Site Table |
+------------------+--+-----+-----+------------------------+--------------------------+
| callSiteTableLength | (ULEB128) | Call Site Table length, used to find Action table |
+---------------------+-----------+---------------------------------------------------+
#if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__WASM_EXCEPTIONS__)
+---------------------+-----------+------------------------------------------------+
| Beginning of Call Site Table            The current ip lies within the           |
| ...                                     (start, length) range of one of these    |
|                                         call sites. There may be action needed.  |
| +-------------+---------------------------------+------------------------------+ |
| | start       | (encoded with callSiteEncoding) | offset relative to funcStart | |
| | length      | (encoded with callSiteEncoding) | length of code fragment      | |
| | landingPad  | (encoded with callSiteEncoding) | offset relative to lpStart   | |
| | actionEntry | (ULEB128)                       | Action Table Index 1-based   | |
| |             |                                 | actionEntry == 0 -> cleanup  | |
| +-------------+---------------------------------+------------------------------+ |
| ...                                                                              |
+----------------------------------------------------------------------------------+
#else  // __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS__
+---------------------+-----------+------------------------------------------------+
| Beginning of Call Site Table            The current ip is a 1-based index into   |
| ...                                     this table.  Or it is -1 meaning no      |
|                                         action is needed.  Or it is 0 meaning    |
|                                         terminate.                               |
| +-------------+---------------------------------+------------------------------+ |
| | landingPad  | (ULEB128)                       | offset relative to lpStart   | |
| | actionEntry | (ULEB128)                       | Action Table Index 1-based   | |
| |             |                                 | actionEntry == 0 -> cleanup  | |
| +-------------+---------------------------------+------------------------------+ |
| ...                                                                              |
+----------------------------------------------------------------------------------+
#endif // __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS__
+---------------------------------------------------------------------+
| Beginning of Action Table       ttypeIndex == 0 : cleanup           |
| ...                             ttypeIndex  > 0 : catch             |
|                                 ttypeIndex  < 0 : exception spec    |
| +--------------+-----------+--------------------------------------+ |
| | ttypeIndex   | (SLEB128) | Index into type_info Table (1-based) | |
| | actionOffset | (SLEB128) | Offset into next Action Table entry  | |
| +--------------+-----------+--------------------------------------+ |
| ...                                                                 |
+---------------------------------------------------------------------+-----------------+
| type_info Table, but classInfoOffset does *not* point here!                           |
| +----------------+------------------------------------------------+-----------------+ |
| | Nth type_info* | Encoded with ttypeEncoding, 0 means catch(...) | ttypeIndex == N | |
| +----------------+------------------------------------------------+-----------------+ |
| ...                                                                                   |
| +----------------+------------------------------------------------+-----------------+ |
| | 1st type_info* | Encoded with ttypeEncoding, 0 means catch(...) | ttypeIndex == 1 | |
| +----------------+------------------------------------------------+-----------------+ |
| +---------------------------------------+-----------+------------------------------+  |
| | 1st ttypeIndex for 1st exception spec | (ULEB128) | classInfoOffset points here! |  |
| | ...                                   | (ULEB128) |                              |  |
| | Mth ttypeIndex for 1st exception spec | (ULEB128) |                              |  |
| | 0                                     | (ULEB128) |                              |  |
| +---------------------------------------+------------------------------------------+  |
| ...                                                                                   |
| +---------------------------------------+------------------------------------------+  |
| | 0                                     | (ULEB128) | throw()                      |  |
| +---------------------------------------+------------------------------------------+  |
| ...                                                                                   |
| +---------------------------------------+------------------------------------------+  |
| | 1st ttypeIndex for Nth exception spec | (ULEB128) |                              |  |
| | ...                                   | (ULEB128) |                              |  |
| | Mth ttypeIndex for Nth exception spec | (ULEB128) |                              |  |
| | 0                                     | (ULEB128) |                              |  |
| +---------------------------------------+------------------------------------------+  |
+---------------------------------------------------------------------------------------+

Notes:

*  ttypeIndex in the Action Table, and in the exception spec table, is an index,
     not a byte count, if positive.  It is a negative index offset of
     classInfoOffset and the sizeof entry depends on ttypeEncoding.
   But if ttypeIndex is negative, it is a positive 1-based byte offset into the
     type_info Table.
   And if ttypeIndex is zero, it refers to a catch (...).

*  landingPad can be 0, this implies there is nothing to be done.

*  landingPad != 0 and actionEntry == 0 implies a cleanup needs to be done
     @landingPad.

*  A cleanup can also be found under landingPad != 0 and actionEntry != 0 in
     the Action Table with ttypeIndex == 0.
*/

// namespace

// private API

// Heavily borrowed from llvm/examples/ExceptionDemo/ExceptionDemo.cpp

// DWARF Constants

/// Read a uleb128 encoded value and advance pointer

/// See Variable Length Data Appendix C in:

/// @link http://dwarfstd.org/Dwarf4.pdf @unlink

/// @param data reference variable holding memory pointer to decode from

/// @returns decoded value

/// Read a sleb128 encoded value and advance pointer

/// See Variable Length Data Appendix C in:

/// @link http://dwarfstd.org/Dwarf4.pdf @unlink

/// @param data reference variable holding memory pointer to decode from

/// @returns decoded value

/// Read a pointer encoded value and advance pointer

/// See Variable Length Data in:

/// @link http://dwarfstd.org/Dwarf3.pdf @unlink

/// @param data reference variable holding memory pointer to decode from

/// @param encoding dwarf encoding type

/// @param base for adding relative offset, default to 0

/// @returns decoded value

// first get value

// not supported

// then add relative offset

// do nothing

// not supported

// then apply indirection

// Use the stored terminate_handler if possible

// "ARM EABI provides a TARGET2 relocation to describe these typeinfo

// pointers. The reason being it allows their precise semantics to be

// deferred to the linker. For bare-metal they turn into absolute

// relocations. For linux they turn into GOT-REL relocations."

// https://gcc.gnu.org/ml/gcc-patches/2009-08/msg00264.html

/*base*/

// this should not happen.  Indicates corrupted eh_table.

// LLVM or GCC 4.6

// GCC 4.7 baremetal

// GCC 4.7 linux

// !defined(_LIBCXXABI_ARM_EHABI)

// this should not happen.  Indicates corrupted eh_table.

// this should not happen.   Indicates corrupted eh_table.

// !defined(_LIBCXXABI_ARM_EHABI)

/*
    This is checking a thrown exception type, excpType, against a possibly empty
    list of catchType's which make up an exception spec.

    An exception spec acts like a catch handler, but in reverse.  This "catch
    handler" will catch an excpType if and only if none of the catchType's in
    the list will catch a excpType.  If any catchType in the list can catch an
    excpType, then this exception spec does not catch the excpType.
*/

/*base*/

// this should not happen.   Indicates corrupted eh_table.

// LLVM or GCC 4.6

// GCC 4.7 baremetal

// GCC 4.7 linux

// specIndex is negative of 1-based byte offset into classInfo;

// If any type in the spec list can catch excpType, return false, else return true

//    adjustments to adjustedPtr are ignored.

// ARM EHABI exception specification table (filter table) consists of

// several pointers which will directly point to the type info object

// (instead of ttypeIndex).  The table will be terminated with 0.

// We can get the __shim_type_info simply by performing a

// R_ARM_TARGET2 relocation, and cast the result to __shim_type_info.

// this should not happen.   Indicates corrupted eh_table.

// specIndex is negative of 1-based byte offset into classInfo;

// If any type in the spec list can catch excpType, return false, else return true

//    adjustments to adjustedPtr are ignored.

// Even for foreign exceptions, the exception object is *probably* at unwind_exception + 1

//    Regardless, this library is prohibited from touching a foreign exception

// > 0 catch handler, < 0 exception spec handler, == 0 a cleanup

// Currently unused.  Retained to ease future maintenance.

// Needed only for __cxa_call_unexpected

// null -> nothing found, else something found

// Used in cxa_exception.cpp

// One of _URC_FATAL_PHASE1_ERROR,

//        _URC_FATAL_PHASE2_ERROR,

//        _URC_CONTINUE_UNWIND,

//        _URC_HANDLER_FOUND

// unnamed namespace

// IBM xlclang++ compiler does not support __builtin_eh_return_data_regno.

/*
    There are 3 types of scans needed:

    1.  Scan for handler with native or foreign exception.  If handler found,
        save state and return _URC_HANDLER_FOUND, else return _URC_CONTINUE_UNWIND.
        May also report an error on invalid input.
        May terminate for invalid exception table.
        _UA_SEARCH_PHASE

    2.  Scan for handler with foreign exception.  Must return _URC_HANDLER_FOUND,
        or call terminate.
        _UA_CLEANUP_PHASE && _UA_HANDLER_FRAME && !native_exception

    3.  Scan for cleanups.  If a handler is found and this isn't forced unwind,
        then terminate, otherwise ignore the handler and keep looking for cleanup.
        If a cleanup is found, return _URC_HANDLER_FOUND, else return _URC_CONTINUE_UNWIND.
        May also report an error on invalid input.
        May terminate for invalid exception table.
        _UA_CLEANUP_PHASE && !_UA_HANDLER_FRAME
*/

// Initialize results to found nothing but an error

// Check for consistent actions

// Do Phase 1

// None of these flags should be set during Phase 1

//   Client error

// _UA_HANDLER_FRAME should only be set if phase 1 found a handler.

// If _UA_FORCE_UNWIND is set, phase 1 shouldn't have happened.

//    Client error

// Neither _UA_SEARCH_PHASE nor _UA_CLEANUP_PHASE is set

// One of these should be set.

//   Client error

// Start scan by getting exception table address.

// There is no exception table

// Get the current instruction pointer and offset it before next

// instruction in the current frame which threw the exception.

// Get beginning current frame's code (as defined by the

// emitted dwarf code)

// no action

// ip is 1-based index into call site table

// !__USING_SJLJ_EXCEPTIONS__ && !__WASM_EXCEPTIONS__

// !__USING_SJLJ_EXCEPTIONS__ && !__WASM_EXCEPTIONS__

// Note: See JITDwarfEmitter::EmitExceptionTable(...) for corresponding

//       dwarf emission

// Parse LSDA header.

// Unused when using SjLj/Wasm exceptions

// Calculate type info locations in emitted dwarf code which

// were flagged by type info arguments to llvm.eh.selector

// intrinsic

// Walk call-site table looking for range that

// includes current PC.

// Unused when using SjLj/Wasm exceptions

// There is one entry per call site.

// The call sites are non-overlapping in [start, start+length)

// The call sites are ordered in increasing value of start

// __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS__

// ip is 1-based index into this table

// __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS__

// Found the call site containing ip.

// No handler here

// __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS__

// __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS__

// Found a cleanup

// Convert 1-based byte offset into

// Scan action entries until you find a matching handler, cleanup, or the end of action list

// Found a catch, does it actually catch?

// First check for catch (...)

// Found catch (...) catches everything, including

// foreign exceptions. This is search phase, cleanup

// phase with foreign exception, or forced unwinding.

// Else this is a catch (T) clause and will never

//    catch a foreign exception

// Something very bad happened

// Found a matching handler. This is either search

// phase or forced unwinding.

// Scan next action ...

// Found an exception specification.

// Skip if forced unwinding.

// Does the exception spec catch this native exception?

// Something very bad happened

// Native exception caught by exception

// specification.

// foreign exception caught by exception spec

// Scan next action ...

// End of action list. If this is phase 2 and we have found

// a cleanup (ttypeIndex=0), return _URC_HANDLER_FOUND;

// otherwise return _URC_CONTINUE_UNWIND.

// Go to next action

// there is no break out of this loop, only return

// There is no call site for this ip

// Something bad has happened.  We should never get here.

// Possible stack corruption.

// !__USING_SJLJ_EXCEPTIONS__ && !__WASM_EXCEPTIONS__

// there might be some tricky cases which break out of this loop

// It is possible that no eh table entry specify how to handle

// this exception. By spec, terminate it immediately.

// public API

/*
The personality function branches on actions like so:

_UA_SEARCH_PHASE

    If _UA_CLEANUP_PHASE or _UA_HANDLER_FRAME or _UA_FORCE_UNWIND there's
      an error from above, return _URC_FATAL_PHASE1_ERROR.

    Scan for anything that could stop unwinding:

       1.  A catch clause that will catch this exception
           (will never catch foreign).
       2.  A catch (...) (will always catch foreign).
       3.  An exception spec that will catch this exception
           (will always catch foreign).
    If a handler is found
        If not foreign
            Save state in header
        return _URC_HANDLER_FOUND
    Else a handler not found
        return _URC_CONTINUE_UNWIND

_UA_CLEANUP_PHASE

    If _UA_HANDLER_FRAME
        If _UA_FORCE_UNWIND
            How did this happen?  return _URC_FATAL_PHASE2_ERROR
        If foreign
            Do _UA_SEARCH_PHASE to recover state
        else
            Recover state from header
        Transfer control to landing pad.  return _URC_INSTALL_CONTEXT

    Else

        This branch handles both normal C++ non-catching handlers (cleanups)
          and forced unwinding.
        Scan for anything that can not stop unwinding:

            1.  A cleanup.

        If a cleanup is found
            transfer control to it. return _URC_INSTALL_CONTEXT
        Else a cleanup is not found: return _URC_CONTINUE_UNWIND
*/

// Process a catch handler for a native exception first.

// Reload the results from the phase 1 cache.

// Jump to the handler.

// Cache base for calculating the address of ttype in

// __cxa_call_unexpected.

// In other cases we need to scan LSDA.

// Phase 1 search:  All we're looking for in phase 1 is a handler that

//   halts unwinding

// For a native exception, cache the LSDA result.

// Wasm only uses a single phase (_UA_SEARCH_PHASE), so save the

// results here.

// Cache base for calculating the address of ttype in __cxa_call_unexpected.

// Helper function to unwind one frame.

// ARM EHABI 7.3 and 7.4: If the personality function returns _URC_CONTINUE_UNWIND, the

// personality routine should update the virtual register set (VRS) according to the

// corresponding frame unwinding instructions (ARM EHABI 9.3.)

// ARM register names

// Register to save _Unwind_Control_Block

// Copy the address of _Unwind_Control_Block to r12 so that

// _Unwind_GetLanguageSpecificData() and _Unwind_GetRegionStart() can

// return correct address.

// Check the undocumented force unwinding behavior

// Phase 1 search:  All we're looking for in phase 1 is a handler that halts unwinding

// Did not find the catch handler

// TODO: Support force unwinding in the phase 2 search.

// NOTE: In order to call the cleanup functions, _Unwind_ForcedUnwind()

// will call this personality function with (_US_FORCE_UNWIND |

// _US_UNWIND_FRAME_STARTING).

// Phase 2 search

// Found a catching handler in phase 1

// Load the result from the native exception barrier cache.

// Search for the catching handler again for the foreign exception.

// phase1 search should guarantee to find one

// Install the context for the catching handler

// Either we didn't do a phase 1 search (due to forced unwinding), or

// phase 1 reported no catching-handlers.

// Search for a (non-catching) cleanup

// Found a non-catching handler

// ARM EHABI 8.4.2: Before we can jump to the cleanup handler, we have to setup some

// internal data structures, so that __cxa_end_cleanup() can get unwind_exception from

// __cxa_get_globals().

// Install the context for the cleanup handler

// Did not find any handler

// We were called improperly: neither a phase 1 or phase 2 search

// If std::__unexpected(u_handler) rethrows the same exception,

//   these values get overwritten by the rethrow.  So save them now:

// If the old exception is foreign, then all we can do is terminate.

//   We have no way to recover the needed old exception spec.  There's

//   no way to pass that information here.  And the personality routine

//   can't call us directly and do anything but terminate() if we throw

//   from here.

// Have:

//   old_exception_header->languageSpecificData

//   old_exception_header->actionRecord

//   old_exception_header->catchTemp, base for calculating ttype

// Need

//   const uint8_t* classInfo

//   uint8_t ttypeEncoding

// purposefully unused.  Just needed to increment lsda.

// Is this new exception catchable by the exception spec at ttypeIndex?

// The answer is obviously yes if the new and old exceptions are the same exception

// If no

//    throw;

// This shouldn't be able to happen!

// We need to __cxa_end_catch, but for the old exception,

//   not the new one.  This is a little tricky ...

// Disguise new_exception_header as a rethrown exception, but

//   don't actually rethrow it.  This means you can temporarily

//   end the catch clause enclosing new_exception_header without

//   __cxa_end_catch destroying new_exception_header.

// Call __cxa_end_catch for new_exception_header

// Call __cxa_end_catch for old_exception_header

// Renter this catch clause with new_exception_header

// Rethrow new_exception_header

// Will a std::bad_exception be catchable by the exception spec at

//   ttypeIndex?

// If no

//    throw std::bad_exception();

// We need to __cxa_end_catch for both the old exception and the

//   new exception.  Technically we should do it in that order.

//   But it is expedient to do it in the opposite order:

// Call __cxa_end_catch for new_exception_header

// Throw std::bad_exception will __cxa_end_catch for

//   old_exception_header

// Personality routine for EH using the range table. Make it an alias of

// __gxx_personality_v0().

// extern "C"

// __cxxabiv1

// Include implementation of the personality and helper functions for the

// state table based EH used by IBM legacy compilers xlC and xlclang++ on AIX.


=== system/lib/libcxxabi/src/cxa_thread_atexit.cpp ===
SHA256: ea74f7fdb68062bb02d53469b57a5e48b62fa0895d2e2f7924b09dc97c0e27e3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// A weak symbol is used to detect this function's presence in the C library

// at runtime, even if libc++ is built against an older libc

// This implementation is used if the C library does not provide

// __cxa_thread_atexit_impl() for us.  It has a number of limitations that are

// difficult to impossible to address without ..._impl():

//

// - dso_symbol is ignored.  This means that a shared library may be unloaded

//   (via dlclose()) before its thread_local destructors have run.

//

// - thread_local destructors for the main thread are run by the destructor of

//   a static object.  This is later than expected; they should run before the

//   destructors of any objects with static storage duration.

//

// - thread_local destructors on non-main threads run on the first iteration

//   through the __libccpp_tls_key destructors.

//   std::notify_all_at_thread_exit() and similar functions must be careful to

//   wait until the second iteration to provide their intended ordering

//   guarantees.

//

// Another limitation, though one shared with ..._impl(), is that any

// thread_locals that are first initialized after non-thread_local global

// destructors begin to run will not be destroyed.  [basic.start.term] states

// that all thread_local destructors are sequenced before the destruction of

// objects with static storage duration, resulting in a contradiction if a

// thread_local is constructed after that point.  Thus we consider such

// programs ill-formed, and don't bother to run those destructors.  (If the

// program terminates abnormally after such a thread_local is constructed,

// the destructor is not expected to run and thus there is no contradiction.

// So construction still has to work.)

// The linked list of thread-local destructors to run

// True if the destructors are currently scheduled to run on this thread

// Used to trigger destructors on thread exit; value is ignored

// There is intentionally no matching std::__libcpp_tls_delete call, as

// __cxa_thread_atexit() may be called arbitrarily late (for example, from

// global destructors or atexit() handlers).

// std::__libcpp_tls_key destructors do not run on threads that call exit()

// (including when the main thread returns from main()), so we explicitly

// call the destructor here.  This runs at exit time (potentially earlier

// if libc++abi is dlclose()'d).  Any thread_locals initialized after this

// point will not be destroyed.

// namespace

// HAVE___CXA_THREAD_ATEXIT_IMPL

// Emscripten doesn't implement __cxa_thread_atexit_impl, so we can simply

// avoid this check.

// Initialize the dtors std::__libcpp_tls_key (uses __cxa_guard_*() for

// one-time initialization and __cxa_atexit() for destruction)

// HAVE___CXA_THREAD_ATEXIT_IMPL

// extern "C"

// namespace __cxxabiv1


=== system/lib/libcxxabi/src/cxa_vector.cpp ===
SHA256: c34ef4c79f84ff6c859270399324e2b2252275f73b8014ed471ce698c3714f07
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//  This file implements the "Array Construction and Destruction APIs"

//  https://itanium-cxx-abi.github.io/cxx-abi/abi.html#array-ctor

//

//===----------------------------------------------------------------------===//

// for std::terminate

// for std::bad_array_new_length

//

// Helper routines and classes

//

//  A pair of classes to simplify exception handling and control flow.

//  They get passed a block of memory in the constructor, and unless the

//  'release' method is called, they deallocate the memory in the destructor.

//  Preferred usage is to allocate some memory, attach it to one of these objects,

//  and then, when all the operations to set up the memory block have succeeded,

//  call 'release'. If any of the setup operations fail, or an exception is

//  thrown, then the block is automatically deallocated.

//

//  The only difference between these two classes is the signature for the

//  deallocation function (to match new2/new3 and delete2/delete3.

//

// Externally visible routines

//

// namespace

// Equivalent to

//

//   __cxa_vec_new2(element_count, element_size, padding_size, constructor,

//                  destructor, &::operator new[], &::operator delete[])

// Given the number and size of elements for an array and the non-negative

// size of prefix padding for a cookie, allocate space (using alloc) for

// the array preceded by the specified padding, initialize the cookie if

// the padding is non-zero, and call the given constructor on each element.

// Return the address of the array proper, after the padding.

//

// If alloc throws an exception, rethrow the exception. If alloc returns

// NULL, return NULL. If the constructor throws an exception, call

// destructor for any already constructed elements, and rethrow the

// exception. If the destructor throws an exception, call std::terminate.

//

// The constructor may be NULL, in which case it must not be called. If the

// padding_size is zero, the destructor may be NULL; in that case it must

// not be called.

//

// Neither alloc nor dealloc may be NULL.

//  put the padding before the array elements

//  Construct the elements

// We're good!

// Same as __cxa_vec_new2 except that the deallocation function takes both

// the object address and its size.

//  put the padding before the array elements

//  Construct the elements

// We're good!

// Given the (data) addresses of a destination and a source array, an

// element count and an element size, call the given copy constructor to

// copy each element from the source array to the destination array. The

// copy constructor's arguments are the destination address and source

// address, respectively. If an exception occurs, call the given destructor

// (if non-NULL) on each copied element and rethrow. If the destructor

// throws an exception, call terminate(). The constructor and or destructor

// pointers may be NULL. If either is NULL, no action is taken when it

// would have been called.

// We're good!

// Given the (data) address of an array, not including any cookie padding,

// and the number and size of its elements, call the given constructor on

// each element. If the constructor throws an exception, call the given

// destructor for any already-constructed elements, and rethrow the

// exception. If the destructor throws an exception, call terminate(). The

// constructor and/or destructor pointers may be NULL. If either is NULL,

// no action is taken when it would have been called.

//  Construct the elements

// We're good!

// Given the (data) address of an array, the number of elements, and the

// size of its elements, call the given destructor on each element. If the

// destructor throws an exception, rethrow after destroying the remaining

// elements if possible. If the destructor throws a second exception, call

// terminate(). The destructor pointer may be NULL, in which case this

// routine does nothing.

// one past the last element

//  We're good !

// We're still good!

// Given the (data) address of an array, the number of elements, and the

// size of its elements, call the given destructor on each element. If the

// destructor throws an exception, call terminate(). The destructor pointer

// may be NULL, in which case this routine does nothing.

// one past the last element

// We're done!

// If the array_address is NULL, return immediately. Otherwise, given the

// (data) address of an array, the non-negative size of prefix padding for

// the cookie, and the size of its elements, call the given destructor on

// each element, using the cookie to determine the number of elements, and

// then delete the space by calling ::operator delete[](void *). If the

// destructor throws an exception, rethrow after (a) destroying the

// remaining elements, and (b) deallocating the storage. If the destructor

// throws a second exception, call terminate(). If padding_size is 0, the

// destructor pointer must be NULL. If the destructor pointer is NULL, no

// destructor call is to be made.

//

// The intent of this function is to permit an implementation to call this

// function when confronted with an expression of the form delete[] p in

// the source code, provided that the default deallocation function can be

// used. Therefore, the semantics of this function are consistent with

// those required by the standard. The requirement that the deallocation

// function be called even if the destructor throws an exception derives

// from the resolution to DR 353 to the C++ standard, which was adopted in

// April, 2003.

// Same as __cxa_vec_delete, except that the given function is used for

// deallocation instead of the default delete function. If dealloc throws

// an exception, the result is undefined. The dealloc pointer may not be

// NULL.

// call the destructors

// Same as __cxa_vec_delete, except that the given function is used for

// deallocation instead of the default delete function. The deallocation

// function takes both the object address and its size. If dealloc throws

// an exception, the result is undefined. The dealloc pointer may not be

// NULL.

// call the destructors

// extern "C"

// abi


=== system/lib/libcxxabi/src/cxa_virtual.cpp ===
SHA256: 0862e2a61238ea37d8aea2d5ebb21664df4217b3658f5a81c61813b6ed673949
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// extern "C"

// abi


=== system/lib/libcxxabi/src/demangle/DemangleConfig.h ===
SHA256: d2b1b5b7218c1831ae54a810cc8982cc84e0b84c09ed2c639adefd8f961ae1f7
//===--- DemangleConfig.h --------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

// This file is contains a subset of macros copied from

// llvm/include/llvm/Demangle/DemangleConfig.h

//===----------------------------------------------------------------------===//

// Must be defined before pulling in headers from libc++. Allow downstream

// build systems to override this value.

// https://libcxx.llvm.org/UsingLibcxx.html#enabling-the-safe-libc-mode

// Libc++abi does not have any functionality to log and continue, so we drop

// error messages when we build the demangler with `observe` assertion semantic.

// Once the layering with libc++ is improved, this could use the libc++

// functionality to log hardening failures.

// snprintf is implemented in VS 2015

// Workaround for llvm.org/PR23435, since clang 3.6 and below emit a spurious

// error when __has_cpp_attribute is given a scoped attribute in C mode.

// LIBCXXABI_DEMANGLE_DEMANGLE_CONFIG_H


=== system/lib/libcxxabi/src/demangle/ItaniumDemangle.h ===
SHA256: bf60e1615cb9a1f2f58dc3a3c6664f58419c168e85bfa7b16c6453ba5780a847
//===------------------------- ItaniumDemangle.h ----------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Generic itanium demangler library.

// There are two copies of this file in the source tree.  The one under

// libcxxabi is the original and the one under llvm is the copy.  Use

// cp-to-llvm.sh to update the copy.  See README.txt for more details.

//

//===----------------------------------------------------------------------===//

// NOLINTNEXTLINE(readability-identifier-naming)

// NOLINTNEXTLINE(readability-identifier-naming)

// Base class of all AST nodes. The AST is built by the parser, then is

// traversed by the printLeft/Right functions to produce a demangled string.

/// Three-way bool to track a cached value. Unknown is possible if this node

/// has an unexpanded parameter pack below it that may affect this cache.

/// Operator precedence for expression nodes. Used to determine required

/// parens in expression emission.

/// Tracks if this node has a component on its right side, in which case we

/// need to call printRight.

/// Track if this node is a (possibly qualified) array type. This can affect

/// how we format the output string.

/// Track if this node is a (possibly qualified) function type. This can

/// affect how we format the output string.

/// Visit the most-derived object corresponding to this object.

// The following function is provided by all derived classes:

//

// Call F with arguments that, when passed to the constructor of this node,

// would construct an equivalent node.

//template<typename Fn> void match(Fn F) const;

// Dig through "glue" nodes like ParameterPack and ForwardTemplateReference to

// get at a node that actually represents some concrete syntax.

// Print this node as an expression operand, surrounding it in parentheses if

// its precedence is [Strictly] weaker than P.

// Print an initializer list of this type. Returns true if we printed a custom

// representation, false if nothing has been printed and the default

// representation should be used.

// Silence compiler warnings, this dtor will never be called.

// Print the "left" side of this Node into OutputBuffer.

//

// Note, should only be called from OutputBuffer implementations.

// Call \ref OutputBuffer::printLeft instead.

// Print the "right". This distinction is necessary to represent C++ types

// that appear on the RHS of their subtype, such as arrays or functions.

// Since most types don't have such a component, provide a default

// implementation.

//

// Note, should only be called from OutputBuffer implementations.

// Call \ref OutputBuffer::printRight instead.

// Elements[Idx] is an empty parameter pack expansion, we should erase the

// comma we just printed.

// Print an array of integer literals as a string literal. Returns whether we

// could do so.

// We rewrite objc_object<SomeProtocol>* into id<SomeProtocol>.

// Represents either a LValue or an RValue reference type.

// Dig through any refs to refs, collapsing the ReferenceTypes as we go. The

// rule here is rvalue ref to rvalue ref collapses to a rvalue ref, and any

// other combination collapses to a lvalue ref.

//

// A combination of a TemplateForwardReference and a back-ref Substitution

// from an ill-formed string may have created a cycle; use cycle detection to

// avoid looping forever.

// Track the chain of nodes for the Floyd's 'tortoise and hare'

// cycle-detection algorithm, since getSyntaxNode(S) is impure

// The middle of Prev is the 'slow' pointer moving at half speed

// Cycle detected

/*RHSComponentCache=*/

/*ArrayCache=*/

/*RHSComponentCache=*/

/*ArrayCache=*/

/*FunctionCache=*/

// Handle C++'s ... quirky decl grammar by using the left & right

// distinction. Consider:

//   int (*f(float))(char) {}

// f is a function that takes a float and returns a pointer to a function

// that takes a char and returns an int. If we're trying to print f, start

// by printing out the return types's left, then print our parameters, then

// finally print right of the return type.

/// Represents the explicitly named object parameter.

/// E.g.,

/// \code{.cpp}

///   struct Foo {

///     void bar(this Foo && self);

///   };

/// \endcode

/*RHSComponentCache=*/

/*ArrayCache=*/

/*FunctionCache=*/

// qualifier::name

// FIXME: This should demangle as "vector pixel".

/// An invented name for a template parameter for which we don't have a

/// corresponding template argument.

///

/// This node is created when parsing the <lambda-sig> for a lambda with

/// explicit template arguments, which might be referenced in the parameter

/// types appearing later in the <lambda-sig>.

// Don't print Param to keep the output consistent.

/// A template type parameter declaration, 'typename T'.

/// A constrained template type parameter declaration, 'C<U> T'.

/// A non-type template parameter declaration, 'int N'.

/// A template template parameter declaration,

/// 'template<typename T> typename N'.

/// A template parameter pack declaration, 'typename ...T'.

/// An unexpanded parameter pack (either in the expression or type context). If

/// this AST is correct, this node will have a ParameterPackExpansion node above

/// it.

///

/// This node is created when some <template-args> are found that apply to an

/// <encoding>, and is stored in the TemplateParams table. In order for this to

/// appear in the final AST, it has to referenced via a <template-param> (ie,

/// T_).

// Setup OutputBuffer for a pack expansion, unless we're already expanding

// one.

/// A variadic template argument. This node represents an occurrence of

/// J<something>E in some <template-args>. It isn't itself unexpanded, unless

/// one of its Elements is. The parser inserts a ParameterPack into the

/// TemplateParams table if the <template-args> this pack belongs to apply to an

/// <encoding>.

/// A pack expansion. Below this node, there are some unexpanded ParameterPacks

/// which each have Child->ParameterPackSize elements.

// Print the first element in the pack. If Child contains a ParameterPack,

// it will set up S.CurrentPackMax and print the first element.

// No ParameterPack was found in Child. This can occur if we've found a pack

// expansion on a <function-param>.

// We found a ParameterPack, but it has no elements. Erase whatever we may

// of printed.

// Else, iterate through the rest of the elements in the pack.

// Don't print the requires clause to keep the output simple.

/// A forward-reference to a template argument that was not known at the point

/// where the template parameter name was parsed in a mangling.

///

/// This is created when demangling the name of a specialization of a

/// conversion function template:

///

/// \code

/// struct A {

///   template<typename T> operator T*();

/// };

/// \endcode

///

/// When demangling a specialization of the conversion function template, we

/// encounter the name of the template (including the \c T) before we reach

/// the template argument list, so we cannot substitute the parameter name

/// for the corresponding argument while parsing. Instead, we create a

/// \c ForwardTemplateReference node that is resolved after we parse the

/// template arguments.

// If we're currently printing this node. It is possible (though invalid) for

// a forward template reference to refer to itself via a substitution. This

// creates a cyclic AST, which will stack overflow printing. To fix this, bail

// out if more than one print* function is active.

// We don't provide a matcher for these, because the value of the node is

// not determined by its construction parameters, and it generally needs

// special handling.

// name<template_args>

// The instantiations are typedefs that drop the "basic_" prefix.

// FIXME: This demangling is not particularly readable.

// -- Expression Nodes --

// Assignment is right associative, with special LHS precedence.

// No space before comma operator

// cast_kind<to>(from)

// (func)(args ...) ?

// new (expr_list) type(init_list)

// ::operator new ?

// new[] ?

// Either '[init op ]... op pack' or 'pack op ...[ op init]'

// Refactored to '[(init|pack) op ]...[ op (pack|init)]'

// Fold expr operands are cast-expressions

// '(init|pack) op '

// ' op (init|pack)'

// ty(integer)

/// Visit the node. Calls \c F(P), where \c P is the node cast to the

/// appropriate derived class.

/// Determine the kind of a node from its type.

// Insert a `""` to avoid accidentally extending a numeric escape.

// Determine how to print this character.

// We assume that the character is ASCII, and use a numeric escape for all

// remaining non-printable ASCII characters.

// Assume all remaining characters are directly printable.

// Name stack, this is used by the parser to hold temporary names that were

// parsed. The parser collapses multiple names into new nodes to construct

// the AST. Once the parser is finished, names.size() == 1.

// Substitution table. Itanium supports name substitutions as a means of

// compression. The string "S42_" refers to the 44nd entry (base-36) in this

// table.

// A list of template argument values corresponding to a template parameter

// list.

// Template parameter table. Like the above, but referenced like "T42_".

// This has a smaller size compared to Subs and Names because it can be

// stored on the stack.

// Lists of template parameters indexed by template parameter depth,

// referenced like "TL2_4_". If nonempty, element 0 is always

// OuterTemplateParams; inner elements are always template parameter lists of

// lambda expressions. For a generic lambda with no explicit template

// parameter list, the corresponding parameter list pointer will be null.

// Set of unresolved forward <template-param> references. These can occur in a

// conversion operator's type, and are resolved in the enclosing <encoding>.

/// Parse the <expression> production.

/// Parse the <type> production.

/// Holds some extra information about a <name> that is being parsed. This

/// information is only pertinent if the <name> refers to an <encoding>.

/// Parse the <name> production>

// Prefix unary: @ expr

// Postfix unary: expr @

// Binary: lhs @ rhs

// Array index:  lhs [ rhs ]

// Member access: lhs @ rhs

// New

// Delete

// Function call: expr (expr*)

// C cast: (type)expr

// Conditional: expr ? expr : expr

// Overload only, not allowed in expression.

// Below do not have operator names

// Named cast, @<type>(expr)

// alignof, sizeof, typeid

// Encoding

// Kind of operator

// Entry-specific flag

// Precedence

// Spelling

/// Parse the <unresolved-name> production.

/// Top-level entry point into the parser.

// <name> ::= <nested-name> // N

//        ::= <local-name> # See Scope Encoding below  // Z

//        ::= <unscoped-template-name> <template-args>

//        ::= <unscoped-name>

//

// <unscoped-template-name> ::= <unscoped-name>

//                          ::= <substitution>

//        ::= <unscoped-template-name> <template-args>

// An unscoped-template-name is substitutable.

// The substitution case must be followed by <template-args>.

// <local-name> := Z <function encoding> E <entity name> [<discriminator>]

//              := Z <function encoding> E s [<discriminator>]

//              := Z <function encoding> Ed [ <parameter number> ] _ <entity name>

// The template parameters of the inner name are unrelated to those of the

// enclosing context.

// <unscoped-name> ::= <unqualified-name>

//                 ::= St <unqualified-name>   # ::std::

// [*] extension

// <unqualified-name> ::= [<module-name>] F? L? <operator-name> [<abi-tags>]

//                    ::= [<module-name>] <ctor-dtor-name> [<abi-tags>]

//                    ::= [<module-name>] F? L? <source-name> [<abi-tags>]

//                    ::= [<module-name>] L? <unnamed-type-name> [<abi-tags>]

//			# structured binding declaration

//                    ::= [<module-name>] L? DC <source-name>+ E

// Structured binding

// A <ctor-dtor-name>.

// <module-name> ::= <module-subname>

// 	 	 ::= <module-name> <module-subname>

//		 ::= <substitution>  # passed in by caller

// <module-subname> ::= W <source-name>

//		    ::= W P <source-name>

// <unnamed-type-name> ::= Ut [<nonnegative number>] _

//                     ::= <closure-type-name>

//

// <closure-type-name> ::= Ul <lambda-sig> E [ <nonnegative number> ] _

//

// <lambda-sig> ::= <template-param-decl>* [Q <requires-clause expression>]

//                  <parameter type>+  # or "v" if the lambda has no parameters

// <template-params> refer to the innermost <template-args>. Clear out any

// outer args that we may have inserted into TemplateParams.

// FIXME: If TempParams is empty and none of the function parameters

// includes 'auto', we should remove LambdaTemplateParams from the

// TemplateParams list. Unfortunately, we don't find out whether there are

// any 'auto' parameters until too late in an example such as:

//

//   template<typename T> void f(

//       decltype([](decltype([]<typename T>(T v) {}),

//                   auto) {})) {}

//   template<typename T> void f(

//       decltype([](decltype([]<typename T>(T w) {}),

//                   int) {})) {}

//

// Here, the type of v is at level 2 but the type of w is at level 1. We

// don't find this out until we encounter the type of the next parameter.

//

// However, compilers can't actually cope with the former example in

// practice, and it's likely to be made ill-formed in future, so we don't

// need to support it here.

//

// If we encounter an 'auto' in the function parameter types, we will

// recreate a template parameter scope for it, but any intervening lambdas

// will be parsed in the 'wrong' template parameter depth.

// <source-name> ::= <positive length number> <identifier>

// Operator encodings

// Keep ordered by encoding

/*Type*/

/*Type*/

/*Paren*/

/*Paren*/

// C Cast

/*Ary*/

/*Ary*/

/*Named*/

/*Named*/

/*Ary*/

/*Ary*/

/*Named*/

/*Named*/

/*Type*/

/*Type*/

/*Type*/

/*Type*/

// If the next 2 chars are an operator encoding, consume them and return their

// OperatorInfo.  Otherwise return nullptr.

// We can't use lower_bound as that can link to symbols in the C++ library,

// and this must remain independent of that.

// Inclusive bounds.

//   <operator-name> ::= See parseOperatorEncoding()

//                   ::= li <source-name>  # operator ""

//                   ::= v <digit> <source-name>  # vendor extended operator

//              ::= cv <type>    # (cast)

// If we're parsing an encoding, State != nullptr and the conversion

// operators' <type> could have a <template-param> that refers to some

// <template-arg>s further ahead in the mangled name.

/* Not a nameable operator.  */

/* Not a nameable MemberExpr */

//                   ::= li <source-name>  # operator ""

// ::= v <digit> <source-name>        # vendor extended operator

// <ctor-dtor-name> ::= C1  # complete object constructor

//                  ::= C2  # base object constructor

//                  ::= C3  # complete object allocating constructor

//   extension      ::= C4  # gcc old-style "[unified]" constructor

//   extension      ::= C5  # the COMDAT used for ctors

//                  ::= D0  # deleting destructor

//                  ::= D1  # complete object destructor

//                  ::= D2  # base object destructor

//   extension      ::= D4  # gcc old-style "[unified]" destructor

//   extension      ::= D5  # the COMDAT used for dtors

// Expand the special substitution.

/*IsDtor=*/

/*IsDtor=*/

// <nested-name> ::= N [<CV-Qualifiers>] [<ref-qualifier>] <prefix>

// 			<unqualified-name> E

//               ::= N [<CV-Qualifiers>] [<ref-qualifier>] <template-prefix>

//               	<template-args> E

//

// <prefix> ::= <prefix> <unqualified-name>

//          ::= <template-prefix> <template-args>

//          ::= <template-param>

//          ::= <decltype>

//          ::= # empty

//          ::= <substitution>

//          ::= <prefix> <data-member-prefix>

// [*] extension

//

// <data-member-prefix> := <member source-name> [<template-args>] M

//

// <template-prefix> ::= <prefix> <template unqualified-name>

//                   ::= <template-param>

//                   ::= <substitution>

// 'H' specifies that the encoding that follows

// has an explicit object parameter.

// Only set end-with-template on the case that does that.

//          ::= <template-param>

// Cannot have a prefix.

//          ::= <template-prefix> <template-args>

// Must have a prefix.

// Semantically <template-args> <template-args> cannot be generated by a

// C++ entity.  There will always be [something like] a name between

// them.

//          ::= <decltype>

// Cannot have a prefix.

//          ::= <substitution>

// Cannot have a prefix.

// Do not push a new substitution.

//          ::= [<prefix>] <unqualified-name>

// No longer used.

// <data-member-prefix> := <member source-name> [<template-args>] M

// <simple-id> ::= <source-name> [ <template-args> ]

/*NameState=*/

// <destructor-name> ::= <unresolved-type>  # e.g., ~T or ~decltype(f())

//                   ::= <simple-id>        # e.g., ~A<2*N>

// <unresolved-type> ::= <template-param>

//                   ::= <decltype>

//                   ::= <substitution>

// <base-unresolved-name> ::= <simple-id>                                # unresolved name

//          extension     ::= <operator-name>                            # unresolved operator-function-id

//          extension     ::= <operator-name> <template-args>            # unresolved operator template-id

//                        ::= on <operator-name>                         # unresolved operator-function-id

//                        ::= on <operator-name> <template-args>         # unresolved operator template-id

//                        ::= dn <destructor-name>                       # destructor or pseudo-destructor;

//                                                                         # e.g. ~X or ~X<N-1>

/*NameState=*/

// <unresolved-name>

//  extension        ::= srN <unresolved-type> [<template-args>] <unresolved-qualifier-level>* E <base-unresolved-name>

//                   ::= [gs] <base-unresolved-name>                     # x or (with "gs") ::x

//                   ::= [gs] sr <unresolved-qualifier-level>+ E <base-unresolved-name>

//                                                                       # A::x, N::y, A<T>::z; "gs" means leading "::"

// [gs] has been parsed by caller.

//                   ::= sr <unresolved-type> <base-unresolved-name>     # T::x / decltype(p)::x

//  extension        ::= sr <unresolved-type> <template-args> <base-unresolved-name>

//                                                                       # T::N::x /decltype(p)::N::x

//  (ignored)        ::= srN <unresolved-type>  <unresolved-qualifier-level>+ E <base-unresolved-name>

//

// <unresolved-qualifier-level> ::= <simple-id>

// srN <unresolved-type> [<template-args>] <unresolved-qualifier-level>* E <base-unresolved-name>

// srN <unresolved-type>                   <unresolved-qualifier-level>+ E <base-unresolved-name>

// [gs] <base-unresolved-name>                     # x or (with "gs") ::x

// [gs] sr <unresolved-qualifier-level>+ E   <base-unresolved-name>

//      sr <unresolved-type>                 <base-unresolved-name>

//      sr <unresolved-type> <template-args> <base-unresolved-name>

// <abi-tags> ::= <abi-tag> [<abi-tags>]

// <abi-tag> ::= B <source-name>

// <number> ::= [n] <non-negative decimal integer>

// <positive length number> ::= [0-9]*

// <function-type> ::= [<CV-qualifiers>] [<exception-spec>] [Dx] F [Y] <bare-function-type> [<ref-qualifier>] E

//

// <exception-spec> ::= Do                # non-throwing exception-specification (e.g., noexcept, throw())

//                  ::= DO <expression> E # computed (instantiation-dependent) noexcept

//                  ::= Dw <type>+ E      # dynamic exception specification with instantiation-dependent types

//

// <ref-qualifier> ::= R                   # & ref-qualifier

// <ref-qualifier> ::= O                   # && ref-qualifier

// transaction safe

// extern "C"

// extension:

// <vector-type>           ::= Dv <positive dimension number> _ <extended element type>

//                         ::= Dv [<dimension expression>] _ <element type>

// <extended element type> ::= <element type>

//                         ::= p # AltiVec vector pixel

/*Dimension=*/

// <decltype>  ::= Dt <expression> E  # decltype of an id-expression or class member access (C++0x)

//             ::= DT <expression> E  # decltype of an expression (C++0x)

// <array-type> ::= A <positive dimension number> _ <element type>

//              ::= A [<dimension expression>] _ <element type>

// <pointer-to-member-type> ::= M <class type> <member type>

// <class-enum-type> ::= <name>     # non-dependent type name, dependent type name, or dependent typename-specifier

//                   ::= Ts <name>  # dependent elaborated type specifier using 'struct' or 'class'

//                   ::= Tu <name>  # dependent elaborated type specifier using 'union'

//                   ::= Te <name>  # dependent elaborated type specifier using 'enum'

// <qualified-type>     ::= <qualifiers> <type>

// <qualifiers> ::= <extended-qualifier>* <CV-qualifiers>

// <extended-qualifier> ::= U <source-name> [<template-args>] # vendor extended type qualifier

// extension            ::= U <objc-name> <objc-type>  # objc-type<identifier>

// <type>      ::= <builtin-type>

//             ::= <qualified-type>

//             ::= <function-type>

//             ::= <class-enum-type>

//             ::= <array-type>

//             ::= <pointer-to-member-type>

//             ::= <template-param>

//             ::= <template-template-param> <template-args>

//             ::= <decltype>

//             ::= P <type>        # pointer

//             ::= R <type>        # l-value reference

//             ::= O <type>        # r-value reference (C++11)

//             ::= C <type>        # complex pair (C99)

//             ::= G <type>        # imaginary (C99)

//             ::= <substitution>  # See Compression below

// extension   ::= U <objc-name> <objc-type>  # objc-type<identifier>

// extension   ::= <vector-type> # <vector-type> starts with Dv

//

// <objc-name> ::= <k0 number> objcproto <k1 number> <identifier>  # k0 = 9 + <number of digits in k1> + k1

// <objc-type> ::= <source-name>  # PU<11+>objcproto 11objc_object<source-name> 11objc_object -> id<source-name>

//             ::= <qualified-type>

// <builtin-type> ::= v    # void

//                ::= w    # wchar_t

//                ::= b    # bool

//                ::= c    # char

//                ::= a    # signed char

//                ::= h    # unsigned char

//                ::= s    # short

//                ::= t    # unsigned short

//                ::= i    # int

//                ::= j    # unsigned int

//                ::= l    # long

//                ::= m    # unsigned long

//                ::= x    # long long, __int64

//                ::= y    # unsigned long long, __int64

//                ::= n    # __int128

//                ::= o    # unsigned __int128

//                ::= f    # float

//                ::= d    # double

//                ::= e    # long double, __float80

//                ::= g    # __float128

//                ::= z    # ellipsis

// <builtin-type> ::= u <source-name>    # vendor extended type

// Typically, <builtin-type>s are not considered substitution candidates,

// but the exception to that exception is vendor extended types (Itanium C++

// ABI 5.9.1).

//                ::= Dd   # IEEE 754r decimal floating point (64 bits)

//                ::= De   # IEEE 754r decimal floating point (128 bits)

//                ::= Df   # IEEE 754r decimal floating point (32 bits)

//                ::= Dh   # IEEE 754r half-precision floating point (16 bits)

//       ::= DF16b         # C++23 std::bfloat16_t

//       ::= DF <number> _ # ISO/IEC TS 18661 binary floating point (N bits)

//                ::= [DS] DA  # N1169 fixed-point [_Sat] T _Accum

//                ::= [DS] DR  # N1169 fixed-point [_Sat] T _Frac

// <fixed-point-size>

//                ::= s # short

//                ::= t # unsigned short

//                ::= i # plain

//                ::= j # unsigned

//                ::= l # long

//                ::= m # unsigned long

//                ::= DB <number> _                             # C23 signed _BitInt(N)

//                ::= DB <instantiation-dependent expression> _ # C23 signed _BitInt(N)

//                ::= DU <number> _                             # C23 unsigned _BitInt(N)

//                ::= DU <instantiation-dependent expression> _ # C23 unsigned _BitInt(N)

// The front end expects this to be available for Substitution

//                ::= Di   # char32_t

//                ::= Ds   # char16_t

//                ::= Du   # char8_t (C++2a, not yet in the Itanium spec)

//                ::= Da   # auto (in dependent new-expressions)

//                ::= Dc   # decltype(auto)

//                ::= Dk <type-constraint> # constrained auto

//                ::= DK <type-constraint> # constrained decltype(auto)

//                ::= Dn   # std::nullptr_t (i.e., decltype(nullptr))

//             ::= <decltype>

// extension   ::= <vector-type> # <vector-type> starts with Dv

//           ::= Dp <type>       # pack expansion (C++0x)

// Exception specifier on a function type.

// Transaction safe function type.

//             ::= <function-type>

//             ::= <array-type>

//             ::= <pointer-to-member-type>

//             ::= <template-param>

// This could be an elaborate type specifier on a <class-enum-type>.

// Result could be either of:

//   <type>        ::= <template-param>

//   <type>        ::= <template-template-param> <template-args>

//

//   <template-template-param> ::= <template-param>

//                             ::= <substitution>

//

// If this is followed by some <template-args>, and we're permitted to

// parse them, take the second production.

//             ::= P <type>        # pointer

//             ::= R <type>        # l-value reference

//             ::= O <type>        # r-value reference (C++11)

//             ::= C <type>        # complex pair (C99)

//             ::= G <type>        # imaginary (C99)

//             ::= <substitution>  # See Compression below

// Sub could be either of:

//   <type>        ::= <substitution>

//   <type>        ::= <template-template-param> <template-args>

//

//   <template-template-param> ::= <template-param>

//                             ::= <substitution>

//

// If this is followed by some <template-args>, and we're permitted to

// parse them, take the second production.

// If all we parsed was a substitution, don't re-insert into the

// substitution table.

//        ::= <class-enum-type>

// If we parsed a type, insert it into the substitution table. Note that all

// <builtin-type>s and <substitution>s have already bailed out, because they

// don't get substitutions.

// <CV-Qualifiers> ::= [r] [V] [K]

// <function-param> ::= fp <top-level CV-Qualifiers> _                                     # L == 0, first parameter

//                  ::= fp <top-level CV-Qualifiers> <parameter-2 non-negative number> _   # L == 0, second and later parameters

//                  ::= fL <L-1 non-negative number> p <top-level CV-Qualifiers> _         # L > 0, first parameter

//                  ::= fL <L-1 non-negative number> p <top-level CV-Qualifiers> <parameter-2 non-negative number> _   # L > 0, second and later parameters

//                  ::= fpT      # 'this' expression (not part of standard?)

// cv <type> <expression>                               # conversion with one argument

// cv <type> _ <expression>* E                          # conversion with a different number of arguments

// <expr-primary> ::= L <type> <value number> E                          # integer literal

//                ::= L <type> <value float> E                           # floating literal

//                ::= L <string type> E                                  # string literal

//                ::= L <nullptr type> E                                 # nullptr literal (i.e., "LDnE")

//                ::= L <lambda type> E                                  # lambda expression

// FIXME:         ::= L <type> <real-part float> _ <imag-part float> E   # complex floating point literal (C 2000)

//                ::= L <mangled-name> E                                 # external name

// Handle cases where long doubles encoded with e have the same size

// and representation as doubles.

// FIXME: We need to include the string contents in the mangling.

// Invalid mangled name per

//   http://sourcerytools.com/pipermail/cxx-abi-dev/2011-August/002422.html

// FIXME: Should we support LUb... for block literals?

// might be named type

/*AllowNegative=*/

// <braced-expression> ::= <expression>

//                     ::= di <field source-name> <braced-expression>    # .name = expr

//                     ::= dx <index expression> <braced-expression>     # [expr] = expr

//                     ::= dX <range begin expression> <range end expression> <braced-expression>

/*NameState=*/

/*isArray=*/

/*isArray=*/

// (not yet in the spec)

// <fold-expr> ::= fL <binary-operator-name> <expression> <expression>

//             ::= fR <binary-operator-name> <expression> <expression>

//             ::= fl <binary-operator-name> <expression>

//             ::= fr <binary-operator-name> <expression>

// <expression> ::= mc <parameter type> <expr> [<offset number>] E

//

// Not yet in the spec: https://github.com/itanium-cxx-abi/cxx-abi/issues/47

// <expression> ::= so <referent type> <expr> [<offset number>] <union-selector>* [p] E

// <union-selector> ::= _ [<number>]

//

// Not yet in the spec: https://github.com/itanium-cxx-abi/cxx-abi/issues/47

// Within this expression, all enclosing template parameter lists are in

// scope.

// <expression> ::= rQ <bare-function-type> _ <requirement>+ E

// <expression> ::= rq <requirement>+ E

// <requirement> ::= X <expression> [N] [R <type-constraint>]

// <requirement> ::= T <type>

// <requirement> ::= Q <constraint-expression>

//

// FIXME: We use <expression> instead of <constraint-expression>. Either

// the requires expression is already inside a constraint expression, in

// which case it makes no difference, or we're in a requires-expression

// that might be partially-substituted, where the language behavior is

// not yet settled and clang mangles after substitution.

// <expression> ::= <unary operator-name> <expression>

//              ::= <binary operator-name> <expression> <expression>

//              ::= <ternary operator-name> <expression> <expression> <expression>

//              ::= cl <expression>+ E                                   # call

//              ::= cp <base-unresolved-name> <expression>* E            # (name) (expr-list), call that would use argument-dependent lookup but for the parentheses

//              ::= cv <type> <expression>                               # conversion with one argument

//              ::= cv <type> _ <expression>* E                          # conversion with a different number of arguments

//              ::= [gs] nw <expression>* _ <type> E                     # new (expr-list) type

//              ::= [gs] nw <expression>* _ <type> <initializer>         # new (expr-list) type (init)

//              ::= [gs] na <expression>* _ <type> E                     # new[] (expr-list) type

//              ::= [gs] na <expression>* _ <type> <initializer>         # new[] (expr-list) type (init)

//              ::= [gs] dl <expression>                                 # delete expression

//              ::= [gs] da <expression>                                 # delete[] expression

//              ::= pp_ <expression>                                     # prefix ++

//              ::= mm_ <expression>                                     # prefix --

//              ::= ti <type>                                            # typeid (type)

//              ::= te <expression>                                      # typeid (expression)

//              ::= dc <type> <expression>                               # dynamic_cast<type> (expression)

//              ::= sc <type> <expression>                               # static_cast<type> (expression)

//              ::= cc <type> <expression>                               # const_cast<type> (expression)

//              ::= rc <type> <expression>                               # reinterpret_cast<type> (expression)

//              ::= st <type>                                            # sizeof (a type)

//              ::= sz <expression>                                      # sizeof (an expression)

//              ::= at <type>                                            # alignof (a type)

//              ::= az <expression>                                      # alignof (an expression)

//              ::= nx <expression>                                      # noexcept (expression)

//              ::= <template-param>

//              ::= <function-param>

//              ::= dt <expression> <unresolved-name>                    # expr.name

//              ::= pt <expression> <unresolved-name>                    # expr->name

//              ::= ds <expression> <expression>                         # expr.*expr

//              ::= sZ <template-param>                                  # size of a parameter pack

//              ::= sZ <function-param>                                  # size of a function parameter pack

//              ::= sP <template-arg>* E                                 # sizeof...(T), size of a captured template parameter pack from an alias template

//              ::= sp <expression>                                      # pack expansion

//              ::= tw <expression>                                      # throw expression

//              ::= tr                                                   # throw with no operand (rethrow)

//              ::= <unresolved-name>                                    # f(p), N::f(p), ::f(p),

//                                                                       # freestanding dependent name (e.g., T::x),

//                                                                       # objectless nonstatic member reference

//              ::= fL <binary-operator-name> <expression> <expression>

//              ::= fR <binary-operator-name> <expression> <expression>

//              ::= fl <binary-operator-name> <expression>

//              ::= fr <binary-operator-name> <expression>

//              ::= <expr-primary>

// Binary operator: lhs @ rhs

// Prefix unary operator: @ expr

// Postfix unary operator: expr @

// Array Index:  lhs [ rhs ]

// Member access lhs @ rhs

// New

// # new (expr-list) type [(init)]

// [gs] nw <expression>* _ <type> [pi <expression>*] E

// # new[] (expr-list) type [(init)]

// [gs] na <expression>* _ <type> [pi <expression>*] E

/*IsArray=*/

// Delete

/*IsArray=*/

// Function Call

/*IsParen=*/

// C Cast: (type)expr

// Conditional operator: expr ? expr : expr

// Named cast operation, @<type>(expr)

// [sizeof/alignof/typeid] ( <type>|<expr> )

// Not valid as an expression operand.

// Disambiguate a fold expression from a <function-param>.

/*NameState=*/

// Special case legacy __uuidof mangling. The 't' and 'z' appear where the

// standard encoding expects a <template-arg>, and would be otherwise be

// interpreted as <type> node 'short' or 'ellipsis'. However, neither

// __uuidof(short) nor __uuidof(...) can actually appear, so there is no

// actual conflict here.

/*IsParen=*/

// Only unresolved names remain.

// <call-offset> ::= h <nv-offset> _

//               ::= v <v-offset> _

//

// <nv-offset> ::= <offset number>

//               # non-virtual base override

//

// <v-offset>  ::= <offset number> _ <virtual offset number>

//               # virtual base override, with vcall offset

// Just scan through the call offset, we never add this information into the

// output.

// <special-name> ::= TV <type>    # virtual table

//                ::= TT <type>    # VTT structure (construction vtable index)

//                ::= TI <type>    # typeinfo structure

//                ::= TS <type>    # typeinfo name (null-terminated byte string)

//                ::= Tc <call-offset> <call-offset> <base encoding>

//                    # base is the nominal target function of thunk

//                    # first call-offset is 'this' adjustment

//                    # second call-offset is result adjustment

//                ::= T <call-offset> <base encoding>

//                    # base is the nominal target function of thunk

//                # Guard variable for one-time initialization

//                ::= GV <object name>

//                                     # No <type>

//                ::= TW <object name> # Thread-local wrapper

//                ::= TH <object name> # Thread-local initialization

//                ::= GR <object name> _             # First temporary

//                ::= GR <object name> <seq-id> _    # Subsequent temporaries

//                # construction vtable for second-in-first

//      extension ::= TC <first type> <number> _ <second type>

//      extension ::= GR <object name> # reference temporary for object

//      extension ::= GI <module name> # module global initializer

// TA <template-arg>    # template parameter object

//

// Not yet in the spec: https://github.com/itanium-cxx-abi/cxx-abi/issues/63

// TV <type>    # virtual table

// TT <type>    # VTT structure (construction vtable index)

// TI <type>    # typeinfo structure

// TS <type>    # typeinfo name (null-terminated byte string)

// Tc <call-offset> <call-offset> <base encoding>

// extension ::= TC <first type> <number> _ <second type>

//               # construction vtable for second-in-first

// TW <object name> # Thread-local wrapper

// TH <object name> # Thread-local initialization

// T <call-offset> <base encoding>

// GV <object name> # Guard variable for one-time initialization

// GR <object name> # reference temporary for object

// GR <object name> _             # First temporary

// GR <object name> <seq-id> _    # Subsequent temporaries

// GI <module-name> v

// <encoding> ::= <function name> <bare-function-type>

//                    [`Q` <requires-clause expr>]

//            ::= <data name>

//            ::= <special-name>

// The template parameters of an encoding are unrelated to those of the

// enclosing context.

// The set of chars that can potentially follow an <encoding> (none of which

// can start a <type>). Enumerating these allows us to avoid speculative

// parsing.

// ParseParams may be false at the top level only, when called from parse().

// For example in the mangled name _Z3fooILZ3BarEET_f, ParseParams may be

// false when demangling 3fooILZ3BarEET_f but is always true when demangling

// 3Bar.

// MSVC doesn't define __LDBL_MANT_DIG__, but it has long double equal to

// regular double on all current architectures.

// `-0x1.ffffffffffffffffffffffffffffp+16383` + 'L' + '\0' == 42 bytes.

// 28 'f's * 4 bits == 112 bits, which is the number of mantissa bits.

// Negatives are one character longer than positives.

// `0x1.` and `p` are constant, and exponents `+16383` and `-16382` are the

// same length. 1 sign bit, 112 mantissa bits, and 15 exponent bits == 128.

// <seq-id> ::= <0-9A-Z>+

// <substitution> ::= S <seq-id> _

//                ::= S_

// <substitution> ::= Sa # ::std::allocator

// <substitution> ::= Sb # ::std::basic_string

// <substitution> ::= Ss # ::std::basic_string < char,

//                                               ::std::char_traits<char>,

//                                               ::std::allocator<char> >

// <substitution> ::= Si # ::std::basic_istream<char,  std::char_traits<char> >

// <substitution> ::= So # ::std::basic_ostream<char,  std::char_traits<char> >

// <substitution> ::= Sd # ::std::basic_iostream<char, std::char_traits<char> >

// The St case is handled specially in parseNestedName.

// Itanium C++ ABI 5.1.2: If a name that would use a built-in <substitution>

// has ABI tags, the tags are appended to the substitution; the result is a

// substitutable component.

//                ::= S_

//                ::= S <seq-id> _

// <template-param> ::= T_    # first template parameter

//                  ::= T <parameter-2 non-negative number> _

//                  ::= TL <level-1> __

//                  ::= TL <level-1> _ <parameter-2 non-negative number> _

// We don't track enclosing template parameter levels well enough to reliably

// substitute them all within a <constraint-expression>, so print the

// parameter numbering instead for now.

// TODO: Track all enclosing template parameters and substitute them here.

// If we're in a context where this <template-param> refers to a

// <template-arg> further ahead in the mangled name (currently just conversion

// operator types), then we should only look it up in the right context.

// This can only happen at the outermost level.

// Itanium ABI 5.1.8: In a generic lambda, uses of auto in the parameter

// list are mangled as the corresponding artificial template type parameter.

// This will be popped by the ScopedTemplateParamList in

// parseUnnamedTypeName.

// <template-param-decl> ::= Ty                          # type parameter

//                       ::= Tk <concept name> [<template-args>] # constrained type parameter

//                       ::= Tn <type>                   # non-type parameter

//                       ::= Tt <template-param-decl>* E # template parameter

//                       ::= Tp <template-param-decl>    # parameter pack

// We don't track enclosing template parameter levels well enough to

// reliably demangle template parameter substitutions, so print an arbitrary

// string in place of a parameter for now.

// TODO: Track all enclosing template parameters and demangle substitutions.

// <template-arg> ::= <type>                    # type or template

//                ::= X <expression> E          # expression

//                ::= <expr-primary>            # simple expressions

//                ::= J <template-arg>* E       # argument pack

//                ::= LZ <encoding> E           # extension

//                ::= <template-param-decl> <template-arg>

//                ::= LZ <encoding> E           # extension

//                ::= <expr-primary>            # simple expressions

// Either <template-param> or a <template-param-decl> <template-arg>.

// <template-args> ::= I <template-arg>* [Q <requires-clause expr>] E

//     extension, the abi says <template-arg>+

// <template-params> refer to the innermost <template-args>. Clear out any

// outer args that we may have inserted into TemplateParams.

// <mangled-name> ::= _Z <encoding>

//                ::= <type>

// extension      ::= ___Z <encoding> _block_invoke

// extension      ::= ___Z <encoding> _block_invoke<decimal-digit>+

// extension      ::= ___Z <encoding> _block_invoke_<decimal-digit>+

// DEMANGLE_ITANIUMDEMANGLE_H


=== system/lib/libcxxabi/src/demangle/StringViewExtras.h ===
SHA256: 3e2bef93ff590dcc156d7392b7f0b507a2a21559fee8a15e24a85d100e30bb02
//===--- StringViewExtras.h -------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// There are two copies of this file in the source tree.  The one under

// libcxxabi is the original and the one under llvm is the copy.  Use

// cp-to-llvm.sh to update the copy.  See README.txt for more details.

//

//===----------------------------------------------------------------------===//


=== system/lib/libcxxabi/src/demangle/Utility.h ===
SHA256: caadd40a967867cf5bfdd61c5c1d7851b527dd01a7b2f860bb755abda2b6f81a
//===--- Utility.h ----------------------------------------------*- C++ -*-===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// Provide some utility classes for use in the demangler.

// There are two copies of this file in the source tree.  The one in libcxxabi

// is the original and the one in llvm is the copy.  Use cp-to-llvm.sh to update

// the copy.  See README.txt for more details.

//

//===----------------------------------------------------------------------===//

// Stream that AST nodes write their string representation into after the AST

// has been parsed.

// Ensure there are at least N more positions in the buffer.

// Reduce the number of reallocations, with a bit of hysteresis. The

// number here is chosen so the first allocation will more-than-likely not

// allocate more than 1K.

// Output at least one character.

// Add negative sign.

// Non-copyable

/// Called by the demangler when printing the demangle tree. By

/// default calls into \c Node::print{Left|Right} but can be overriden

/// by clients to track additional state when printing the demangled name.

/// Called when we write to this object anywhere other than the end.

/*Position*/

/*Count*/

/// Called when we make the \c CurrentPosition of this object smaller.

/*OldPos*/

/*NewPos*/

/// If a ParameterPackExpansion (or similar type) is encountered, the offset

/// into the pack that we're currently printing.

/// When zero, we're printing template args and '>' needs to be parenthesized.

/// Use a counter so we can simply increment inside parentheses.

/*Position=*/

/*Count=*/


=== system/lib/libcxxabi/src/fallback_malloc.cpp ===
SHA256: eebf8d5a54c058a1d12caba4ca78dd85bb8eb0880bdd4ab91fbb2b675dbcf942
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// for malloc, calloc, free

// for memset

//  A small, simple heap manager based (loosely) on

//  the startup heap manager from FreeBSD, optimized for space.

//

//  Manages a fixed-size memory pool, supports malloc and free only.

//  No support for realloc.

//

//  Allocates chunks in multiples of four bytes, with a four byte header

//  for each chunk. The overhead of each chunk is kept low by keeping pointers

//  as two byte offsets within the heap, rather than (4 or 8 byte) pointers.

// When POSIX threads are not available, make the mutex operations a nop

// On both 64 and 32 bit targets heap_node should have the following properties

// Size: 4

// Alignment: 2

// offset into heap

// size in units of "sizeof(heap_node)"

// All pointers returned by fallback_malloc must be at least aligned

// as RequiredAligned. Note that RequiredAlignment can be greater than

// alignof(std::max_align_t) on 64 bit systems compiling 32 bit code.

// The number of heap_node's that can fit in a chunk of memory with the size

// of the RequiredAlignment. On 64 bit targets NodesPerAlignment should be 4.

// one past the end of the heap

// Return a pointer to the first address, 'A', in `heap` that can actually be

// used to represent a heap_node. 'A' must be aligned so that

// '(A + sizeof(heap_node)) % RequiredAlignment == 0'. On 64 bit systems this

// address should be 12 bytes after the first 16 byte boundary.

//  How big a chunk we allocate

//  Walk the free list, looking for a "big enough" chunk

// Check the invariant that all heap_nodes pointers 'p' are aligned

// so that 'p + 1' has an alignment of at least RequiredAlignment

// Calculate the number of extra padding elements needed in order

// to split 'p' and create a properly aligned heap_node from the tail

// of 'p'. We calculate aligned_nelems such that 'p->len - aligned_nelems'

// will be a multiple of NodesPerAlignment.

// chunk is larger and we can create a properly aligned heap_node

// from the tail. In this case we shorten 'p' and return the tail.

// The chunk is the exact size or the chunk is larger but not large

// enough to split due to alignment constraints.

// couldn't find a spot big enough

//  Return the start of the next block

// retrieve the chunk

// make the free heap_node larger

// there's a free heap_node right after

//  Nothing to merge with, add it to the start of the free list

// end unnamed namespace

// if calloc fails, fall back to emergency stash

// namespace __cxxabiv1


=== system/lib/libcxxabi/src/fallback_malloc.h ===
SHA256: a9f725ecf2bfe34f482ead34e182b74013e48fc51902f55eba2a7e30866415b1
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// for size_t

// Allocate some memory from _somewhere_

// Allocate and zero-initialize memory from _somewhere_

// namespace __cxxabiv1


=== system/lib/libcxxabi/src/private_typeinfo.cpp ===
SHA256: b643812c79e5660ec59fb0baa1bc7e6e885f99c617f045dd02e7328cfab9f9e2
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// The flag _LIBCXXABI_FORGIVING_DYNAMIC_CAST is used to make dynamic_cast

// more forgiving when type_info's mistakenly have hidden visibility and

// thus multiple type_infos can exist for a single type.

//

// When _LIBCXXABI_FORGIVING_DYNAMIC_CAST is defined, and only in the case where

// there is a detected inconsistency in the type_info hierarchy during a

// dynamic_cast, then the equality operation will fall back to using strcmp

// on type_info names to determine type_info equality.

//

// This change happens *only* under dynamic_cast, and only when

// dynamic_cast is faced with the choice:  abort, or possibly give back the

// wrong answer.  If when the dynamic_cast is done with this fallback

// algorithm and an inconsistency is still detected, dynamic_cast will call

// abort with an appropriate message.

//

// The current implementation of _LIBCXXABI_FORGIVING_DYNAMIC_CAST requires a

// printf-like function called syslog:

//

//     void syslog(int facility_priority, const char* format, ...);

//

// If you want this functionality but your platform doesn't have syslog,

// just implement it in terms of fprintf(stderr, ...).

//

// _LIBCXXABI_FORGIVING_DYNAMIC_CAST is currently off by default.

// On Windows, typeids are different between DLLs and EXEs, so comparing

// type_info* will work for typeids from the same compiled file but fail

// for typeids from a DLL and an executable. Among other things, exceptions

// are not caught by handlers since can_catch() returns false.

//

// Defining _LIBCXXABI_FORGIVING_DYNAMIC_CAST does not help since can_catch() calls

// is_equal() with use_strcmp=false so the string names are not compared.

// Use std::type_info's default comparison unless we've explicitly asked

// for strcmp.

// Still allow pointer equality to short circut.

// VTable components are 32 bits in the relative vtables ABI.

/// A helper function that gets (dynamic_ptr, dynamic_type, offset_to_derived) from static_ptr.

// The vtable address will point to the first virtual function, which is 8

// bytes after the start of the vtable (4 for the offset from top + 4 for

// the typeinfo component).

// The typeinfo component is now a relative offset to a proxy.

/// A helper function for __dynamic_cast that casts a base sub-object pointer

/// to the object's dynamic type.

///

/// This function returns the casting result directly. No further processing

/// required.

///

/// Specifically, this function can only be called if the following pre-

/// condition holds:

///   * The dynamic type of the object pointed to by `static_ptr` is exactly

///     the same as `dst_type`.

// We're downcasting from src_type to the complete object's dynamic type.

//   This is a really hot path that can be further optimized with the

//   `src2dst_offset` hint.

// In such a case, dynamic_ptr already gives the casting result if the

//   casting ever succeeds. All we have to do now is to check static_ptr

//   points to a public base sub-object of dynamic_ptr.

// The static type is a unique public non-virtual base type of

//   dst_type at offset `src2dst_offset` from the origin of dst.

// Note that there might be other non-public static_type bases. The

//   hint only guarantees that the public base is non-virtual and

//   unique. So we have to check whether static_ptr points to that

//   unique public base sub-object.

// static_type is not a public base of dst_type.

// If src2dst_offset == -3, then:

//   src_type is a multiple public base type but never a virtual

//   base type. We can't conclude that static_ptr points to those

//   public base sub-objects because there might be other non-

//   public static_type bases. The search is inevitable.

// Fallback to the slow path to check that static_type is a public

//   base type of dynamic_type.

// Using giant short cut.  Add that information to info.

// number_of_dst_type

// Do the  search

// The following if should always be false because we should

//   definitely find (static_ptr, static_type), either on a public

//   or private path

// We get here only if there is some kind of visibility problem

//   in client code.

// Redo the search comparing type_info's using strcmp

// _LIBCXXABI_FORGIVING_DYNAMIC_CAST

// Query the search.

/// A helper function for __dynamic_cast that tries to perform a downcast

/// before giving up and falling back to the slow path.

// We can only optimize the case if the static type is a unique public

//   base of dst_type. Give up.

// Pretend there is a dst_type object that leads to static_ptr. Later we

//   will check whether this imagined dst_type object exists. If it exists

//   then it will be the casting result.

// The imagined dst_type object does not exist. Bail-out quickly.

// Try to search a path from dynamic_type to dst_type.

// number_of_dst_type

// We have found at least one path from dynamic_ptr to dst_ptr. The

//   downcast can succeed.

// Not using giant short cut.  Do the search

// Initialize info struct for this search.

// The following if should always be false because we should

//   definitely find (static_ptr, static_type), either on a public

//   or private path

// Redo the search comparing type_info's using strcmp

// _LIBCXXABI_FORGIVING_DYNAMIC_CAST

// Query the search.

// namespace

// __shim_type_info

// __fundamental_type_info

// This miraculously (compiler magic) emits the type_info's for:

//   1. all of the fundamental types

//   2. pointers to all of the fundamental types

//   3. pointers to all of the const fundamental types

// __array_type_info

// __function_type_info

// __enum_type_info

// __class_type_info

// __si_class_type_info

// __vmi_class_type_info

// __pbase_type_info

// __pointer_type_info

// __pointer_to_member_type_info

// can_catch

// A handler is a match for an exception object of type E if

//   1. The handler is of type cv T or cv T& and E and T are the same type

//      (ignoring the top-level cv-qualifiers), or

//   2. the handler is of type cv T or cv T& and T is an unambiguous public

//       base class of E, or

//   3. the handler is of type cv1 T* cv2 and E is a pointer type that can be

//      converted to the type of the handler by either or both of

//      A. a standard pointer conversion (4.10) not involving conversions to

//         pointers to private or protected or ambiguous classes

//      B. a qualification conversion

//   4. the handler is a pointer or pointer to member type and E is

//      std::nullptr_t.

// adjustedPtr:

//

// catch (A& a) : adjustedPtr == &a

// catch (A* a) : adjustedPtr == a

// catch (A** a) : adjustedPtr == a

//

// catch (D2& d2) : adjustedPtr == &d2  (d2 is base class of thrown object)

// catch (D2* d2) : adjustedPtr == d2

// catch (D2*& d2) : adjustedPtr == d2

//

// catch (...) : adjustedPtr == & of the exception

//

// If the thrown type is nullptr_t and the caught type is a pointer to

// member type, adjustedPtr points to a statically-allocated null pointer

// representation of that type.

// Handles bullet 1

// We can get here if someone tries to catch an array by reference.

//   However if someone tries to throw an array, it immediately gets

//   converted to a pointer, which will not convert back to an array

//   at the catch clause.  So this can never catch anything.

// We can get here if someone tries to catch a function by reference.

//   However if someone tries to throw a function, it immediately gets

//   converted to a pointer, which will not convert back to a function

//   at the catch clause.  So this can never catch anything.

// Handles bullet 1

// Handles bullets 1 and 2

// bullet 1

// bullet 2

// When we have an object to inspect - we just pass the pointer to the sub-

// object that matched the static_type we just checked.  If that is different

// from any previously recorded pointer to that object type, then we have

// an ambiguous case.

// When we have no object to inspect, we need to account for virtual bases

// explicitly.

// info->vbase_cookie is a pointer to the name of the innermost virtual base

// type, or nullptr if there is no virtual base on the path so far.

// adjustedPtr points to the subobject we just found.

// If vbase_cookie != any previously recorded (including the case of nullptr

// representing an already-found static sub-object) then we have an ambiguous

// case.  Assuming that the vbase_cookie values agree; if then we have a

// different offset (adjustedPtr) from any previously recorded, this indicates

// an ambiguous case within the virtual base.

// First time we found this base

// stash the virtual base cookie.

// We've been here before.  Update path to "most public"

// We've detected an ambiguous cast from (thrown_class_type, adjustedPtr)

// to a static_type.

/* We have an object to inspect, we can look through its vtables to
       find the layout.  */

/* We have no object; however, for non-virtual bases, (since we do not
       need to inspect any content) we can pretend to have an object based
       at '0'.  */

/* No object to inspect, and the next base is virtual.
       We cannot indirect through the vtable to find the actual object offset.
       So, update vbase_cookie to the new innermost virtual base using the
       pointer to the typeinfo name as a key.  */

// .. and reset the pointer.

// Handles bullet 1 for both pointers and member pointers

// Handles bullets 1, 3 and 4

// NOTE: It might not be safe to adjust the pointer if it is not not a pointer

// type. Only adjust the pointer after we know it is safe to do so.

// bullet 4

// bullet 1

// bullet 3

// Do the dereference adjustment

// bullet 3B and 3C

// bullet 3A

// pointers to functions cannot be converted to void*.

// pointers to member functions are not handled here.

// Handle pointer to pointer

// Handle pointer to pointer to member

// Handle pointer to class type

// In the case of a thrown null pointer, we have no object but we might

// well have computed the offset to where a public sub-object would be.

// However, we do not want to return that offset to the user; we still

// want them to catch a null ptr.

// bullet 3B

// If the pointed to types differ then the catch type must be const

// qualified.

// Handle pointer to pointer

// Handle pointer to pointer to member

// bullet 4

// We assume that the pointer to member representation is the same for

// all pointers to data members and for all pointers to member functions.

// bullet 1

// [except.handle] does not allow the pointer-to-member conversions mentioned

// in [mem.conv] to take place. For this reason we don't check Derived->Base

// for Derived->Base conversions.

// __dynamic_cast

// static_ptr: pointer to an object of type static_type; nonnull, and since the

//   object is polymorphic, *(void**)static_ptr is a virtual table pointer.

//   static_ptr is &v in the expression dynamic_cast<T>(v).

// static_type: static type of the object pointed to by static_ptr.

// dst_type: destination type of the cast (the "T" in "dynamic_cast<T>(v)").

// src2dst_offset: a static hint about the location of the

//                 source subobject with respect to the complete object;

//                 special negative values are:

//                     -1: no hint

//                     -2: static_type is not a public base of dst_type

//                     -3: static_type is a multiple public base type but never a

//                         virtual base type

//                 otherwise, the static_type type is a unique public nonvirtual

//                 base type of dst_type at offset src2dst_offset from the

//                 origin of dst_type.

//

// (dynamic_ptr, dynamic_type) are the run time type of the complete object

// referred to by static_ptr and a pointer to it.  These can be found from

// static_ptr for polymorphic types.

// static_type is guaranteed to be a polymorphic type.

//

// (dynamic_ptr, dynamic_type) is the root of a DAG that grows upward.  Each

// node of the tree represents a base class/object of its parent (or parents) below.

// Each node is uniquely represented by a pointer to the object, and a pointer

// to a type_info - its type.  Different nodes may have the same pointer and

// different nodes may have the same type.  But only one node has a specific

// (pointer-value, type) pair.  In C++ two objects of the same type can not

// share the same address.

//

// There are two flavors of nodes which have the type dst_type:

//    1.  Those that are derived from (below) (static_ptr, static_type).

//    2.  Those that are not derived from (below) (static_ptr, static_type).

//

// Invariants of the DAG:

//

// There is at least one path from the root (dynamic_ptr, dynamic_type) to

// the node (static_ptr, static_type).  This path may or may not be public.

// There may be more than one such path (some public some not).  Such a path may

// or may not go through a node having type dst_type.

//

// No node of type T appears above a node of the same type.  That means that

// there is only one node with dynamic_type.  And if dynamic_type == dst_type,

// then there is only one dst_type in the DAG.

//

// No node of type dst_type appears above a node of type static_type.  Such

// DAG's are possible in C++, but the compiler computes those dynamic_casts at

// compile time, and only calls __dynamic_cast when dst_type lies below

// static_type in the DAG.

//

// dst_type != static_type:  The compiler computes the dynamic_cast in this case too.

// dynamic_type != static_type:  The compiler computes the dynamic_cast in this case too.

//

// Returns:

//

// If there is exactly one dst_type of flavor 1, and

//    If there is a public path from that dst_type to (static_ptr, static_type), or

//    If there are 0 dst_types of flavor 2, and there is a public path from

//        (dynamic_ptr, dynamic_type) to (static_ptr, static_type) and a public

//        path from (dynamic_ptr, dynamic_type) to the one dst_type, then return

//        a pointer to that dst_type.

// Else if there are 0 dst_types of flavor 1 and exactly 1 dst_type of flavor 2, and

//    if there is a public path from (dynamic_ptr, dynamic_type) to

//    (static_ptr, static_type) and a public path from (dynamic_ptr, dynamic_type)

//    to the one dst_type, then return a pointer to that one dst_type.

// Else return nullptr.

//

// If dynamic_type == dst_type, then the above algorithm collapses to the

// following cheaper algorithm:

//

// If there is a public path from (dynamic_ptr, dynamic_type) to

//    (static_ptr, static_type), then return dynamic_ptr.

// Else return nullptr.

// Get (dynamic_ptr, dynamic_type) from static_ptr

// Initialize answer to nullptr.  This will be changed from the search

//    results if a non-null answer is found.  Regardless, this is what will

//    be returned.

// Find out if we can use a giant short cut in the search

// Optimize toward downcasting: let's first try to do a downcast before

//   falling back to the slow path.

// Call this function when you hit a static_type which is a base (above) a dst_type.

// Let caller know you hit a static_type.  But only start recording details if

// this is (static_ptr, static_type) -- the node we are casting from.

// If this is (static_ptr, static_type)

//   Record the path (public or not) from the dst_type to here.  There may be

//   multiple paths from the same dst_type to here, record the "most public" one.

//   Record the dst_ptr as pointing to (static_ptr, static_type).

//   If more than one (dst_ptr, dst_type) points to (static_ptr, static_type),

//   then mark this dyanmic_cast as ambiguous and stop the search.

// Record that we found a static_type

// Record that we found (static_ptr, static_type)

// First time here

// If there is only one dst_type in the entire tree and the path from

//    there to here is public then we are done!

// We've been here before.  Update path to "most public"

// If there is only one dst_type in the entire tree and the path from

//    there to here is public then we are done!

// We've detected an ambiguous cast from (static_ptr, static_type)

//   to a dst_type

// Call this function when you hit a static_type which is not a base (above) a dst_type.

// If this is (static_ptr, static_type)

//   Record the path (public or not) from (dynamic_ptr, dynamic_type) to here.  There may be

//   multiple paths from (dynamic_ptr, dynamic_type) to here, record the "most public" one.

// Record the most public path from (dynamic_ptr, dynamic_type) to

//                                  (static_ptr, static_type)

// Call this function when searching below a dst_type node.  This function searches

// for a path to (static_ptr, static_type) and for paths to one or more dst_type nodes.

// If it finds a static_type node, there is no need to further search base classes

// above.

// If it finds a dst_type node it should search base classes using search_above_dst

// to find out if this dst_type points to (static_ptr, static_type) or not.

// Either way, the dst_type is recorded as one of two "flavors":  one that does

// or does not point to (static_ptr, static_type).

// If this is neither a static_type nor a dst_type node, continue searching

// base classes above.

// All the hoopla surrounding the search code is doing nothing but looking for

// excuses to stop the search prematurely (break out of the for-loop).  That is,

// the algorithm below is simply an optimization of this:

// void

// __vmi_class_type_info::search_below_dst(__dynamic_cast_info* info,

//                                         const void* current_ptr,

//                                         int path_below) const

// {

//     typedef const __base_class_type_info* Iter;

//     if (this == info->static_type)

//         process_static_type_below_dst(info, current_ptr, path_below);

//     else if (this == info->dst_type)

//     {

//         // Record the most public access path that got us here

//         if (info->path_dynamic_ptr_to_dst_ptr != public_path)

//             info->path_dynamic_ptr_to_dst_ptr = path_below;

//         bool does_dst_type_point_to_our_static_type = false;

//         for (Iter p = __base_info, e= __base_info + __base_count; p < e; ++p)

//         {

//             p->search_above_dst(info, current_ptr, current_ptr, public_path);

//             if (info->found_our_static_ptr)

//                 does_dst_type_point_to_our_static_type = true;

//             // break out early here if you can detect it doesn't matter if you do

//         }

//         if (!does_dst_type_point_to_our_static_type)

//         {

//             // We found a dst_type that doesn't point to (static_ptr, static_type)

//             // So record the address of this dst_ptr and increment the

//             // count of the number of such dst_types found in the tree.

//             info->dst_ptr_not_leading_to_static_ptr = current_ptr;

//             info->number_to_dst_ptr += 1;

//         }

//     }

//     else

//     {

//         // This is not a static_type and not a dst_type.

//         for (Iter p = __base_info, e = __base_info + __base_count; p < e; ++p)

//         {

//             p->search_below_dst(info, current_ptr, public_path);

//             // break out early here if you can detect it doesn't matter if you do

//         }

//     }

// }

// We've been here before if we've recorded current_ptr in one of these

//   two places:

// We've seen this node before, and therefore have already searched

// its base classes above.

//  Update path to here that is "most public".

// We have haven't been here before

// Record the access path that got us here

//   If there is more than one dst_type this path doesn't matter.

// Only search above here if dst_type derives from static_type, or

//    if it is unknown if dst_type derives from static_type.

// Set up flags to record results from all base classes

// We've found a dst_type with a potentially public path to here.

// We have to assume the path is public because it may become

//   public later (if we get back to here with a public path).

// We can stop looking above if:

//    1.  We've found a public path to (static_ptr, static_type).

//    2.  We've found an ambiguous cast from (static_ptr, static_type) to a dst_type.

//        This is detected at the (static_ptr, static_type).

//    3.  We can prove that there is no public path to (static_ptr, static_type)

//        above here.

// Zero out found flags

// If we found what we're looking for, stop looking above.

// We found a private path to (static_ptr, static_type)

//   If there is no diamond then there is only one path

//   to (static_ptr, static_type) and we just found it.

// If we found a static_type that isn't the one we're looking

//    for, and if there are no repeated types above here,

//    then stop looking.

// If we found no static_type,s then dst_type doesn't derive

//   from static_type, else it does.  Record this result so that

//   next time we hit a dst_type we will know not to search above

//   it if it doesn't derive from static_type.

// We found a dst_type that doesn't point to (static_ptr, static_type)

// So record the address of this dst_ptr and increment the

// count of the number of such dst_types found in the tree.

// If there exists another dst with a private path to

//    (static_ptr, static_type), then the cast from

//     (dynamic_ptr, dynamic_type) to dst_type is now ambiguous,

//      so stop search.

// This is not a static_type and not a dst_type.

// If there are multiple paths to a base above from here, or if

//    a dst_type pointing to (static_ptr, static_type) has been found,

//    then there is no way to break out of this loop early unless

//    something below detects the search is done.

// There are not multiple paths to any base class from here and a

//   dst_type pointing to (static_ptr, static_type) has not yet been

//   found.

// If we just found a dst_type with a public path to (static_ptr, static_type),

//    then the only reason to continue the search is to make sure

//    no other dst_type points to (static_ptr, static_type).

//    If !diamond, then we don't need to search here.

// There are no repeated types above this node.

// There are no nodes with multiple parents above this node.

// no dst_type has been found to (static_ptr, static_type)

// If we just found a dst_type with a public path to (static_ptr, static_type),

//    then the only reason to continue the search is to make sure

//    no other dst_type points to (static_ptr, static_type).

//    If !diamond, then we don't need to search here.

// if we just found a dst_type with a private path to (static_ptr, static_type),

//    then we're only looking for a public path to (static_ptr, static_type)

//    and to check for other dst_types.

//    If !diamond & !repeat, then there is not a pointer to (static_ptr, static_type)

//    and not a dst_type under here.

// This is the same algorithm as __vmi_class_type_info::search_below_dst but

//   simplified to the case that there is only a single base class.

// We've been here before if we've recorded current_ptr in one of these

//   two places:

// We've seen this node before, and therefore have already searched

// its base classes above.

//  Update path to here that is "most public".

// We have haven't been here before

// Record the access path that got us here

//   If there is more than one dst_type this path doesn't matter.

// Only search above here if dst_type derives from static_type, or

//    if it is unknown if dst_type derives from static_type.

// Set up flags to record results from all base classes

// Zero out found flags

// If we found no static_type,s then dst_type doesn't derive

//   from static_type, else it does.  Record this result so that

//   next time we hit a dst_type we will know not to search above

//   it if it doesn't derive from static_type.

// We found a dst_type that doesn't point to (static_ptr, static_type)

// So record the address of this dst_ptr and increment the

// count of the number of such dst_types found in the tree.

// If there exists another dst with a private path to

//    (static_ptr, static_type), then the cast from

//     (dynamic_ptr, dynamic_type) to dst_type is now ambiguous.

// This is not a static_type and not a dst_type

// This is the same algorithm as __vmi_class_type_info::search_below_dst but

//   simplified to the case that there is no base class.

// We've been here before if we've recorded current_ptr in one of these

//   two places:

// We've seen this node before, and therefore have already searched

// its base classes above.

//  Update path to here that is "most public".

// We have haven't been here before

// Record the access path that got us here

//   If there is more than one dst_type this path doesn't matter.

// We found a dst_type that doesn't point to (static_ptr, static_type)

// So record the address of this dst_ptr and increment the

// count of the number of such dst_types found in the tree.

// If there exists another dst with a private path to

//    (static_ptr, static_type), then the cast from

//     (dynamic_ptr, dynamic_type) to dst_type is now ambiguous.

// We found that dst_type does not derive from static_type

// Call this function when searching above a dst_type node.  This function searches

// for a public path to (static_ptr, static_type).

// This function is guaranteed not to find a node of type dst_type.

// Theoretically this is a very simple function which just stops if it finds a

// static_type node:  All the hoopla surrounding the search code is doing

// nothing but looking for excuses to stop the search prematurely (break out of

// the for-loop).  That is, the algorithm below is simply an optimization of this:

// void

// __vmi_class_type_info::search_above_dst(__dynamic_cast_info* info,

//                                         const void* dst_ptr,

//                                         const void* current_ptr,

//                                         int path_below) const

// {

//     if (this == info->static_type)

//         process_static_type_above_dst(info, dst_ptr, current_ptr, path_below);

//     else

//     {

//         typedef const __base_class_type_info* Iter;

//         // This is not a static_type and not a dst_type

//         for (Iter p = __base_info, e = __base_info + __base_count; p < e; ++p)

//         {

//             p->search_above_dst(info, dst_ptr, current_ptr, public_path);

//             // break out early here if you can detect it doesn't matter if you do

//         }

//     }

// }

// This is not a static_type and not a dst_type

// Save flags so they can be restored when returning to nodes below.

// We've found a dst_type below with a path to here.  If the path

//    to here is not public, there may be another path to here that

//    is public.  So we have to assume that the path to here is public.

//  We can stop looking above if:

//    1.  We've found a public path to (static_ptr, static_type).

//    2.  We've found an ambiguous cast from (static_ptr, static_type) to a dst_type.

//        This is detected at the (static_ptr, static_type).

//    3.  We can prove that there is no public path to (static_ptr, static_type)

//        above here.

// Zero out found flags

// If we found what we're looking for, stop looking above.

// We found a private path to (static_ptr, static_type)

//   If there is no diamond then there is only one path

//   to (static_ptr, static_type) from here and we just found it.

// If we found a static_type that isn't the one we're looking

//    for, and if there are no repeated types above here,

//    then stop looking.

// Zero out found flags

// Restore flags

// This is the same algorithm as __vmi_class_type_info::search_above_dst but

//   simplified to the case that there is only a single base class.

// This is the same algorithm as __vmi_class_type_info::search_above_dst but

//   simplified to the case that there is no base class.

// The search functions for __base_class_type_info are simply convenience

//   functions for adjusting the current_ptr and path_below as the search is

//   passed up to the base class node.

// __cxxabiv1

// XXX EMSCRIPTEN

// These functions are used by the emscripten-style exception handling

// mechanism.

// Note that they need to be included even in the `-noexcept` build of

// libc++abi to support the case where some parts of a project are built

// with exception catching enabled, but at link time exception catching

// is disabled.  In this case dependencies to these functions (and the JS

// functions which call them) will still exist in the final build.

//std::type_info *t1 = static_cast<std::type_info*>(catchType);

//std::type_info *t2 = static_cast<std::type_info*>(excpType);

//printf("can %s catch %s (%p)?\n", t1->name(), t2->name(), thrown);

// apply changes only if we are catching

// Get pointer which is expected to be received by catch clause in C++ code.

// It may be adjusted when the pointer is casted to some of the exception

// object base classes (e.g. when virtual inheritance is used). When a pointer

// is thrown this method should return the thrown pointer itself.

// Work around a fastcomp bug, this code is still included for some reason in

// a build without exceptions support.

// __cxxabiv1

// __wasm__ && !__WASM_EXCEPTIONS__


=== system/lib/libcxxabi/src/private_typeinfo.h ===
SHA256: 308dd443446dfa0e6972e897f575c4e379f50bbf3aee3f5126f955f44768c803
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// const data supplied to the search:

// Data that represents the answer:

// pointer to a dst_type which has (static_ptr, static_type) above it

// pointer to a dst_type which does not have (static_ptr, static_type) above it

// The following three paths are either unknown, public_path or not_public_path.

// access of path from dst_ptr_leading_to_static_ptr to (static_ptr, static_type)

// access of path from (dynamic_ptr, dynamic_type) to (static_ptr, static_type)

//    when there is no dst_type along the path

// access of path from (dynamic_ptr, dynamic_type) to dst_type

//    (not used if there is a (static_ptr, static_type) above a dst_type).

// Number of dst_types below (static_ptr, static_type)

// Number of dst_types not below (static_ptr, static_type)

// Data that helps stop the search before the entire tree is searched:

// is_dst_type_derived_from_static_type is either unknown, yes or no.

// Number of dst_type in tree.  If 0, then that means unknown.

// communicates to a dst_type node that (static_ptr, static_type) was found

//    above it.

// communicates to a dst_type node that a static_type was found

//    above it, but it wasn't (static_ptr, static_type)

// Set whenever a search can be stopped

// Data that modifies the search mechanism.

// There is no object (seen when we throw a null pointer to object).

// Virtual base

// Has no base class

// Has one non-virtual public base class at offset zero

// base is public

// Has one or more base classes

// has two or more distinct base class

//    objects of the same type

// has base class object with two or

//    more derived objects

// This implements the following proposal from cxx-abi-dev (not yet part of

// the ABI document):

//

//   http://sourcerytools.com/pipermail/cxx-abi-dev/2016-October/002986.html

//

// This is necessary for support of http://wg21.link/p0012, which permits

// throwing noexcept function and member function pointers and catching

// them as non-noexcept pointers.

// Flags that cannot be removed by a standard conversion.

// Flags that cannot be added by a standard conversion.

// __cxxabiv1

// __PRIVATE_TYPEINFO_H_


=== system/lib/libcxxabi/src/stdlib_exception.cpp ===
SHA256: d609597f8f536fec59f7afa2dbd352c69a9b50ce8aaf85082fd1fbad08c79a25
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// exception

// bad_exception

//  bad_alloc

// bad_array_new_length

// std


=== system/lib/libcxxabi/src/stdlib_new_delete.cpp ===
SHA256: 86ad03b757c0ef27cd120fdf0ac005fd50644b3d8d64c63abbf5dc1b7b74cd76
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// from libc++

// Perform a few sanity checks on libc++ and libc++abi macros to ensure that

// the code below can be an exact copy of the code in libcxx/src/new.cpp.

// ------------------ BEGIN COPY ------------------

// Implement all new and delete operators as weak definitions

// in this shared library, so that they can be overridden by programs

// that define non-weak copies of the functions.

// If malloc fails and there is a new_handler,

// call it to try free up memory.

// Try allocating memory. If allocation fails and there is a new_handler,

// call it to try free up memory, and try again until it succeeds, or until

// the new_handler decides to terminate.

// _LIBCPP_HAS_LIBRARY_ALIGNED_ALLOCATION

// ------------------ END COPY ------------------


=== system/lib/libcxxabi/src/stdlib_stdexcept.cpp ===
SHA256: 8539fc8929cd9a166a74fe04ef81472e7a6d507f4422f991963867fbda1f256a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// from libc++

// purposefully not using versioning namespace

// std


=== system/lib/libcxxabi/src/stdlib_typeinfo.cpp ===
SHA256: 5d0b584b9341eb49ea5e640a475dc690d44b0770712222e2667185b1e814367f
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// type_info

// bad_cast

// bad_typeid

// std


=== system/lib/libcxxabi/src/vendor/apple/shims.cpp ===
SHA256: 649380b6b4976b75fc0cd52d08de491536502135c3a6595f1c98a216fc534ed7
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

// These shims implement symbols that are present in the system libc++ on Apple platforms

// but are not implemented in upstream libc++. This allows testing libc++ under a system

// library configuration, which requires the just-built libc++ to be ABI compatible with

// the system library it is replacing.

//

// purposefully not versioned, like align_val_t


=== system/lib/libunwind/include/__libunwind_config.h ===
SHA256: 5e963e752482bf8cefcabbb6b4f3f09ae3bff247f59b7a2f1d8fcabbe539c18b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

// Values here change when : Registers.hpp - hexagon_thread_state_t change

// Unused

// !_LIBUNWIND_IS_NATIVE_ONLY

// _LIBUNWIND_IS_NATIVE_ONLY

// ____LIBUNWIND_CONFIG_H__


=== system/lib/libunwind/include/libunwind.h ===
SHA256: 9f9a52c31dbb093e09ccef880652fdced398070b6062515a2fa118361cf8afb7
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

// Compatible with libunwind API documented at:

//   http://www.nongnu.org/libunwind/man/libunwind(3).html

//

//===----------------------------------------------------------------------===//

/* error codes */

/* no error */

/* unspecified (general) error */

/* out of memory */

/* bad register number */

/* attempt to write read-only register */

/* stop unwinding */

/* invalid IP */

/* bad frame */

/* unsupported operation or bad value */

/* unwind info has unsupported version */

/* no unwind info found */

/* cross unwind with return address signing */

/* start address of function */

/* address after end of function */

/* address of language specific data area, */

/*  or zero if not used */

/* personality routine, or zero if not used */

/* not used */

/* not used */

/* compact unwind encoding, or zero if none */

/* size of DWARF unwind info, or zero if none */

/* address of DWARF unwind info, or zero */

/* mach_header of mach-o image containing func */

/* Save VFP registers in FSTMX format (instead of FSTMD). */

//extern int       unw_get_save_loc(unw_cursor_t*, int, unw_save_loc_t*);

// architecture independent register numbers

// instruction pointer

// stack pointer

// 32-bit x86 registers

// 64-bit x86_64 registers

// 32-bit ppc register numbers

// 64-bit ppc register numbers

// 64: reserved

// 67: reserved

// 109, 111-113: OpenPOWER ELF V2 ABI: reserved

// Borrowing VRSAVE number from PPC32.

// 64-bit ARM64 registers

// reserved block

// FP/vector registers

// Compatibility aliases

// 32-bit ARM registers. Numbers match DWARF for ARM spec #3.1 Table 1.

// Naming scheme uses recommendations given in Note 4 for VFP-v2 and VFP-v3.

// In this scheme, even though the 64-bit floating point registers D0-D31

// overlap physically with the 32-bit floating pointer registers S0-S31,

// they are given a non-overlapping range of register numbers.

//

// Commented out ranges are not preserved during unwinding.

// Logical alias for UNW_REG_SP

// Logical alias for UNW_REG_IP

// 16-63 -- OBSOLETE. Used in VFP1 to represent both S0-S31 and D0-D31.

//  96-103 -- OBSOLETE. F0-F7. Used by the FPA system. Superseded by VFP.

// 104-111 -- wCGR0-wCGR7, ACC0-ACC7 (Intel wireless MMX)

// 128-133 -- SPSR, SPSR_{FIQ|IRQ|ABT|UND|SVC}

// 134-142 -- Reserved

// 144-150 -- R8_USR-R14_USR

// 151-157 -- R8_FIQ-R14_FIQ

// 158-159 -- R13_IRQ-R14_IRQ

// 160-161 -- R13_ABT-R14_ABT

// 162-163 -- R13_UND-R14_UND

// 164-165 -- R13_SVC-R14_SVC

// 166-191 -- Reserved

// 196-199 -- wC4-wC7 (Intel wireless MMX control)

// 200-255 -- Reserved

// 288-319 -- Reserved for VFP/Neon

// 320-8191 -- Reserved

// 8192-16383 -- Unspecified vendor co-processor register.

// OpenRISC1000 register numbers

// MIPS registers

// HI,LO have been dropped since r6, we keep them here.

// So, when we add DSP/MSA etc, we can use the same register indexes

// for r6 and pre-r6.

// SPARC registers

// Hexagon register numbers

// RISC-V registers. These match the DWARF register numbers defined by section

// 4 of the RISC-V ELF psABI specification, which can be found at:

//

// https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md

// 65-95 -- Reserved for future standard extensions

// 96-127 -- v0-v31 (Vector registers)

// 128-3071 -- Reserved for future standard extensions

// 3072-4095 -- Reserved for custom extensions

// 4096-8191 -- CSRs

//

// VLENB CSR number: 0xC22 -- defined by section 3 of v-spec:

// https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc#3-vector-extension-programmers-model

// VLENB DWARF number: 0x1000 + 0xC22

// VE register numbers

// = 143

// Following registers don't have DWARF register numbers.

// s390x register numbers

// 32-47 Control Registers

// 48-63 Access Registers

// 66-67 Reserved

// 68-83 Vector Registers %v16-%v31

// LoongArch registers.


=== system/lib/libunwind/include/mach-o/compact_unwind_encoding.h ===
SHA256: 06f58e9d0058583b6da91ca2328fa663f80d089496a4979754ee7608fe9bd877
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

// Darwin's alternative to DWARF based unwind encodings.

//

//===----------------------------------------------------------------------===//

//

// Compilers can emit standard DWARF FDEs in the __TEXT,__eh_frame section

// of object files. Or compilers can emit compact unwind information in

// the __LD,__compact_unwind section.

//

// When the linker creates a final linked image, it will create a

// __TEXT,__unwind_info section.  This section is a small and fast way for the

// runtime to access unwind info for any given function.  If the compiler

// emitted compact unwind info for the function, that compact unwind info will

// be encoded in the __TEXT,__unwind_info section. If the compiler emitted

// DWARF unwind info, the __TEXT,__unwind_info section will contain the offset

// of the FDE in the __TEXT,__eh_frame section in the final linked image.

//

// Note: Previously, the linker would transform some DWARF unwind infos into

//       compact unwind info.  But that is fragile and no longer done.

//

// The compact unwind encoding is a 32-bit value which encoded in an

// architecture specific way, which registers to restore from where, and how

// to unwind out of the function.

//

// architecture independent bits

//

// x86

//

// 1-bit: start

// 1-bit: has lsda

// 2-bit: personality index

//

// 4-bits: 0=old, 1=ebp based, 2=stack-imm, 3=stack-ind, 4=DWARF

//  ebp based:

//        15-bits (5*3-bits per reg) register permutation

//        8-bits for stack offset

//  frameless:

//        8-bits stack size

//        3-bits stack adjust

//        3-bits register count

//        10-bits register permutation

//

//

// For x86 there are four modes for the compact unwind encoding:

// UNWIND_X86_MODE_EBP_FRAME:

//    EBP based frame where EBP is push on stack immediately after return address,

//    then ESP is moved to EBP. Thus, to unwind ESP is restored with the current

//    EPB value, then EBP is restored by popping off the stack, and the return

//    is done by popping the stack once more into the pc.

//    All non-volatile registers that need to be restored must have been saved

//    in a small range in the stack that starts EBP-4 to EBP-1020.  The offset/4

//    is encoded in the UNWIND_X86_EBP_FRAME_OFFSET bits.  The registers saved

//    are encoded in the UNWIND_X86_EBP_FRAME_REGISTERS bits as five 3-bit entries.

//    Each entry contains which register to restore.

// UNWIND_X86_MODE_STACK_IMMD:

//    A "frameless" (EBP not used as frame pointer) function with a small

//    constant stack size.  To return, a constant (encoded in the compact

//    unwind encoding) is added to the ESP. Then the return is done by

//    popping the stack into the pc.

//    All non-volatile registers that need to be restored must have been saved

//    on the stack immediately after the return address.  The stack_size/4 is

//    encoded in the UNWIND_X86_FRAMELESS_STACK_SIZE (max stack size is 1024).

//    The number of registers saved is encoded in UNWIND_X86_FRAMELESS_STACK_REG_COUNT.

//    UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION contains which registers were

//    saved and their order.

// UNWIND_X86_MODE_STACK_IND:

//    A "frameless" (EBP not used as frame pointer) function large constant

//    stack size.  This case is like the previous, except the stack size is too

//    large to encode in the compact unwind encoding.  Instead it requires that

//    the function contains "subl $nnnnnnnn,ESP" in its prolog.  The compact

//    encoding contains the offset to the nnnnnnnn value in the function in

//    UNWIND_X86_FRAMELESS_STACK_SIZE.

// UNWIND_X86_MODE_DWARF:

//    No compact unwind encoding is available.  Instead the low 24-bits of the

//    compact encoding is the offset of the DWARF FDE in the __eh_frame section.

//    This mode is never used in object files.  It is only generated by the

//    linker in final linked images which have only DWARF unwind info for a

//    function.

//

// The permutation encoding is a Lehmer code sequence encoded into a

// single variable-base number so we can encode the ordering of up to

// six registers in a 10-bit space.

//

// The following is the algorithm used to create the permutation encoding used

// with frameless stacks.  It is passed the number of registers to be saved and

// an array of the register numbers saved.

//

//uint32_t permute_encode(uint32_t registerCount, const uint32_t registers[6])

//{

//    uint32_t renumregs[6];

//    for (int i=6-registerCount; i < 6; ++i) {

//        int countless = 0;

//        for (int j=6-registerCount; j < i; ++j) {

//            if ( registers[j] < registers[i] )

//                ++countless;

//        }

//        renumregs[i] = registers[i] - countless -1;

//    }

//    uint32_t permutationEncoding = 0;

//    switch ( registerCount ) {

//        case 6:

//            permutationEncoding |= (120*renumregs[0] + 24*renumregs[1]

//                                    + 6*renumregs[2] + 2*renumregs[3]

//                                      + renumregs[4]);

//            break;

//        case 5:

//            permutationEncoding |= (120*renumregs[1] + 24*renumregs[2]

//                                    + 6*renumregs[3] + 2*renumregs[4]

//                                      + renumregs[5]);

//            break;

//        case 4:

//            permutationEncoding |= (60*renumregs[2] + 12*renumregs[3]

//                                   + 3*renumregs[4] + renumregs[5]);

//            break;

//        case 3:

//            permutationEncoding |= (20*renumregs[3] + 4*renumregs[4]

//                                     + renumregs[5]);

//            break;

//        case 2:

//            permutationEncoding |= (5*renumregs[4] + renumregs[5]);

//            break;

//        case 1:

//            permutationEncoding |= (renumregs[5]);

//            break;

//    }

//    return permutationEncoding;

//}

//

//

// x86_64

//

// 1-bit: start

// 1-bit: has lsda

// 2-bit: personality index

//

// 4-bits: 0=old, 1=rbp based, 2=stack-imm, 3=stack-ind, 4=DWARF

//  rbp based:

//        15-bits (5*3-bits per reg) register permutation

//        8-bits for stack offset

//  frameless:

//        8-bits stack size

//        3-bits stack adjust

//        3-bits register count

//        10-bits register permutation

//

//

// For x86_64 there are four modes for the compact unwind encoding:

// UNWIND_X86_64_MODE_RBP_FRAME:

//    RBP based frame where RBP is push on stack immediately after return address,

//    then RSP is moved to RBP. Thus, to unwind RSP is restored with the current

//    EPB value, then RBP is restored by popping off the stack, and the return

//    is done by popping the stack once more into the pc.

//    All non-volatile registers that need to be restored must have been saved

//    in a small range in the stack that starts RBP-8 to RBP-2040.  The offset/8

//    is encoded in the UNWIND_X86_64_RBP_FRAME_OFFSET bits.  The registers saved

//    are encoded in the UNWIND_X86_64_RBP_FRAME_REGISTERS bits as five 3-bit entries.

//    Each entry contains which register to restore.

// UNWIND_X86_64_MODE_STACK_IMMD:

//    A "frameless" (RBP not used as frame pointer) function with a small

//    constant stack size.  To return, a constant (encoded in the compact

//    unwind encoding) is added to the RSP. Then the return is done by

//    popping the stack into the pc.

//    All non-volatile registers that need to be restored must have been saved

//    on the stack immediately after the return address.  The stack_size/8 is

//    encoded in the UNWIND_X86_64_FRAMELESS_STACK_SIZE (max stack size is 2048).

//    The number of registers saved is encoded in UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT.

//    UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION contains which registers were

//    saved and their order.

// UNWIND_X86_64_MODE_STACK_IND:

//    A "frameless" (RBP not used as frame pointer) function large constant

//    stack size.  This case is like the previous, except the stack size is too

//    large to encode in the compact unwind encoding.  Instead it requires that

//    the function contains "subq $nnnnnnnn,RSP" in its prolog.  The compact

//    encoding contains the offset to the nnnnnnnn value in the function in

//    UNWIND_X86_64_FRAMELESS_STACK_SIZE.

// UNWIND_X86_64_MODE_DWARF:

//    No compact unwind encoding is available.  Instead the low 24-bits of the

//    compact encoding is the offset of the DWARF FDE in the __eh_frame section.

//    This mode is never used in object files.  It is only generated by the

//    linker in final linked images which have only DWARF unwind info for a

//    function.

//

// ARM64

//

// 1-bit: start

// 1-bit: has lsda

// 2-bit: personality index

//

// 4-bits: 4=frame-based, 3=DWARF, 2=frameless

//  frameless:

//        12-bits of stack size

//  frame-based:

//        4-bits D reg pairs saved

//        5-bits X reg pairs saved

//  DWARF:

//        24-bits offset of DWARF FDE in __eh_frame section

//

// For arm64 there are three modes for the compact unwind encoding:

// UNWIND_ARM64_MODE_FRAME:

//    This is a standard arm64 prolog where FP/LR are immediately pushed on the

//    stack, then SP is copied to FP. If there are any non-volatile registers

//    saved, then are copied into the stack frame in pairs in a contiguous

//    range right below the saved FP/LR pair.  Any subset of the five X pairs

//    and four D pairs can be saved, but the memory layout must be in register

//    number order.

// UNWIND_ARM64_MODE_FRAMELESS:

//    A "frameless" leaf function, where FP/LR are not saved. The return address

//    remains in LR throughout the function. If any non-volatile registers

//    are saved, they must be pushed onto the stack before any stack space is

//    allocated for local variables.  The stack sized (including any saved

//    non-volatile registers) divided by 16 is encoded in the bits

//    UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK.

// UNWIND_ARM64_MODE_DWARF:

//    No compact unwind encoding is available.  Instead the low 24-bits of the

//    compact encoding is the offset of the DWARF FDE in the __eh_frame section.

//    This mode is never used in object files.  It is only generated by the

//    linker in final linked images which have only DWARF unwind info for a

//    function.

//

////////////////////////////////////////////////////////////////////////////////

//

//  Relocatable Object Files: __LD,__compact_unwind

//

////////////////////////////////////////////////////////////////////////////////

//

// A compiler can generated compact unwind information for a function by adding

// a "row" to the __LD,__compact_unwind section.  This section has the

// S_ATTR_DEBUG bit set, so the section will be ignored by older linkers.

// It is removed by the new linker, so never ends up in final executables.

// This section is a table, initially with one row per function (that needs

// unwind info).  The table columns and some conceptual entries are:

//

//     range-start               pointer to start of function/range

//     range-length

//     compact-unwind-encoding   32-bit encoding

//     personality-function      or zero if no personality function

//     lsda                      or zero if no LSDA data

//

// The length and encoding fields are 32-bits.  The other are all pointer sized.

//

// In x86_64 assembly, these entry would look like:

//

//     .section __LD,__compact_unwind,regular,debug

//

//     #compact unwind for _foo

//     .quad    _foo

//     .set     L1,LfooEnd-_foo

//     .long    L1

//     .long    0x01010001

//     .quad    0

//     .quad    0

//

//     #compact unwind for _bar

//     .quad    _bar

//     .set     L2,LbarEnd-_bar

//     .long    L2

//     .long    0x01020011

//     .quad    __gxx_personality

//     .quad    except_tab1

//

//

// Notes: There is no need for any labels in the __compact_unwind section.

//        The use of the .set directive is to force the evaluation of the

//        range-length at assembly time, instead of generating relocations.

//

// To support future compiler optimizations where which non-volatile registers

// are saved changes within a function (e.g. delay saving non-volatiles until

// necessary), there can by multiple lines in the __compact_unwind table for one

// function, each with a different (non-overlapping) range and each with

// different compact unwind encodings that correspond to the non-volatiles

// saved at that range of the function.

//

// If a particular function is so wacky that there is no compact unwind way

// to encode it, then the compiler can emit traditional DWARF unwind info.

// The runtime will use which ever is available.

//

// Runtime support for compact unwind encodings are only available on 10.6

// and later.  So, the compiler should not generate it when targeting pre-10.6.

////////////////////////////////////////////////////////////////////////////////

//

//  Final Linked Images: __TEXT,__unwind_info

//

////////////////////////////////////////////////////////////////////////////////

//

// The __TEXT,__unwind_info section is laid out for an efficient two level lookup.

// The header of the section contains a coarse index that maps function address

// to the page (4096 byte block) containing the unwind info for that function.

//

// UNWIND_SECTION_VERSION

// compact_unwind_encoding_t[]

// uint32_t personalities[]

// unwind_info_section_header_index_entry[]

// unwind_info_section_header_lsda_index_entry[]

// section offset to start of regular or compress page

// section offset to start of lsda_index array for this range

//

// There are two kinds of second level index pages: regular and compressed.

// A compressed page can hold up to 1021 entries, but it cannot be used

// if too many different encoding types are used.  The regular page holds

// 511 entries.

//

// UNWIND_SECOND_LEVEL_REGULAR

// entry array

// UNWIND_SECOND_LEVEL_COMPRESSED

// 32-bit entry array

// encodings array


=== system/lib/libunwind/include/unwind.h ===
SHA256: e4a58637fc8ca1d29cd600c3c4416aafed50085edf276fa076214c8d81c263f0
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

// C++ ABI Level 1 ABI documented at:

//   https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html

//

//===----------------------------------------------------------------------===//

// gcc extension to C++ ABI

// opaque

//

// The following are semi-supported extensions to the C++ ABI

//

//

//  called by __cxa_rethrow().

//

// _Unwind_Backtrace() is a gcc extension that walks the stack and calls the

// _Unwind_Trace_Fn once per frame until it reaches the bottom of the stack

// or the _Unwind_Trace_Fn function returns something other than _URC_NO_REASON.

// _Unwind_GetCFA is a gcc extension that can be called from within a

// personality handler to get the CFA (stack pointer before call) of

// current frame.

// _Unwind_GetIPInfo is a gcc extension that can be called from within a

// personality handler.  Similar to _Unwind_GetIP() but also returns in

// *ipBefore a non-zero value if the instruction pointer is at or before the

// instruction causing the unwind. Normally, in a function call, the IP returned

// is the return address which is after the call instruction and may be past the

// end of the function containing the call instruction.

// __register_frame() is used with dynamically generated code to register the

// FDE for a generated (JIT) code.  The FDE must use pc-rel addressing to point

// to its function and optional LSDA.

// __register_frame() has existed in all versions of Mac OS X, but in 10.4 and

// 10.5 it was buggy and did not actually register the FDE with the unwinder.

// In 10.6 and later it does register properly.

// _Unwind_Find_FDE() will locate the FDE if the pc is in some function that has

// an associated FDE. Note, Mac OS X 10.6 and later, introduces "compact unwind

// info" which the runtime uses in preference to DWARF unwind info.  This

// function will only work if the target function has an FDE but no compact

// unwind info.

// This function attempts to find the start (address of first instruction) of

// a function given an address inside the function.  It only works if the

// function has an FDE (DWARF unwind info).

// This function is unimplemented on Mac OS X 10.6 and later.  Instead, use

// _Unwind_Find_FDE() and look at the dwarf_eh_bases.func result.

// Mac OS X does not support text-rel and data-rel addressing so these functions

// are unimplemented.

// Mac OS X 10.4 and 10.5 had implementations of these functions in

// libgcc_s.dylib, but they never worked.

/// These functions are no longer available on Mac OS X.

// This is the common wrapper for GCC-style personality functions with SEH.

// __UNWIND_H__


=== system/lib/libunwind/include/unwind_arm_ehabi.h ===
SHA256: 80edc55ea33440f46e676e4ac805ecdc64a7222f2c9107f8ff6b1097eb8a51df
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

// C++ ABI Level 1 ABI documented at:

//   https://github.com/ARM-software/abi-aa/blob/main/ehabi32/ehabi32.rst

//

//===----------------------------------------------------------------------===//

/* Undocumented flag for force unwinding. */

/* Alias */

/* Unwinder cache, private fields for the unwinder's use */

/* init reserved1 to 0, then don't touch */

/* Propagation barrier cache (valid after phase 1): */

/* Cleanup cache (preserved over cleanup): */

/* Pr cache (for pr's benefit): */

/* function start address */

/* pointer to EHT entry header word */

/* Enforce the 8-byte alignment */

//

// The following are the base functions documented by the C++ ABI

//

/* integer register */

/* vfp */

/* Intel WMMX data register */

/* Intel WMMX control register */

/* Special purpose pseudo register */

// These are de facto helper functions for ARM, which delegate the function

// calls to _Unwind_VRS_Get/Set().  These are not a part of ARM EHABI

// specification, thus these function MUST be inlined.  Please don't replace

// these with the "extern" function declaration; otherwise, the program

// including this <unwind.h> header won't be ABI compatible and will result in

// link error when we are linking the program with libgcc.

// remove the thumb-bit before returning

// __ARM_EHABI_UNWIND_H__


=== system/lib/libunwind/include/unwind_itanium.h ===
SHA256: c8cc61d806e13a2e75e93f1c15afd432f93a99283d27d15f5a28a3ebee989cba
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

// C++ ABI Level 1 ABI documented at:

//   https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html

//

//===----------------------------------------------------------------------===//

// opaque

// forward declaration

// non-zero means forced unwind

// holds sp that phase1 found for phase2 to use

// The implementation of _Unwind_Exception uses an attribute mode on the

// above fields which has the side effect of causing this whole struct to

// round up to 32 bytes in size (48 with SEH). To be more explicit, we add

// pad fields added for binary compatibility.

// The Itanium ABI requires that _Unwind_Exception objects are "double-word

// aligned".  GCC has interpreted this to mean "use the maximum useful

// alignment for the target"; so do we.

//

// The following are the base functions documented by the C++ ABI

//

// __ITANIUM_UNWIND_H__


=== system/lib/libunwind/src/AddressSpace.hpp ===
SHA256: c12382512621f8c749d4ecfa05964c59905a340ba1ea75adecf944d69b383def
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

// Abstracts accessing local vs remote address spaces.

//

//===----------------------------------------------------------------------===//

// In 10.7.0 or later, libSystem.dylib implements this function.

// When statically linked on bare-metal, the symbols for the EH table are looked

// up without going through the dynamic loader.

// The following linker script may be used to produce the necessary sections and symbols.

// Unless the --eh-frame-hdr linker option is provided, the section is not generated

// and does not take space in the output file.

//

//   .eh_frame :

//   {

//       __eh_frame_start = .;

//       KEEP(*(.eh_frame))

//       __eh_frame_end = .;

//   }

//

//   .eh_frame_hdr :

//   {

//       KEEP(*(.eh_frame_hdr))

//   }

//

//   __eh_frame_hdr_start = SIZEOF(.eh_frame_hdr) > 0 ? ADDR(.eh_frame_hdr) : 0;

//   __eh_frame_hdr_end = SIZEOF(.eh_frame_hdr) > 0 ? . : 0;

// When statically linked on bare-metal, the symbols for the EH table are looked

// up without going through the dynamic loader.

/// Used by findUnwindSections() to return info about needed sections.

// No dso_base for SEH.

/// LocalAddressSpace is used as a template parameter to UnwindCursor when

/// unwinding a thread in the same process.  The wrappers compile away,

/// making local unwinds fast.

/// Read a ULEB128 into a 64-bit word.

/// Read a SLEB128 into a 64-bit word.

// sign extend negative numbers

// first get value

// Sign extend from signed 16-bit value.

// Sign extend from signed 32-bit value.

// then add relative offset

// do nothing

// DW_EH_PE_datarel is only valid in a few places, so the parameter has a

// default value of 0, and we abort in the event that someone calls this

// function with a datarelBase of 0 and DW_EH_PE_datarel encoding.

// The ElfW() macro for pointer-size independent ELF header traversal is not

// provided by <link.h> on some systems (e.g., FreeBSD). On these systems the

// data structures are just called Elf_XXX. Define ElfW() locally.

// Typically there is one cache per process, but when libunwind is built as a

// hermetic static library, then each shared object may have its own cache.

// .eh_frame_hdr records the start of .eh_frame, but not its size.

// Rely on a zero terminator to find the end of the section.

// Avoid warning about unused variable.

// Most shared objects seen in this callback function likely don't contain the

// target address, so optimize for that. Scan for a matching PT_LOAD segment

// first and bail when it isn't found.

// PT_GNU_EH_FRAME and PT_ARM_EXIDX are usually near the end. Iterate

// backward.

// defined(_LIBUNWIND_USE_DL_ITERATE_PHDR)

// Bare metal is statically linked, so no need to ask the dynamic loader

// Bare metal is statically linked, so no need to ask the dynamic loader

// Don't even bother, since Windows has functions that do all this stuff

// for us.

// The traceback table is used for unwinding.

// Use DLFO_STRUCT_HAS_EH_DBASE to determine the existence of

// `_dl_find_object`. Use _LIBUNWIND_SUPPORT_DWARF_INDEX, because libunwind

// support for _dl_find_object on other unwind formats is not implemented,

// yet.

// We expect `_dl_find_object` to return PT_GNU_EH_FRAME.

// We look-up `dl_find_object` dynamically at runtime to ensure backwards

// compatibility with earlier version of glibc not yet providing it. On older

// systems, we gracefully fallback to `dl_iterate_phdr`. Cache the pointer

// so we only look it up once. Do manual lock to avoid _cxa_guard_acquire.

// Try to find the unwind info using `dl_find_object`

// Found an entry for `targetAddr`, but there is no unwind info.

// Record the start of PT_GNU_EH_FRAME.

// `_dl_find_object` does not give us the size of PT_GNU_EH_FRAME.

// Setting length to `SIZE_MAX` effectively disables all range checks.

// Record the start of the FDE and use SIZE_MAX to indicate that we do

// not know the end address.

// TO DO: if OS has way to dynamically register FDEs, check that.

// namespace libunwind

// __ADDRESSSPACE_HPP__


=== system/lib/libunwind/src/CompactUnwinder.hpp ===
SHA256: 438d320fb6503e1c82160d96fe8c774e03d51a755226deb28a1b7d248bd4ef9a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//  Does runtime stack unwinding using compact unwind encodings.

//

//===----------------------------------------------------------------------===//

/// CompactUnwinder_x86 uses a compact unwind info to virtually "step" (aka

/// unwind) by modifying a Registers_x86 register set

// no register saved in this slot

// stack size is encoded in subl $xxx,%esp instruction

// decompress permutation

// re-number registers back to standard numbers

// ebp points to old ebp

// old esp is ebp less saved ebp and return address

// pop return address into eip

// return address is on stack after last saved register

// old esp is before return address

// _LIBUNWIND_TARGET_I386

/// CompactUnwinder_x86_64 uses a compact unwind info to virtually "step" (aka

/// unwind) by modifying a Registers_x86_64 register set

// no register saved in this slot

// stack size is encoded in subl $xxx,%esp instruction

// decompress permutation

// re-number registers back to standard numbers

// ebp points to old ebp

// old esp is ebp less saved ebp and return address

// pop return address into eip

// return address is on stack after last saved register

// old esp is before return address

// _LIBUNWIND_TARGET_X86_64

/// CompactUnwinder_arm64 uses a compact unwind info to virtually "step" (aka

/// unwind) by modifying a Registers_arm64 register set

// subtract stack size off of sp

// set pc to be value in lr

// fp points to old fp

// old sp is fp less saved fp and lr

// pop return address into pc

// _LIBUNWIND_TARGET_AARCH64

// namespace libunwind

// __COMPACT_UNWINDER_HPP__


=== system/lib/libunwind/src/DwarfInstructions.hpp ===
SHA256: 39766cd4ef99fe26de1b0f044199d447b952743e669096b5b66ac619d8a3cb31
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//  Processor specific interpretation of DWARF unwind info.

//

//===----------------------------------------------------------------------===//

/// DwarfInstructions maps abstract DWARF unwind instructions to a particular

/// architecture

// sparc64 specific

// FIX ME

// FIX ME

// FIX ME

// Only bit[0] is meaningful.

// Only bit[1] is meaningful.

// get pointer to cfa (architecture specific)

// __unw_step_stage2 is not used for cross unwinding, so we use

// __aarch64__ rather than LIBUNWIND_TARGET_AARCH64 to make sure we are

// building for AArch64 natively.

// AArch64 doesn't require the value of SP to be 16-byte aligned at

// all times, only at memory accesses and public interfaces [1]. Thus,

// a signal could arrive at a point where SP is not aligned properly.

// In that case, the kernel fixes up [2] the signal frame, but we

// still have a misaligned SP in the previous frame. If that signal

// handler caused stack unwinding, we would have an unaligned SP.

// We do not need to fix up the CFA, as that is the SP at a "public

// interface".

// [1]:

// https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#622the-stack

// [2]:

// https://github.com/torvalds/linux/blob/1930a6e739c4b4a654a69164dbe39e554d228915/arch/arm64/kernel/signal.c#L718

// CFA is the bottom of the current stack frame.

// restore registers that DWARF says were saved

// Typically, the CFA is the stack pointer at the call site in

// the previous frame. However, there are scenarios in which this is not

// true. For example, if we switched to a new stack. In that case, the

// value of the previous SP might be indicated by a CFI directive.

//

// We set the SP here to the CFA, allowing for it to be overridden

// by a CFI directive later on.

// Leaf function keeps the return address in register and there is no

// explicit instructions how to restore it.

// If the target is aarch64 then the return address may have been signed

// using the v8.3 pointer authentication extensions. The original

// return address needs to be authenticated before the return address is

// restored. autia1716 is used instead of autia as autia1716 assembles

// to a NOP on pre-v8.3a architectures.

// We use the hint versions of the authentication instructions below to

// ensure they're assembled by the compiler even for targets with no

// FEAT_PAuth/FEAT_PAuth_LR support.

// pacm

// autib1716

// pacm

// autia1716

// autib1716

// autia1716

// Skip call site instruction and delay slot

// Skip unimp instruction if function returns a struct

// Skip call site instruction and delay slot.

// ld r2,40(r1)

// ld r2,24(r1)

// If the instruction at return address is a TOC (r2) restore,

// then r2 was saved and needs to be restored.

// ELFv2 ABI specifies that the TOC Pointer must be saved at SP + 24,

// while in ELFv1 ABI it is saved at SP + 40.

// Return address is address after call site instruction, so setting IP to

// that does simulates a return.

// Simulate the step by replacing the register set with the new ones.

// temp, until len read

// push immediate address sized value

// pop stack, dereference, push result

// push immediate 1 byte value

// push immediate 1 byte signed value

// push immediate 2 byte value

// push immediate 2 byte signed value

// push immediate 4 byte value

// push immediate 4 byte signed value

// push immediate 8 byte value

// push immediate 8 byte signed value

// push immediate ULEB128 value

// push immediate SLEB128 value

// push top of stack

// pop

// dup second

// pick from

// swap top two

// rotate top three

// pop stack, dereference, push result

// pop stack, add uelb128 constant, push result

// pop stack, dereference, push result

// namespace libunwind

// __DWARF_INSTRUCTIONS_HPP__


=== system/lib/libunwind/src/DwarfParser.hpp ===
SHA256: 72fbc24384208310588d42014033f3ac39da907e63aa743e26eafbec8e83f3a7
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//  Parses DWARF CFIs (FDEs and CIEs).

//

//===----------------------------------------------------------------------===//

/// CFI_Parser does basic parsing of a CFI (Call Frame Information) records.

/// See DWARF Spec for details:

///    http://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html

///

/// Information encoded in a CIE (Common Information Entry)

/// Information about an FDE (Frame Description Entry)

// sparc64 specific

/// Information about a frame layout and registers saved determined

/// by "running" the DWARF FDE "instructions"

// CFA = (cfaRegister)+cfaRegisterOffset

// CFA = expression

// When saving registers, this data structure is lazily initialized.

// else the register still holds its initial state

// Clean up rememberStack. Even in the case where every

// DW_CFA_remember_state is paired with a DW_CFA_restore_state,

// parseInstructions can skip restore opcodes if it reaches the target PC

// and stops interpreting, so we have to make sure we don't leak memory.

/// Parse a FDE into a CIE_Info and an FDE_Info. If useCIEInfo is

/// true, treat cieInfo as already-parsed CIE_Info (whose start offset

/// must match the one specified by the FDE) rather than parsing the

/// one indicated within the FDE.

// 0xffffffff means length is really next 8 bytes

// zero terminator

// this is a CIE not an FDE

// Parse pc begin and range.

// Parse rest of info.

// Check for augmentation length.

// Peek at value (without indirection).  Zero means no LSDA.

// Reset pointer and re-parse LSDA address.

// success

/// Scan an eh_frame section to find an FDE for a pc

//fprintf(stderr, "findFDE(0x%llX)\n", (long long)pc);

//fprintf(stderr, "findFDE() CFI at 0x%llX\n", (long long)p);

// 0xffffffff means length is really next 8 bytes

// zero terminator

// Skip over CIEs.

// Process FDE to see if it covers pc.

// Validate pointer to CIE is within section.

// Parse pc begin and range.

// Test if pc is within the function this FDE covers.

// parse rest of info

// check for augmentation length

// Peek at value (without indirection).  Zero means no LSDA.

// Reset pointer and re-parse LSDA address.

// pc is not in begin/range, skip this FDE

// Malformed CIE, now augmentation describing pc range encoding.

// malformed FDE.  CIE is bad

/// Extract info from a CIE

// 0xffffffff means length is really next 8 bytes

// CIE ID is always 0

// Version is always 1 or 3

// save start of augmentation string and find end

// parse code alignment factor

// parse data alignment factor

// parse return address register

// parse augmentation data based on augmentation string

// parse augmentation data length

// ignore unknown letters

/// "run" the DWARF instructions and create the abstract PrologInfo for an FDE

// Alloca is used for the allocation of the rememberStack entries. It removes

// the dependency on new/malloc but the below for loop can not be refactored

// into functions. Entry could be saved during the processing of a CIE and

// restored by an FDE.

// initialState initialized as registers in results are modified. Use

// PrologInfo accessor functions to avoid reading uninitialized data.

// see DWARF Spec, section 6.4.2 for details on unwind opcodes

// <rdar://problem/8456377> DW_CFA_same_value unsupported

// "same value" means register was stored in frame, but its current

// value has not changed, so no need to restore from frame.

// We model this as if the register was never saved.

// Avoid operator new because that would be an upward dependency.

// Avoid malloc because it needs heap allocation.

// The same constant is used to represent different instructions on

// AArch64 (negate_ra_state) and SPARC (window_save).

// case DW_CFA_GNU_window_save:

// case DW_CFA_GNU_window_save:

// Don't save %o0-%o7 on sparc64.

// https://reviews.llvm.org/D32450#736405

// When calculating the value of the PC, it is assumed that the CFI

// instruction is placed before the signing instruction, however it is

// placed after. Because of this, we need to take into account the CFI

// instruction is one instruction call later than expected, and reduce

// the PC value by 4 bytes to compensate.

// namespace libunwind

// __DWARF_PARSER_HPP__


=== system/lib/libunwind/src/EHHeaderParser.hpp ===
SHA256: 31c22a99d0a0eef3341db272812e343b08b0de00518b2372eb189d977d9dda38
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//  Parses ELF .eh_frame_hdr sections.

//

//===----------------------------------------------------------------------===//

/// \brief EHHeaderParser does basic parsing of an ELF .eh_frame_hdr section.

///

/// See DWARF spec for details:

///    http://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html

///

/// Information encoded in the EH frame header.

// Ensure that we don't read data beyond the end of .eh_frame_hdr

// Don't print a message for an empty .eh_frame_hdr (this can happen if

// the linker script defines symbols for it even in the empty case).

// Have to decode the whole FDE for the PC range anyway, so just throw away

// the PC start.


=== system/lib/libunwind/src/FrameHeaderCache.hpp ===
SHA256: ba9d7a8ae3c936fce48639f3f0964f67657cc8ffcccdb75416d3fa7c304845e9
//===-FrameHeaderCache.hpp ------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

// Cache the elf program headers necessary to unwind the stack more efficiently

// in the presence of many dsos.

//

//===----------------------------------------------------------------------===//

// This cache should only be be used from within a dl_iterate_phdr callback.

// dl_iterate_phdr does the necessary synchronization to prevent problems

// with concurrent access via the libc load lock. Adding synchronization

// for other uses is possible, but not currently done.

// Can't depend on the C++ standard library in libunwind, so use an array to

// allocate the entries, and two linked lists for ordering unused and recently

// used entries.  FIXME: Would the extra memory for a doubly-linked list

// be better than the runtime cost of traversing a very short singly-linked

// list on a cache miss? The entries themselves are all small and consecutive,

// so unlikely to cause page faults when following the pointers. The memory

// spent on additional pointers could also be spent on more entries.

// C libraries increment dl_phdr_info.adds and dl_phdr_info.subs when

// loading and unloading shared libraries. If these values change between

// iterations of dl_iterate_phdr, then invalidate the cache.

// These are static to avoid needing an initializer, and unsigned long long

// because that is their type within the extended dl_phdr_info.  Initialize

// these to something extremely unlikely to be found upon the first call to

// dl_iterate_phdr.

// Resetting the entire cache is a big hammer, but this path is rare--

// usually just on the very first call, when the cache is empty anyway--so

// added complexity doesn't buy much.

// If there is no Previous, then Current is already the

// MostRecentlyUsed, and no need to move it up.

// __FRAMEHEADER_CACHE_HPP__


=== system/lib/libunwind/src/RWMutex.hpp ===
SHA256: 3d6f718c49944207310eafc2231767016a971c6be6612d31dcc673312f23e724
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

// Abstract interface to shared reader/writer log, hiding platform and

// configuration differences.

//

//===----------------------------------------------------------------------===//

// Calls to the locking functions are gated on pthread_create, and not the

// functions themselves, because the data structure should only be locked if

// another thread has been created. This is what similar libraries do.

// namespace libunwind

// __RWMUTEX_HPP__


=== system/lib/libunwind/src/Registers.hpp ===
SHA256: 9b39bf413a663d76a367b90d1a225ed68c06e3855ee1acfca85dd935707133a3
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//  Models register sets for supported processors.

//

//===----------------------------------------------------------------------===//

// For emulating 128-bit registers

/// Registers_x86 holds the register state of a thread in a 32-bit intel

/// process.

// _LIBUNWIND_TARGET_I386

/// Registers_x86_64  holds the register state of a thread in a 64-bit intel

/// process.

// 16-byte align

// suppress unused parameter warning

// suppress unused parameter warning

// suppress unused parameter warnings

// _LIBUNWIND_TARGET_X86_64

/// Registers_ppc holds the register state of a thread in a 32-bit PowerPC

/// process.

/* Instruction address register (PC) */

/* Machine state register (supervisor) */

/* Condition register */

/* User's integer exception register */

/* Link register */

/* Count register */

/* MQ register (601 only) */

/* Vector Save Register */

/* fpscr is 64 bits, 32 bits of rubbish */

/* floating point status register */

// offset 424

//fprintf(stderr, "Registers_ppc::setRegister(%d, 0x%08X)\n", regNum, value);

// not saved

// not saved

// _LIBUNWIND_TARGET_PPC

/// Registers_ppc64 holds the register state of a thread in a 64-bit PowerPC

/// process.

// Instruction address register (PC)

// Machine state register (supervisor)

// Condition register

// User's integer exception register

// Link register

// Count register

// Vector Save Register

// _LIBUNWIND_TARGET_PPC64

/// Registers_arm64  holds the register state of a thread in a 64-bit arm

/// process.

// x0-x28

// Frame pointer x29

// Link register x30

// Stack pointer x31

// Program counter

// RA sign state register

// Currently only the lower double in 128-bit vectore registers

// is perserved during unwinding.  We could define new register

// numbers (> 96) which mean whole vector registers, then this

// struct would need to change to contain whole vector registers.

// _LIBUNWIND_TARGET_AARCH64

/// Registers_arm holds the register state of a thread in a 32-bit arm

/// process.

///

/// NOTE: Assumes VFPv3. On ARM processors without a floating point unit,

/// this uses more memory than required.

// r0-r12

// Stack pointer r13

// Link register r14

// Program counter r15

// Return Authentication Code (PAC)

// ARM registers

// We save floating point registers lazily because we can't know ahead of

// time which ones are used. See EHABI #4.7.

// Whether D0-D15 are saved in the FTSMX instead of FSTMD format.

//

// See EHABI #7.5 that explains how matching instruction sequences for load

// and store need to be used to correctly restore the exact register bits.

// Whether VFP D0-D15 are saved.

// Whether VFPv3 D16-D31 are saved.

// VFP registers D0-D15, + padding if saved using FSTMX

// VFPv3 registers D16-D31, always saved using FSTMD

// Whether iWMMX data registers are saved.

// Whether iWMMX control registers are saved.

// iWMMX registers

// iWMMX control registers

// See __unw_getcontext() note about data.

// Returns true for all non-VFP registers supported by the EHABI

// virtual register set (VRS).

// UNW_ARM_R15 is alias

// UNW_ARM_R14 is alias

// UNW_ARM_R13 is alias

// NOTE: Consider the intel MMX registers floating points so the

// __unw_get_fpreg can be used to transmit the 64-bit data back.

// _LIBUNWIND_TARGET_ARM

/// Registers_or1k holds the register state of a thread in an OpenRISC1000

/// process.

// r0-r31

// Program counter

// Program counter at exception

/* regNum */

/* regNum */

/* regNum */

/* value */

/* regNum */

/* regNum */

/* regNum */

/* value */

// _LIBUNWIND_TARGET_OR1K

/// Registers_mips_o32 holds the register state of a thread in a 32-bit MIPS

/// process.

/// O32 with 32-bit floating point registers only uses half of this

/// space.  However, using the same layout for 32-bit vs 64-bit

/// floating point registers results in a single context size for

/// O32 with hard float.

// FIXME: DSP accumulator registers, MSA registers

/* regNum */

/* regNum */

/* regNum */

/* value */

// _LIBUNWIND_TARGET_MIPS_O32

/// Registers_mips_newabi holds the register state of a thread in a

/// MIPS process using NEWABI (the N32 or N64 ABIs).

// FIXME: Hard float, DSP accumulator registers, MSA registers

/* regNum */

/* regNum */

/* regNum */

/* value */

// _LIBUNWIND_TARGET_MIPS_NEWABI

/// Registers_sparc holds the register state of a thread in a 32-bit Sparc

/// process.

// _LIBUNWIND_TARGET_SPARC

/// Registers_sparc64 holds the register state of a thread in a 64-bit

/// sparc process.

// _LIBUNWIND_TARGET_SPARC64

/// Registers_hexagon holds the register state of a thread in a Hexagon QDSP6

/// process.

/* regNum */

/* regNum */

/* regNum */

/* value */

/* regNum */

/* regNum */

/* regNum */

/* value */

// _LIBUNWIND_TARGET_HEXAGON

/// Registers_riscv holds the register state of a thread in a RISC-V

/// process.

// This check makes it safe when LIBUNWIND_ENABLE_CROSS_UNWINDING enabled.

// This is just for suppressing undeclared error of fp_t.

// Use Max possible width when cross unwinding

/// Registers_riscv holds the register state of a thread.

// _registers[0] holds the pc

/* x0 is hardwired to zero */

// _LIBUNWIND_TARGET_RISCV

/// Registers_ve holds the register state of a thread in a VE process.

// FIXME: Need to store not only scalar registers but also vector and vector

// mask registers.  VEOS uses mcontext_t defined in ucontext.h.  It takes

// 524288 bytes (65536*8 bytes), though.  Currently, we use libunwind for

// SjLj exception support only, so Registers_ve is not implemented completely.

// s0-s64

// Instruction counter (IC)

// Vector Index Register

// Vector Length Register

// total 67 registers

// Currently no vector register is preserved.

/* regNum */

/* regNum */

/* regNum */

/* value */

/* regNum */

/* regNum */

/* regNum */

/* value */

// _LIBUNWIND_TARGET_VE

/// Registers_s390x holds the register state of a thread in a

/// 64-bit Linux on IBM zSystems process.

// Problem Status Word: Mask

// Problem Status Word: Address (PC)

// General Purpose Registers

// Floating-Point Registers

// NOTE: FPR DWARF register numbers are not consecutive.

// NOTE: FPR DWARF register numbers are not consecutive.

/*regNum*/

/*regNum*/

/*regNum*/

/*value*/

// _LIBUNWIND_TARGET_S390X

/// Registers_loongarch holds the register state of a thread in a 64-bit

/// LoongArch process.

//_LIBUNWIND_TARGET_LOONGARCH

// namespace libunwind

// __REGISTERS_HPP__


=== system/lib/libunwind/src/Unwind-EHABI.cpp ===
SHA256: 352ab8ec8eaa93a790c261c418ffea18fc78d55ba805601df369a310dc086417
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//  Implements ARM zero-cost C++ exceptions

//

//===----------------------------------------------------------------------===//

// Strange order: take words in order, but inside word, take from most to least

// signinficant byte.

// See # 9.2

// Short descriptor, 16-bit entries

// Long descriptor,  16-bit entries

// Long descriptor,  32-bit entries

// See # 9.2

// EHT is inlined in the index using compact form. No descriptors. #5

// TODO: We should check the state here, and determine whether we need to

// perform phase1 or phase2 unwinding.

// Read descriptor based on # 9.2.

// See # 9.2 table for decoding the kind of descriptor. It's a 2-bit value.

// Clear off flag from last bit.

// TODO(ajwong): Handle cleanup descriptors.

// TODO(ajwong): Handle function descriptors.

// Catch descriptors require gobbling one more word.

// TODO(ajwong): This is only phase1 compatible logic. Implement

// phase2.

/*
            bool is_reference_type = landing_pad & 0x80000000;
            void* matched_object;
            if (__cxxabiv1::__cxa_type_match(
                    ucbp, reinterpret_cast<const std::type_info *>(landing_pad),
                    is_reference_type,
                    &matched_object) != __cxxabiv1::ctm_failed)
                return _URC_HANDLER_FOUND;
                */

// Read the compact model EHT entry's header # 6.3

// Handle descriptors before unwinding so they are processed in the context

// of the correct stack frame.

// Generates mask discriminator for _Unwind_VRS_Pop, e.g. for _UVRSC_CORE /

// _UVRSD_UINT32.

// Generates mask discriminator for _Unwind_VRS_Pop, e.g. for _UVRSC_VFP /

// _UVRSD_DOUBLE.

// end anonymous namespace

/**
 * Decodes an EHT entry.
 *
 * @param data Pointer to EHT.
 * @param[out] off Offset from return value (in bytes) to begin interpretation.
 * @param[out] len Number of bytes in unwind code.
 * @return Pointer to beginning of unwind code.
 */

// 6.2: Generic Model

//

// EHT entry is a prel31 pointing to the PR, followed by data understood

// only by the personality routine. Fortunately, all existing assembler

// implementations, including GNU assembler, LLVM integrated assembler,

// and ARM assembler, assume that the unwind opcodes come after the

// personality rountine address.

// First byte is size data.

// Skip the first word, which is the prel31 offset.

// 6.3: ARM Compact Model

//

// EHT entries here correspond to the __aeabi_unwind_cpp_pr[012] PRs indeed

// by format:

// This decodes a uleb128 value.

/* Return Address Auth Code */

// EHABI #7.3 discusses preserving the VRS in a "temporary VRS" during

// phase 1 and then restoring it to the "primary VRS" for phase 2. The

// effect is phase 2 doesn't see any of the VRS manipulations from phase 1.

// In this implementation, the phases don't share the VRS backing store.

// Instead, they are passed the original |uc| and they create a new VRS

// from scratch thus achieving the same effect.

// Walk each frame looking for a place to stop.

// See if frame has code to run (has personality routine).

// When tracing, print state information.

// If there is a personality routine, ask it if it will want to stop at

// this frame.

// found a catch clause or locals that need destructing in this frame

// stop search and remember stack pointer at the frame

// p should have initialized barrier_cache. EHABI #7.3.5

// continue unwinding

// EHABI #7.3.3

// something went wrong

// See comment at the start of unwind_phase1 regarding VRS integrity.

// Walk each frame until we reach where search phase said to stop.

// Ask libunwind to get next frame (skip over first which is

// _Unwind_RaiseException or _Unwind_Resume).

//

// Resume only ever makes sense for 1 frame.

// On a resume, first unwind the _Unwind_Resume() frame. The next frame

// is now the landing pad for the cleanup from a previous execution of

// phase2. To continue unwindingly correctly, replace VRS[15] with the

// IP of the frame that the previous run of phase2 installed the context

// for. After this, continue unwinding as if normal.

//

// See #7.4.6 for details.

// Get info about this frame.

// When tracing, print state information.

// If there is a personality routine, tell it we are unwinding.

// EHABI #7.2

// Continue unwinding

// EHABI #7.2

// Phase 1 said we would stop at this frame, but we did not...

// Personality routine says to transfer control to landing pad.

// We may get control back if landing pad calls _Unwind_Resume().

// EHABI #7.4.1 says we need to preserve pc for when _Unwind_Resume

// is called back, to find this same frame.

// __unw_resume() only returns if there was an error.

// # EHABI #7.4.3

// Personality routine returned an unknown result code.

// Clean up phase did not resume at the frame that the search phase

// said it would...

// See comment at the start of unwind_phase1 regarding VRS integrity.

// Walk each frame until we reach where search phase said to stop

// Update info about this frame.

// When tracing, print state information.

// Call stop function at each frame.

// If there is a personality routine, tell it we are unwinding.

// EHABI #7.2

// Destructors called, continue unwinding

// We may get control back if landing pad calls _Unwind_Resume().

// Personalty routine did the step and it can't step forward.

// Personality routine returned an unknown result code.

// Call stop function one last time and tell it we've reached the end

// of the stack.

// Clean up phase did not resume at the frame that the search phase said it

// would.

/// Called by __cxa_throw.  Only returns if there is a fatal error.

// This field for is for compatibility with GCC to say this isn't a forced

// unwind. EHABI #7.2

// phase 1: the search phase

// phase 2: the clean up phase

// This is to be called when exception handling completes to give us a chance

// to perform any housekeeping. EHABI #7.2. But we have nothing to do here.

/// When _Unwind_RaiseException() is in phase2, it hands control

/// to the personality function at each frame.  The personality

/// may force a jump to a landing pad in that function, the landing

/// pad code may then call _Unwind_Resume() to continue with the

/// unwinding.  Note: the call to _Unwind_Resume() is from compiler

/// generated user code.  All other _Unwind_* routines are called

/// by the C++ runtime __cxa_* routines.

///

/// Note: re-throwing an exception (as opposed to continuing the unwind)

/// is implemented by having the code call __cxa_rethrow() which

/// in turn calls _Unwind_Resume_or_Rethrow().

// Clients assume _Unwind_Resume() does not return, so all we can do is abort.

/// Called by personality handler during phase 2 to get LSDA for current frame.

// Only used in _LIBUNWIND_TRACE_API, which is a no-op when assertions are

// disabled.

// Can only touch d0-15 with FSTMFDX.

// There's only one pseudo-register, PAC, with regno == 0.

// Can only touch d0-15 with FSTMFDX.

// There's only one pseudo-register, PAC, with regno == 0.

// When popping SP from the stack, we don't want to override it from the

// computed new stack location. See EHABI #7.5.4 table 3.

// For _UVRSD_VFPX, we're assuming the data is stored in FSTMX "standard

// format 1", which is equivalent to FSTMD + a padding word.

// SP is only 32-bit aligned so don't copy 64-bit at a time.

// Return Address Authentication code (PAC) - discriminator 0

/// Not used by C++.

/// Unwinds stack, calling "stop" function at each frame.

/// Could be used to implement longjmp().

// Mark that this is a forced unwind, so _Unwind_Resume() can do

// the right thing.

/// Called by personality handler during phase 2 to find the start of the

/// function.

/// Called by personality handler during phase 2 if a foreign exception

// is caught.

// defined(_LIBUNWIND_ARM_EHABI)


=== system/lib/libunwind/src/Unwind-EHABI.h ===
SHA256: c04fdebcd31e26de7615b82751373cc64ef83d02b24dbaaf0e112d0a559acc6b
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//===----------------------------------------------------------------------===//

// Unable to unwind in the ARM index table (section 5 EHABI).

// extern "C"

// defined(_LIBUNWIND_ARM_EHABI)

// __UNWIND_EHABI_H__


=== system/lib/libunwind/src/Unwind-seh.cpp ===
SHA256: 6255fc0d176d33492f88e50b85d5fe6afdc7201346bf209d01bd5d3d9ed3c173
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

//

//  Implements SEH-based Itanium C++ exceptions.

//

//===----------------------------------------------------------------------===//

/// SEH exception raised by libunwind when the program calls

/// \c _Unwind_RaiseException.

// 0x20474343

/// SEH exception raised by libunwind to initiate phase 2 of exception

/// handling.

// 0x21474343

// Local redefinition of this type; mingw-w64 headers lack the

// DISPATCHER_CONTEXT_NONVOLREG_ARM64 type as of May 2025, so locally redefine

// it and use that definition, to avoid needing to test/guess whether the real

// type is available of not.

// Custom data type definition; this type is not defined in WinSDK.

/// Common implementation of SEH-style handler functions used by Itanium-

/// style frames.  Depending on how and why it was called, it may do one of:

///  a) Delegate to the given Itanium-style personality function; or

///  b) Initiate a collided unwind to halt unwinding.

// Set up the upper return value (the lower one and the target PC

// were set in the call to RtlUnwindEx()) for the landing pad.

// This is the collided unwind to the landing pad. Nothing to do.

// This is (probably) a libunwind-controlled exception/unwind. Recover the

// parameters which we set below, and pass them to the personality function.

// Foreign exception.

// We can't interact with them (we don't know the original target frame

// that we should pass on to RtlUnwindEx in _Unwind_Resume), so just

// pass without calling our destructors here.

// If we're in phase 2, and the personality routine said to continue

// at the target frame, we're in real trouble.

// If we were called by __libunwind_seh_personality(), indicate that

// a handler was found; otherwise, initiate phase 2 by unwinding.

/* ExceptionExecuteHandler in mingw */

// This should never happen in phase 2.

// FIXME: Indicate target frame in foreign case!

// phase 2: the clean up phase

// If we were called by __libunwind_seh_personality(), indicate that

// a handler was found; otherwise, it's time to initiate a collided

// unwind to the target.

/* ExceptionExecuteHandler in mingw */

// This should never happen in phase 1.

// Give NTRTL some scratch space to keep track of the collided unwind.

// Don't use the one that was passed in; we don't want to overwrite the

// context in the DISPATCHER_CONTEXT.

// Anything else indicates a serious problem.

/// Personality function returned by \c __unw_get_proc_info() in SEH contexts.

/// This is a wrapper that calls the real SEH handler function, which in

/// turn (at least, for Itanium-style frames) calls the real Itanium

/// personality function (see \c _GCC_specific_handler()).

/*ExceptionExecuteHandler*/

// Walk each frame until we reach where search phase said to stop

// Update info about this frame.

// When tracing, print state information.

// Call stop function at each frame.

// If there is a personality routine, tell it we are unwinding.

// Destructors called, continue unwinding

// We may get control back if landing pad calls _Unwind_Resume().

// Personality routine returned an unknown result code.

// Call stop function one last time and tell it we've reached the end

// of the stack.

// Clean up phase did not resume at the frame that the search phase said it

// would.

/// Called by \c __cxa_throw().  Only returns if there is a fatal error.

// Mark that this is a non-forced unwind, so _Unwind_Resume()

// can do the right thing.

// phase 1: the search phase

// We'll let the system do that for us.

// If we get here, either something went horribly wrong or we reached the

// top of the stack. Either way, let libc++abi call std::terminate().

/// When \c _Unwind_RaiseException() is in phase2, it hands control

/// to the personality function at each frame.  The personality

/// may force a jump to a landing pad in that function; the landing

/// pad code may then call \c _Unwind_Resume() to continue with the

/// unwinding.  Note: the call to \c _Unwind_Resume() is from compiler

/// generated user code.  All other \c _Unwind_* routines are called

/// by the C++ runtime \c __cxa_* routines.

///

/// Note: re-throwing an exception (as opposed to continuing the unwind)

/// is implemented by having the code call \c __cxa_rethrow() which

/// in turn calls \c _Unwind_Resume_or_Rethrow().

// Recover the parameters for the unwind from the exception object

// so we can start unwinding again.

// Clients assume _Unwind_Resume() does not return, so all we can do is abort.

/// Not used by C++.

/// Unwinds stack, calling "stop" function at each frame.

/// Could be used to implement \c longjmp().

// Mark that this is a forced unwind, so _Unwind_Resume() can do

// the right thing.

// do it

/// Called by personality handler during phase 2 to get LSDA for current frame.

/// Called by personality handler during phase 2 to find the start of the

/// function.

// defined(_LIBUNWIND_SUPPORT_SEH_UNWIND)


=== system/lib/libunwind/src/Unwind-sjlj.c ===
SHA256: 25be6bc007751639556d0e896a0479affd8b23138e6cc3f4b2d8d7f257e1b678
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//  Implements setjump-longjump based C++ exceptions

//

//===----------------------------------------------------------------------===//

/// With SJLJ based exceptions, any function that has a catch clause or needs to

/// do any clean up when an exception propagates through it, needs to call

/// \c _Unwind_SjLj_Register at the start of the function and

/// \c _Unwind_SjLj_Unregister at the end.  The register function is called with

/// the address of a block of memory in the function's stack frame.  The runtime

/// keeps a linked list (stack) of these blocks - one per thread.  The calling

/// function also sets the personality and lsda fields of the block.

// next function in stack of handlers

// VE requires to store 64 bit pointers in the buffer for SjLj exception.

// We expand the size of values defined here.  This size must be matched

// to the size returned by TargetMachine::getSjLjDataSize().

// set by calling function before registering to be the landing pad

// set by personality handler to be parameters passed to landing pad function

// set by calling function before registering to be the landing pad

// set by personality handler to be parameters passed to landing pad function

// set by calling function before registering

// arm offset=24

// arm offset=28

// variable length array, contains registers to restore

// 0 = r7, 1 = pc, 2 = sp

/// Called at start of each function that catches exceptions

/// Called at end of each function that catches exceptions

// walk each frame looking for a place to stop

// check for no more frames

// if there is a personality routine, ask it if it will want to stop at this

// frame

// found a catch clause or locals that need destructing in this frame

// stop search and remember function context

// continue unwinding

// something went wrong

// walk each frame until we reach where search phase said to stop

// check for no more frames

// if there is a personality routine, tell it we are unwinding

// tell personality this was the frame it marked

// in phase 1

// continue unwinding

// phase 1 said we would stop at this frame, but we did not...

// personality routine says to transfer control to landing pad

// we may get control back if landing pad calls _Unwind_Resume()

// __unw_resume() only returns if there was an error

// something went wrong

// clean up phase did not resume at the frame that the search phase said it

// would

// walk each frame until we reach where search phase said to stop

// get next frame (skip over first which is _Unwind_RaiseException)

// call stop function at each frame

// if there is a personality routine, tell it we are unwinding

// destructors called, continue unwinding

// we may get control back if landing pad calls _Unwind_Resume()

// something went wrong

// call stop function one last time and tell it we've reached the end of the

// stack

// clean up phase did not resume at the frame that the search phase said it

// would

/// Called by __cxa_throw.  Only returns if there is a fatal error

// mark that this is a non-forced unwind, so _Unwind_Resume() can do the right

// thing

// phase 1: the search phase

// phase 2: the clean up phase

/// When _Unwind_RaiseException() is in phase2, it hands control

/// to the personality function at each frame.  The personality

/// may force a jump to a landing pad in that function, the landing

/// pad code may then call _Unwind_Resume() to continue with the

/// unwinding.  Note: the call to _Unwind_Resume() is from compiler

/// generated user code.  All other _Unwind_* routines are called

/// by the C++ runtime __cxa_* routines.

///

/// Re-throwing an exception is implemented by having the code call

/// __cxa_rethrow() which in turn calls _Unwind_Resume_or_Rethrow()

// clients assume _Unwind_Resume() does not return, so all we can do is abort.

///  Called by __cxa_rethrow().

// If this is non-forced and a stopping place was found, then this is a

// re-throw.

// Call _Unwind_RaiseException() as if this was a new exception.

// should return if there is no catch clause, so that __cxa_rethrow can call

// std::terminate()

// Call through to _Unwind_Resume() which distinguishes between forced and

// regular exceptions.

/// Called by personality handler during phase 2 to get LSDA for current frame.

/// Called by personality handler during phase 2 to get register values.

/// Called by personality handler during phase 2 to alter register values.

/// Called by personality handler during phase 2 to get instruction pointer.

/// Called by personality handler during phase 2 to get instruction pointer.

/// ipBefore is a boolean that says if IP is already adjusted to be the call

/// site address.  Normally IP is the return address.

/// Called by personality handler during phase 2 to alter instruction pointer.

/// Called by personality handler during phase 2 to find the start of the

/// function.

// Not supported or needed for sjlj based unwinding

/// Called by personality handler during phase 2 if a foreign exception

/// is caught.

/// Called by personality handler during phase 2 to get base address for data

/// relative encodings.

// Not supported or needed for sjlj based unwinding

/// Called by personality handler during phase 2 to get base address for text

/// relative encodings.

// Not supported or needed for sjlj based unwinding

/// Called by personality handler to get "Call Frame Area" for current frame.

// Setjmp/longjmp based exceptions don't have a true CFA.

// Instead, the SP in the jmpbuf is the closest approximation.

// defined(_LIBUNWIND_BUILD_SJLJ_APIS)


=== system/lib/libunwind/src/Unwind-wasm.c ===
SHA256: 2982cadd1f5e3e052a865a5076bacb4a002d2f85cbe425343ff4a5aabbcbfb10
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//  Implements Wasm exception handling proposal

//  (https://github.com/WebAssembly/exception-handling) based C++ exceptions

//

//===----------------------------------------------------------------------===//

// Input information to personality function

// landing pad index

// LSDA address

// Output information computed by personality function

// selector value

// Communication channel between compiler-generated user code and personality

// function

/// Calls to this function are in landing pads in compiler-generated user code.

/// In other EH schemes, stack unwinding is done by libunwind library, which

/// calls the personality function for each frame it lands. On the other

/// hand, WebAssembly stack unwinding process is performed by a VM, and the

/// personality function cannot be called from there. So the compiler inserts

/// a call to this function in landing pads in the user code, which in turn

/// calls the personality function.

// Reset the selector.

// Call personality function. Wasm does not have two-phase unwinding, so we

// only do the cleanup phase.

/// Called by __cxa_throw.

// Use Wasm EH's 'throw' instruction.

/// Called by __cxa_end_catch.

/// Called by personality handler to alter register values.

// We only use this function to set __wasm_lpad_context.selector field, which

// is index 1 in the personality function.

/// Called by personality handler to get instruction pointer.

// The result will be used as a 1-based index after decrementing 1, so we

// increment 2 here

/// Not used in Wasm.

/// Called by personality handler to get LSDA for current frame.

/// Not used in Wasm.

// defined(__WASM_EXCEPTIONS__)


=== system/lib/libunwind/src/UnwindCursor.hpp ===
SHA256: 61593a9b28bbfb9e80df6a8dab72fe0c3ebaeb1aa53748d0e8d850fa51614a3a
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

// C++ interface to lower levels of libunwind

//===----------------------------------------------------------------------===//

// Provide a definition for the DISPATCHER_CONTEXT struct for old (Win7 and

// earlier) SDKs.

// MinGW-w64 has always provided this struct.

/// Cache of recently found FDEs.

// These fields are all static to avoid needing an initializer.

// There is only one instance of this class per process.

// Can't use operator new (we are below it).

// defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)

// defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND)

// NOTE: provide a class specific placement deallocation function (S5.3.4 p20)

// This avoids an unnecessary dependency to libc++abi.

/// \c UnwindCursor contains all state (including all register values) during

/// an unwind.  This is normally stack-allocated inside a unw_cursor_t.

// libunwind does not and should not depend on C++ library which means that we

// need our own definition of inline placement new.

// Remove the thumb bit; FunctionEntry ranges don't include the thumb bit.

// If pc points exactly at the end of the range, we might resolve the

// next function instead. Decrement pc by 1 to fit inside the current

// function.

// Update some fields of the unwind info now, since we have them.

// Initialize MS context from ours.

// !defined(_LIBUNWIND_SUPPORT_SEH_UNWIND) || !defined(_WIN32)

/// UnwindCursor contains all state (including all register values) during

/// an unwind.  This is normally stack allocated inside a unw_cursor_t.

// libunwind does not and should not depend on C++ library which means that we

// need our own definition of inline placement new.

// FIXME: Calling decode_eht_entry() here is violating the libunwind

// abstraction layer.

// defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND)

// defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)

// For runtime environments using SEH unwind data without Windows runtime

// support.

/* FIXME: Implement */

/* FIXME: Implement */

/* FIXME: Implement */

/* FIXME: Implement */

// defined(_LIBUNWIND_SUPPORT_SEH_UNWIND)

// defined(_LIBUNWIND_SUPPORT_TBTAB_UNWIND)

// FIXME

// fill in _registers from thread arg

// defined(_LIBUNWIND_SUPPORT_SEH_UNWIND)

// If an exception is thrown from a function, corresponding to the last entry

// in the table, we don't really know the function extent and have to choose a

// value for nextPC. Choosing max() will allow the range check during trace to

// succeed.

// If the high bit is set, the exception handling table entry is inline inside

// the index table entry on the second word (aka |indexDataAddr|). Otherwise,

// the table points at an offset in the exception handling table (section 5

// EHABI).

// TODO(ajwong): Should this data be 0?

// Now we know the 3 things:

//   exceptionTableAddr -- exception handler table entry.

//   exceptionTableData -- the data inside the first word of the eht entry.

//   isSingleWordEHT -- whether the entry is in the index.

// If the high bit in the exception handling table entry is set, the entry is

// in compact form (section 6.3 EHABI).

// Grab the index of the personality routine from the compact form.

// ARM EHABI # 6.2, # 9.2

//

//  +---- ehtp

//  v

// +--------------------------------------+

// | +--------+--------+--------+-------+ |

// | |0| prel31 to personalityRoutine   | |

// | +--------+--------+--------+-------+ |

// | |      N |      unwind opcodes     | |  <-- UnwindData

// | +--------+--------+--------+-------+ |

// | | Word 2        unwind opcodes     | |

// | +--------+--------+--------+-------+ |

// | ...                                  |

// | +--------+--------+--------+-------+ |

// | | Word N        unwind opcodes     | |

// | +--------+--------+--------+-------+ |

// | | LSDA                             | |  <-- lsda

// | | ...                              | |

// | +--------+--------+--------+-------+ |

// +--------------------------------------+

// flags is pr_cache.additional. See EHABI #7.2 for definition of bit 0.

// Use enum?

// Save off parsed FDE info

// Some frameless functions need SP altered when resuming in function, so

// propagate spExtraArgSize.

// If compact encoding table gave offset into dwarf section, go directly there

// otherwise, search cache of previously found FDEs.

// Still not found, do full scan of __eh_frame section.

// Add to cache (to make next lookup faster) if we had no hint

// and there was no index.

//_LIBUNWIND_DEBUG_LOG("can't find/use FDE for pc=0x%llX", (uint64_t)pc);

// defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)

// do a binary search of top level index to find page with unwind info

//if ( log ) fprintf(stderr, "\tmid=%d, low=%d, high=%d, *mid=0x%08X\n",

//mid, low, high, topIndex.functionOffset(mid));

// do a binary search of second level page index

// regular page

// binary search looks for entry with e where index[e].offset <= pc <

// index[e+1].offset

// at end of table

// next is too big, so we found it

// compressed page

// binary search looks for entry with e where index[e].offset <= pc <

// index[e+1].offset

// encoding is in common table in section header

// encoding is in page specific table

// look up LSDA, if encoding says function has one

// binary search looks for entry with exact match for functionOffset

// extract personality routine, if encoding says function has one

// change 1-based to zero-based index

// defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND)

// Only fill in the handler and LSDA if they're stale.

// The personality is given in the UNWIND_INFO itself. The LSDA immediately

// follows the UNWIND_INFO. (This follows how both Clang and MSVC emit

// these structures.)

// N.B. UNWIND_INFO structs are DWORD-aligned.

// Packed unwind info

// Only fill in the handler and LSDA if they're stale.

// Packed unwind info doesn't have an exception handler.

// Only fill in the handler and LSDA if they're stale.

// The main xdata

// The extension word has got the same layout for both ARM and ARM64

// Masks for traceback table field xtbtable.

// The traceback table was incorrectly generated if set

// (see comments in function getInfoFromTBTable().

// Exception handling info is present if set

// Keep looking forward until a word of 0 is found. The traceback

// table starts at the following word.

// If the traceback table does not contain necessary info, bypass this frame.

// Structure tbtable_ext contains important data we are looking for.

// Skip field parminfo if it exists.

// p now points to tb_offset, the offset from start of function to TB table.

// Skip field hand_mask if it exists.

// State table info is available. The ctl_info field indicates the

// number of CTL anchors. There should be only one entry for the C++

// state table.

// p points to the offset of the state table into the stack.

// Skip fields name_len and name if exist.

// default frame pointer == SP

// Since the traceback table generated by the legacy XLC++ does not

// provide the location of the personality for the state table,

// function __xlcxx_personality_v0(), which is the personality for the state

// table and is exported from libc++abi, is directly assigned as the

// handler here. When a legacy XLC++ frame is encountered, the symbol

// is resolved dynamically using dlopen() to avoid a hard dependency of

// libunwind on libc++abi in cases such as non-C++ applications.

// Resolve the function pointer to the state table personality if it has

// not already been done.

// Resolve __xlcxx_personality_v0 using dlopen().

// The AIX dlopen() sets errno to 0 when it is successful, which

// clobbers the value of errno from the user code. This is an AIX

// bug because according to POSIX it should not set errno to 0. To

// workaround before AIX fixes the bug, errno is saved and restored.

// This frame has the traceback table extension. Possible cases are

// 1) a C++ frame that has the 'eh_info' structure; 2) a C++ frame that

// is not EH aware; or, 3) a frame of other languages. We need to figure out

// if the traceback table extension contains the 'eh_info' structure.

//

// We also need to deal with the complexity arising from some XL compiler

// versions use the wrong ordering of 'longtbtable' and 'has_vec' bits

// where the 'longtbtable' bit is meant to be the 'has_vec' bit and vice

// versa. For frames of code generated by those compilers, the 'longtbtable'

// bit may be set but there isn't really a traceback table extension.

//

// In </usr/include/sys/debug.h>, there is the following definition of

// 'struct tbtable_ext'. It is not really a structure but a dummy to

// collect the description of optional parts of the traceback table.

//

// struct tbtable_ext {

//   ...

//   char alloca_reg;        /* Register for alloca automatic storage */

//   struct vec_ext vec_ext; /* Vector extension (if has_vec is set) */

//   unsigned char xtbtable; /* More tbtable fields, if longtbtable is set*/

// };

//

// Depending on how the 'has_vec'/'longtbtable' bit is interpreted, the data

// following 'alloca_reg' can be treated either as 'struct vec_ext' or

// 'unsigned char xtbtable'. 'xtbtable' bits are defined in

// </usr/include/sys/debug.h> as flags. The 7th bit '0x02' is currently

// unused and should not be set. 'struct vec_ext' is defined in

// </usr/include/sys/debug.h> as follows:

//

// struct vec_ext {

//   unsigned vr_saved:6;      /* Number of non-volatile vector regs saved

//   */

//                             /* first register saved is assumed to be */

//                             /* 32 - vr_saved                         */

//   unsigned saves_vrsave:1;  /* Set if vrsave is saved on the stack */

//   unsigned has_varargs:1;

//   ...

// };

//

// Here, the 7th bit is used as 'saves_vrsave'. To determine whether it

// is 'struct vec_ext' or 'xtbtable' that follows 'alloca_reg',

// we checks if the 7th bit is set or not because 'xtbtable' should

// never have the 7th bit set. The 7th bit of 'xtbtable' will be reserved

// in the future to make sure the mitigation works. This mitigation

// is not 100% bullet proof because 'struct vec_ext' may not always have

// 'saves_vrsave' bit set.

//

// 'reservedBit' is defined in enum 'xTBTableMask' above as the mask for

// checking the 7th bit.

// p points to field name len.

// Skip fields name_len and name if they exist.

// Skip field alloc_reg if it exists.

// Check traceback table bit has_vec. Skip struct vec_ext if it exists.

// Note struct vec_ext does exist at this point because whether the

// ordering of longtbtable and has_vec bits is correct or not, both

// are set.

// charPtr points to field 'xtbtable'. Check if the EH info is available.

// Also check if the reserved bit of the extended traceback table field

// 'xtbtable' is set. If it is, the traceback table was incorrectly

// generated by an XL compiler that uses the wrong ordering of 'longtbtable'

// and 'has_vec' bits and this is in fact 'struct vec_ext'. So skip the

// frame.

// Mark this frame has the new EH info.

// eh_info is available.

// The pointer is 4-byte aligned.

// ehInfo points to structure en_info. The first member is version.

// Only version 0 is currently supported.

// Increment ehInfo to point to member lsda.

// enInfo now points to member personality.

// Step back up the stack following the frame back link.

// Instruction to reload TOC register "ld r2,40(r1)"

// Instruction to reload TOC register "lwz r2,20(r1)"

// lastStack points to the stack frame of the next routine up.

// If backchain is not stored, use the current stack frame.

// Return address is the address after call site instruction.

// Try again using STKMIN.

// Restore the condition register from sigcontext.

// Save the LR in sigcontext for stepping up when the function that

// raised the signal is a leaf function. This LR has the return address

// to the caller of the leaf function.

// Restore GPRs from sigcontext.

// Restore FPRs from sigcontext.

// Restore vector registers if there is an associated extended context

// structure.

// Step up a normal frame.

// This case should only occur if we were called from a signal handler

// and the signal occurred in a function that doesn't save the LR.

// Otherwise, use the LR value in the stack link area.

// Reset LR in the current context.

// Restore FP registers.

// Restore GP registers.

// Restore Vector registers.

// Restore vector registers only if this is a Clang frame. Also

// check if traceback table bit has_vec is set. If it is, structure

// vec_ext is available.

// Get to the vec_ext structure to check if vector registers are saved.

// Skip field parminfo if exists.

// Skip field tb_offset if exists.

// Skip field hand_mask if exists.

// Skip fields ctl_info and ctl_info_disp if exist.

// Skip field ctl_info.

// Skip field ctl_info_disp.

// Skip fields name_len and name if exist.

// p is supposed to point to field name_len now.

// Skip field alloc_reg if it exists.

// Restore vector register(s) if saved on the stack.

// Saved vector registers are 16-byte aligned.

// Get the saved condition register. The condition register is only

// a single word.

// Restore the SP.

// The first instruction after return.

// Do we need to set the TOC register?

// The return address is the address after call site instruction, so

// setting IP to that simulates a return.

// Simulate the step by replacing the register set with the new ones.

// Check if the next frame is a signal frame.

// Return address is the address after call site instruction.

// defined(_LIBUNWIND_SUPPORT_TBTAB_UNWIND)

// Remove the thumb bit so the IP represents the actual instruction address.

// This matches the behaviour of _Unwind_GetIP on arm.

// Exit early if at the top of the stack.

// If the last line of a function is a "throw" the compiler sometimes

// emits no instructions after the call to __cxa_throw.  This means

// the return address is actually the start of the next function.

// To disambiguate this, back up the pc when we know it is a return

// address.

// PC needs to be a 4-byte aligned address to be able to look for a

// word of 0 that indicates the start of the traceback table at the end

// of a function on AIX.

// In case of this is frame of signal handler, the IP saved in the signal

// handler points to first non-executed instruction, while FDE/CIE expects IP

// to be after the first non-executed instruction.

// Ask address space object to find unwind sections for this pc.

// If there is a compact unwind encoding table, look there first.

// Found info in table, done unless encoding says to use dwarf.

// found info in dwarf, done

// If unwind table has entry, but entry says there is no unwind info,

// record that we have no unwind info.

// defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND)

// If there is SEH unwind info, look there next.

// If there is unwind info in the traceback table, look there next.

// If there is dwarf unwind info, look there next.

// found info in dwarf, done

// If there is ARM EHABI unwind info, look there next.

// There is no static unwind info for this pc. Look to see if an FDE was

// dynamically registered for it.

// Lastly, ask AddressSpace object about platform specific ways to locate

// other FDEs.

// Double check this FDE is for a function that includes the pc.

// #if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)

// no unwind info, flag that we can't reliably unwind

// Look for the sigreturn trampoline. The trampoline's body is two

// specific instructions (see below). Typically the trampoline comes from the

// vDSO[1] (i.e. the __kernel_rt_sigreturn function). A libc might provide its

// own restorer function, though, or user-mode QEMU might write a trampoline

// onto the stack.

//

// This special code path is a fallback that is only used if the trampoline

// lacks proper (e.g. DWARF) unwind info. On AArch64, a new DWARF register

// constant for the PC needs to be defined before DWARF can handle a signal

// trampoline. This code may segfault if the target PC is unreadable, e.g.:

//  - The PC points at a function compiled without unwind info, and which is

//    part of an execute-only mapping (e.g. using -Wl,--execute-only).

//  - The PC is invalid and happens to point to unreadable or unmapped memory.

//

// [1] https://github.com/torvalds/linux/blob/master/arch/arm64/kernel/vdso/sigreturn.S

// The PC might contain an invalid address if the unwind info is bad, so

// directly accessing it could cause a SIGSEGV.

// Look for instructions: mov x8, #0x8b; svc #0x0

// In the signal trampoline frame, sp points to an rt_sigframe[1], which is:

//  - 128-byte siginfo struct

//  - ucontext struct:

//     - 8-byte long (uc_flags)

//     - 8-byte pointer (uc_link)

//     - 24-byte stack_t

//     - 128-byte signal set

//     - 8 bytes of padding because sigcontext has 16-byte alignment

//     - sigcontext/mcontext_t

// [1] https://github.com/torvalds/linux/blob/master/arch/arm64/kernel/signal.c

// 304

// Offsets from sigcontext to each register.

// offset to "__u64 regs[31]" field

// offset to "__u64 sp" field

// offset to "__u64 pc" field

// defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) &&

// defined(_LIBUNWIND_TARGET_AARCH64)

// The PC might contain an invalid address if the unwind info is bad, so

// directly accessing it could cause a SIGSEGV.

// Look for the two instructions used in the sigreturn trampoline

// __vdso_rt_sigreturn:

//

// 0x03822c0b li a7,0x8b

// 0x002b0000 syscall 0

// In the signal trampoline frame, sp points to an rt_sigframe[1], which is:

//  - 128-byte siginfo struct

//  - ucontext_t struct:

//     - 8-byte long (__uc_flags)

//     - 8-byte pointer (*uc_link)

//     - 24-byte uc_stack

//     - 8-byte uc_sigmask

//     - 120-byte of padding to allow sigset_t to be expanded in the future

//     - 8 bytes of padding because sigcontext has 16-byte alignment

//     - struct sigcontext uc_mcontext

// [1]

// https://github.com/torvalds/linux/blob/master/arch/loongarch/kernel/signal.c

// skip R0

// defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) &&

// defined(_LIBUNWIND_TARGET_LOONGARCH)

// The PC might contain an invalid address if the unwind info is bad, so

// directly accessing it could cause a SIGSEGV.

// Look for the two instructions used in the sigreturn trampoline

// __vdso_rt_sigreturn:

//

// 0x08b00893 li a7,0x8b

// 0x00000073 ecall

// In the signal trampoline frame, sp points to an rt_sigframe[1], which is:

//  - 128-byte siginfo struct

//  - ucontext_t struct:

//     - 8-byte long (__uc_flags)

//     - 8-byte pointer (*uc_link)

//     - 24-byte uc_stack

//     - 8-byte uc_sigmask

//     - 120-byte of padding to allow sigset_t to be expanded in the future

//     - 8 bytes of padding because sigcontext has 16-byte alignment

//     - struct sigcontext uc_mcontext

// [1]

// https://github.com/torvalds/linux/blob/master/arch/riscv/kernel/signal.c

// defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) &&

// defined(_LIBUNWIND_TARGET_RISCV)

// Look for the sigreturn trampoline. The trampoline's body is a

// specific instruction (see below). Typically the trampoline comes from the

// vDSO (i.e. the __kernel_[rt_]sigreturn function). A libc might provide its

// own restorer function, though, or user-mode QEMU might write a trampoline

// onto the stack.

// The PC might contain an invalid address if the unwind info is bad, so

// directly accessing it could cause a SIGSEGV.

// Determine current SP.

// According to the s390x ABI, the CFA is at (incoming) SP + 160.

// Determine current PC and instruction there (this must be either

// a "svc __NR_sigreturn" or "svc __NR_rt_sigreturn").

// Find the addresses of the signo and sigcontext in the frame.

// "svc __NR_sigreturn" uses a non-RT signal trampoline frame.

// Layout of a non-RT signal trampoline frame, starting at the CFA:

//  - 8-byte signal mask

//  - 8-byte pointer to sigcontext, followed by signo

//  - 4-byte signo

// "svc __NR_rt_sigreturn" uses a RT signal trampoline frame.

// Layout of a RT signal trampoline frame, starting at the CFA:

//  - 8-byte retcode (+ alignment)

//  - 128-byte siginfo struct (starts with signo)

//  - ucontext struct:

//     - 8-byte long (uc_flags)

//     - 8-byte pointer (uc_link)

//     - 24-byte stack_t

//     - 8 bytes of padding because sigcontext has 16-byte alignment

//     - sigcontext/mcontext_t

// Offsets from sigcontext to each register.

// Restore all registers.

// SIGILL, SIGFPE and SIGTRAP are delivered with psw_addr

// after the faulting instruction rather than before it.

// Do not set _isSignalFrame in that case.

// defined(_LIBUNWIND_CHECK_LINUX_SIGRETURN) &&

// defined(_LIBUNWIND_TARGET_S390X)

// Layout of the stack before function call:

// - signal_frame_data

//   + siginfo_t    (public struct, fairly stable)

//   + ucontext_t   (public struct, fairly stable)

//     - mcontext_t -> Offset 0x70, this is what we want.

// - frame->ip (8 bytes)

// - frame->bp (8 bytes). Not written by the kernel,

//   but the signal handler has a "push %rbp" instruction.

// TODO: XMM

// defined(_LIBUNWIND_TARGET_X86_64)

// defined(_LIBUNWIND_CHECK_HAIKU_SIGRETURN)

// Bottom of stack is defined is when unwind info cannot be found.

// Use unwinding info to modify register set as if function returned.

// update info based on new PC

// We use SYS_rt_sigprocmask, inspired by Abseil's AddressIsReadable.

// We have to check that addr is nullptr because sigprocmask allows that

// as an argument without failure.

// We MUST use a raw syscall here, as wrappers may try to access

// sigsetAddr which may cause a SIGSEGV. A raw syscall however is

// safe. Additionally, we need to pass the kernel_sigset_size, which is

// different from libc sizeof(sigset_t). For the majority of architectures,

// it's 64 bits (_NSIG), and libc NSIG is _NSIG + 1.

/*how=*/

// Because our "how" is invalid, this syscall should always fail, and our

// errno should always be EINVAL or an EFAULT. This relies on the Linux

// kernel to check copy_from_user before checking if the "how" argument is

// invalid.

// namespace libunwind

// __UNWINDCURSOR_HPP__


=== system/lib/libunwind/src/UnwindLevel1-gcc-ext.c ===
SHA256: 3bed106de18fec9d1c52cb7bc3d5db89d3225252f3c0312597d159edbbd6e802
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//  Implements gcc extensions to the C++ ABI Exception Handling Level 1.

//

//===----------------------------------------------------------------------===//

///  Called by __cxa_rethrow().

// If this is non-forced and a stopping place was found, then this is a

// re-throw.

// Call _Unwind_RaiseException() as if this was a new exception

// Will return if there is no catch clause, so that __cxa_rethrow can call

// std::terminate().

// Call through to _Unwind_Resume() which distinguishes between forced and

// regular exceptions.

/// Called by personality handler during phase 2 to get base address for data

/// relative encodings.

/// Called by personality handler during phase 2 to get base address for text

/// relative encodings.

/// Scans unwind information to find the function that contains the

/// specified code address "pc".

// Get the start address of the enclosing function from the function's

// traceback table.

// Keep looking forward until a word of 0 is found. The traceback

// table starts at the following word.

// Get the address of the traceback table extension.

// Skip field parminfo if it exists.

// *p contains the offset from the function start to traceback table.

// This is slow, but works.

// We create an unwind cursor then alter the IP to be pc

/// Walk every frame and call trace function at each one.  If trace function

/// returns anything other than _URC_NO_REASON, then walk is terminated.

// Create a mock exception object for force unwinding.

// walk each frame

// ask libunwind to get next frame (skip over first frame which is

// _Unwind_Backtrace())

// Get the information for this frame.

// Update the pr_cache in the mock exception object.

// Get and call the personality function to unwind the frame.

// defined(_LIBUNWIND_ARM_EHABI)

// debugging

// call trace function with this frame

/// Find DWARF unwind info for an address 'pc' in some function.

// This is slow, but works.

// We create an unwind cursor then alter the IP to be pc

// dbase not used on Mac OS X

/// Returns the CFA (call frame area, or stack pointer at start of function)

/// for the current context.

/// Called by personality handler during phase 2 to get instruction pointer.

/// ipBefore is a boolean that says if IP is already adjusted to be the call

/// site address.  Normally IP is the return address.

// Negative means some kind of error (probably UNW_ENOINFO), but we have no

// good way to report that, and this maintains backward compatibility with the

// implementation that hard-coded zero in every case, even signal frames.

/// Called by programs with dynamic code generators that want

/// to register a dynamically generated FDE.

/// This function has existed on Mac OS X since 10.4, but

/// was broken until 10.6.

/// Called by programs with dynamic code generators that want

/// to unregister a dynamically generated FDE.

/// This function has existed on Mac OS X since 10.4, but

/// was broken until 10.6.

// The following register/deregister functions are gcc extensions.

// They have existed on Mac OS X, but have never worked because Mac OS X

// before 10.6 used keymgr to track known FDEs, but these functions

// never got updated to use keymgr.

// For now, we implement these as do-nothing functions to keep any existing

// applications working.  We also add the not in 10.6 symbol so that nwe

// application won't be able to use them.

// do nothing, this function never worked in Mac OS X

// do nothing, this function never worked in Mac OS X

// do nothing, this function never worked in Mac OS X

// do nothing, this function never worked in Mac OS X

// do nothing, this function never worked in Mac OS X

// do nothing, this function never worked in Mac OS X

// do nothing, this function never worked in Mac OS X

// defined(_LIBUNWIND_SUPPORT_FRAME_APIS)

// defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)

// defined(_LIBUNWIND_BUILD_ZERO_COST_APIS)


=== system/lib/libunwind/src/UnwindLevel1.c ===
SHA256: 98ca10cb9194ae174661a5b799502be7d47fd7f2e464cf3f410fa9b7fdaf9b25
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

// Implements C++ ABI Exception Handling Level 1 as documented at:

//      https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html

// using libunwind

//

//===----------------------------------------------------------------------===//

// ARM EHABI does not specify _Unwind_{Get,Set}{GR,IP}().  Thus, we are

// defining inline functions to delegate the function calls to

// _Unwind_VRS_{Get,Set}().  However, some applications might declare the

// function protetype directly (instead of including <unwind.h>), thus we need

// to export these functions from libunwind.so as well.

// When shadow stack is enabled, a separate stack containing only return

// addresses would be maintained. On function return, the return address would

// be compared to the popped address from shadow stack to ensure the return

// target is not tempered with. When unwinding, we're skipping the normal return

// procedure for multiple frames and thus need to pop the return addresses of

// the skipped frames from shadow stack to avoid triggering an exception (using

// `_LIBUNWIND_POP_SHSTK_SSP()`). Also, some architectures, like the x86-family

// CET, push the return adddresses onto shadow stack with common call

// instructions, so for these architectures, normal function calls should be

// avoided when invoking the `jumpto()` function. To do this, we use inline

// assemblies to "goto" the `jumpto()` for these architectures.

// Walk each frame looking for a place to stop.

// Ask libunwind to get next frame (skip over first which is

// _Unwind_RaiseException).

// See if frame has code to run (has personality routine).

// When tracing, print state information.

// If there is a personality routine, ask it if it will want to stop at

// this frame.

// found a catch clause or locals that need destructing in this frame

// stop search and remember stack pointer at the frame

// continue unwinding

// something went wrong

// Enable the GCS target feature to permit gcspop instructions to be used.

// uc is initialized by __unw_getcontext in the parent frame. The first stack

// frame walked is unwind_phase2.

// Walk each frame until we reach where search phase said to stop.

// Ask libunwind to get next frame (skip over first which is

// _Unwind_RaiseException).

// Get info about this frame.

// When tracing, print state information.

// In shadow stack enabled environment, we check return address stored in normal

// stack against return address stored in shadow stack, if the 2 addresses don't

// match, it means return address in normal stack has been corrupted, we return

// _URC_FATAL_PHASE2_ERROR.

// If there is a personality routine, tell it we are unwinding.

// Tell personality this was the frame it marked in phase 1.

// Continue unwinding

// Phase 1 said we would stop at this frame, but we did not...

// Personality routine says to transfer control to landing pad.

// We may get control back if landing pad calls _Unwind_Resume().

// __unw_phase2_resume() only returns if there was an error.

// Personality routine returned an unknown result code.

// Clean up phase did not resume at the frame that the search phase

// said it would...

// Enable the GCS target feature to permit gcspop instructions to be used.

// uc is initialized by __unw_getcontext in the parent frame. The first stack

// frame walked is unwind_phase2_forced.

// Walk each frame until we reach where search phase said to stop

// Update info about this frame.

// When tracing, print state information.

// Call stop function at each frame.

// If there is a personality routine, tell it we are unwinding.

// Destructors called, continue unwinding

// We may get control back if landing pad calls _Unwind_Resume().

// Personality routine returned an unknown result code.

// Call stop function one last time and tell it we've reached the end

// of the stack.

// Clean up phase did not resume at the frame that the search phase said it

// would.

/// Called by __cxa_throw.  Only returns if there is a fatal error.

// Mark that this is a non-forced unwind, so _Unwind_Resume()

// can do the right thing.

// phase 1: the search phase

// phase 2: the clean up phase

/// When _Unwind_RaiseException() is in phase2, it hands control

/// to the personality function at each frame.  The personality

/// may force a jump to a landing pad in that function, the landing

/// pad code may then call _Unwind_Resume() to continue with the

/// unwinding.  Note: the call to _Unwind_Resume() is from compiler

/// generated user code.  All other _Unwind_* routines are called

/// by the C++ runtime __cxa_* routines.

///

/// Note: re-throwing an exception (as opposed to continuing the unwind)

/// is implemented by having the code call __cxa_rethrow() which

/// in turn calls _Unwind_Resume_or_Rethrow().

// Clients assume _Unwind_Resume() does not return, so all we can do is abort.

/// Not used by C++.

/// Unwinds stack, calling "stop" function at each frame.

/// Could be used to implement longjmp().

// Mark that this is a forced unwind, so _Unwind_Resume() can do

// the right thing.

// do it

/// Called by personality handler during phase 2 to get LSDA for current frame.

/// Called by personality handler during phase 2 to find the start of the

/// function.

// !_LIBUNWIND_SUPPORT_SEH_UNWIND

/// Called by personality handler during phase 2 if a foreign exception

// is caught.

/// Called by personality handler during phase 2 to get register values.

/// Called by personality handler during phase 2 to alter register values.

/// Called by personality handler during phase 2 to get instruction pointer.

/// Called by personality handler during phase 2 to alter instruction pointer,

/// such as setting where the landing pad is, so _Unwind_Resume() will

/// start executing in the landing pad.

// !defined(_LIBUNWIND_ARM_EHABI) && !defined(__USING_SJLJ_EXCEPTIONS__)


=== system/lib/libunwind/src/UnwindRegistersRestore.S ===
SHA256: 7849e87827f184c12b2dd7b15b04e56d2eee5450f521a0d936f608ab93a48df0
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "assembly.h"

#define FROM_0_TO_15 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
#define FROM_16_TO_31 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31

#define FROM_0_TO_31 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
#define FROM_32_TO_63 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

#if defined(_AIX)
  .toc
#else
  .text
#endif

#if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__wasm__)

#if defined(__i386__)
DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_x86_jumpto)
#
# extern "C" void __libunwind_Registers_x86_jumpto(Registers_x86 *);
#
# On entry:
#  +                       +
#  +-----------------------+
#  + thread_state pointer  +
#  +-----------------------+
#  + return address        +
#  +-----------------------+   <-- SP
#  +                       +

  _LIBUNWIND_CET_ENDBR
  movl   4(%esp), %eax
  # set up eax and ret on new stack location
  movl  28(%eax), %edx # edx holds new stack pointer
  subl  $8,%edx
  movl  %edx, 28(%eax)
  movl  0(%eax), %ebx
  movl  %ebx, 0(%edx)
  movl  40(%eax), %ebx
  movl  %ebx, 4(%edx)
  # we now have ret and eax pushed onto where new stack will be
  # restore all registers
  movl   4(%eax), %ebx
  movl   8(%eax), %ecx
  movl  12(%eax), %edx
  movl  16(%eax), %edi
  movl  20(%eax), %esi
  movl  24(%eax), %ebp
  movl  28(%eax), %esp
  # skip ss
  # skip eflags
  pop    %eax  # eax was already pushed on new stack
  pop    %ecx
  jmp    *%ecx
  # skip cs
  # skip ds
  # skip es
  # skip fs
  # skip gs

#elif defined(__x86_64__) && !defined(__arm64ec__)

DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_x86_64_jumpto)
#
# extern "C" void __libunwind_Registers_x86_64_jumpto(Registers_x86_64 *);
#
#if defined(_WIN64)
# On entry, thread_state pointer is in rcx; move it into rdi
# to share restore code below. Since this routine restores and
# overwrites all registers, we can use the same registers for
# pointers and temporaries as on unix even though win64 normally
# mustn't clobber some of them.
  movq  %rcx, %rdi
#else
# On entry, thread_state pointer is in rdi
#endif

  _LIBUNWIND_CET_ENDBR
  movq  56(%rdi), %rax # rax holds new stack pointer
  subq  $16, %rax
  movq  %rax, 56(%rdi)
  movq  32(%rdi), %rbx  # store new rdi on new stack
  movq  %rbx, 0(%rax)
  movq  128(%rdi), %rbx # store new rip on new stack
  movq  %rbx, 8(%rax)
  # restore all registers
  movq    0(%rdi), %rax
  movq    8(%rdi), %rbx
  movq   16(%rdi), %rcx
  movq   24(%rdi), %rdx
  # restore rdi later
  movq   40(%rdi), %rsi
  movq   48(%rdi), %rbp
  # restore rsp later
  movq   64(%rdi), %r8
  movq   72(%rdi), %r9
  movq   80(%rdi), %r10
  movq   88(%rdi), %r11
  movq   96(%rdi), %r12
  movq  104(%rdi), %r13
  movq  112(%rdi), %r14
  movq  120(%rdi), %r15
  # skip rflags
  # skip cs
  # skip fs
  # skip gs

#if defined(_WIN64)
  movdqu 176(%rdi),%xmm0
  movdqu 192(%rdi),%xmm1
  movdqu 208(%rdi),%xmm2
  movdqu 224(%rdi),%xmm3
  movdqu 240(%rdi),%xmm4
  movdqu 256(%rdi),%xmm5
  movdqu 272(%rdi),%xmm6
  movdqu 288(%rdi),%xmm7
  movdqu 304(%rdi),%xmm8
  movdqu 320(%rdi),%xmm9
  movdqu 336(%rdi),%xmm10
  movdqu 352(%rdi),%xmm11
  movdqu 368(%rdi),%xmm12
  movdqu 384(%rdi),%xmm13
  movdqu 400(%rdi),%xmm14
  movdqu 416(%rdi),%xmm15
#endif
  movq  56(%rdi), %rsp  # cut back rsp to new location
  pop    %rdi      # rdi was saved here earlier
  pop    %rcx
  jmpq   *%rcx


#elif defined(__powerpc64__)

DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind15Registers_ppc646jumptoEv)
//
// void libunwind::Registers_ppc64::jumpto()
//
// On entry:
//  thread_state pointer is in r3
//

// load register (GPR)
#define PPC64_LR(n) \
  ld    n, (8 * (n + 2))(3)

  // restore integral registers
  // skip r0 for now
  // skip r1 for now
  PPC64_LR(2)
  // skip r3 for now
  // skip r4 for now
  // skip r5 for now
  PPC64_LR(6)
  PPC64_LR(7)
  PPC64_LR(8)
  PPC64_LR(9)
  PPC64_LR(10)
  PPC64_LR(11)
  PPC64_LR(12)
  PPC64_LR(13)
  PPC64_LR(14)
  PPC64_LR(15)
  PPC64_LR(16)
  PPC64_LR(17)
  PPC64_LR(18)
  PPC64_LR(19)
  PPC64_LR(20)
  PPC64_LR(21)
  PPC64_LR(22)
  PPC64_LR(23)
  PPC64_LR(24)
  PPC64_LR(25)
  PPC64_LR(26)
  PPC64_LR(27)
  PPC64_LR(28)
  PPC64_LR(29)
  PPC64_LR(30)
  PPC64_LR(31)

#if defined(__VSX__)

  // restore VS registers
  // (note that this also restores floating point registers and V registers,
  // because part of VS is mapped to these registers)

  addi  4, 3, PPC64_OFFS_FP

// load VS register
#ifdef __LITTLE_ENDIAN__
// For little-endian targets, we need a swap since lxvd2x will load the register
// in the incorrect doubleword order.
// FIXME: when supporting targets older than Power9 on LE is no longer required,
//        this can be changed to simply `lxv n, (16 * n)(4)`.
#define PPC64_LVS(n)         \
  lxvd2x  n, 0, 4           ;\
  xxswapd n, n              ;\
  addi    4, 4, 16
#else
#define PPC64_LVS(n)         \
  lxvd2x  n, 0, 4           ;\
  addi    4, 4, 16
#endif

  // restore the first 32 VS regs (and also all floating point regs)
  PPC64_LVS(0)
  PPC64_LVS(1)
  PPC64_LVS(2)
  PPC64_LVS(3)
  PPC64_LVS(4)
  PPC64_LVS(5)
  PPC64_LVS(6)
  PPC64_LVS(7)
  PPC64_LVS(8)
  PPC64_LVS(9)
  PPC64_LVS(10)
  PPC64_LVS(11)
  PPC64_LVS(12)
  PPC64_LVS(13)
  PPC64_LVS(14)
  PPC64_LVS(15)
  PPC64_LVS(16)
  PPC64_LVS(17)
  PPC64_LVS(18)
  PPC64_LVS(19)
  PPC64_LVS(20)
  PPC64_LVS(21)
  PPC64_LVS(22)
  PPC64_LVS(23)
  PPC64_LVS(24)
  PPC64_LVS(25)
  PPC64_LVS(26)
  PPC64_LVS(27)
  PPC64_LVS(28)
  PPC64_LVS(29)
  PPC64_LVS(30)
  PPC64_LVS(31)

#ifdef __LITTLE_ENDIAN__
#define PPC64_CLVS_RESTORE(n)                    \
  addi   4, 3, PPC64_OFFS_FP + n * 16           ;\
  lxvd2x n, 0, 4                                ;\
  xxswapd n, n
#else
#define PPC64_CLVS_RESTORE(n)                    \
  addi   4, 3, PPC64_OFFS_FP + n * 16           ;\
  lxvd2x n, 0, 4
#endif

#if !defined(_AIX)
  // use VRSAVE to conditionally restore the remaining VS regs, that are
  // where the V regs are mapped. In the AIX ABI, VRSAVE is not used.
  ld    5, PPC64_OFFS_VRSAVE(3)   // test VRsave
  cmpwi 5, 0
  beq   Lnovec

// conditionally load VS
#define PPC64_CLVSl(n)                           \
  andis. 0, 5, (1 PPC_LEFT_SHIFT(47-n))         ;\
  beq    Ldone##n                               ;\
  PPC64_CLVS_RESTORE(n)                         ;\
Ldone##n:

#define PPC64_CLVSh(n)                           \
  andi.  0, 5, (1 PPC_LEFT_SHIFT(63-n))         ;\
  beq    Ldone##n                               ;\
  PPC64_CLVS_RESTORE(n)                         ;\
Ldone##n:

#else

#define PPC64_CLVSl(n) PPC64_CLVS_RESTORE(n)
#define PPC64_CLVSh(n) PPC64_CLVS_RESTORE(n)

#endif // !defined(_AIX)

  PPC64_CLVSl(32)
  PPC64_CLVSl(33)
  PPC64_CLVSl(34)
  PPC64_CLVSl(35)
  PPC64_CLVSl(36)
  PPC64_CLVSl(37)
  PPC64_CLVSl(38)
  PPC64_CLVSl(39)
  PPC64_CLVSl(40)
  PPC64_CLVSl(41)
  PPC64_CLVSl(42)
  PPC64_CLVSl(43)
  PPC64_CLVSl(44)
  PPC64_CLVSl(45)
  PPC64_CLVSl(46)
  PPC64_CLVSl(47)
  PPC64_CLVSh(48)
  PPC64_CLVSh(49)
  PPC64_CLVSh(50)
  PPC64_CLVSh(51)
  PPC64_CLVSh(52)
  PPC64_CLVSh(53)
  PPC64_CLVSh(54)
  PPC64_CLVSh(55)
  PPC64_CLVSh(56)
  PPC64_CLVSh(57)
  PPC64_CLVSh(58)
  PPC64_CLVSh(59)
  PPC64_CLVSh(60)
  PPC64_CLVSh(61)
  PPC64_CLVSh(62)
  PPC64_CLVSh(63)

#else

// load FP register
#define PPC64_LF(n) \
  lfd   n, (PPC64_OFFS_FP + n * 16)(3)

  // restore float registers
  PPC64_LF(0)
  PPC64_LF(1)
  PPC64_LF(2)
  PPC64_LF(3)
  PPC64_LF(4)
  PPC64_LF(5)
  PPC64_LF(6)
  PPC64_LF(7)
  PPC64_LF(8)
  PPC64_LF(9)
  PPC64_LF(10)
  PPC64_LF(11)
  PPC64_LF(12)
  PPC64_LF(13)
  PPC64_LF(14)
  PPC64_LF(15)
  PPC64_LF(16)
  PPC64_LF(17)
  PPC64_LF(18)
  PPC64_LF(19)
  PPC64_LF(20)
  PPC64_LF(21)
  PPC64_LF(22)
  PPC64_LF(23)
  PPC64_LF(24)
  PPC64_LF(25)
  PPC64_LF(26)
  PPC64_LF(27)
  PPC64_LF(28)
  PPC64_LF(29)
  PPC64_LF(30)
  PPC64_LF(31)

#if defined(__ALTIVEC__)

#define PPC64_CLV_UNALIGNED_RESTORE(n)       \
  ld     0, (PPC64_OFFS_V + n * 16)(3)      ;\
  std    0, 0(4)                            ;\
  ld     0, (PPC64_OFFS_V + n * 16 + 8)(3)  ;\
  std    0, 8(4)                            ;\
  lvx    n, 0, 4

#if !defined(_AIX)
  // restore vector registers if any are in use. In the AIX ABI, VRSAVE is
  // not used.
  ld    5, PPC64_OFFS_VRSAVE(3)   // test VRsave
  cmpwi 5, 0
  beq   Lnovec

#define PPC64_CLV_UNALIGNEDl(n)              \
  andis. 0, 5, (1 PPC_LEFT_SHIFT(15-n))     ;\
  beq    Ldone##n                           ;\
  PPC64_CLV_UNALIGNED_RESTORE(n)            ;\
Ldone  ## n:

#define PPC64_CLV_UNALIGNEDh(n)              \
  andi.  0, 5, (1 PPC_LEFT_SHIFT(31-n))     ;\
  beq    Ldone##n                           ;\
  PPC64_CLV_UNALIGNED_RESTORE(n)            ;\
Ldone  ## n:

#else

#define PPC64_CLV_UNALIGNEDl(n) PPC64_CLV_UNALIGNED_RESTORE(n)
#define PPC64_CLV_UNALIGNEDh(n) PPC64_CLV_UNALIGNED_RESTORE(n)

#endif // !defined(_AIX)

  subi  4, 1, 16
  // r4 is now a 16-byte aligned pointer into the red zone
  // the _vectorScalarRegisters may not be 16-byte aligned
  // so copy via red zone temp buffer

  PPC64_CLV_UNALIGNEDl(0)
  PPC64_CLV_UNALIGNEDl(1)
  PPC64_CLV_UNALIGNEDl(2)
  PPC64_CLV_UNALIGNEDl(3)
  PPC64_CLV_UNALIGNEDl(4)
  PPC64_CLV_UNALIGNEDl(5)
  PPC64_CLV_UNALIGNEDl(6)
  PPC64_CLV_UNALIGNEDl(7)
  PPC64_CLV_UNALIGNEDl(8)
  PPC64_CLV_UNALIGNEDl(9)
  PPC64_CLV_UNALIGNEDl(10)
  PPC64_CLV_UNALIGNEDl(11)
  PPC64_CLV_UNALIGNEDl(12)
  PPC64_CLV_UNALIGNEDl(13)
  PPC64_CLV_UNALIGNEDl(14)
  PPC64_CLV_UNALIGNEDl(15)
  PPC64_CLV_UNALIGNEDh(16)
  PPC64_CLV_UNALIGNEDh(17)
  PPC64_CLV_UNALIGNEDh(18)
  PPC64_CLV_UNALIGNEDh(19)
  PPC64_CLV_UNALIGNEDh(20)
  PPC64_CLV_UNALIGNEDh(21)
  PPC64_CLV_UNALIGNEDh(22)
  PPC64_CLV_UNALIGNEDh(23)
  PPC64_CLV_UNALIGNEDh(24)
  PPC64_CLV_UNALIGNEDh(25)
  PPC64_CLV_UNALIGNEDh(26)
  PPC64_CLV_UNALIGNEDh(27)
  PPC64_CLV_UNALIGNEDh(28)
  PPC64_CLV_UNALIGNEDh(29)
  PPC64_CLV_UNALIGNEDh(30)
  PPC64_CLV_UNALIGNEDh(31)

#endif
#endif

Lnovec:
  ld    0, PPC64_OFFS_CR(3)
  mtcr  0
  ld    0, PPC64_OFFS_SRR0(3)
  mtctr 0

#if defined(_AIX)
  // After setting GPR1 to a higher address, AIX wipes out the original
  // stack space below that address invalidated by the new GPR1 value. Use
  // GPR0 to save the value of GPR3 in the context before it is wiped out.
  // This compromises the content of GPR0 which is a volatile register.
  ld 0, (8 * (3 + 2))(3)
#else
  PPC64_LR(0)
#endif
  PPC64_LR(5)
  PPC64_LR(4)
  PPC64_LR(1)
#if defined(_AIX)
  mr 3, 0
#else
  PPC64_LR(3)
#endif
  bctr

#elif defined(__powerpc__)

DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
//
// void libunwind::Registers_ppc::jumpto()
//
// On entry:
//  thread_state pointer is in r3
//

  // restore integral registers
  // skip r0 for now
  // skip r1 for now
  lwz     2,  16(3)
  // skip r3 for now
  // skip r4 for now
  // skip r5 for now
  lwz     6,  32(3)
  lwz     7,  36(3)
  lwz     8,  40(3)
  lwz     9,  44(3)
  lwz     10, 48(3)
  lwz     11, 52(3)
  lwz     12, 56(3)
  lwz     13, 60(3)
  lwz     14, 64(3)
  lwz     15, 68(3)
  lwz     16, 72(3)
  lwz     17, 76(3)
  lwz     18, 80(3)
  lwz     19, 84(3)
  lwz     20, 88(3)
  lwz     21, 92(3)
  lwz     22, 96(3)
  lwz     23,100(3)
  lwz     24,104(3)
  lwz     25,108(3)
  lwz     26,112(3)
  lwz     27,116(3)
  lwz     28,120(3)
  lwz     29,124(3)
  lwz     30,128(3)
  lwz     31,132(3)

#ifndef __NO_FPRS__
  // restore float registers
  lfd     0, 160(3)
  lfd     1, 168(3)
  lfd     2, 176(3)
  lfd     3, 184(3)
  lfd     4, 192(3)
  lfd     5, 200(3)
  lfd     6, 208(3)
  lfd     7, 216(3)
  lfd     8, 224(3)
  lfd     9, 232(3)
  lfd     10,240(3)
  lfd     11,248(3)
  lfd     12,256(3)
  lfd     13,264(3)
  lfd     14,272(3)
  lfd     15,280(3)
  lfd     16,288(3)
  lfd     17,296(3)
  lfd     18,304(3)
  lfd     19,312(3)
  lfd     20,320(3)
  lfd     21,328(3)
  lfd     22,336(3)
  lfd     23,344(3)
  lfd     24,352(3)
  lfd     25,360(3)
  lfd     26,368(3)
  lfd     27,376(3)
  lfd     28,384(3)
  lfd     29,392(3)
  lfd     30,400(3)
  lfd     31,408(3)
#endif

#if defined(__ALTIVEC__)

#define LOAD_VECTOR_RESTORE(_index)                 \
  lwz     0, 424+_index*16(3)             SEPARATOR \
  stw     0, 0(4)                         SEPARATOR \
  lwz     0, 424+_index*16+4(3)           SEPARATOR \
  stw     0, 4(4)                         SEPARATOR \
  lwz     0, 424+_index*16+8(3)           SEPARATOR \
  stw     0, 8(4)                         SEPARATOR \
  lwz     0, 424+_index*16+12(3)          SEPARATOR \
  stw     0, 12(4)                        SEPARATOR \
  lvx     _index, 0, 4

#if !defined(_AIX)
  // restore vector registers if any are in use. In the AIX ABI, VRSAVE
  // is not used.
  lwz     5, 156(3)       // test VRsave
  cmpwi   5, 0
  beq     Lnovec

#define LOAD_VECTOR_UNALIGNEDl(_index)                   \
  andis.  0, 5, (1 PPC_LEFT_SHIFT(15-_index))  SEPARATOR \
  beq     Ldone ## _index                      SEPARATOR \
  LOAD_VECTOR_RESTORE(_index)                  SEPARATOR \
  Ldone ## _index:

#define LOAD_VECTOR_UNALIGNEDh(_index)                   \
  andi.   0, 5, (1 PPC_LEFT_SHIFT(31-_index))  SEPARATOR \
  beq     Ldone ## _index                      SEPARATOR \
  LOAD_VECTOR_RESTORE(_index)                  SEPARATOR \
  Ldone ## _index:

#else

#define LOAD_VECTOR_UNALIGNEDl(_index) LOAD_VECTOR_RESTORE(_index)
#define LOAD_VECTOR_UNALIGNEDh(_index) LOAD_VECTOR_RESTORE(_index)

#endif // !defined(_AIX)

  subi    4, 1, 16
  rlwinm  4, 4, 0, 0, 27  // mask low 4-bits
  // r4 is now a 16-byte aligned pointer into the red zone
  // the _vectorRegisters may not be 16-byte aligned so copy via red zone temp buffer

  LOAD_VECTOR_UNALIGNEDl(0)
  LOAD_VECTOR_UNALIGNEDl(1)
  LOAD_VECTOR_UNALIGNEDl(2)
  LOAD_VECTOR_UNALIGNEDl(3)
  LOAD_VECTOR_UNALIGNEDl(4)
  LOAD_VECTOR_UNALIGNEDl(5)
  LOAD_VECTOR_UNALIGNEDl(6)
  LOAD_VECTOR_UNALIGNEDl(7)
  LOAD_VECTOR_UNALIGNEDl(8)
  LOAD_VECTOR_UNALIGNEDl(9)
  LOAD_VECTOR_UNALIGNEDl(10)
  LOAD_VECTOR_UNALIGNEDl(11)
  LOAD_VECTOR_UNALIGNEDl(12)
  LOAD_VECTOR_UNALIGNEDl(13)
  LOAD_VECTOR_UNALIGNEDl(14)
  LOAD_VECTOR_UNALIGNEDl(15)
  LOAD_VECTOR_UNALIGNEDh(16)
  LOAD_VECTOR_UNALIGNEDh(17)
  LOAD_VECTOR_UNALIGNEDh(18)
  LOAD_VECTOR_UNALIGNEDh(19)
  LOAD_VECTOR_UNALIGNEDh(20)
  LOAD_VECTOR_UNALIGNEDh(21)
  LOAD_VECTOR_UNALIGNEDh(22)
  LOAD_VECTOR_UNALIGNEDh(23)
  LOAD_VECTOR_UNALIGNEDh(24)
  LOAD_VECTOR_UNALIGNEDh(25)
  LOAD_VECTOR_UNALIGNEDh(26)
  LOAD_VECTOR_UNALIGNEDh(27)
  LOAD_VECTOR_UNALIGNEDh(28)
  LOAD_VECTOR_UNALIGNEDh(29)
  LOAD_VECTOR_UNALIGNEDh(30)
  LOAD_VECTOR_UNALIGNEDh(31)
#endif

Lnovec:
  lwz     0, 136(3)   // __cr
  mtcr    0
  lwz     0, 148(3)   // __ctr
  mtctr   0
  lwz     0,   0(3)   // __ssr0
  mtctr   0
  lwz     0,   8(3)   // do r0 now
  lwz     5,  28(3)   // do r5 now
  lwz     4,  24(3)   // do r4 now
  lwz     1,  12(3)   // do sp now
  lwz     3,  20(3)   // do r3 last
  bctr

#elif defined(__aarch64__)

#if defined(__ARM_FEATURE_GCS_DEFAULT)
.arch_extension gcs
#endif

//
// extern "C" void __libunwind_Registers_arm64_jumpto(Registers_arm64 *);
//
// On entry:
//  thread_state pointer is in x0
//
  .p2align 2
DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto)
  // skip restore of x0,x1 for now
  ldp    x2, x3,  [x0, #0x010]
  ldp    x4, x5,  [x0, #0x020]
  ldp    x6, x7,  [x0, #0x030]
  ldp    x8, x9,  [x0, #0x040]
  ldp    x10,x11, [x0, #0x050]
  ldp    x12,x13, [x0, #0x060]
  ldp    x14,x15, [x0, #0x070]
  // x16 and x17 were clobbered by the call into the unwinder, so no point in
  // restoring them.
  ldp    x18,x19, [x0, #0x090]
  ldp    x20,x21, [x0, #0x0A0]
  ldp    x22,x23, [x0, #0x0B0]
  ldp    x24,x25, [x0, #0x0C0]
  ldp    x26,x27, [x0, #0x0D0]
  ldp    x28,x29, [x0, #0x0E0]
  ldr    x30,     [x0, #0x100]  // restore pc into lr
#if defined(__ARM_FP) && __ARM_FP != 0
  ldp    d0, d1,  [x0, #0x110]
  ldp    d2, d3,  [x0, #0x120]
  ldp    d4, d5,  [x0, #0x130]
  ldp    d6, d7,  [x0, #0x140]
  ldp    d8, d9,  [x0, #0x150]
  ldp    d10,d11, [x0, #0x160]
  ldp    d12,d13, [x0, #0x170]
  ldp    d14,d15, [x0, #0x180]
  ldp    d16,d17, [x0, #0x190]
  ldp    d18,d19, [x0, #0x1A0]
  ldp    d20,d21, [x0, #0x1B0]
  ldp    d22,d23, [x0, #0x1C0]
  ldp    d24,d25, [x0, #0x1D0]
  ldp    d26,d27, [x0, #0x1E0]
  ldp    d28,d29, [x0, #0x1F0]
  ldr    d30,     [x0, #0x200]
  ldr    d31,     [x0, #0x208]
#endif
  // Finally, restore sp. This must be done after the last read from the
  // context struct, because it is allocated on the stack, and an exception
  // could clobber the de-allocated portion of the stack after sp has been
  // restored.
  ldr    x16,     [x0, #0x0F8]
  ldp    x0, x1,  [x0, #0x000]  // restore x0,x1
  mov    sp,x16                 // restore sp
#if defined(__ARM_FEATURE_GCS_DEFAULT)
  // If GCS is enabled we need to push the address we're returning to onto the
  // GCS stack. We can't just return using br, as there won't be a BTI landing
  // pad instruction at the destination.
  mov      x16, #1
  chkfeat  x16
  cbnz     x16, Lnogcs
  gcspushm x30
Lnogcs:
#endif
  ret    x30                    // jump to pc

#elif defined(__arm__) && !defined(__APPLE__)

#if !defined(__ARM_ARCH_ISA_ARM)
#if (__ARM_ARCH_ISA_THUMB == 2)
  .syntax unified
#endif
  .thumb
#endif

@
@ void libunwind::Registers_arm::restoreCoreAndJumpTo()
@
@ On entry:
@  thread_state pointer is in r0
@
  .p2align 2
DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_arm20restoreCoreAndJumpToEv)
#if !defined(__ARM_ARCH_ISA_ARM) && __ARM_ARCH_ISA_THUMB == 1
  @ r8-r11: ldm into r1-r4, then mov to r8-r11
  adds r0, #0x20
  ldm r0!, {r1-r4}
  subs r0, #0x30
  mov r8, r1
  mov r9, r2
  mov r10, r3
  mov r11, r4
  @ r12 does not need loading, it it the intra-procedure-call scratch register
  ldr r2, [r0, #0x34]
  ldr r3, [r0, #0x3c]
  mov sp, r2
  mov lr, r3         @ restore pc into lr
  ldm r0, {r0-r7}
#else
  @ Use lr as base so that r0 can be restored.
  mov lr, r0
  @ 32bit thumb-2 restrictions for ldm:
  @ . the sp (r13) cannot be in the list
  @ . the pc (r15) and lr (r14) cannot both be in the list in an LDM instruction
  ldm lr, {r0-r12}
  ldr sp, [lr, #52]
  ldr lr, [lr, #60]  @ restore pc into lr
#endif
#if defined(__ARM_FEATURE_BTI_DEFAULT) && !defined(__ARM_ARCH_ISA_ARM)
  // 'bx' is not BTI setting when used with lr, therefore r12 is used instead
  mov r12, lr
  JMP(r12)
#else
  JMP(lr)
#endif

@
@ static void libunwind::Registers_arm::restoreVFPWithFLDMD(unw_fpreg_t* values)
@
@ On entry:
@  values pointer is in r0
@
  .p2align 2
#if defined(__ELF__)
  .fpu vfpv3-d16
#endif
DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_arm19restoreVFPWithFLDMDEPv)
  @ VFP and iwMMX instructions are only available when compiling with the flags
  @ that enable them. We do not want to do that in the library (because we do not
  @ want the compiler to generate instructions that access those) but this is
  @ only accessed if the personality routine needs these registers. Use of
  @ these registers implies they are, actually, available on the target, so
  @ it's ok to execute.
  @ So, generate the instruction using the corresponding coprocessor mnemonic.
  vldmia r0, {d0-d15}
  JMP(lr)

@
@ static void libunwind::Registers_arm::restoreVFPWithFLDMX(unw_fpreg_t* values)
@
@ On entry:
@  values pointer is in r0
@
  .p2align 2
#if defined(__ELF__)
  .fpu vfpv3-d16
#endif
DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_arm19restoreVFPWithFLDMXEPv)
  vldmia r0, {d0-d15} @ fldmiax is deprecated in ARMv7+ and now behaves like vldmia
  JMP(lr)

@
@ static void libunwind::Registers_arm::restoreVFPv3(unw_fpreg_t* values)
@
@ On entry:
@  values pointer is in r0
@
  .p2align 2
#if defined(__ELF__)
  .fpu vfpv3
#endif
DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_arm12restoreVFPv3EPv)
  vldmia r0, {d16-d31}
  JMP(lr)

#if defined(__ARM_WMMX)

@
@ static void libunwind::Registers_arm::restoreiWMMX(unw_fpreg_t* values)
@
@ On entry:
@  values pointer is in r0
@
  .p2align 2
#if defined(__ELF__)
  .arch armv5te
#endif
DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_arm12restoreiWMMXEPv)
  ldcl p1, cr0, [r0], #8  @ wldrd wR0, [r0], #8
  ldcl p1, cr1, [r0], #8  @ wldrd wR1, [r0], #8
  ldcl p1, cr2, [r0], #8  @ wldrd wR2, [r0], #8
  ldcl p1, cr3, [r0], #8  @ wldrd wR3, [r0], #8
  ldcl p1, cr4, [r0], #8  @ wldrd wR4, [r0], #8
  ldcl p1, cr5, [r0], #8  @ wldrd wR5, [r0], #8
  ldcl p1, cr6, [r0], #8  @ wldrd wR6, [r0], #8
  ldcl p1, cr7, [r0], #8  @ wldrd wR7, [r0], #8
  ldcl p1, cr8, [r0], #8  @ wldrd wR8, [r0], #8
  ldcl p1, cr9, [r0], #8  @ wldrd wR9, [r0], #8
  ldcl p1, cr10, [r0], #8  @ wldrd wR10, [r0], #8
  ldcl p1, cr11, [r0], #8  @ wldrd wR11, [r0], #8
  ldcl p1, cr12, [r0], #8  @ wldrd wR12, [r0], #8
  ldcl p1, cr13, [r0], #8  @ wldrd wR13, [r0], #8
  ldcl p1, cr14, [r0], #8  @ wldrd wR14, [r0], #8
  ldcl p1, cr15, [r0], #8  @ wldrd wR15, [r0], #8
  JMP(lr)

@
@ static void libunwind::Registers_arm::restoreiWMMXControl(unw_uint32_t* values)
@
@ On entry:
@  values pointer is in r0
@
  .p2align 2
#if defined(__ELF__)
  .arch armv5te
#endif
DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_arm19restoreiWMMXControlEPj)
  ldc2 p1, cr8, [r0], #4  @ wldrw wCGR0, [r0], #4
  ldc2 p1, cr9, [r0], #4  @ wldrw wCGR1, [r0], #4
  ldc2 p1, cr10, [r0], #4  @ wldrw wCGR2, [r0], #4
  ldc2 p1, cr11, [r0], #4  @ wldrw wCGR3, [r0], #4
  JMP(lr)

#endif

#elif defined(__or1k__)

DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind14Registers_or1k6jumptoEv)
#
# void libunwind::Registers_or1k::jumpto()
#
# On entry:
#  thread_state pointer is in r3
#

  # restore integral registers
  l.lwz     r0,  0(r3)
  l.lwz     r1,  4(r3)
  l.lwz     r2,  8(r3)
  # skip r3 for now
  l.lwz     r4, 16(r3)
  l.lwz     r5, 20(r3)
  l.lwz     r6, 24(r3)
  l.lwz     r7, 28(r3)
  l.lwz     r8, 32(r3)
  # skip r9
  l.lwz    r10, 40(r3)
  l.lwz    r11, 44(r3)
  l.lwz    r12, 48(r3)
  l.lwz    r13, 52(r3)
  l.lwz    r14, 56(r3)
  l.lwz    r15, 60(r3)
  l.lwz    r16, 64(r3)
  l.lwz    r17, 68(r3)
  l.lwz    r18, 72(r3)
  l.lwz    r19, 76(r3)
  l.lwz    r20, 80(r3)
  l.lwz    r21, 84(r3)
  l.lwz    r22, 88(r3)
  l.lwz    r23, 92(r3)
  l.lwz    r24, 96(r3)
  l.lwz    r25,100(r3)
  l.lwz    r26,104(r3)
  l.lwz    r27,108(r3)
  l.lwz    r28,112(r3)
  l.lwz    r29,116(r3)
  l.lwz    r30,120(r3)
  l.lwz    r31,124(r3)

  # load new pc into ra
  l.lwz    r9, 128(r3)

  # at last, restore r3
  l.lwz    r3,  12(r3)

  # jump to pc
  l.jr     r9
   l.nop

#elif defined(__hexagon__)
# On entry:
#  thread_state pointer is in r2
DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind17Registers_hexagon6jumptoEv)
#
# void libunwind::Registers_hexagon::jumpto()
#
  r8 = memw(r0+#32)
  r9 = memw(r0+#36)
  r10 = memw(r0+#40)
  r11 = memw(r0+#44)

  r12 = memw(r0+#48)
  r13 = memw(r0+#52)
  r14 = memw(r0+#56)
  r15 = memw(r0+#60)

  r16 = memw(r0+#64)
  r17 = memw(r0+#68)
  r18 = memw(r0+#72)
  r19 = memw(r0+#76)

  r20 = memw(r0+#80)
  r21 = memw(r0+#84)
  r22 = memw(r0+#88)
  r23 = memw(r0+#92)

  r24 = memw(r0+#96)
  r25 = memw(r0+#100)
  r26 = memw(r0+#104)
  r27 = memw(r0+#108)

  r28 = memw(r0+#112)
  r29 = memw(r0+#116)
  r30 = memw(r0+#120)
  r31 = memw(r0+#132)

  r1 = memw(r0+#128)
  c4 = r1   // Predicate register
  r1 = memw(r0+#4)
  r0 = memw(r0)
  jumpr r31
#elif defined(__mips__) && defined(_ABIO32) && _MIPS_SIM == _ABIO32

//
// void libunwind::Registers_mips_o32::jumpto()
//
// On entry:
//  thread state pointer is in a0 ($4)
//
DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind18Registers_mips_o326jumptoEv)
  .set push
  .set noat
  .set noreorder
  .set nomacro
#ifdef __mips_hard_float
#if __mips_fpr != 64
  ldc1  $f0, (4 * 36 + 8 * 0)($4)
  ldc1  $f2, (4 * 36 + 8 * 2)($4)
  ldc1  $f4, (4 * 36 + 8 * 4)($4)
  ldc1  $f6, (4 * 36 + 8 * 6)($4)
  ldc1  $f8, (4 * 36 + 8 * 8)($4)
  ldc1  $f10, (4 * 36 + 8 * 10)($4)
  ldc1  $f12, (4 * 36 + 8 * 12)($4)
  ldc1  $f14, (4 * 36 + 8 * 14)($4)
  ldc1  $f16, (4 * 36 + 8 * 16)($4)
  ldc1  $f18, (4 * 36 + 8 * 18)($4)
  ldc1  $f20, (4 * 36 + 8 * 20)($4)
  ldc1  $f22, (4 * 36 + 8 * 22)($4)
  ldc1  $f24, (4 * 36 + 8 * 24)($4)
  ldc1  $f26, (4 * 36 + 8 * 26)($4)
  ldc1  $f28, (4 * 36 + 8 * 28)($4)
  ldc1  $f30, (4 * 36 + 8 * 30)($4)
#else
  ldc1  $f0, (4 * 36 + 8 * 0)($4)
  ldc1  $f1, (4 * 36 + 8 * 1)($4)
  ldc1  $f2, (4 * 36 + 8 * 2)($4)
  ldc1  $f3, (4 * 36 + 8 * 3)($4)
  ldc1  $f4, (4 * 36 + 8 * 4)($4)
  ldc1  $f5, (4 * 36 + 8 * 5)($4)
  ldc1  $f6, (4 * 36 + 8 * 6)($4)
  ldc1  $f7, (4 * 36 + 8 * 7)($4)
  ldc1  $f8, (4 * 36 + 8 * 8)($4)
  ldc1  $f9, (4 * 36 + 8 * 9)($4)
  ldc1  $f10, (4 * 36 + 8 * 10)($4)
  ldc1  $f11, (4 * 36 + 8 * 11)($4)
  ldc1  $f12, (4 * 36 + 8 * 12)($4)
  ldc1  $f13, (4 * 36 + 8 * 13)($4)
  ldc1  $f14, (4 * 36 + 8 * 14)($4)
  ldc1  $f15, (4 * 36 + 8 * 15)($4)
  ldc1  $f16, (4 * 36 + 8 * 16)($4)
  ldc1  $f17, (4 * 36 + 8 * 17)($4)
  ldc1  $f18, (4 * 36 + 8 * 18)($4)
  ldc1  $f19, (4 * 36 + 8 * 19)($4)
  ldc1  $f20, (4 * 36 + 8 * 20)($4)
  ldc1  $f21, (4 * 36 + 8 * 21)($4)
  ldc1  $f22, (4 * 36 + 8 * 22)($4)
  ldc1  $f23, (4 * 36 + 8 * 23)($4)
  ldc1  $f24, (4 * 36 + 8 * 24)($4)
  ldc1  $f25, (4 * 36 + 8 * 25)($4)
  ldc1  $f26, (4 * 36 + 8 * 26)($4)
  ldc1  $f27, (4 * 36 + 8 * 27)($4)
  ldc1  $f28, (4 * 36 + 8 * 28)($4)
  ldc1  $f29, (4 * 36 + 8 * 29)($4)
  ldc1  $f30, (4 * 36 + 8 * 30)($4)
  ldc1  $f31, (4 * 36 + 8 * 31)($4)
#endif
#endif
#if __mips_isa_rev < 6
  // restore hi and lo
  lw    $8, (4 * 33)($4)
  mthi  $8
  lw    $8, (4 * 34)($4)
  mtlo  $8
#endif
  // r0 is zero
  lw    $1, (4 * 1)($4)
  lw    $2, (4 * 2)($4)
  lw    $3, (4 * 3)($4)
  // skip a0 for now
  lw    $5, (4 * 5)($4)
  lw    $6, (4 * 6)($4)
  lw    $7, (4 * 7)($4)
  lw    $8, (4 * 8)($4)
  lw    $9, (4 * 9)($4)
  lw    $10, (4 * 10)($4)
  lw    $11, (4 * 11)($4)
  lw    $12, (4 * 12)($4)
  lw    $13, (4 * 13)($4)
  lw    $14, (4 * 14)($4)
  lw    $15, (4 * 15)($4)
  lw    $16, (4 * 16)($4)
  lw    $17, (4 * 17)($4)
  lw    $18, (4 * 18)($4)
  lw    $19, (4 * 19)($4)
  lw    $20, (4 * 20)($4)
  lw    $21, (4 * 21)($4)
  lw    $22, (4 * 22)($4)
  lw    $23, (4 * 23)($4)
  lw    $24, (4 * 24)($4)
  lw    $25, (4 * 25)($4)
  lw    $26, (4 * 26)($4)
  lw    $27, (4 * 27)($4)
  lw    $28, (4 * 28)($4)
  lw    $29, (4 * 29)($4)
  // load new pc into ra
  lw    $31, (4 * 32)($4)
  // MIPS 1 has load delay slot. Ensure lw $31 and jr are separated by an instruction.
  lw    $30, (4 * 30)($4)
  // jump to ra, load a0 in the delay slot
  jr    $31
  lw    $4, (4 * 4)($4)
  .set pop

#elif defined(__mips64)

//
// void libunwind::Registers_mips_newabi::jumpto()
//
// On entry:
//  thread state pointer is in a0 ($4)
//
DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind21Registers_mips_newabi6jumptoEv)
  .set push
  .set noat
  .set noreorder
  .set nomacro
#ifdef __mips_hard_float
  .irp i,FROM_0_TO_31
    ldc1 $f\i, (280+8*\i)($4)
  .endr
#endif
#if __mips_isa_rev < 6
  // restore hi and lo
  ld    $8, (8 * 33)($4)
  mthi  $8
  ld    $8, (8 * 34)($4)
  mtlo  $8
#endif
  // r0 is zero
  ld    $1, (8 * 1)($4)
  ld    $2, (8 * 2)($4)
  ld    $3, (8 * 3)($4)
  // skip a0 for now
  .irp i,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
    ld $\i, (8 * \i)($4)
  .endr
  // load new pc into ra
  ld    $31, (8 * 32)($4)
  // MIPS 1 has load delay slot. Ensure lw $31 and jr are separated by an instruction.
  ld    $30, (8 * 30)($4)
  // jump to ra, load a0 in the delay slot
  jr    $31
  ld    $4, (8 * 4)($4)
  .set pop

#elif defined(__sparc__) && defined(__arch64__)

DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind17Registers_sparc646jumptoEv)
//
// void libunwind::Registers_sparc64::jumpto()
//
// On entry:
//  thread_state pointer is in %o0
//
  .register %g2, #scratch
  .register %g3, #scratch
  .register %g6, #scratch
  .register %g7, #scratch
  flushw
  ldx  [%o0 + 0x08], %g1
  ldx  [%o0 + 0x10], %g2
  ldx  [%o0 + 0x18], %g3
  ldx  [%o0 + 0x20], %g4
  ldx  [%o0 + 0x28], %g5
  ldx  [%o0 + 0x30], %g6
  ldx  [%o0 + 0x38], %g7
  ldx  [%o0 + 0x48], %o1
  ldx  [%o0 + 0x50], %o2
  ldx  [%o0 + 0x58], %o3
  ldx  [%o0 + 0x60], %o4
  ldx  [%o0 + 0x68], %o5
  ldx  [%o0 + 0x70], %o6
  ldx  [%o0 + 0x78], %o7
  ldx  [%o0 + 0x80], %l0
  ldx  [%o0 + 0x88], %l1
  ldx  [%o0 + 0x90], %l2
  ldx  [%o0 + 0x98], %l3
  ldx  [%o0 + 0xa0], %l4
  ldx  [%o0 + 0xa8], %l5
  ldx  [%o0 + 0xb0], %l6
  ldx  [%o0 + 0xb8], %l7
  ldx  [%o0 + 0xc0], %i0
  ldx  [%o0 + 0xc8], %i1
  ldx  [%o0 + 0xd0], %i2
  ldx  [%o0 + 0xd8], %i3
  ldx  [%o0 + 0xe0], %i4
  ldx  [%o0 + 0xe8], %i5
  ldx  [%o0 + 0xf0], %i6
  ldx  [%o0 + 0xf8], %i7
  jmp  %o7
   ldx [%o0 + 0x40], %o0

#elif defined(__sparc__)

//
// void libunwind::Registers_sparc_o32::jumpto()
//
// On entry:
//  thread_state pointer is in o0
//
DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind15Registers_sparc6jumptoEv)
  ta 3
  ldd [%o0 + 64],  %l0
  ldd [%o0 + 72],  %l2
  ldd [%o0 + 80],  %l4
  ldd [%o0 + 88],  %l6
  ldd [%o0 + 96],  %i0
  ldd [%o0 + 104], %i2
  ldd [%o0 + 112], %i4
  ldd [%o0 + 120], %i6
  ld  [%o0 + 60],  %o7
  jmp %o7
   nop

#elif defined(__riscv)

//
// void libunwind::Registers_riscv::jumpto()
//
// On entry:
//  thread_state pointer is in a0
//
  .p2align 2
DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind15Registers_riscv6jumptoEv)
# if defined(__riscv_flen)
  .irp i,FROM_0_TO_31
    FLOAD f\i, (RISCV_FOFFSET + RISCV_FSIZE * \i)(a0)
  .endr
# endif

  // x0 is zero
  ILOAD    x1, (RISCV_ISIZE * 0)(a0) // restore pc into ra
  .irp i,2,3,4,5,6,7,8,9
    ILOAD x\i, (RISCV_ISIZE * \i)(a0)
  .endr
  // skip a0 for now
#if defined(__riscv_32e)
  .irp i,11,12,13,14,15
#else
  .irp i,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
#endif
    ILOAD x\i, (RISCV_ISIZE * \i)(a0)
  .endr
  ILOAD    x10, (RISCV_ISIZE * 10)(a0)   // restore a0

  ret                       // jump to ra

#elif defined(__s390x__)

DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind15Registers_s390x6jumptoEv)
//
// void libunwind::Registers_s390x::jumpto()
//
// On entry:
//  thread_state pointer is in r2
//

  // Skip PSWM, but load PSWA into r1
  lg %r1, 8(%r2)

  // Restore FPRs
  .irp i,FROM_0_TO_15
    ld %f\i, (144+8*\i)(%r2)
  .endr

  // Restore GPRs - skipping %r0 and %r1
  lmg  %r2, %r15, 32(%r2)

  // Return to PSWA (was loaded into %r1 above)
  br %r1

#elif defined(__loongarch__) && __loongarch_grlen == 64

//
// void libunwind::Registers_loongarch::jumpto()
//
// On entry:
//  thread_state pointer is in $a0($r4)
//
  .p2align 2
DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind19Registers_loongarch6jumptoEv)
# if __loongarch_frlen == 64
  .irp i,FROM_0_TO_31
    fld.d $f\i, $a0, (8 * 33 + 8 * \i)
  .endr
# endif

  // $r0 is zero
  .irp i,1,2,3
    ld.d $r\i, $a0, (8 * \i)
  .endr
  // skip $a0 for now
  .irp i,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
    ld.d $r\i, $a0, (8 * \i)
  .endr

  ld.d    $ra,  $a0, (8 * 32)  // load new pc into $ra
  ld.d    $a0,  $a0, (8 * 4)   // restore $a0 last

  jr      $ra

#endif

#endif /* !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__wasm__) */

NO_EXEC_STACK_DIRECTIVE




=== system/lib/libunwind/src/UnwindRegistersSave.S ===
SHA256: b5fa5422491ad3465dee5452323c6fed0e3a61a5508e915fb38b7fc2aeb23b03
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "assembly.h"

#define FROM_0_TO_15 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
#define FROM_16_TO_31 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31

#define FROM_0_TO_31 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
#define FROM_32_TO_63 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

#if defined(_AIX)
    .toc
#else
    .text
#endif

#if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__wasm__)

#if defined(__i386__)

#
# extern int __unw_getcontext(unw_context_t* thread_state)
#
# On entry:
#   +                       +
#   +-----------------------+
#   + thread_state pointer  +
#   +-----------------------+
#   + return address        +
#   +-----------------------+   <-- SP
#   +                       +
#
DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)

  _LIBUNWIND_CET_ENDBR
  push  %eax
  movl  8(%esp), %eax
  movl  %ebx,  4(%eax)
  movl  %ecx,  8(%eax)
  movl  %edx, 12(%eax)
  movl  %edi, 16(%eax)
  movl  %esi, 20(%eax)
  movl  %ebp, 24(%eax)
  movl  %esp, %edx
  addl  $8, %edx
  movl  %edx, 28(%eax)  # store what sp was at call site as esp
  # skip ss
  # skip eflags
  movl  4(%esp), %edx
  movl  %edx, 40(%eax)  # store return address as eip
  # skip cs
  # skip ds
  # skip es
  # skip fs
  # skip gs
  movl  (%esp), %edx
  movl  %edx, (%eax)  # store original eax
  popl  %eax
  xorl  %eax, %eax    # return UNW_ESUCCESS
  ret

#elif defined(__arm64ec__)

//
// extern int __unw_getcontext(unw_context_t* thread_state)
//
// On entry:
//  thread_state pointer is in x0
//
  .section .text,"xr",discard,"#__unw_getcontext"
  .p2align 2
DEFINE_LIBUNWIND_FUNCTION("#__unw_getcontext")
  stp    x8, x27, [x0, #0x000]  // rax, rbx
  stp    x0, x1,  [x0, #0x010]  // rcx, rdx
  stp    x26,x25, [x0, #0x020]  // rdi, rsi
  mov    x1, sp
  stp    fp, x1,  [x0, #0x030]  // rbp, rsp
  stp    x2, x3,  [x0, #0x040]  // r8,  r9
  stp    x4, x5,  [x0, #0x050]  // r10, r11
  stp    x19,x20, [x0, #0x060]  // r12, r13
  stp    x21,x22, [x0, #0x070]  // r14, r15
  str    x30,     [x0, #0x080]  // store return address as pc
  stp    q0, q1,  [x0, #0x0b0]  // xmm0, xmm1
  stp    q2, q3,  [x0, #0x0d0]  // xmm2, xmm3
  stp    q4, q5,  [x0, #0x0f0]  // xmm4, xmm5
  stp    q6, q7,  [x0, #0x110]  // xmm6, xmm7
  stp    q8, q9,  [x0, #0x130]  // xmm8, xmm9
  stp    q10,q11, [x0, #0x150]  // xmm10,xmm11
  stp    q12,q13, [x0, #0x170]  // xmm12,xmm13
  stp    q14,q15, [x0, #0x190]  // xmm14,xmm15
  mov    x0, #0                 // return UNW_ESUCCESS
  ret

  .weak_anti_dep __unw_getcontext
  .set __unw_getcontext, "#__unw_getcontext"

  .section .hybmp$x,"yi"
  .symidx "#__unw_getcontext"
  .symidx $ientry_thunk$cdecl$i8$i8
  .word 1
  .text

#elif defined(__x86_64__)

#
# extern int __unw_getcontext(unw_context_t* thread_state)
#
# On entry:
#  thread_state pointer is in rdi
#
DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
#if defined(_WIN64)
#define PTR %rcx
#define TMP %rdx
#else
#define PTR %rdi
#define TMP %rsi
#endif

  _LIBUNWIND_CET_ENDBR
  movq  %rax,   (PTR)
  movq  %rbx,  8(PTR)
  movq  %rcx, 16(PTR)
  movq  %rdx, 24(PTR)
  movq  %rdi, 32(PTR)
  movq  %rsi, 40(PTR)
  movq  %rbp, 48(PTR)
  movq  %rsp, 56(PTR)
  addq  $8,   56(PTR)
  movq  %r8,  64(PTR)
  movq  %r9,  72(PTR)
  movq  %r10, 80(PTR)
  movq  %r11, 88(PTR)
  movq  %r12, 96(PTR)
  movq  %r13,104(PTR)
  movq  %r14,112(PTR)
  movq  %r15,120(PTR)
  movq  (%rsp),TMP
  movq  TMP,128(PTR) # store return address as rip
  # skip rflags
  # skip cs
  # skip fs
  # skip gs

#if defined(_WIN64)
  movdqu %xmm0,176(PTR)
  movdqu %xmm1,192(PTR)
  movdqu %xmm2,208(PTR)
  movdqu %xmm3,224(PTR)
  movdqu %xmm4,240(PTR)
  movdqu %xmm5,256(PTR)
  movdqu %xmm6,272(PTR)
  movdqu %xmm7,288(PTR)
  movdqu %xmm8,304(PTR)
  movdqu %xmm9,320(PTR)
  movdqu %xmm10,336(PTR)
  movdqu %xmm11,352(PTR)
  movdqu %xmm12,368(PTR)
  movdqu %xmm13,384(PTR)
  movdqu %xmm14,400(PTR)
  movdqu %xmm15,416(PTR)
#endif
  xorl  %eax, %eax    # return UNW_ESUCCESS
  ret

#elif defined(__mips__) && defined(_ABIO32) && _MIPS_SIM == _ABIO32

#
# extern int __unw_getcontext(unw_context_t* thread_state)
#
# On entry:
#  thread_state pointer is in a0 ($4)
#
DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
  .set push
  .set noat
  .set noreorder
  .set nomacro
  sw    $1, (4 * 1)($4)
  sw    $2, (4 * 2)($4)
  sw    $3, (4 * 3)($4)
  sw    $4, (4 * 4)($4)
  sw    $5, (4 * 5)($4)
  sw    $6, (4 * 6)($4)
  sw    $7, (4 * 7)($4)
  sw    $8, (4 * 8)($4)
  sw    $9, (4 * 9)($4)
  sw    $10, (4 * 10)($4)
  sw    $11, (4 * 11)($4)
  sw    $12, (4 * 12)($4)
  sw    $13, (4 * 13)($4)
  sw    $14, (4 * 14)($4)
  sw    $15, (4 * 15)($4)
  sw    $16, (4 * 16)($4)
  sw    $17, (4 * 17)($4)
  sw    $18, (4 * 18)($4)
  sw    $19, (4 * 19)($4)
  sw    $20, (4 * 20)($4)
  sw    $21, (4 * 21)($4)
  sw    $22, (4 * 22)($4)
  sw    $23, (4 * 23)($4)
  sw    $24, (4 * 24)($4)
  sw    $25, (4 * 25)($4)
  sw    $26, (4 * 26)($4)
  sw    $27, (4 * 27)($4)
  sw    $28, (4 * 28)($4)
  sw    $29, (4 * 29)($4)
  sw    $30, (4 * 30)($4)
  sw    $31, (4 * 31)($4)
  # Store return address to pc
  sw    $31, (4 * 32)($4)
#if __mips_isa_rev < 6
  # hi and lo
  mfhi  $8
  sw    $8,  (4 * 33)($4)
  mflo  $8
  sw    $8,  (4 * 34)($4)
#endif
#ifdef __mips_hard_float
#if __mips_fpr != 64
  sdc1  $f0, (4 * 36 + 8 * 0)($4)
  sdc1  $f2, (4 * 36 + 8 * 2)($4)
  sdc1  $f4, (4 * 36 + 8 * 4)($4)
  sdc1  $f6, (4 * 36 + 8 * 6)($4)
  sdc1  $f8, (4 * 36 + 8 * 8)($4)
  sdc1  $f10, (4 * 36 + 8 * 10)($4)
  sdc1  $f12, (4 * 36 + 8 * 12)($4)
  sdc1  $f14, (4 * 36 + 8 * 14)($4)
  sdc1  $f16, (4 * 36 + 8 * 16)($4)
  sdc1  $f18, (4 * 36 + 8 * 18)($4)
  sdc1  $f20, (4 * 36 + 8 * 20)($4)
  sdc1  $f22, (4 * 36 + 8 * 22)($4)
  sdc1  $f24, (4 * 36 + 8 * 24)($4)
  sdc1  $f26, (4 * 36 + 8 * 26)($4)
  sdc1  $f28, (4 * 36 + 8 * 28)($4)
  sdc1  $f30, (4 * 36 + 8 * 30)($4)
#else
  sdc1  $f0, (4 * 36 + 8 * 0)($4)
  sdc1  $f1, (4 * 36 + 8 * 1)($4)
  sdc1  $f2, (4 * 36 + 8 * 2)($4)
  sdc1  $f3, (4 * 36 + 8 * 3)($4)
  sdc1  $f4, (4 * 36 + 8 * 4)($4)
  sdc1  $f5, (4 * 36 + 8 * 5)($4)
  sdc1  $f6, (4 * 36 + 8 * 6)($4)
  sdc1  $f7, (4 * 36 + 8 * 7)($4)
  sdc1  $f8, (4 * 36 + 8 * 8)($4)
  sdc1  $f9, (4 * 36 + 8 * 9)($4)
  sdc1  $f10, (4 * 36 + 8 * 10)($4)
  sdc1  $f11, (4 * 36 + 8 * 11)($4)
  sdc1  $f12, (4 * 36 + 8 * 12)($4)
  sdc1  $f13, (4 * 36 + 8 * 13)($4)
  sdc1  $f14, (4 * 36 + 8 * 14)($4)
  sdc1  $f15, (4 * 36 + 8 * 15)($4)
  sdc1  $f16, (4 * 36 + 8 * 16)($4)
  sdc1  $f17, (4 * 36 + 8 * 17)($4)
  sdc1  $f18, (4 * 36 + 8 * 18)($4)
  sdc1  $f19, (4 * 36 + 8 * 19)($4)
  sdc1  $f20, (4 * 36 + 8 * 20)($4)
  sdc1  $f21, (4 * 36 + 8 * 21)($4)
  sdc1  $f22, (4 * 36 + 8 * 22)($4)
  sdc1  $f23, (4 * 36 + 8 * 23)($4)
  sdc1  $f24, (4 * 36 + 8 * 24)($4)
  sdc1  $f25, (4 * 36 + 8 * 25)($4)
  sdc1  $f26, (4 * 36 + 8 * 26)($4)
  sdc1  $f27, (4 * 36 + 8 * 27)($4)
  sdc1  $f28, (4 * 36 + 8 * 28)($4)
  sdc1  $f29, (4 * 36 + 8 * 29)($4)
  sdc1  $f30, (4 * 36 + 8 * 30)($4)
  sdc1  $f31, (4 * 36 + 8 * 31)($4)
#endif
#endif
  jr	$31
  # return UNW_ESUCCESS
  or    $2, $0, $0
  .set pop

#elif defined(__mips64)

#
# extern int __unw_getcontext(unw_context_t* thread_state)
#
# On entry:
#  thread_state pointer is in a0 ($4)
#
DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
  .set push
  .set noat
  .set noreorder
  .set nomacro
  .irp i,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
    sd $\i, (8 * \i)($4)
  .endr
  # Store return address to pc
  sd    $31, (8 * 32)($4)
#if __mips_isa_rev < 6
  # hi and lo
  mfhi  $8
  sd    $8,  (8 * 33)($4)
  mflo  $8
  sd    $8,  (8 * 34)($4)
#endif
#ifdef __mips_hard_float
  .irp i,FROM_0_TO_31
    sdc1 $f\i, (280+8*\i)($4)
  .endr
#endif
  jr	$31
  # return UNW_ESUCCESS
  or    $2, $0, $0
  .set pop

# elif defined(__mips__)

#
# extern int __unw_getcontext(unw_context_t* thread_state)
#
# Just trap for the time being.
DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
  teq $0, $0

#elif defined(__powerpc64__)

//
// extern int __unw_getcontext(unw_context_t* thread_state)
//
// On entry:
//  thread_state pointer is in r3
//
#if defined(_AIX)
DEFINE_LIBUNWIND_FUNCTION_AND_WEAK_ALIAS(__unw_getcontext, unw_getcontext)
#else
DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
#endif
// store register (GPR)
#define PPC64_STR(n) \
  std   n, (8 * (n + 2))(3)

  // save GPRs
  PPC64_STR(0)
  mflr  0
  std   0, PPC64_OFFS_SRR0(3) // store lr as ssr0
  PPC64_STR(1)
  PPC64_STR(4)        // Save r4 first since it will be used for fixing r2.
#if defined(_AIX)
  // The TOC register (r2) was changed by the glue code if unw_getcontext
  // is called from a different module. Save the original TOC register
  // in the context if this is the case.
  mflr   4
  lwz    4, 0(4)      // Get the first instruction at the return address.
  xoris  0, 4, 0xe841 // Is it reloading the TOC register "ld 2,40(1)"?
  cmplwi 0, 0x28
  bne    0, LnoR2Fix  // No need to fix up r2 if it is not.
  ld     2, 40(1)     // Use the saved TOC register in the stack.
LnoR2Fix:
#endif
  PPC64_STR(2)
  PPC64_STR(3)
  PPC64_STR(5)
  PPC64_STR(6)
  PPC64_STR(7)
  PPC64_STR(8)
  PPC64_STR(9)
  PPC64_STR(10)
  PPC64_STR(11)
  PPC64_STR(12)
  PPC64_STR(13)
  PPC64_STR(14)
  PPC64_STR(15)
  PPC64_STR(16)
  PPC64_STR(17)
  PPC64_STR(18)
  PPC64_STR(19)
  PPC64_STR(20)
  PPC64_STR(21)
  PPC64_STR(22)
  PPC64_STR(23)
  PPC64_STR(24)
  PPC64_STR(25)
  PPC64_STR(26)
  PPC64_STR(27)
  PPC64_STR(28)
  PPC64_STR(29)
  PPC64_STR(30)
  PPC64_STR(31)

  mfcr  0
  std   0,  PPC64_OFFS_CR(3)
  mfxer 0
  std   0,  PPC64_OFFS_XER(3)
#if defined(_AIX)
  // LR value saved from the register is not used, initialize it to 0.
  li    0,  0
#else
  mflr  0
#endif
  std   0,  PPC64_OFFS_LR(3)
  mfctr 0
  std   0,  PPC64_OFFS_CTR(3)
  mfvrsave    0
  std   0,  PPC64_OFFS_VRSAVE(3)

#if defined(__VSX__)
  // save VS registers
  // (note that this also saves floating point registers and V registers,
  // because part of VS is mapped to these registers)

  addi  4, 3, PPC64_OFFS_FP

// store VS register
#ifdef __LITTLE_ENDIAN__
// For little-endian targets, we need a swap since stxvd2x will store the
// register in the incorrect doubleword order.
// FIXME: when supporting targets older than Power9 on LE is no longer required
//        this can be changed to simply `stxv n, 16 * n(4)`.
#define PPC64_STVS(n)      \
  xxswapd n, n            ;\
  stxvd2x n, 0, 4         ;\
  addi    4, 4, 16
#else
#define PPC64_STVS(n)      \
  stxvd2x n, 0, 4         ;\
  addi    4, 4, 16
#endif

  PPC64_STVS(0)
  PPC64_STVS(1)
  PPC64_STVS(2)
  PPC64_STVS(3)
  PPC64_STVS(4)
  PPC64_STVS(5)
  PPC64_STVS(6)
  PPC64_STVS(7)
  PPC64_STVS(8)
  PPC64_STVS(9)
  PPC64_STVS(10)
  PPC64_STVS(11)
  PPC64_STVS(12)
  PPC64_STVS(13)
  PPC64_STVS(14)
  PPC64_STVS(15)
  PPC64_STVS(16)
  PPC64_STVS(17)
  PPC64_STVS(18)
  PPC64_STVS(19)
  PPC64_STVS(20)
  PPC64_STVS(21)
  PPC64_STVS(22)
  PPC64_STVS(23)
  PPC64_STVS(24)
  PPC64_STVS(25)
  PPC64_STVS(26)
  PPC64_STVS(27)
  PPC64_STVS(28)
  PPC64_STVS(29)
  PPC64_STVS(30)
  PPC64_STVS(31)
  PPC64_STVS(32)
  PPC64_STVS(33)
  PPC64_STVS(34)
  PPC64_STVS(35)
  PPC64_STVS(36)
  PPC64_STVS(37)
  PPC64_STVS(38)
  PPC64_STVS(39)
  PPC64_STVS(40)
  PPC64_STVS(41)
  PPC64_STVS(42)
  PPC64_STVS(43)
  PPC64_STVS(44)
  PPC64_STVS(45)
  PPC64_STVS(46)
  PPC64_STVS(47)
  PPC64_STVS(48)
  PPC64_STVS(49)
  PPC64_STVS(50)
  PPC64_STVS(51)
  PPC64_STVS(52)
  PPC64_STVS(53)
  PPC64_STVS(54)
  PPC64_STVS(55)
  PPC64_STVS(56)
  PPC64_STVS(57)
  PPC64_STVS(58)
  PPC64_STVS(59)
  PPC64_STVS(60)
  PPC64_STVS(61)
  PPC64_STVS(62)
  PPC64_STVS(63)

#else

// store FP register
#define PPC64_STF(n) \
  stfd  n, (PPC64_OFFS_FP + n * 16)(3)

  // save float registers
  PPC64_STF(0)
  PPC64_STF(1)
  PPC64_STF(2)
  PPC64_STF(3)
  PPC64_STF(4)
  PPC64_STF(5)
  PPC64_STF(6)
  PPC64_STF(7)
  PPC64_STF(8)
  PPC64_STF(9)
  PPC64_STF(10)
  PPC64_STF(11)
  PPC64_STF(12)
  PPC64_STF(13)
  PPC64_STF(14)
  PPC64_STF(15)
  PPC64_STF(16)
  PPC64_STF(17)
  PPC64_STF(18)
  PPC64_STF(19)
  PPC64_STF(20)
  PPC64_STF(21)
  PPC64_STF(22)
  PPC64_STF(23)
  PPC64_STF(24)
  PPC64_STF(25)
  PPC64_STF(26)
  PPC64_STF(27)
  PPC64_STF(28)
  PPC64_STF(29)
  PPC64_STF(30)
  PPC64_STF(31)

#if defined(__ALTIVEC__)
  // save vector registers

  // Use 16-bytes below the stack pointer as an
  // aligned buffer to save each vector register.
  // Note that the stack pointer is always 16-byte aligned.
  subi  4, 1, 16

#define PPC64_STV_UNALIGNED(n)             \
  stvx  n, 0, 4                           ;\
  ld    5, 0(4)                           ;\
  std   5, (PPC64_OFFS_V + n * 16)(3)     ;\
  ld    5, 8(4)                           ;\
  std   5, (PPC64_OFFS_V + n * 16 + 8)(3)

  PPC64_STV_UNALIGNED(0)
  PPC64_STV_UNALIGNED(1)
  PPC64_STV_UNALIGNED(2)
  PPC64_STV_UNALIGNED(3)
  PPC64_STV_UNALIGNED(4)
  PPC64_STV_UNALIGNED(5)
  PPC64_STV_UNALIGNED(6)
  PPC64_STV_UNALIGNED(7)
  PPC64_STV_UNALIGNED(8)
  PPC64_STV_UNALIGNED(9)
  PPC64_STV_UNALIGNED(10)
  PPC64_STV_UNALIGNED(11)
  PPC64_STV_UNALIGNED(12)
  PPC64_STV_UNALIGNED(13)
  PPC64_STV_UNALIGNED(14)
  PPC64_STV_UNALIGNED(15)
  PPC64_STV_UNALIGNED(16)
  PPC64_STV_UNALIGNED(17)
  PPC64_STV_UNALIGNED(18)
  PPC64_STV_UNALIGNED(19)
  PPC64_STV_UNALIGNED(20)
  PPC64_STV_UNALIGNED(21)
  PPC64_STV_UNALIGNED(22)
  PPC64_STV_UNALIGNED(23)
  PPC64_STV_UNALIGNED(24)
  PPC64_STV_UNALIGNED(25)
  PPC64_STV_UNALIGNED(26)
  PPC64_STV_UNALIGNED(27)
  PPC64_STV_UNALIGNED(28)
  PPC64_STV_UNALIGNED(29)
  PPC64_STV_UNALIGNED(30)
  PPC64_STV_UNALIGNED(31)

#endif
#endif

  li    3,  0   // return UNW_ESUCCESS
  blr


#elif defined(__powerpc__)

//
// extern int unw_getcontext(unw_context_t* thread_state)
//
// On entry:
//  thread_state pointer is in r3
//
#if defined(_AIX)
DEFINE_LIBUNWIND_FUNCTION_AND_WEAK_ALIAS(__unw_getcontext, unw_getcontext)
#else
DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
#endif
  stw     0,   8(3)
  mflr    0
  stw     0,   0(3) // store lr as ssr0
  stw     1,  12(3)
  stw     4,  24(3) // Save r4 first since it will be used for fixing r2.
#if defined(_AIX)
  // The TOC register (r2) was changed by the glue code if unw_getcontext
  // is called from a different module. Save the original TOC register
  // in the context if this is the case.
  mflr    4
  lwz     4,  0(4)      // Get the instruction at the return address.
  xoris   0,  4, 0x8041 // Is it reloading the TOC register "lwz 2,20(1)"?
  cmplwi  0,  0x14
  bne     0,  LnoR2Fix  // No need to fix up r2 if it is not.
  lwz     2,  20(1)     // Use the saved TOC register in the stack.
LnoR2Fix:
#endif
  stw     2,  16(3)
  stw     3,  20(3)
  stw     5,  28(3)
  stw     6,  32(3)
  stw     7,  36(3)
  stw     8,  40(3)
  stw     9,  44(3)
  stw     10, 48(3)
  stw     11, 52(3)
  stw     12, 56(3)
  stw     13, 60(3)
  stw     14, 64(3)
  stw     15, 68(3)
  stw     16, 72(3)
  stw     17, 76(3)
  stw     18, 80(3)
  stw     19, 84(3)
  stw     20, 88(3)
  stw     21, 92(3)
  stw     22, 96(3)
  stw     23,100(3)
  stw     24,104(3)
  stw     25,108(3)
  stw     26,112(3)
  stw     27,116(3)
  stw     28,120(3)
  stw     29,124(3)
  stw     30,128(3)
  stw     31,132(3)

#if defined(__ALTIVEC__)
  // save VRSave register
  mfspr   0, 256
  stw     0, 156(3)
#endif
  // save CR registers
  mfcr    0
  stw     0, 136(3)
#if defined(_AIX)
  // LR value from the register is not used, initialize it to 0.
  li      0, 0
  stw     0, 144(3)
#endif
  // save CTR register
  mfctr   0
  stw     0, 148(3)

#if !defined(__NO_FPRS__)
  // save float registers
  stfd    0, 160(3)
  stfd    1, 168(3)
  stfd    2, 176(3)
  stfd    3, 184(3)
  stfd    4, 192(3)
  stfd    5, 200(3)
  stfd    6, 208(3)
  stfd    7, 216(3)
  stfd    8, 224(3)
  stfd    9, 232(3)
  stfd    10,240(3)
  stfd    11,248(3)
  stfd    12,256(3)
  stfd    13,264(3)
  stfd    14,272(3)
  stfd    15,280(3)
  stfd    16,288(3)
  stfd    17,296(3)
  stfd    18,304(3)
  stfd    19,312(3)
  stfd    20,320(3)
  stfd    21,328(3)
  stfd    22,336(3)
  stfd    23,344(3)
  stfd    24,352(3)
  stfd    25,360(3)
  stfd    26,368(3)
  stfd    27,376(3)
  stfd    28,384(3)
  stfd    29,392(3)
  stfd    30,400(3)
  stfd    31,408(3)
#endif

#if defined(__ALTIVEC__)
  // save vector registers

  subi    4, 1, 16
  rlwinm  4, 4, 0, 0, 27  // mask low 4-bits
  // r4 is now a 16-byte aligned pointer into the red zone

#define SAVE_VECTOR_UNALIGNED(_vec, _offset) \
  stvx    _vec, 0, 4               SEPARATOR \
  lwz     5, 0(4)                  SEPARATOR \
  stw     5, _offset(3)            SEPARATOR \
  lwz     5, 4(4)                  SEPARATOR \
  stw     5, _offset+4(3)          SEPARATOR \
  lwz     5, 8(4)                  SEPARATOR \
  stw     5, _offset+8(3)          SEPARATOR \
  lwz     5, 12(4)                 SEPARATOR \
  stw     5, _offset+12(3)

  SAVE_VECTOR_UNALIGNED( 0, 424+0x000)
  SAVE_VECTOR_UNALIGNED( 1, 424+0x010)
  SAVE_VECTOR_UNALIGNED( 2, 424+0x020)
  SAVE_VECTOR_UNALIGNED( 3, 424+0x030)
  SAVE_VECTOR_UNALIGNED( 4, 424+0x040)
  SAVE_VECTOR_UNALIGNED( 5, 424+0x050)
  SAVE_VECTOR_UNALIGNED( 6, 424+0x060)
  SAVE_VECTOR_UNALIGNED( 7, 424+0x070)
  SAVE_VECTOR_UNALIGNED( 8, 424+0x080)
  SAVE_VECTOR_UNALIGNED( 9, 424+0x090)
  SAVE_VECTOR_UNALIGNED(10, 424+0x0A0)
  SAVE_VECTOR_UNALIGNED(11, 424+0x0B0)
  SAVE_VECTOR_UNALIGNED(12, 424+0x0C0)
  SAVE_VECTOR_UNALIGNED(13, 424+0x0D0)
  SAVE_VECTOR_UNALIGNED(14, 424+0x0E0)
  SAVE_VECTOR_UNALIGNED(15, 424+0x0F0)
  SAVE_VECTOR_UNALIGNED(16, 424+0x100)
  SAVE_VECTOR_UNALIGNED(17, 424+0x110)
  SAVE_VECTOR_UNALIGNED(18, 424+0x120)
  SAVE_VECTOR_UNALIGNED(19, 424+0x130)
  SAVE_VECTOR_UNALIGNED(20, 424+0x140)
  SAVE_VECTOR_UNALIGNED(21, 424+0x150)
  SAVE_VECTOR_UNALIGNED(22, 424+0x160)
  SAVE_VECTOR_UNALIGNED(23, 424+0x170)
  SAVE_VECTOR_UNALIGNED(24, 424+0x180)
  SAVE_VECTOR_UNALIGNED(25, 424+0x190)
  SAVE_VECTOR_UNALIGNED(26, 424+0x1A0)
  SAVE_VECTOR_UNALIGNED(27, 424+0x1B0)
  SAVE_VECTOR_UNALIGNED(28, 424+0x1C0)
  SAVE_VECTOR_UNALIGNED(29, 424+0x1D0)
  SAVE_VECTOR_UNALIGNED(30, 424+0x1E0)
  SAVE_VECTOR_UNALIGNED(31, 424+0x1F0)
#endif

  li      3, 0  // return UNW_ESUCCESS
  blr


#elif defined(__aarch64__)

//
// extern int __unw_getcontext(unw_context_t* thread_state)
//
// On entry:
//  thread_state pointer is in x0
//
  .p2align 2
DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
  stp    x0, x1,  [x0, #0x000]
  stp    x2, x3,  [x0, #0x010]
  stp    x4, x5,  [x0, #0x020]
  stp    x6, x7,  [x0, #0x030]
  stp    x8, x9,  [x0, #0x040]
  stp    x10,x11, [x0, #0x050]
  stp    x12,x13, [x0, #0x060]
  stp    x14,x15, [x0, #0x070]
  stp    x16,x17, [x0, #0x080]
  stp    x18,x19, [x0, #0x090]
  stp    x20,x21, [x0, #0x0A0]
  stp    x22,x23, [x0, #0x0B0]
  stp    x24,x25, [x0, #0x0C0]
  stp    x26,x27, [x0, #0x0D0]
  stp    x28,x29, [x0, #0x0E0]
  str    x30,     [x0, #0x0F0]
  mov    x1,sp
  str    x1,      [x0, #0x0F8]
  str    x30,     [x0, #0x100]    // store return address as pc
  // skip cpsr
#if defined(__ARM_FP) && __ARM_FP != 0
  stp    d0, d1,  [x0, #0x110]
  stp    d2, d3,  [x0, #0x120]
  stp    d4, d5,  [x0, #0x130]
  stp    d6, d7,  [x0, #0x140]
  stp    d8, d9,  [x0, #0x150]
  stp    d10,d11, [x0, #0x160]
  stp    d12,d13, [x0, #0x170]
  stp    d14,d15, [x0, #0x180]
  stp    d16,d17, [x0, #0x190]
  stp    d18,d19, [x0, #0x1A0]
  stp    d20,d21, [x0, #0x1B0]
  stp    d22,d23, [x0, #0x1C0]
  stp    d24,d25, [x0, #0x1D0]
  stp    d26,d27, [x0, #0x1E0]
  stp    d28,d29, [x0, #0x1F0]
  str    d30,     [x0, #0x200]
  str    d31,     [x0, #0x208]
#endif
  mov    x0, #0                   // return UNW_ESUCCESS
  ret

#elif defined(__arm__) && !defined(__APPLE__)

#if !defined(__ARM_ARCH_ISA_ARM)
#if (__ARM_ARCH_ISA_THUMB == 2)
  .syntax unified
#endif
  .thumb
#endif

@
@ extern int __unw_getcontext(unw_context_t* thread_state)
@
@ On entry:
@  thread_state pointer is in r0
@
@ Per EHABI #4.7 this only saves the core integer registers.
@ EHABI #7.4.5 notes that in general all VRS registers should be restored
@ however this is very hard to do for VFP registers because it is unknown
@ to the library how many registers are implemented by the architecture.
@ Instead, VFP registers are demand saved by logic external to __unw_getcontext.
@
  .p2align 2
DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
#if !defined(__ARM_ARCH_ISA_ARM) && __ARM_ARCH_ISA_THUMB == 1
  stm r0!, {r0-r7}
  mov r1, r8
  mov r2, r9
  mov r3, r10
  stm r0!, {r1-r3}
  mov r1, r11
  mov r2, sp
  mov r3, lr
  str r1, [r0, #0]   @ r11
  @ r12 does not need storing, it it the intra-procedure-call scratch register
  str r2, [r0, #8]   @ sp
  str r3, [r0, #12]  @ lr
  str r3, [r0, #16]  @ store return address as pc
  @ T1 does not have a non-cpsr-clobbering register-zeroing instruction.
  @ It is safe to use here though because we are about to return, and cpsr is
  @ not expected to be preserved.
  movs r0, #0        @ return UNW_ESUCCESS
#else
  @ 32bit thumb-2 restrictions for stm:
  @ . the sp (r13) cannot be in the list
  @ . the pc (r15) cannot be in the list in an STM instruction
  stm r0, {r0-r12}
  str sp, [r0, #52]
  str lr, [r0, #56]
  str lr, [r0, #60]  @ store return address as pc
  mov r0, #0         @ return UNW_ESUCCESS
#endif
  JMP(lr)

@
@ static void libunwind::Registers_arm::saveVFPWithFSTMD(unw_fpreg_t* values)
@
@ On entry:
@  values pointer is in r0
@
  .p2align 2
#if defined(__ELF__)
  .fpu vfpv3-d16
#endif
DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_arm16saveVFPWithFSTMDEPv)
  vstmia r0, {d0-d15}
  JMP(lr)

@
@ static void libunwind::Registers_arm::saveVFPWithFSTMX(unw_fpreg_t* values)
@
@ On entry:
@  values pointer is in r0
@
  .p2align 2
#if defined(__ELF__)
  .fpu vfpv3-d16
#endif
DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_arm16saveVFPWithFSTMXEPv)
  vstmia r0, {d0-d15} @ fstmiax is deprecated in ARMv7+ and now behaves like vstmia
  JMP(lr)

@
@ static void libunwind::Registers_arm::saveVFPv3(unw_fpreg_t* values)
@
@ On entry:
@  values pointer is in r0
@
  .p2align 2
#if defined(__ELF__)
  .fpu vfpv3
#endif
DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_arm9saveVFPv3EPv)
  @ VFP and iwMMX instructions are only available when compiling with the flags
  @ that enable them. We do not want to do that in the library (because we do not
  @ want the compiler to generate instructions that access those) but this is
  @ only accessed if the personality routine needs these registers. Use of
  @ these registers implies they are, actually, available on the target, so
  @ it's ok to execute.
  @ So, generate the instructions using the corresponding coprocessor mnemonic.
  vstmia r0, {d16-d31}
  JMP(lr)

#if defined(_LIBUNWIND_ARM_WMMX)

@
@ static void libunwind::Registers_arm::saveiWMMX(unw_fpreg_t* values)
@
@ On entry:
@  values pointer is in r0
@
  .p2align 2
#if defined(__ELF__)
  .arch armv5te
#endif
DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_arm9saveiWMMXEPv)
  stcl p1, cr0, [r0], #8  @ wstrd wR0, [r0], #8
  stcl p1, cr1, [r0], #8  @ wstrd wR1, [r0], #8
  stcl p1, cr2, [r0], #8  @ wstrd wR2, [r0], #8
  stcl p1, cr3, [r0], #8  @ wstrd wR3, [r0], #8
  stcl p1, cr4, [r0], #8  @ wstrd wR4, [r0], #8
  stcl p1, cr5, [r0], #8  @ wstrd wR5, [r0], #8
  stcl p1, cr6, [r0], #8  @ wstrd wR6, [r0], #8
  stcl p1, cr7, [r0], #8  @ wstrd wR7, [r0], #8
  stcl p1, cr8, [r0], #8  @ wstrd wR8, [r0], #8
  stcl p1, cr9, [r0], #8  @ wstrd wR9, [r0], #8
  stcl p1, cr10, [r0], #8  @ wstrd wR10, [r0], #8
  stcl p1, cr11, [r0], #8  @ wstrd wR11, [r0], #8
  stcl p1, cr12, [r0], #8  @ wstrd wR12, [r0], #8
  stcl p1, cr13, [r0], #8  @ wstrd wR13, [r0], #8
  stcl p1, cr14, [r0], #8  @ wstrd wR14, [r0], #8
  stcl p1, cr15, [r0], #8  @ wstrd wR15, [r0], #8
  JMP(lr)

@
@ static void libunwind::Registers_arm::saveiWMMXControl(unw_uint32_t* values)
@
@ On entry:
@  values pointer is in r0
@
  .p2align 2
#if defined(__ELF__)
  .arch armv5te
#endif
DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_arm16saveiWMMXControlEPj)
  stc2 p1, cr8, [r0], #4  @ wstrw wCGR0, [r0], #4
  stc2 p1, cr9, [r0], #4  @ wstrw wCGR1, [r0], #4
  stc2 p1, cr10, [r0], #4  @ wstrw wCGR2, [r0], #4
  stc2 p1, cr11, [r0], #4  @ wstrw wCGR3, [r0], #4
  JMP(lr)

#endif

#elif defined(__or1k__)

#
# extern int __unw_getcontext(unw_context_t* thread_state)
#
# On entry:
#  thread_state pointer is in r3
#
DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
  l.sw       0(r3), r0
  l.sw       4(r3), r1
  l.sw       8(r3), r2
  l.sw      12(r3), r3
  l.sw      16(r3), r4
  l.sw      20(r3), r5
  l.sw      24(r3), r6
  l.sw      28(r3), r7
  l.sw      32(r3), r8
  l.sw      36(r3), r9
  l.sw      40(r3), r10
  l.sw      44(r3), r11
  l.sw      48(r3), r12
  l.sw      52(r3), r13
  l.sw      56(r3), r14
  l.sw      60(r3), r15
  l.sw      64(r3), r16
  l.sw      68(r3), r17
  l.sw      72(r3), r18
  l.sw      76(r3), r19
  l.sw      80(r3), r20
  l.sw      84(r3), r21
  l.sw      88(r3), r22
  l.sw      92(r3), r23
  l.sw      96(r3), r24
  l.sw     100(r3), r25
  l.sw     104(r3), r26
  l.sw     108(r3), r27
  l.sw     112(r3), r28
  l.sw     116(r3), r29
  l.sw     120(r3), r30
  l.sw     124(r3), r31
  # store ra to pc
  l.sw     128(r3), r9
  # zero epcr
  l.sw     132(r3), r0

#elif defined(__hexagon__)
#
# extern int unw_getcontext(unw_context_t* thread_state)
#
# On entry:
#  thread_state pointer is in r0
#
#define OFFSET(offset) (offset/4)
DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
  memw(r0+#32) = r8
  memw(r0+#36) = r9
  memw(r0+#40) = r10
  memw(r0+#44) = r11

  memw(r0+#48) = r12
  memw(r0+#52) = r13
  memw(r0+#56) = r14
  memw(r0+#60) = r15

  memw(r0+#64) = r16
  memw(r0+#68) = r17
  memw(r0+#72) = r18
  memw(r0+#76) = r19

  memw(r0+#80) = r20
  memw(r0+#84) = r21
  memw(r0+#88) = r22
  memw(r0+#92) = r23

  memw(r0+#96) = r24
  memw(r0+#100) = r25
  memw(r0+#104) = r26
  memw(r0+#108) = r27

  memw(r0+#112) = r28
  memw(r0+#116) = r29
  memw(r0+#120) = r30
  memw(r0+#124) = r31
  r1 = c4   // Predicate register
  memw(r0+#128) = r1
  r1 = memw(r30)           // *FP == Saved FP
  r1 = r31
  memw(r0+#132) = r1

  jumpr r31

#elif defined(__sparc__) && defined(__arch64__)

#
# extern int __unw_getcontext(unw_context_t* thread_state)
#
# On entry:
#  thread_state pointer is in %o0
#
DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
  .register %g2, #scratch
  .register %g3, #scratch
  .register %g6, #scratch
  .register %g7, #scratch
  stx  %g1, [%o0 + 0x08]
  stx  %g2, [%o0 + 0x10]
  stx  %g3, [%o0 + 0x18]
  stx  %g4, [%o0 + 0x20]
  stx  %g5, [%o0 + 0x28]
  stx  %g6, [%o0 + 0x30]
  stx  %g7, [%o0 + 0x38]
  stx  %o0, [%o0 + 0x40]
  stx  %o1, [%o0 + 0x48]
  stx  %o2, [%o0 + 0x50]
  stx  %o3, [%o0 + 0x58]
  stx  %o4, [%o0 + 0x60]
  stx  %o5, [%o0 + 0x68]
  stx  %o6, [%o0 + 0x70]
  stx  %o7, [%o0 + 0x78]
  stx  %l0, [%o0 + 0x80]
  stx  %l1, [%o0 + 0x88]
  stx  %l2, [%o0 + 0x90]
  stx  %l3, [%o0 + 0x98]
  stx  %l4, [%o0 + 0xa0]
  stx  %l5, [%o0 + 0xa8]
  stx  %l6, [%o0 + 0xb0]
  stx  %l7, [%o0 + 0xb8]
  stx  %i0, [%o0 + 0xc0]
  stx  %i1, [%o0 + 0xc8]
  stx  %i2, [%o0 + 0xd0]
  stx  %i3, [%o0 + 0xd8]
  stx  %i4, [%o0 + 0xe0]
  stx  %i5, [%o0 + 0xe8]
  stx  %i6, [%o0 + 0xf0]
  stx  %i7, [%o0 + 0xf8]

  # save StackGhost cookie
  mov  %i7, %g4
  save %sp, -176, %sp
  # register window flush necessary even without StackGhost
  flushw
  restore
  ldx  [%sp + 2047 + 0x78], %g5
  xor  %g4, %g5, %g4
  stx  %g4, [%o0 + 0x100]
  retl
  # return UNW_ESUCCESS
   clr %o0

#elif defined(__sparc__)

#
# extern int __unw_getcontext(unw_context_t* thread_state)
#
# On entry:
#  thread_state pointer is in o0
#
DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
  ta 3
  add %o7, 8, %o7
  std %g0, [%o0 +   0]
  std %g2, [%o0 +   8]
  std %g4, [%o0 +  16]
  std %g6, [%o0 +  24]
  std %o0, [%o0 +  32]
  std %o2, [%o0 +  40]
  std %o4, [%o0 +  48]
  std %o6, [%o0 +  56]
  std %l0, [%o0 +  64]
  std %l2, [%o0 +  72]
  std %l4, [%o0 +  80]
  std %l6, [%o0 +  88]
  std %i0, [%o0 +  96]
  std %i2, [%o0 + 104]
  std %i4, [%o0 + 112]
  std %i6, [%o0 + 120]
  jmp %o7
   clr %o0                   // return UNW_ESUCCESS

#elif defined(__riscv)

#
# extern int __unw_getcontext(unw_context_t* thread_state)
#
# On entry:
#  thread_state pointer is in a0
#
DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
  ISTORE    x1, (RISCV_ISIZE * 0)(a0) // store ra as pc
#if defined(__riscv_32e)
  .irp i,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
#else
  .irp i,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
#endif
    ISTORE x\i, (RISCV_ISIZE * \i)(a0)
  .endr

# if defined(__riscv_flen)
  .irp i,FROM_0_TO_31
    FSTORE f\i, (RISCV_FOFFSET + RISCV_FSIZE * \i)(a0)
  .endr
# endif

  li     a0, 0  // return UNW_ESUCCESS
  ret           // jump to ra

#elif defined(__s390x__)

//
// extern int __unw_getcontext(unw_context_t* thread_state)
//
// On entry:
//  thread_state pointer is in r2
//
DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)

  // Save GPRs
  stmg %r0, %r15, 16(%r2)

  // Save PSWM
  epsw %r0, %r1
  stm %r0, %r1, 0(%r2)

  // Store return address as PSWA
  stg %r14, 8(%r2)

  // Save FPRs
  .irp i,FROM_0_TO_15
    std %f\i, (144+8*\i)(%r2)
  .endr

  // Return UNW_ESUCCESS
  lghi %r2, 0
  br %r14

#elif defined(__loongarch__) && __loongarch_grlen == 64

#
# extern int __unw_getcontext(unw_context_t* thread_state)
#
# On entry:
#  thread_state pointer is in $a0($r4)
#
DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
  .irp i,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
    st.d $r\i, $a0, (8*\i)
  .endr
  st.d    $r1,  $a0, (8 * 32) // store $ra to pc

# if __loongarch_frlen == 64
  .irp i,FROM_0_TO_31
    fst.d $f\i, $a0, (8 * 33 + 8 * \i)
  .endr
# endif

  move     $a0, $zero  // UNW_ESUCCESS
  jr       $ra

#endif

#ifdef __arm64ec__
  .globl "#unw_getcontext"
  .set "#unw_getcontext", "#__unw_getcontext"
  .weak_anti_dep unw_getcontext
  .set unw_getcontext, "#unw_getcontext"
  EXPORT_SYMBOL(unw_getcontext)
#else
  WEAK_ALIAS(__unw_getcontext, unw_getcontext)
#endif

#endif /* !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__wasm__) */

NO_EXEC_STACK_DIRECTIVE



=== system/lib/libunwind/src/Unwind_AIXExtras.cpp ===
SHA256: fec55a3209fcd9ad4eac0f9820d599ceef2750a155e2aa10f66aacdf6f0fb536
//===--------------------- Unwind_AIXExtras.cpp -------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//===----------------------------------------------------------------------===//

// This file is only used for AIX.

// getFuncNameFromTBTable

// Get the function name from its traceback table.

// Keep looking forward until a word of 0 is found. The traceback

// table starts at the following word.

// Get to the name of the function.

// Skip field parminfo if it exists.

// If the tb_offset field exists, get the offset from the start of

// the function to pc. Skip the field.

// Skip field hand_mask if it exists.

// Skip fields ctl_info and ctl_info_disp if they exist.

// namespace libunwind

// defined(_AIX)


=== system/lib/libunwind/src/assembly.h ===
SHA256: c3d765a0642dd4bc59e2f92ab16be2e9192432fcb834b8b313a69eb9165e699a
/* ===-- assembly.h - libUnwind assembler support macros -------------------===
 *
 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 * See https://llvm.org/LICENSE.txt for license information.
 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 *
 * ===----------------------------------------------------------------------===
 *
 * This file defines macros for use in libUnwind assembler source.
 * This file is not part of the interface of this library.
 *
 * ===----------------------------------------------------------------------===
 */

// Set BTI, PAC, and GCS gnu property bits

// We indirectly branch to __libunwind_Registers_arm64_jumpto from

// __unw_phase2_resume, so we need to use bti jc.

// Set GCS gnu property bit

// Set BTI and PAC gnu property bits

/* GNU_PROPERTY_AARCH64_FEATURE_1_AND */

// clang-format off

// clang-format on

// clang-format off

// clang-format on

/* __arm__ */

/* UNWIND_ASSEMBLY_H */


=== system/lib/libunwind/src/config.h ===
SHA256: 65d0561fb6af948fbbf32e9c9b087bbc7013c94faae9565d7edabc18336bce95
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//  Defines macros used within libunwind project.

//

//===----------------------------------------------------------------------===//

// Platform specific configuration defines.

// For ARM EHABI, Bionic didn't implement dl_iterate_phdr until API 21. After

// API 21, dl_iterate_phdr exists, but dl_unwind_find_exidx is much faster.

// The traceback table at the end of each function is used for unwinding.

// Assume an ELF system with a dl_iterate_phdr function.

// The CMake file passes -fvisibility=hidden to control ELF/Mach-O visibility.

// Apple/armv7k defaults to DWARF/Compact unwinding, but its libunwind also

// needs to include the SJLJ APIs.

/* _LIBUNWIND_REMEMBER_HEAP_ALLOC */

// Macros that define away in non-Debug builds

// Used to fit UnwindCursor and Registers_xxx types against unw_context_t /

// unw_cursor_t sized memory blocks.

// __cplusplus

// LIBUNWIND_CONFIG_H


=== system/lib/libunwind/src/dwarf2.h ===
SHA256: e10d240e2f19de7121a8afaf3d4841a65936723e69d636f7e3241e14802d0bfc
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//===----------------------------------------------------------------------===//

/*
   These constants were taken from version 3 of the DWARF standard,
   which is Copyright (c) 2005 Free Standards Group, and
   Copyright (c) 1992, 1993 UNIX International, Inc.
*/

// DWARF unwind instructions

// high 2 bits are 0x1, lower 6 bits are delta

// high 2 bits are 0x2, lower 6 bits are register

// high 2 bits are 0x3, lower 6 bits are register

// GNU extensions

// AARCH64 extensions

// FSF exception handling Pointer-Encoding constants

// Used in CFI augmentation by GCC

// DWARF expressions

// constant address (size target specific)

// 1-byte constant

// 1-byte constant

// 2-byte constant

// 2-byte constant

// 4-byte constant

// 4-byte constant

// 8-byte constant

// 8-byte constant

// ULEB128 constant

// SLEB128 constant

// 1-byte stack index

// ULEB128 addend

// signed 2-byte constant

// signed 2-byte constant

// Literal 0

// Literal 1

// Literal 2

// Literal 3

// Literal 4

// Literal 5

// Literal 6

// Literal 7

// Literal 8

// Literal 9

// Literal 10

// Literal 11

// Literal 12

// Literal 13

// Literal 14

// Literal 15

// Literal 16

// Literal 17

// Literal 18

// Literal 19

// Literal 20

// Literal 21

// Literal 22

// Literal 23

// Literal 24

// Literal 25

// Literal 26

// Literal 27

// Literal 28

// Literal 29

// Literal 30

// Literal 31

// Contents of reg0

// Contents of reg1

// Contents of reg2

// Contents of reg3

// Contents of reg4

// Contents of reg5

// Contents of reg6

// Contents of reg7

// Contents of reg8

// Contents of reg9

// Contents of reg10

// Contents of reg11

// Contents of reg12

// Contents of reg13

// Contents of reg14

// Contents of reg15

// Contents of reg16

// Contents of reg17

// Contents of reg18

// Contents of reg19

// Contents of reg20

// Contents of reg21

// Contents of reg22

// Contents of reg23

// Contents of reg24

// Contents of reg25

// Contents of reg26

// Contents of reg27

// Contents of reg28

// Contents of reg29

// Contents of reg30

// Contents of reg31

// base register 0 + SLEB128 offset

// base register 1 + SLEB128 offset

// base register 2 + SLEB128 offset

// base register 3 + SLEB128 offset

// base register 4 + SLEB128 offset

// base register 5 + SLEB128 offset

// base register 6 + SLEB128 offset

// base register 7 + SLEB128 offset

// base register 8 + SLEB128 offset

// base register 9 + SLEB128 offset

// base register 10 + SLEB128 offset

// base register 11 + SLEB128 offset

// base register 12 + SLEB128 offset

// base register 13 + SLEB128 offset

// base register 14 + SLEB128 offset

// base register 15 + SLEB128 offset

// base register 16 + SLEB128 offset

// base register 17 + SLEB128 offset

// base register 18 + SLEB128 offset

// base register 19 + SLEB128 offset

// base register 20 + SLEB128 offset

// base register 21 + SLEB128 offset

// base register 22 + SLEB128 offset

// base register 23 + SLEB128 offset

// base register 24 + SLEB128 offset

// base register 25 + SLEB128 offset

// base register 26 + SLEB128 offset

// base register 27 + SLEB128 offset

// base register 28 + SLEB128 offset

// base register 29 + SLEB128 offset

// base register 30 + SLEB128 offset

// base register 31 + SLEB128 offset

// ULEB128 register

// SLEB128 offset

// ULEB128 register followed by SLEB128 offset

// ULEB128 size of piece addressed

// 1-byte size of data retrieved

// 1-byte size of data retrieved

// 2-byte offset of DIE

// 4-byte offset of DIE

// 4- or 8-byte offset of DIE


=== system/lib/libunwind/src/libunwind.cpp ===
SHA256: 0be28214f509a9301f7745b20b8f5e0667a9bd4f42ecf946dd7ee5dcec40b0d1
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//  Implements unw_* functions from <libunwind.h>

//

//===----------------------------------------------------------------------===//

// Define the __has_feature extension for compilers that do not support it so

// that we can later check for the presence of ASan in a compiler-neutral way.

/// internal object to represent this processes address space

/// Create a cursor of a thread in this process given 'context' recorded by

/// __unw_getcontext().

// Use "placement new" to allocate UnwindCursor in the cursor buffer.

/// Get value of specified register at cursor position in stack frame.

/// Set value of specified register at cursor position in stack frame.

// special case altering IP to re-find info (being called by personality

// function)

// First, get the FDE for the old location and then update it.

// If the original call expects stack adjustment, perform this now.

// Normal frame unwinding would have included the offset already in the

// CFA computation.

// Note: for PA-RISC and other platforms where the stack grows up,

// this should actually be - info.gp. LLVM doesn't currently support

// any such platforms and Clang doesn't export a macro for them.

/// Get value of specified float register at cursor position in stack frame.

/// Set value of specified float register at cursor position in stack frame.

/// Move cursor to next frame.

// Move cursor to next frame and for stage2 of unwinding.

// This resets MTE tags of tagged frames to zero.

/// Get unwind info at cursor position in stack frame.

/// Resume execution at cursor position (aka longjump).

// Inform the ASan runtime that now might be a good time to clean stuff up.

/// Get name of function at cursor position in stack frame.

/// Checks if a register is a floating-point register.

/// Checks if a register is a floating-point register.

/// Checks if current frame is signal trampoline.

// Save VFP registers d0-d15 using FSTMIADX instead of FSTMIADD

/// SPI: walks cached DWARF entries

/// IPI: for __register_frame()

// dynamically registered FDEs don't have a mach_header group they are in.

// Use fde as mh_group

/// IPI: for __deregister_frame()

// fde is own mh_group

// The eh_frame section start serves as the mh_group

// The eh_frame section start serves as the mh_group

// defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)

// !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__wasm__)

// namespace libunwind

// Check that we have enough space...

// Check for value already present...

// Success -- add callback entry.

// Find index to remove.

// If no such registration is present then error out.

// Remove entry.

// __APPLE__

// Add logging hooks in Debug builds only

// do manual lock to avoid use of _cxa_guard_acquire or initializers

// do manual lock to avoid use of _cxa_guard_acquire or initializers

// do manual lock to avoid use of _cxa_guard_acquire or initializers

// NDEBUG


=== system/lib/libunwind/src/libunwind_ext.h ===
SHA256: ee76dbef4b8a910e6d9302e643ae4566ce5ed8f4cbe5e612804506a089b291e1
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//  Extensions to libunwind API.

//

//===----------------------------------------------------------------------===//

/* Save VFP registers in FSTMX format (instead of FSTMD). */

// SPI

// IPI

// Holds a description of the object-format-header (if any) and unwind info

// sections for a given address:

//

// * dso_base should point to a header for the JIT'd object containing the

//   given address. The header's type should match the format type that

//   libunwind was compiled for (so a mach_header or mach_header_64 on Darwin).

//   A value of zero indicates that no such header exists.

//

// * dwarf_section and dwarf_section_length hold the address range of a DWARF

//   eh-frame section associated with the given address, if any. If the

//   dwarf_section_length field is zero it indicates that no such section

//   exists (and in this case dwarf_section should also be set to zero).

//

// * compact_unwind_section and compact_unwind_section_length hold the address

//   range of a compact-unwind info section associated with the given address,

//   if any. If the compact_unwind_section_length field is zero it indicates

//   that no such section exists (and in this case compact_unwind_section

//   should also be set to zero).

//

// See the unw_find_dynamic_unwind_sections type below for more details.

// Typedef for unwind-info lookup callbacks. Functions of this type can be

// registered and deregistered using __unw_add_find_dynamic_unwind_sections

// and __unw_remove_find_dynamic_unwind_sections respectively.

//

// An unwind-info lookup callback should return 1 to indicate that it found

// unwind-info for the given address, or 0 to indicate that it did not find

// unwind-info for the given address. If found, the callback should populate

// some or all of the fields of the info argument (which is guaranteed to be

// non-null with all fields zero-initialized):

// Register a dynamic unwind-info lookup callback. If libunwind does not find

// unwind info for a given frame in the executable program or normal dynamic

// shared objects then it will call all registered dynamic lookup functions

// in registration order until either one of them returns true, or the end

// of the list is reached. This lookup will happen before libunwind searches

// any eh-frames registered via __register_frame or

// __unw_add_dynamic_eh_frame_section.

//

// Returns UNW_ESUCCESS for successful registrations. If the given callback

// has already been registered then UNW_EINVAL will be returned. If all

// available callback entries are in use then UNW_ENOMEM will be returned.

// Deregister a dynacim unwind-info lookup callback.

//

// Returns UNW_ESUCCESS for successful deregistrations. If the given callback

// has already been registered then UNW_EINVAL will be returned.

// __LIBUNWIND_EXT__


=== system/lib/libunwind/src/shadow_stack_unwind.h ===
SHA256: 136fbdc6142baeedd74c4f704a3d522d97f8d2bfb6acbcdd383de0c9f48dee45
//===----------------------------------------------------------------------===//

//

// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

// See https://llvm.org/LICENSE.txt for license information.

// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

//

//

//===----------------------------------------------------------------------===//

// Currently, CET is implemented on Linux x86 platforms.

// On AArch64 we use _LIBUNWIND_USE_GCS to indicate that GCS is supported. We

// need to guard any use of GCS instructions with __chkfeat though, as GCS may

// not be enabled.

// We can only use GCS if arm_acle.h defines the GCS intrinsics.


=== system/lib/mimalloc/include/mimalloc-new-delete.h ===
SHA256: dd4f25cae53209d45d73f8e6a2b9c219e8fc7434d97f20eba9af1a8b850030fd
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2020 Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// ----------------------------------------------------------------------------

// This header provides convenient overrides for the new and

// delete operations in C++.

//

// This header should be included in only one source file!

//

// On Windows, or when linking dynamically with mimalloc, these

// can be more performant than the standard new-delete operations.

// See <https://en.cppreference.com/w/cpp/memory/new/operator_new>

// ---------------------------------------------------------------------------

// stay consistent with VCRT definitions

// MIMALLOC_NEW_DELETE_H


=== system/lib/mimalloc/include/mimalloc-override.h ===
SHA256: 243db1b073ce985873545b746288546efb8ccadeb9860e674a7f0f701af8bac9
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2020 Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

/* ----------------------------------------------------------------------------
This header can be used to statically redirect malloc/free and new/delete
to the mimalloc variants. This can be useful if one can include this file on
each source file in a project (but be careful when using external code to
not accidentally mix pointers from different allocators).
-----------------------------------------------------------------------------*/

// Standard C allocation

// Microsoft extensions

// Various Posix and Unix variants

// Microsoft aligned variants

// MIMALLOC_OVERRIDE_H


=== system/lib/mimalloc/include/mimalloc.h ===
SHA256: 65becba41248d139f7dd21f979d0e82adbb71e234eb18c151bb30e2c30d69a1e
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2023, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// major + 2 digits minor

// ------------------------------------------------------

// Compiler specific attributes

// ------------------------------------------------------

// C++11

// includes clang, icc, and clang-cl

// includes clang and icc

// leads to warnings... __attribute__((cdecl))

// ------------------------------------------------------

// Includes

// ------------------------------------------------------

// size_t

// bool

// INTPTR_MAX

// ------------------------------------------------------

// Standard malloc interface

// ------------------------------------------------------

// ------------------------------------------------------

// Extended functionality

// ------------------------------------------------------

// ------------------------------------------------------

// Internals

// ------------------------------------------------------

// backward compatibility: `out` is ignored and should be NULL

// -------------------------------------------------------------------------------------

// Aligned allocation

// Note that `alignment` always follows `size` for consistency with unaligned

// allocation, but unfortunately this differs from `posix_memalign` and `aligned_alloc`.

// -------------------------------------------------------------------------------------

// -------------------------------------------------------------------------------------

// Heaps: first-class, but can only allocate from the same thread that created it.

// -------------------------------------------------------------------------------------

// --------------------------------------------------------------------------------

// Zero initialized re-allocation.

// Only valid on memory that was originally allocated with zero initialization too.

// e.g. `mi_calloc`, `mi_zalloc`, `mi_zalloc_aligned` etc.

// see <https://github.com/microsoft/mimalloc/issues/63#issuecomment-508272992>

// --------------------------------------------------------------------------------

// ------------------------------------------------------

// Analysis

// ------------------------------------------------------

// An area of heap space contains blocks of a single size.

// start of the area containing heap blocks

// bytes reserved for this area (virtual)

// current available bytes for this area

// number of allocated blocks

// size in bytes of each block

// size in bytes of a full block including padding and metadata.

// Experimental

// Experimental: heaps associated with specific memory arena's

// Create a heap that only allocates in the specified arena

// deprecated

// ------------------------------------------------------

// Convenience

// ------------------------------------------------------

// ------------------------------------------------------

// Options

// ------------------------------------------------------

// stable options

// print error messages

// print statistics on termination

// print verbose messages

// advanced options

// eager commit segments? (after `eager_commit_delay` segments) (=1)

// eager commit arenas? Use 2 to enable just on overcommit systems (=2)

// should a memory purge decommit? (=1). Set to 0 to use memory reset on a purge (instead of decommit)

// allow large (2 or 4 MiB) OS pages, implies eager commit. If false, also disables THP for the process.

// reserve N huge OS pages (1GiB pages) at startup

// reserve huge OS pages at a specific NUMA node

// reserve specified amount of OS memory in an arena at startup (internally, this value is in KiB; use `mi_option_get_size`)

// immediately purge delayed purges on thread termination

// the first N segments per thread are not eagerly committed (but per page in the segment on demand)

// memory purging is delayed by N milli seconds; use 0 for immediate purging or -1 for no purging at all. (=10)

// 0 = use all available numa nodes, otherwise use at most N nodes.

// 1 = do not use OS memory for allocation (but only programmatically reserved arenas)

// tag used for OS logging (macOS only for now) (=100)

// issue at most N error messages

// issue at most N warning messages

// max. percentage of the abandoned segments can be reclaimed per try (=10%)

// if set, release all memory on exit; sometimes used for dynamic unloading but can be unsafe

// initial memory size for arena reservation (= 1 GiB on 64-bit) (internally, this value is in KiB; use `mi_option_get_size`)

// multiplier for `purge_delay` for the purging delay for arenas (=10)

// allow to reclaim an abandoned segment on a free (=1)

// 1 = do not use arena's for allocation (except if using specific arena id's)

// retry on out-of-memory for N milli seconds (=400), set to 0 to disable retries. (only on windows)

// legacy option names

// -------------------------------------------------------------------------------------------------------

// "mi" prefixed implementations of various posix, Unix, Windows, and C++ allocation functions.

// (This can be convenient when providing overrides of these functions as done in `mimalloc-override.h`.)

// note: we use `mi_cfree` as "checked free" and it checks if the pointer is in our heap before free-ing.

// -------------------------------------------------------------------------------------------------------

// The `mi_new` wrappers implement C++ semantics on out-of-memory instead of directly returning `NULL`.

// (and call `std::get_new_handler` and potentially raise a `std::bad_alloc` exception).

// ---------------------------------------------------------------------------------------------

// Implement the C++ std::allocator interface for use in STL containers.

// (note: see `mimalloc-new-delete.h` for overriding the new/delete operators globally)

// ---------------------------------------------------------------------------------------------

// std::size_t

// PTRDIFF_MAX

// C++11

// std::true_type

// std::forward

// C++11

// C++17

// C++11

// C++11

// std::shared_ptr

// Common base class for STL allocators in a specific heap

/* will not delete nor destroy the passed in heap */

// C++17

// C++11

/* calls heap_delete/destroy when the refcount drops to zero */

// STL allocator allocation in a specific heap

// creates fresh heap that is deleted when the destructor is called

// no delete nor destroy on the passed in heap

// STL allocator allocation in a specific heap, where `free` does nothing and

// the heap is destroyed in one go on destruction -- use with care!

// creates fresh heap that is destroyed when the destructor is called

// no delete nor destroy on the passed in heap

/* do nothing as we destroy the heap on destruct. */

// C++11

// __cplusplus


=== system/lib/mimalloc/include/mimalloc/atomic.h ===
SHA256: 9fb64be39216e8945f50596743422a67ca7eca790bcff809ee5d418cd598af27
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2023 Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// --------------------------------------------------------------------------------------------

// Atomics

// We need to be portable between C, C++, and MSVC.

// We base the primitives on the C/C++ atomics and create a mimimal wrapper for MSVC in C compilation mode.

// This is why we try to use only `uintptr_t` and `<type>*` as atomic types.

// To gain better insight in the range of used atomics, we use explicitly named memory order operations

// instead of passing the memory order as a parameter.

// -----------------------------------------------------------------------------------------------

// Use C++ atomics

// c++20, see issue #571

// Use MSVC C wrapper for C11 atomics

// Use C11 atomics

// c17, see issue #735

// Various defines for all used memory orders in mimalloc

// In C++/C11 atomics we have polymorphic atomics so can use the typed `ptr` variants (where `tp` is the type of atomic value)

// We use these macros so we can provide a typed wrapper in MSVC in C compilation mode as well

// In C++ we need to add casts to help resolve templates if NULL is passed

// These are used by the statistics

/* nothing */

// Used by timers

// Legacy MSVC plain C compilation wrapper that uses Interlocked operations to model C11 atomics.

/* nothing */

// These are used by the statistics

// The pointer macros cast to `uintptr_t`.

// Atomically add a signed value; returns the previous value.

// Atomically subtract a signed value; returns the previous value.

// Returns true only on the first invocation

// quick test 

// try to set to 1

// Allows only one thread to execute at a time

// Yield

// Fallback for other archs

// __MIMALLOC_ATOMIC_H


=== system/lib/mimalloc/include/mimalloc/internal.h ===
SHA256: 11d67ff05ec6653f615c4c571bef77f2d73d127189a9bb872ede658bba97ceec
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2023, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// --------------------------------------------------------------------------

// This file contains the interal API's of mimalloc and various utility

// functions and macros.

// --------------------------------------------------------------------------

// suppress constant conditional warning (due to MI_SECURE paths)

// unscoped enum warning

// includes clang and icc

// hope for the best :-)

// pthreads

// "options.c"

// random.c

// init.c

// true while the C runtime is not initialized yet

// statically allocated main backing heap

// os.c

// called from process init

// arena.c

// abstract

// "segment-map.c"

// "segment.c"

// page start for any page

// "page.c"

// free the page if there are no other pages with many free blocks

// free the page

// abandon the page, to be picked up by another thread...

// callback from segments

// for stats

// for stats

// "heap.c"

// "stats.c"

// "alloc.c"

// called from `_mi_malloc_generic`

// called from `_mi_heap_malloc_aligned`

// called from `_mi_heap_malloc_aligned`

// called from `_mi_heap_malloc_aligned`

// for runtime integration

// "libc.c"

// ------------------------------------------------------

// Branches

// ------------------------------------------------------

/* -----------------------------------------------------------
  Error codes passed to `_mi_fatal_error`
  All are recoverable but EFAULT is a serious error and aborts by default in secure mode.
  For portability define undefined error codes using common Unix codes:
  <https://www-numi.fnal.gov/offline_software/srt_public_context/WebDocs/Errors/unix_system_errors.html>
----------------------------------------------------------- */

// double free

// out of memory

// corrupted free-list or meta-data

// trying to free an invalid pointer

// count*size overflow

/* -----------------------------------------------------------
  Inlined definitions
----------------------------------------------------------- */

// initialize a local variable to zero; use memset as compilers optimize constant sized memset's

// Is `x` a power of two? (0 is considered a power of two)

// Is a pointer aligned?

// Align upwards

// power of two?

// Align downwards

// power of two?

// Align a pointer upwards

// Align a pointer downwards

// Divide upwards: `s <= _mi_divide_up(s,d)*d < s+d`.

// Is memory zero initialized?

// Align a byte size to a size in _machine words_,

// i.e. byte size == `wsize*sizeof(void*)`.

// Overflow detecting multiply

// UINT_MAX, ULONG_MAX

// for Illumos

/* __builtin_umul_overflow is unavailable */

// sqrt(SIZE_MAX)

// note: gcc/clang optimize this to directly check the overflow flag

// Safe multiply `count*size` into `total`; return `true` on overflow.

// quick check for the case where count is one (common for C++ allocators)

/*----------------------------------------------------------------------------------------
  Heap functions
------------------------------------------------------------------------------------------- */

// read-only empty heap, initial value of the thread local default heap

/* -----------------------------------------------------------
  Pages
----------------------------------------------------------- */

// Segment that contains the pointer

// Large aligned blocks may be aligned at N*MI_SEGMENT_SIZE (inside a huge segment > MI_SEGMENT_SIZE),

// and we need align "down" to the segment info which is `MI_SEGMENT_SIZE` bytes before it;

// therefore we align one byte before `p`.

// We check for NULL afterwards on 64-bit systems to improve codegen for `mi_free`.

// Segment belonging to a page

// Get the page containing the pointer (performance critical as it is called in mi_free)

// adjust to the block that holds the page data

// Quick page start for initialized pages

// Get the page containing the pointer

// Get the block size of a page (special case for huge objects)

// Get the usable block size of a page without fixed padding.

// This may still include internal padding due to alignment and rounding up size classes.

// size of a segment

// Thread free access

// Heap access

// Thread free flag helpers

// are all blocks in a page freed?

// note: needs up-to-date used count, (as the `xthread_free` list may not be empty). see `_mi_page_collect_free`.

// are there any available blocks?

// are there immediately available blocks, i.e. blocks available on the free list.

// is more than 7/8th of a page in use?

//-----------------------------------------------------------

// Page flags

//-----------------------------------------------------------

/* -------------------------------------------------------------------
Encoding/Decoding the free list next pointers

This is to protect against buffer overflow exploits where the
free list is mutated. Many hardened allocators xor the next pointer `p`
with a secret key `k1`, as `p^k1`. This prevents overwriting with known
values but might be still too weak: if the attacker can guess
the pointer `p` this  can reveal `k1` (since `p^k1^p == k1`).
Moreover, if multiple blocks can be read as well, the attacker can
xor both as `(p1^k1) ^ (p2^k1) == p1^p2` which may reveal a lot
about the pointers (and subsequently `k1`).

Instead mimalloc uses an extra key `k2` and encodes as `((p^k2)<<<k1)+k1`.
Since these operations are not associative, the above approaches do not
work so well any more even if the `p` can be guesstimated. For example,
for the read case we can subtract two entries to discard the `+k1` term,
but that leads to `((p1^k2)<<<k1) - ((p2^k2)<<<k1)` at best.
We include the left-rotation since xor and addition are otherwise linear
in the lowest bit. Finally, both keys are unique per page which reduces
the re-use of keys by a large factor.

We also pass a separate `null` value to be used as `NULL` or otherwise
`(k2<<<k1)+k1` would appear (too) often as a sentinel value.
------------------------------------------------------------------- */

// assume q may be invalid // return (_mi_segment_page_of(segment, p) == _mi_segment_page_of(segment, q));

// check for free list corruption: is `next` at least in the same page?

// TODO: check if `next` is `page->block_size` aligned?

// -------------------------------------------------------------------

// commit mask

// -------------------------------------------------------------------

// defined in `segment.c`:

/* -----------------------------------------------------------
  memory id's
----------------------------------------------------------- */

// -------------------------------------------------------------------

// Fast "random" shuffle

// -------------------------------------------------------------------

// ensure we don't get stuck in generating zeros

// by Sebastiano Vigna, see: <http://xoshiro.di.unimi.it/splitmix64.c>

// by Chris Wellons, see: <https://nullprogram.com/blog/2018/07/31/>

// -------------------------------------------------------------------

// Optimize numa node access for the common case (= one node)

// -------------------------------------------------------------------

// -----------------------------------------------------------------------

// Count bits: trailing or leading zeros (with MI_INTPTR_BITS on all zero)

// -----------------------------------------------------------------------

// LONG_MAX

// LONG_MAX

// BitScanReverse64

// de Bruijn multiplication, see <http://supertech.csail.mit.edu/papers/debruijn.pdf>

// de Bruijn multiplication, see <http://supertech.csail.mit.edu/papers/debruijn.pdf>

// "bit scan reverse": Return index of the highest bit (or MI_INTPTR_BITS if `x` is zero)

// ---------------------------------------------------------------------------------

// Provide our own `_mi_memcpy` for potential performance optimizations.

//

// For now, only on Windows with msvc/clang-cl we optimize to `rep movsb` if

// we happen to run on x86/x64 cpu's that have "fast short rep movsb" (FSRM) support

// (AMD Zen3+ (~2020) or Intel Ice Lake+ (~2017). See also issue #201 and pr #253.

// ---------------------------------------------------------------------------------

// -------------------------------------------------------------------------------

// The `_mi_memcpy_aligned` can be used if the pointers are machine-word aligned

// This is used for example in `mi_realloc`.

// -------------------------------------------------------------------------------

// On GCC/CLang we provide a hint that the pointers are word aligned.

// Default fallback on `_mi_memcpy`


=== system/lib/mimalloc/include/mimalloc/prim.h ===
SHA256: e8f88eaaffc10532c1516371f3111cd3a656c76a6d928c6aa09f30fbeacd8f33
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2023, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// --------------------------------------------------------------------------

// This file specifies the primitive portability API.

// Each OS/host needs to implement these primitives, see `src/prim`

// for implementations on Window, macOS, WASI, and Linux/Unix.

//

// note: on all primitive functions, we always have result parameters != NULL, and:

//  addr != NULL and page aligned

//  size > 0     and page aligned

//  the return value is an error code as an `int` where 0 is success

// --------------------------------------------------------------------------

// OS memory configuration

// default to 4KiB

// 0 if not supported, usually 2MiB (4MiB on Windows)

// smallest allocation size (usually 4KiB, on Windows 64KiB)

// can we reserve more memory than can be actually committed?

// can allocated blocks be freed partially? (true for mmap, false for VirtualAlloc)

// supports virtual address space reservation? (if true we can reserve virtual address space without using commit or physical memory)

// Initialize

// Free OS memory

// Allocate OS memory. Return NULL on error.

// The `try_alignment` is just a hint and the returned pointer does not have to be aligned.

// If `commit` is false, the virtual memory range only needs to be reserved (with no access)

// which will later be committed explicitly using `_mi_prim_commit`.

// `is_zero` is set to true if the memory was zero initialized (as on most OS's)

// pre: !commit => !allow_large

//      try_alignment >= _mi_os_page_size() and a power of 2

// Commit memory. Returns error code or 0 on success.

// For example, on Linux this would make the memory PROT_READ|PROT_WRITE.

// `is_zero` is set to true if the memory was zero initialized (e.g. on Windows)

// Decommit memory. Returns error code or 0 on success. The `needs_recommit` result is true

// if the memory would need to be re-committed. For example, on Windows this is always true,

// but on Linux we could use MADV_DONTNEED to decommit which does not need a recommit.

// pre: needs_recommit != NULL

// Reset memory. The range keeps being accessible but the content might be reset.

// Returns error code or 0 on success.

// Protect memory. Returns error code or 0 on success.

// Allocate huge (1GiB) pages possibly associated with a NUMA node.

// `is_zero` is set to true if the memory was zero initialized (as on most OS's)

// pre: size > 0  and a multiple of 1GiB.

//      numa_node is either negative (don't care), or a numa node number.

// Return the current NUMA node

// Return the number of logical NUMA nodes

// Clock ticks

// Return process information (only for statistics)

// Default stderr output. (only for warnings etc. with verbose enabled)

// msg != NULL && _mi_strlen(msg) > 0

// Get an environment variable. (only for options)

// name != NULL, result != NULL, result_size >= 64

// Fill a buffer with strong randomness; return `false` on error or if

// there is no strong randomization available.

// Called on the first thread start, and should ensure `_mi_thread_done` is called on thread termination.

// Called on process exit and may take action to clean up resources associated with the thread auto done.

// Called when the default heap for a thread changes

//-------------------------------------------------------------------

// Thread id: `_mi_prim_thread_id()`

//

// Getting the thread id should be performant as it is called in the

// fast path of `_mi_free` and we specialize for various platforms as

// inlined definitions. Regular code should call `init.c:_mi_thread_id()`.

// We only require _mi_prim_thread_id() to return a unique id

// for each thread (unequal to zero).

//-------------------------------------------------------------------

// On some libc + platform combinations we can directly access a thread-local storage (TLS) slot.

// The TLS layout depends on both the OS and libc implementation so we use specific tests for each main platform.

// If you test on another platform and it works please send a PR :-)

// see also https://akkadia.org/drepper/tls.pdf for more info on the TLS register.

//

// Note: we would like to prefer `__builtin_thread_pointer()` nowadays instead of using assembly,

// but unfortunately we can not detect support reliably (see issue #883)

// We also use it on Apple OS as we use a TLS slot for the default heap there.

// x86 32-bit always uses GS

// x86_64 macOSX uses GS

// x32 ABI

// x86_64 Linux, BSD uses FS

// M1, issue #343

// ppc, issue #781

// setting a tls slot is only used on macOS for now

// 32-bit always uses GS

// x86_64 macOS uses GS

// x32 ABI

// x86_64 Linux, BSD uses FS

// M1, issue #343

// ppc, issue #781

// Do we have __builtin_thread_pointer? This would be the preferred way to get a unique thread id

// but unfortunately, it seems we cannot test for this reliably at this time (see issue #883)

// Nevertheless, it seems needed on older graviton platforms (see issue #851).

// For now, we only enable this for specific platforms.

/* on apple (M1) the wrong register is read (tpidr_el0 instead of tpidrro_el0) so fall back to TLS slot assembly (<https://github.com/microsoft/mimalloc/issues/343#issuecomment-763272369>)*/

/* older clang versions emit bad code; fall back to using the TLS slot (<https://lore.kernel.org/linux-arm-kernel/202110280952.352F66D8@keescook/T/>) */

/* aarch64 for older gcc versions (issue #851) */

// defined in `init.c`; do not use these directly

// default heap to allocate from

// has mi_process_init been called?

// Get a unique id for the current thread.

// used for example by CPython for a free threaded build (see python/cpython#115488)

// Windows: works on Intel and ARM in both 32- and 64-bit

// Works on most Unix based platforms with recent compilers

// issue #384, #495: on the Bionic libc (Android), slot 1 is the thread id

// see: https://github.com/aosp-mirror/platform_bionic/blob/c44b1d0676ded732df4b3b21c5f798eacae93228/libc/platform/bionic/tls_defines.h#L86

// in all our other targets, slot 0 is the thread id

// glibc: https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=sysdeps/x86_64/nptl/tls.h

// apple: https://github.com/apple/darwin-xnu/blob/main/libsyscall/os/tsd.h#L36

// otherwise use portable C, taking the address of a thread local variable (this is still very fast on most platforms).

/* ----------------------------------------------------------------------------------------
The thread local default heap: `_mi_prim_get_default_heap()`
This is inlined here as it is on the fast path for allocation functions.

On most platforms (Windows, Linux, FreeBSD, NetBSD, etc), this just returns a
__thread local variable (`_mi_heap_default`). With the initial-exec TLS model this ensures
that the storage will always be available (allocated on the thread stacks).

On some platforms though we cannot use that when overriding `malloc` since the underlying
TLS implementation (or the loader) will call itself `malloc` on a first access and recurse.
We try to circumvent this in an efficient way:
- macOSX : we use an unused TLS slot from the OS allocated slots (MI_TLS_SLOT). On OSX, the
           loader itself calls `malloc` even before the modules are initialized.
- OpenBSD: we use an unused slot from the pthread block (MI_TLS_PTHREAD_SLOT_OFS).
- DragonFly: defaults are working but seem slow compared to freeBSD (see PR #323)
------------------------------------------------------------------------------------------- */

// macOS

// seems unused?

// other possible unused ones are 9, 29, __PTK_FRAMEWORK_JAVASCRIPTCORE_KEY4 (94), __PTK_FRAMEWORK_GC_KEY9 (112) and __PTK_FRAMEWORK_OLDGC_KEY9 (89)

// see <https://github.com/rweichler/substrate/blob/master/include/pthread_machdep.h>

// use end bytes of a name; goes wrong if anyone uses names > 23 characters (ptrhread specifies 16)

// see <https://github.com/openbsd/src/blob/master/lib/libc/include/thread_private.h#L371>

// #elif defined(__DragonFly__)

// #warning "mimalloc is not working correctly on DragonFly yet."

// #define MI_TLS_PTHREAD_SLOT_OFS   (4 + 1*sizeof(void*))  // offset `uniqueid` (also used by gdb?) <https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/lib/libthread_xu/thread/thr_private.h#L458>

// See issue #381

// prevent conditional load of the address of _mi_heap_empty

// default using a thread local variable; used on most platforms.

// mi_prim_get_default_heap()

// MIMALLOC_PRIM_H


=== system/lib/mimalloc/include/mimalloc/track.h ===
SHA256: 6c200e33299de255eb9ba2bddf8ca239833bbfca6df6b135c84557cc74990318
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2023, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

/* ------------------------------------------------------------------------------------------------------
Track memory ranges with macros for tools like Valgrind address sanitizer, or other memory checkers.
These can be defined for tracking allocation:

  #define mi_track_malloc_size(p,reqsize,size,zero)
  #define mi_track_free_size(p,_size)

The macros are set up such that the size passed to `mi_track_free_size`
always matches the size of `mi_track_malloc_size`. (currently, `size == mi_usable_size(p)`).
The `reqsize` is what the user requested, and `size >= reqsize`.
The `size` is either byte precise (and `size==reqsize`) if `MI_PADDING` is enabled,
or otherwise it is the usable block size which may be larger than the original request.
Use `_mi_block_size_of(void* p)` to get the full block size that was allocated (including padding etc).
The `zero` parameter is `true` if the allocated block is zero initialized.

Optional:

  #define mi_track_align(p,alignedp,offset,size)
  #define mi_track_resize(p,oldsize,newsize)
  #define mi_track_init()

The `mi_track_align` is called right after a `mi_track_malloc` for aligned pointers in a block.
The corresponding `mi_track_free` still uses the block start pointer and original size (corresponding to the `mi_track_malloc`).
The `mi_track_resize` is currently unused but could be called on reallocations within a block.
`mi_track_init` is called at program start.

The following macros are for tools like asan and valgrind to track whether memory is 
defined, undefined, or not accessible at all:

  #define mi_track_mem_defined(p,size)
  #define mi_track_mem_undefined(p,size)
  #define mi_track_mem_noaccess(p,size)

-------------------------------------------------------------------------------------------------------*/

// valgrind tool

// track free of individual blocks on heap_destroy

/*red zone*/

/*red zone*/

/*red zone*/

// address sanitizer

// windows event tracing

// no tracking

// -------------------

// Utility definitions


=== system/lib/mimalloc/include/mimalloc/types.h ===
SHA256: ee12565adefef0ede47686578296017f9ecad80e1145b967fb3a0ebf6cd1789b
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2024, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// --------------------------------------------------------------------------

// This file contains the main type definitions for mimalloc:

// mi_heap_t      : all data for a thread-local heap, contains

//                  lists of all managed heap pages.

// mi_segment_t   : a larger chunk of memory (32GiB) from where pages

//                  are allocated. A segment is divided in slices (64KiB) from

//                  which pages are allocated.

// mi_page_t      : a "mimalloc" page (usually 64KiB or 512KiB) from

//                  where objects are allocated.

//                  Note: we write "OS page" for OS memory pages while

//                  using plain "page" for mimalloc pages (`mi_page_t`).

// --------------------------------------------------------------------------

// ptrdiff_t

// uintptr_t, uint16_t, etc

// _Atomic

// bitfield is not int

// Minimal alignment necessary. On most platforms 16 bytes are needed

// due to SSE registers for example. This must be at least `sizeof(void*)`

// sizeof(max_align_t)

// ------------------------------------------------------

// Variants

// ------------------------------------------------------

// Define NDEBUG in the release version to disable assertions.

// #define NDEBUG

// Define MI_TRACK_<tool> to enable tracking support

// #define MI_TRACK_VALGRIND 1

// #define MI_TRACK_ASAN     1

// #define MI_TRACK_ETW      1

// Define MI_STAT as 1 to maintain statistics; set it to 2 to have detailed statistics (but costs some performance).

// #define MI_STAT 1

// Define MI_SECURE to enable security mitigations

// #define MI_SECURE 1  // guard page around metadata

// #define MI_SECURE 2  // guard page around each mimalloc page

// #define MI_SECURE 3  // encode free lists (detect corrupted free list (buffer overflow), and invalid pointer free)

// #define MI_SECURE 4  // checks for double free. (may be more expensive)

// Define MI_DEBUG for debug mode

// #define MI_DEBUG 1  // basic assertion checks and statistics, check double free, corrupted free list, and invalid pointer free.

// #define MI_DEBUG 2  // + internal assertion checks

// #define MI_DEBUG 3  // + extensive internal invariant checking (cmake -DMI_DEBUG_FULL=ON)

// Reserve extra padding at the end of each block to be more resilient against heap block overflows.

// The padding can detect buffer overflow on free.

// Check padding bytes; allows byte-precise buffer overflow detection

// Encoded free lists allow detection of corrupted free lists

// and can detect buffer overflows, modify after free, and double `free`s.

// We used to abandon huge pages in order to eagerly deallocate it if freed from another thread.

// Unfortunately, that makes it not possible to visit them during a heap walk or include them in a

// `mi_heap_destroy`. We therefore instead reset/decommit the huge blocks nowadays if freed from

// another thread so the memory becomes "virtually" available (and eventually gets properly freed by

// the owning thread).

// #define MI_HUGE_PAGE_ABANDON 1

// ------------------------------------------------------

// Platform specific values

// ------------------------------------------------------

// ------------------------------------------------------

// Size of a pointer.

// We assume that `sizeof(void*)==sizeof(intptr_t)`

// and it holds for all platforms we know of.

//

// However, the C standard only requires that:

//  p == (void*)((intptr_t)p))

// but we also need:

//  i == (intptr_t)((void*)i)

// or otherwise one might define an intptr_t type that is larger than a pointer...

// ------------------------------------------------------

// assume 128-bit  (as on arm CHERI for example)

// ------------------------------------------------------

// Main internal data-structures

// ------------------------------------------------------

// Main tuning parameters for segment and page sizes

// Sizes for 64-bit (usually divide by two for 32-bit)

// 64KiB  (32KiB on 32-bit)

// 32MiB

// 4MiB on 32-bit

// 64KiB

// 512KiB

// Derived constants

// 1024

// 8KiB on 64-bit

// 128KiB on 64-bit

// 32MiB on 64-bit

// Maximum number of size classes. (spaced exponentially in 12.5% increments)

// Maximum block size for which blocks are guaranteed to be block size aligned. (see `segment.c:_mi_segment_page_start`)

// Alignments over MI_BLOCK_ALIGNMENT_MAX are allocated in dedicated huge page segments

// Maximum slice count (255) for which we can find the page for interior pointers

// we never allocate more than PTRDIFF_MAX (see also <https://sourceware.org/ml/libc-announce/2019/msg00001.html>)

// on 64-bit+ systems we also limit the maximum allocation size such that the slice count fits in 32-bits. (issue #877)

// ------------------------------------------------------

// Mimalloc pages contain allocated blocks

// ------------------------------------------------------

// The free lists use encoded next fields

// (Only actually encodes when MI_ENCODED_FREELIST is defined.)

// thread id's

// free lists contain blocks

// The delayed flags are used for efficient multi-threaded free-ing

// push on the owning heap thread delayed list

// temporary: another thread is accessing the owning heap

// optimize: push on page local thread free queue if another block is already in the heap thread delayed free list

// sticky: used for abondoned pages without a owning heap; this only resets on page reclaim

// The `in_full` and `has_aligned` page flags are put in a union to efficiently

// test if both are false (`full_aligned == 0`) in the `mi_free` routine.

// under thread sanitizer, use a byte for each flag to suppress warning, issue #130

// Thread free list.

// We use the bottom 2 bits of the pointer for mi_delayed_t flags

// A page contains blocks of one specific size (`block_size`).

// Each page has three list of free blocks:

// `free` for blocks that can be allocated,

// `local_free` for freed blocks that are not yet available to `mi_malloc`

// `thread_free` for freed blocks by other threads

// The `local_free` and `thread_free` lists are migrated to the `free` list

// when it is exhausted. The separate `local_free` list is necessary to

// implement a monotonic heartbeat. The `thread_free` list is needed for

// avoiding atomic operations in the common case.

//

// `used - |thread_free|` == actual blocks that are in use (alive)

// `used - |thread_free| + |free| + |local_free| == capacity`

//

// We don't count `freed` (as |free|) but use `used` to reduce

// the number of memory accesses in the `mi_page_all_free` function(s).

//

// Notes:

// - Access is optimized for `free.c:mi_free` and `alloc.c:mi_page_alloc`

// - Using `uint16_t` does not seem to slow things down

// - The size is 12 words on 64-bit which helps the page index calculations

//   (and 14 words on 32-bit, and encoded free lists add 2 words)

// - `xthread_free` uses the bottom bits as a delayed-free flags to optimize

//   concurrent frees where only the first concurrent free adds to the owning

//   heap `thread_delayed_free` list (see `free.c:mi_free_block_mt`).

//   The invariant is that no-delayed-free is only set if there is

//   at least one block that will be added, or as already been added, to

//   the owning heap `thread_delayed_free` list. This guarantees that pages

//   will be freed correctly even if only other threads free blocks.

// "owned" by the segment

// slices in this page (0 if not a page)

// distance from the actual page data slice (0 if a page)

// `true` if the page virtual memory is committed

// `true` if the page was initially zero initialized

// `true` if the page is in a huge segment (`segment->kind == MI_SEGMENT_HUGE`)

// padding

// layout like this to optimize access in `mi_malloc` and `mi_free`

// number of blocks committed, must be the first field, see `segment.c:page_clear`

// number of blocks reserved in memory

// `in_full` and `has_aligned` flags (8 bits)

// `true` if the blocks in the free list are zero initialized

// expiration count for retired blocks

// list of available free blocks (`malloc` allocates from this list)

// list of deferred free blocks by this thread (migrates to `free`)

// number of blocks in use (including blocks in `thread_free`)

// if not zero, then `(1 << block_size_shift) == block_size` (only used for fast path in `free.c:_mi_page_ptr_unalign`)

// tag of the owning heap, used for separated heaps by object type

// padding

// size available in each block (always `>0`)

// start of the page area containing the blocks

// two random keys to encode the free lists (see `_mi_block_next`) or padding canary

// list of deferred free blocks freed by other threads

// next page owned by this thread with the same `block_size`

// previous page owned by this thread with the same `block_size`

// 64-bit 11 words, 32-bit 13 words, (+2 for secure)

// ------------------------------------------------------

// Mimalloc segments contain mimalloc pages

// ------------------------------------------------------

// small blocks go into 64KiB pages inside a segment

// medium blocks go into 512KiB pages inside a segment

// larger blocks go into a single page spanning a whole segment

// a huge page is a single page in a segment of variable size

// used for blocks `> MI_LARGE_OBJ_SIZE_MAX` or an aligment `> MI_BLOCK_ALIGNMENT_MAX`.

// MI_SEGMENT_SIZE size with pages inside.

// segment with just one huge page inside.

// ------------------------------------------------------

// A segment holds a commit mask where a bit is set if

// the corresponding MI_COMMIT_SIZE area is committed.

// The MI_COMMIT_SIZE must be a multiple of the slice

// size. If it is equal we have the most fine grained

// decommit (but setting it higher can be more efficient).

// The MI_MINIMAL_COMMIT_SIZE is the minimal amount that will

// be committed in one go which can be set higher than

// MI_COMMIT_SIZE for efficiency (while the decommit mask

// is still tracked in fine-grained MI_COMMIT_SIZE chunks)

// ------------------------------------------------------

// 64KiB

// ---------------------------------------------------------------

// a memory id tracks the provenance of arena/OS allocated memory

// ---------------------------------------------------------------

// Memory can reside in arena's, direct OS allocated, or statically allocated. The memid keeps track of this.

// not allocated

// not owned by mimalloc but provided externally (via `mi_manage_os_memory` for example)

// allocated in a static area and should not be freed (for arena meta data for example)

// allocated from the OS

// allocated as huge OS pages (usually 1GiB, pinned to physical memory)

// allocated in a remapable area (i.e. using `mremap`)

// allocated from an arena (the usual case)

// actual base address of the block (used for offset aligned allocations)

// alignment at allocation

// index in the arena

// arena id (>= 1)

// this arena can only be used for specific arena allocations

// only used for MI_MEM_OS

// only used for MI_MEM_ARENA

// `true` if we cannot decommit/reset/protect in this memory (e.g. when allocated using large (2Mib) or huge (1GiB) OS pages)

// `true` if the memory was originally allocated as committed

// `true` if the memory was originally zero initialized

// -----------------------------------------------------------------------------------------

// Segments are large allocated memory blocks (8mb on 64 bit) from arenas or the OS.

//

// Inside segments we allocated fixed size mimalloc pages (`mi_page_t`) that contain blocks.

// The start of a segment is this structure with a fixed number of slice entries (`slices`)

// usually followed by a guard OS page and the actual allocation area with pages.

// While a page is not allocated, we view it's data as a `mi_slice_t` (instead of a `mi_page_t`).

// Of any free area, the first slice has the info and `slice_offset == 0`; for any subsequent

// slices part of the area, the `slice_offset` is the byte offset back to the first slice

// (so we can quickly find the page info on a free, `internal.h:_mi_segment_page_of`).

// For slices, the `block_size` field is repurposed to signify if a slice is used (`1`) or not (`0`).

// Small and medium pages use a fixed amount of slices to reduce slice fragmentation, while

// large and huge pages span a variable amount of slices.

// constant fields

// memory id for arena/OS allocation

// can we decommmit the memory

// can we purge the memory (reset or decommit)

// segment fields

// purge slices in the `purge_mask` after this time

// slices that can be purged

// slices that are currently committed

// from here is zero initialized

// the list of freed segments in the cache (must be first field, see `segment.c:mi_segment_init`)

// true if it was reclaimed (used to limit on-free reclamation)

// abandoned pages (i.e. the original owning thread stopped) (`abandoned <= used`)

// count how often this segment is visited during abondoned reclamation (to force reclaim if it takes too long)

// count of pages in use

// verify addresses in debug mode: `mi_ptr_cookie(segment) == segment->cookie`

// for huge segments this may be different from `MI_SLICES_PER_SEGMENT`

// initial count of slices that we are using for segment info and possible guard pages.

// layout like this to optimize access in `mi_free`

// entries in the `slices` array, at most `MI_SLICES_PER_SEGMENT`

// unique id of the thread owning this segment

// one extra final entry for huge blocks with large alignment

// ------------------------------------------------------

// Heaps

// Provide first-class heaps to allocate from.

// A heap just owns a set of pages for allocation and

// can only be allocate/reallocate from the thread that created it.

// Freeing blocks can be done from any thread though.

// Per thread, the segments are shared among its heaps.

// Per thread, there is always a default heap that is

// used for allocation; it is initialized to statically

// point to an empty heap to avoid initialization checks

// in the fast path.

// ------------------------------------------------------

// Thread local data

// Pages of a certain block size are held in a queue.

// Random context

// In debug mode there is a padding structure at the end of the blocks to check for buffer overflows

// encoded block value to check validity of the padding (in case of overflow)

// padding bytes before the block. (mi_usable_size(p) - delta == exact allocated bytes)

// A heap owns a set of pages.

// thread this heap belongs too

// arena id if the heap belongs to a specific arena (or 0)

// random cookie to verify pointers (see `_mi_ptr_cookie`)

// two random keys used to encode the `thread_delayed_free` list

// random number context used for secure allocation

// total number of pages in the `pages` queues.

// smallest retired index (retired pages are fully free, but still in the page queues)

// largest retired index into the `pages` array.

// list of heaps per thread

// `true` if this heap should not reclaim abandoned pages

// custom tag, can be used for separating heaps based on the object types

// optimize: array where every entry points a page with possibly free blocks in the corresponding queue for that size.

// queue of pages for each size class (or "bin")

// ------------------------------------------------------

// Debug

// ------------------------------------------------------

// use our own assertion to print without memory allocation

// ------------------------------------------------------

// Statistics

// ------------------------------------------------------

// ------------------------------------------------------

// Thread Local data

// ------------------------------------------------------

// A "span" is is an available range of slices. The span queues keep

// track of slice spans of at most the given `slice_count` (but more than the previous size class).

// 35 == mi_segment_bin(MI_SLICES_PER_SEGMENT)

// OS thread local data

// start point for next allocation

// points to tld stats

// Segments thread local data

// free slice spans inside segments

// current number of segments;

// peak number of segments

// current size of all segments

// peak size of all segments

// number of reclaimed (abandoned) segments

// points to tld stats

// points to os stats

// Thread local data

// monotonic heartbeat count

// true if deferred was called; used to prevent infinite recursion.

// backing heap of this thread (cannot be deleted)

// list of heaps in this thread (so we can abandon all when the thread terminates)

// segment tld

// os tld

// statistics


=== system/lib/mimalloc/src/alloc-aligned.c ===
SHA256: 4c210d75f6f46a200a609fc2367764beb409c62de55cfe145779645203b29999
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2021, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// mi_prim_get_default_heap

// memset

// ------------------------------------------------------

// Aligned Allocation

// ------------------------------------------------------

// objects up to `MI_MAX_ALIGN_GUARANTEE` are allocated aligned to their size (see `segment.c:_mi_segment_page_start`).

// Fallback aligned allocation that over-allocates -- split out for better codegen

// use OS allocation for very large alignment and allocate inside a huge page (dedicated segment with 1 page)

// This can support alignments >= MI_SEGMENT_SIZE by ensuring the object can be aligned at a point in the

// first (and single) page such that the segment info is `MI_SEGMENT_SIZE` bytes before it (so it can be found by aligning the pointer down)

// todo: cannot support offset alignment for very large alignments yet

/* ensure we use generic malloc path */

// the page block size should be large enough to align in the single huge page block

// zero afterwards as only the area from the aligned_p may be committed!

// otherwise over-allocate

// .. and align within the allocation

// for any x, `(x & align_mask) == (x % alignment)`

// todo: expand padding if overallocated ?

// now zero the block if needed

// for the tracker, on huge aligned allocations only the memory from the start of the large block is defined

// Generic primitive aligned allocation -- split out for better codegen

// we don't allocate more than MI_MAX_ALLOC_SIZE (see <https://sourceware.org/ml/libc-announce/2019/msg00001.html>)

// use regular allocation if it is guaranteed to fit the alignment constraints.

// this is important to try as the fast path in `mi_heap_malloc_zero_aligned` only works when there exist

// a page with the right block size, and if we always use the over-alloc fallback that would never happen.

// this should never happen if the `mi_malloc_is_naturally_aligned` check is correct..

// fall back to over-allocation

// Primitive aligned allocation

// note: we don't require `size > offset`, we just guarantee that the address at offset is aligned regardless of the allocated size.

// require power-of-two (see <https://en.cppreference.com/w/c/memory/aligned_alloc>)

// try first if there happens to be a small block available with just the right alignment

// for any x, `(x & align_mask) == (x % alignment)`

// call specific page malloc for better codegen

// fallback to generic aligned allocation

// ------------------------------------------------------

// Optimized mi_heap_malloc_aligned / mi_malloc_aligned

// ------------------------------------------------------

// ensure a definition is emitted

// ------------------------------------------------------

// Aligned Allocation

// ------------------------------------------------------

// ------------------------------------------------------

// Aligned re-allocation

// ------------------------------------------------------

// reallocation still fits, is aligned and not more than 50% waste

// note: we don't zero allocate upfront so we only zero initialize the expanded part

// also set last word in the previous allocation to zero to ensure any padding is zero-initialized

// only free if successful

// use offset of previous allocation (p can be NULL)


=== system/lib/mimalloc/src/alloc-override.c ===
SHA256: 90974f49f64d136754e31f43c5da9adae380abba61b4222a5e8bd287982e62ea
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2021, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// helper definition for C override of C++ new

// ------------------------------------------------------

// Override system malloc

// ------------------------------------------------------

// gcc, clang: use aliasing to alias the exported function to one of our `mi_` functions

// or we get warnings that nodiscard is ignored on a forward

// XXX EMSCRIPTEN: Add "weak"

// otherwise use forwarding by calling our `mi_` function

// define MI_OSX_IS_INTERPOSED as we should not provide forwarding definitions for

// functions that are interposed (or the interposing does not work)

// use interposing so `DYLD_INSERT_LIBRARIES` works without `DYLD_FORCE_FLAT_NAMESPACE=1`

// See: <https://books.google.com/books?id=K8vUkpOXhN4C&pg=PA73>

// we interpose malloc_default_zone in alloc-override-osx.c so we can use mi_free safely

// sometimes code allocates from default zone but deallocates using plain free :-( (like NxHashResizeToCapacity <https://github.com/nneonneo/osx-10.9-opensource/blob/master/objc4-551.1/runtime/hashtable2.mm>)

// use safe free that checks if pointers are from us

// delete

// delete[]

// delete

// delete[]

// new

// new[]

// new nothrow

// new[] nothrow

// cannot override malloc unless using a dll.

// we just override new/delete which does work in a static library.

// On all other systems forward allocation primitives to our API

// In principle we do not need to forward `strdup`/`strndup` but on some systems these do not use `malloc` internally (but a more primitive call)

// We only override if `strdup` is not a macro (as on some older libc's, see issue #885)

// ------------------------------------------------------

// Override new/delete

// This is not really necessary as they usually call

// malloc/free anyway, but it improves performance.

// ------------------------------------------------------

// ------------------------------------------------------

// With a C++ compiler we override the new/delete operators.

// see <https://en.cppreference.com/w/cpp/memory/new/operator_new>

// ------------------------------------------------------

// ------------------------------------------------------

// Override by defining the mangled C++ names of the operators (as

// used by GCC and CLang).

// See <https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling>

// ------------------------------------------------------

// delete

// delete[]

// operator delete(void*, std::nothrow_t const&) 

// operator delete[](void*, std::nothrow_t const&)

// operator delete(void*, std::align_val_t, std::nothrow_t const&) 

// operator delete[](void*, std::align_val_t, std::nothrow_t const&) 

// new 64-bit

// new[] 64-bit

// new 64-bit

// new[] 64-bit

// __cplusplus

// ------------------------------------------------------

// Further Posix & Unix functions definitions

// ------------------------------------------------------

// Forward Posix/Unix calls as well

// No forwarding here due to aliasing/name mangling issues

// XXX EMSCRIPTEN

// XXX EMSCRIPTEN

// `aligned_alloc` is only available when __USE_ISOC11 is defined.

// Note: it seems __USE_ISOC11 is not defined in musl (and perhaps other libc's) so we only check

// for it if using glibc.

// Note: Conda has a custom glibc where `aligned_alloc` is declared `static inline` and we cannot

// override it, but both _ISOC11_SOURCE and __USE_ISOC11 are undefined in Conda GCC7 or GCC9.

// Fortunately, in the case where `aligned_alloc` is declared as `static inline` it

// uses internally `memalign`, `posix_memalign`, or `_aligned_malloc` so we  can avoid overriding it ourselves.

// XXX EMSCRIPTEN

// no forwarding here due to aliasing/name mangling issues

// XXX EMSCRIPTEN

// XXX EMSCRIPTEN

// some systems define reallocarr so mark it as a weak symbol (#751)

// forward __libc interface (see PR #667)

// XXX EMSCRIPTEN

// emscripten adds some more on top of WASI

// forward __libc interface (needed for glibc-based Linux distributions)

// MI_MALLOC_OVERRIDE && !_WIN32


=== system/lib/mimalloc/src/alloc-posix.c ===
SHA256: 4110c34bbd3f212055354cca73303acc773f383a84e37e8db9d4df95338e374d
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2021, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// ------------------------------------------------------------------------

// mi prefixed publi definitions of various Posix, Unix, and C++ functions

// for convenience and used when overriding these functions.

// ------------------------------------------------------------------------

// ------------------------------------------------------

// Posix & Unix functions definitions

// ------------------------------------------------------

// memset

// getenv

// getenv _wgetenv

// if (!mi_is_in_heap_region(p)) return 0;

// if (!mi_is_in_heap_region(p)) return 0;

// Note: The spec dictates we should not modify `*p` on an error. (issue#27)

// <http://man7.org/linux/man-pages/man3/posix_memalign.3.html>

// natural alignment

// it is also required that alignment is a power of 2 and > 0; this is checked in `mi_malloc_aligned`

// not a power of 2

// overflow

// C11 requires the size to be an integral multiple of the alignment, see <https://en.cppreference.com/w/c/memory/aligned_alloc>.

// unfortunately, it turns out quite some programs pass a size that is not an integral multiple so skip this check..

/* if mi_unlikely((size & (alignment - 1)) != 0) { // C11 requires alignment>0 && integral multiple, see <https://en.cppreference.com/w/c/memory/aligned_alloc>
      #if MI_DEBUG > 0
      _mi_error_message(EOVERFLOW, "(mi_)aligned_alloc requires the size to be an integral multiple of the alignment (size %zu, alignment %zu)\n", size, alignment);
      #endif
      return NULL;
    }
  */

// C11 also requires alignment to be a power-of-two (and > 0) which is checked in mi_malloc_aligned

// BSD

// NetBSD

// Microsoft

// mscver warning 4996

// not supported

// msvc warning 4996

// Microsoft

// Microsoft


=== system/lib/mimalloc/src/alloc.c ===
SHA256: fdf55126f310b13f61dfd8a1e2b784cad9498c205fa54097ac56c9d51bd5f78f
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2024, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// for realpath() on Linux

// _mi_prim_thread_id()

// memset, strlen (for mi_strdup)

// malloc, abort

// ------------------------------------------------------

// Allocation

// ------------------------------------------------------

// Fast allocation in a page: just pop from the free list.

// Fall back to generic allocation only if the list is empty.

// Note: in release mode the (inlined) routine is about 7 instructions with a single test.

/* empty heap */

// pop from the free list

// allow use of the block internally

// note: when tracking we need to avoid ever touching the MI_PADDING since

// that is tracked by valgrind etc. as non-accessible (through the red-zone, see `mimalloc/track.h`)

// zero the block? note: we need to zero the full block size (issue #63)

// do not call with zero'ing for huge blocks (see _mi_malloc_generic)

// don't leak internal data

// && !MI_TRACK_ENABLED

// note: re-enable since mi_page_usable_block_size may set noaccess

// set at most N initial padding bytes

// extra entries for improved efficiency in `alloc-aligned.c`.

// heaps are thread local

// allocate a small block

// The main allocation function

// heaps are thread local

// note: size can overflow but it is detected in malloc_generic

// zero initialized small block

// Uninitialized `calloc`

// Expand (or shrink) in place (or fail)

// we do not shrink/expand with padding enabled

// it fits

// if p == NULL then behave as malloc.

// else if size == 0 then reallocate to a zero-sized block (and don't return NULL, just as mi_malloc(0)).

// (this means that returning NULL always indicates an error, and `p` will not have been freed in that case.)

// also works if p == NULL (with size 0)

// note: newsize must be > 0 or otherwise we return NULL for realloc(NULL,0)

// todo: do not track as the usable size is still the same in the free; adjust potential padding?

// mi_track_resize(p,size,newsize)

// if (newsize < size) { mi_track_mem_noaccess((uint8_t*)p + newsize, size - newsize); }

// reallocation still fits and not more than 50% waste

// also set last word in the previous allocation to zero to ensure any padding is zero-initialized

// work around for applications that expect zero-reallocation to be zero initialized (issue #725)

// _mi_useable_size may be too large for byte precise memory tracking..

// only free the original pointer if successful

// Reallocate but free `p` on errors

// Reallocate but free `p` on errors

// ------------------------------------------------------

// strdup, strndup, and realpath

// ------------------------------------------------------

// `strdup` using mi_malloc

// `strndup` using mi_malloc

// len <= n

// `realpath` using mi_malloc

// todo: use GetFullPathNameW to allow longer file names

/*
#include <unistd.h>  // pathconf
static size_t mi_path_max(void) {
  static size_t path_max = 0;
  if (path_max <= 0) {
    long m = pathconf("/",_PC_PATH_MAX);
    if (m <= 0) path_max = 4096;      // guess
    else if (m < 256) path_max = 256; // at least 256
    else path_max = m;
  }
  return path_max;
}
*/

// use checked free (which may be redirected to our free but that's ok)

// note: with ASAN realpath is intercepted and mi_cfree may leak the returned pointer :-(

/*
    const size_t n  = mi_path_max();
    char* buf = (char*)mi_malloc(n+1);
    if (buf == NULL) {
      errno = ENOMEM;
      return NULL;
    }
    char* rname  = realpath(fname,buf);
    char* result = mi_heap_strndup(heap,rname,n); // ok if `rname==NULL`
    mi_free(buf);
    return result;
  }
  */

/*-------------------------------------------------------
C++ new and new_aligned
The standard requires calling into `get_new_handler` and
throwing the bad_alloc exception on failure. If we compile
with a C++ compiler we can implement this precisely. If we
use a C compiler we cannot throw a `bad_alloc` exception
but we call `exit` instead (i.e. not returning).
-------------------------------------------------------*/

// exceptions are not always enabled

// exclude clang-cl, see issue #631

// note: on windows we could dynamically link to `?get_new_handler@std@@YAP6AXXZXZ`.

// cannot throw in plain C, use abort

// on overflow we invoke the try_new_handler once to potentially throw std::bad_alloc

// on overflow we invoke the try_new_handler once to potentially throw std::bad_alloc

// ------------------------------------------------------

// ensure explicit external inline definitions are emitted!

// ------------------------------------------------------

// (void*)&mi_heap_alloc_new,

// (void*)&mi_heap_alloc_new_n


=== system/lib/mimalloc/src/arena.c ===
SHA256: 8cab69c2722b25264df63001e04c886ceea573462d17cf4c6b1ac0b154ec6b91
/* ----------------------------------------------------------------------------
Copyright (c) 2019-2023, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

/* ----------------------------------------------------------------------------
"Arenas" are fixed area's of OS memory from which we can allocate
large blocks (>= MI_ARENA_MIN_BLOCK_SIZE, 4MiB).
In contrast to the rest of mimalloc, the arenas are shared between
threads and need to be accessed using atomic operations.

Arenas are used to for huge OS page (1GiB) reservations or for reserving
OS memory upfront which can be improve performance or is sometimes needed
on embedded devices. We can also employ this with WASI or `sbrk` systems
to reserve large arenas upfront and be able to reuse the memory more effectively.

The arena allocation needs to be thread safe and we use an atomic bitmap to allocate.
-----------------------------------------------------------------------------*/

// memset

// ENOMEM

// atomic bitmap

/* -----------------------------------------------------------
  Arena allocation
----------------------------------------------------------- */

// Block info: bit 0 contains the `in_use` bit, the upper bits the

// size in count of arena blocks.

// 64MiB  (must be at least MI_SEGMENT_ALIGN)

// 32MiB

// not more than 126 (since we use 7 bits in the memid and an arena index + 1)

// A memory arena descriptor

// arena id; 0 for non-specific

// memid of the memory area

// the start of the memory area

// size of the area in arena blocks (of `MI_ARENA_BLOCK_SIZE`)

// number of bitmap fields (where `field_count * MI_BITMAP_FIELD_BITS >= block_count`)

// size of the arena structure itself (including its bitmaps)

// memid of the arena structure itself (OS or static allocation)

// associated NUMA node

// only allow allocations if specifically for this arena

// memory area consists of large- or huge OS pages (always committed)

// optimization to start the search for free blocks

// expiration time when blocks should be decommitted from `blocks_decommit`.  

// are the blocks potentially non-zero?

// are the blocks committed? (can be NULL for memory that cannot be decommitted)

// blocks that can be (reset) decommitted. (can be NULL for memory that cannot be (reset) decommitted)

// blocks that start with an abandoned segment. (This crosses API's but it is convenient to have here)

// in-place bitmap of in-use blocks (of size `field_count`)

// do not add further fields here as the dirty, committed, purged, and abandoned bitmaps follow the inuse bitmap fields.

// The available arenas

// = 0

//static bool mi_manage_os_memory_ex2(void* start, size_t size, bool is_large, int numa_node, bool exclusive, mi_memid_t memid, mi_arena_id_t* arena_id) mi_attr_noexcept;

/* -----------------------------------------------------------
  Arena id's
  id = arena_index + 1
----------------------------------------------------------- */

/* -----------------------------------------------------------
  Arena allocations get a (currently) 16-bit memory id where the
  lower 8 bits are the arena id, and the upper bits the block index.
----------------------------------------------------------- */

/* -----------------------------------------------------------
  Special static area for mimalloc internal structures
  to avoid OS calls (for example, for the arena metadata)
----------------------------------------------------------- */

// 8 KiB on 64-bit

// must be cache aligned, see issue #895

// try to claim space

// try to roll back, ok if this fails

// success

// try static

// or fall back to the OS

// zero the OS memory if needed

/* -----------------------------------------------------------
  Thread safe allocation in an arena
----------------------------------------------------------- */

// claim the `blocks_inuse` bits

// mi_atomic_load_relaxed(&arena->search_idx);  // start from last search; ok to be relaxed as the exact start does not matter

// start search from found location next time around

/* -----------------------------------------------------------
  Arena Allocation
----------------------------------------------------------- */

// claimed it!

// none of the claimed blocks should be scheduled for a decommit

// this is thread safe as a potential purge only decommits parts that are not yet claimed as used (in `blocks_inuse`).

// set the dirty bits (todo: no need for an atomic op here?)

// set commit state

// always committed

// commit requested, but the range may not be committed as a whole: ensure it is committed now

// no need to commit, but check if already fully committed

// allocate in a speficic arena

// Check arena suitability

// in not specific, check numa affinity

// try to allocate

// allocate from an arena with fallback to the OS

// try a specific arena if requested

// try numa affine allocation

// try from another numa node instead..

// if numa_node was < 0 (no specific affinity requested), all arena's have been tried already

/* only proceed if not numa local */

// try to reserve a fresh arena space

// use OS only while pre loading

// be conservative if virtual reserve is not supported (for WASM for example)

// scale up the arena sizes exponentially

// should be able to at least handle the current allocation size

// commit eagerly?

/* exclusive? */

// current numa node

// try to allocate in an arena if the alignment is small enough and the object is not too small (as for heap meta data)

// is arena allocation allowed?

// otherwise, try to first eagerly reserve a new arena

// and try allocate in there

// if we cannot use OS allocation, return NULL

// finally, fall back to the OS

/* -----------------------------------------------------------
  Arena purge
----------------------------------------------------------- */

// <0 = no purging allowed, 0=immediate purging, >0=milli-second delay

// reset or decommit in an arena and update the committed/decommit bitmaps

// assumes we own the area (i.e. blocks_in_use is claimed by us)

// all blocks are committed, we can purge freely

// some blocks are not committed -- this can happen when a partially committed block is freed

// in `_mi_arena_free` and it is conservatively marked as uncommitted but still scheduled for a purge

// we need to ensure we do not try to reset (as that may be invalid for uncommitted memory),

// and also undo the decommit stats (as it was already adjusted)

/* allow reset? */

// clear the purged blocks

// update committed bitmap

// Schedule a purge. This is usually delayed to avoid repeated decommit/commit calls.

// Note: assumes we (still) own the area as we may purge immediately

// is purging allowed at all?

// decommit directly

// schedule decommit

// add smallish extra delay

// purge a range of blocks

// return true if the full range was purged.

// assumes we own the area (i.e. blocks_in_use is claimed by us)

// count consequetive ones in the purge mask

// found range to be purged

// +1 to skip the zero bit (or end)

// returns true if anything was purged

// reset expire (if not already set concurrently)

// potential purges scheduled, walk through the bitmap

// find consequetive range of ones in the purge mask

// try to claim the longest range of corresponding in_use bits

// actual claimed bits at `in_use`

// read purge again now that we have the in_use bits

// release the claimed `in_use` bits again

// +1 to skip the zero (or end)

// while bitidx

// purge != 0

// if not fully purged, make sure to purge again in the future

// nothing will be scheduled

// allow only one thread to purge at a time

/* -----------------------------------------------------------
  Arena free
----------------------------------------------------------- */

// was a direct OS allocation, pass through

// if partially committed, adjust the committed stats (as `_mi_os_free` will increase decommit by the full size)

// allocated in an arena

// checks

// need to set all memory to undefined as some parts may still be marked as no_access (like padding etc.)

// potentially decommit

// mark the entire range as no longer committed (so we recommit the full range when re-using)

// if partially committed, adjust the committed stats (is it will be recommitted when re-using)

// in the delayed purge, we now need to not count a decommit if the range is not marked as committed.

// note: if not all committed, it may be that the purge will reset/decommit the entire range

// that contains already decommitted parts. Since purge consistently uses reset or decommit that

// works (as we should never reset decommitted parts).

// (delay) purge the entire range

// and make it available to others again

// arena was none, external, or static; nothing to do

// purge expired decommits

// destroy owned arenas; this is unsafe and should only be done using `mi_option_destroy_on_exit`

// for dynamic libraries that are unloaded and need to release all their allocated memory.

// try to lower the max arena.

// Purge the arenas; if `force_purge` is true, amenable parts are purged even if not yet expired

/* visit all? */

// destroy owned arenas; this is unsafe and should only be done using `mi_option_destroy_on_exit`

// for dynamic libraries that are unloaded and need to release all their allocated memory.

/* force purge */

// purge non-owned arenas

// Is a pointer inside any of our arenas?

/* -----------------------------------------------------------
  Abandoned blocks/segments.
  This is used to atomically abandon/reclaim segments 
  (and crosses the arena API but it is convenient to have here).
  Abandoned segments still have live blocks; they get reclaimed
  when a thread frees a block in it, or when a thread needs a fresh
  segment; these threads scan the abandoned segments through
  the arena bitmaps.
----------------------------------------------------------- */

// Maintain a count of all abandoned segments

// reclaim a specific abandoned segment; `true` on success.

// sets the thread_id.

// not in an arena, consider it un-abandoned now.

// but we need to still claim it atomically -- we use the thread_id for that.

// arena segment: use the blocks_abandoned bitmap.

// mi_assert_internal(was_marked);

//mi_assert_internal(arena->blocks_committed == NULL || _mi_bitmap_is_claimed(arena->blocks_committed, arena->field_count, 1, bitmap_idx));

// mark a specific segment as abandoned

// clears the thread_id.

// not in an arena; count it as abandoned and return

// start a cursor at a randomized arena

// reclaim abandoned segments 

// this does not set the thread id (so it appears as still abandoned)

// visit arena's (from previous)

// wrap around

// visit the abandoned fields (starting at previous_idx)

// skip zero fields quickly

// visit each set bit in the field  (todo: maybe use `ctz` here?)

// pre-check if the bit is set

// try to reclaim it atomically

//mi_assert_internal(arena->blocks_committed == NULL || _mi_bitmap_is_claimed(arena->blocks_committed, arena->field_count, 1, bitmap_idx));

// no more found

/* -----------------------------------------------------------
  Add an arena.
----------------------------------------------------------- */

// TODO: can we avoid allocating from the OS?

// already zero'd due to zalloc

// _mi_memzero(arena, asize);

// TODO: or get the current numa node if -1? (now it allows anyone to allocate on -1)

// consequetive bitmaps

// just after inuse bitmap

// just after dirty bitmap

// just after abandoned bitmap

// just after committed bitmap

// initialize committed bitmap?

// cast to void* to avoid atomic warning

// and claim leftover blocks if needed (so we never allocate there)

// don't use leftover bits at the end

// Reserve a range of regular OS memory

// at least one block

// todo: use separate is_large field?

/* numa node */

// Manage a range of regular OS memory

/* exclusive? */

// Reserve a range of regular OS memory

/* -----------------------------------------------------------
  Debugging
----------------------------------------------------------- */

/* -----------------------------------------------------------
  Reserve a huge page arena.
----------------------------------------------------------- */

// reserve at a specific numa node

// reserve huge pages evenly among the given number of numa nodes (or use the available ones as detected)

// pages per numa node

// reserve evenly among numa nodes

// can be 0


=== system/lib/mimalloc/src/bitmap.c ===
SHA256: ed71962d647e64773a5563b65b76f276487b09d7a18bd4c0c5b06a03c076c6f5
/* ----------------------------------------------------------------------------
Copyright (c) 2019-2023 Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

/* ----------------------------------------------------------------------------
Concurrent bitmap that can set/reset sequences of bits atomically,
represented as an array of fields where each field is a machine word (`size_t`)

There are two api's; the standard one cannot have sequences that cross
between the bitmap fields (and a sequence must be <= MI_BITMAP_FIELD_BITS).

The `_across` postfixed functions do allow sequences that can cross over
between the fields. (This is used in arena allocation)
---------------------------------------------------------------------------- */

/* -----------------------------------------------------------
  Bitmap definition
----------------------------------------------------------- */

// The bit mask for a given number of blocks at a specified bit index.

/* -----------------------------------------------------------
  Claim a bit sequence atomically
----------------------------------------------------------- */

// Try to atomically claim a sequence of `count` bits in a single

// field at `idx` in `bitmap`. Returns `true` on success.

// short cut

// search for 0-bit sequence of length count

// quickly find the first zero bit if possible

// otherwise start at 0

// invariant: m == mask shifted by bitidx

// scan linearly for a free range of zero bits

// are the mask bits free at bitidx?

// no overflow?

// TODO: use weak cas here?

// no success, another thread claimed concurrently.. keep going (with updated `map`)

// success, we claimed the bits!

// on to the next bit range

// no bits found

// Find `count` bits of 0 and set them to 1 atomically; returns `true` on success.

// Starts at idx, and wraps around to search in all `bitmap_fields` fields.

// `count` can be at most MI_BITMAP_FIELD_BITS and will never cross fields.

// wrap

// Like _mi_bitmap_try_find_from_claim but with an extra predicate that must be fullfilled

// wrap

// predicate returned false, unclaim and look further

// Set `count` bits at `bitmap_idx` to 0 atomically

// Returns `true` if all `count` bits were 1 previously.

// mi_assert_internal((bitmap[idx] & mask) == mask);

// Set `count` bits at `bitmap_idx` to 1 atomically

// Returns `true` if all `count` bits were 0 previously. `any_zero` is `true` if there was at least one zero bit.

//mi_assert_internal(any_zero != NULL || (bitmap[idx] & mask) == 0);

// Returns `true` if all `count` bits were 1. `any_ones` is `true` if there was at least one bit set to one.

// Try to set `count` bits at `bitmap_idx` from 0 to 1 atomically. 

// Returns `true` if successful when all previous `count` bits were 0.

//--------------------------------------------------------------------------

// the `_across` functions work on bitmaps where sequences can cross over

// between the fields. This is used in arena allocation

//--------------------------------------------------------------------------

// Try to atomically claim a sequence of `count` bits starting from the field

// at `idx` in `bitmap` and crossing into subsequent fields. Returns `true` on success.

// Only needs to consider crossing into the next fields (see `mi_bitmap_try_find_from_claim_across`)

// check initial trailing zeros

// count of initial zeros starting at idx

// no need to cross fields (this case won't happen for us)

// not enough entries

// scan ahead

// mask bits for the final field

// some part is already claimed

// we found a range of contiguous zeros up to the final field; mask contains mask in the final field

// now try to claim the range atomically

// initial field

// intermediate fields

// final field

// claimed!

// roll back intermediate fields

// (we just failed to claim `field` so decrement first)

// (if we failed on the initial field, `field + 1 == initial_field`)

// retry? (we make a recursive call instead of goto to be able to use const declarations)

// Find `count` bits of zeros and set them to 1 atomically; returns `true` on success.

// Starts at idx, and wraps around to search in all `bitmap_fields` fields.

// we don't bother with crossover fields for small counts

// visit the fields

// wrap

// first try to claim inside a field

/*
    if (count <= MI_BITMAP_FIELD_BITS) {
      if (_mi_bitmap_try_find_claim_field(bitmap, idx, count, bitmap_idx)) {
        return true;
      }
    }
    */

// if that fails, then try to claim across fields

// Helper for masks across fields; returns the mid count, post_mask may be 0

// Set `count` bits at `bitmap_idx` to 0 atomically

// Returns `true` if all `count` bits were 1 previously.

// clear first part

// clear mid part

// clear end part

// Set `count` bits at `bitmap_idx` to 1 atomically

// Returns `true` if all `count` bits were 0 previously. `any_zero` is `true` if there was at least one zero bit.

// Returns `true` if all `count` bits were 1.

// `any_ones` is `true` if there was at least one bit set to one.


=== system/lib/mimalloc/src/bitmap.h ===
SHA256: d28f202d03e9d1e9d3ebefdb81c3ff96eb935711b720e3fbe351b71de223fda4
/* ----------------------------------------------------------------------------
Copyright (c) 2019-2023 Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

/* ----------------------------------------------------------------------------
Concurrent bitmap that can set/reset sequences of bits atomically,
represented as an array of fields where each field is a machine word (`size_t`)

There are two api's; the standard one cannot have sequences that cross
between the bitmap fields (and a sequence must be <= MI_BITMAP_FIELD_BITS).
(this is used in region allocation)

The `_across` postfixed functions do allow sequences that can cross over
between the fields. (This is used in arena allocation)
---------------------------------------------------------------------------- */

/* -----------------------------------------------------------
  Bitmap definition
----------------------------------------------------------- */

// all bits set

// An atomic bitmap of `size_t` fields

// A bitmap index is the index of the bit in a bitmap.

// Create a bit index.

// Create a bit index.

// Get the field index from a bit index.

// Get the bit index in a bitmap field

// Get the full bit index

/* -----------------------------------------------------------
  Claim a bit sequence atomically
----------------------------------------------------------- */

// Try to atomically claim a sequence of `count` bits in a single

// field at `idx` in `bitmap`. Returns `true` on success.

// Starts at idx, and wraps around to search in all `bitmap_fields` fields.

// For now, `count` can be at most MI_BITMAP_FIELD_BITS and will never cross fields.

// Like _mi_bitmap_try_find_from_claim but with an extra predicate that must be fullfilled

// Set `count` bits at `bitmap_idx` to 0 atomically

// Returns `true` if all `count` bits were 1 previously.

// Try to set `count` bits at `bitmap_idx` from 0 to 1 atomically. 

// Returns `true` if successful when all previous `count` bits were 0.

// Set `count` bits at `bitmap_idx` to 1 atomically

// Returns `true` if all `count` bits were 0 previously. `any_zero` is `true` if there was at least one zero bit.

//--------------------------------------------------------------------------

// the `_across` functions work on bitmaps where sequences can cross over

// between the fields. This is used in arena allocation

//--------------------------------------------------------------------------

// Find `count` bits of zeros and set them to 1 atomically; returns `true` on success.

// Starts at idx, and wraps around to search in all `bitmap_fields` fields.

// Set `count` bits at `bitmap_idx` to 0 atomically

// Returns `true` if all `count` bits were 1 previously.

// Set `count` bits at `bitmap_idx` to 1 atomically

// Returns `true` if all `count` bits were 0 previously. `any_zero` is `true` if there was at least one zero bit.


=== system/lib/mimalloc/src/free.c ===
SHA256: dde8c3501935b29be069a571a8950efa7a4d637b3f249fec90a07ff23b40d87d
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2024, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// add includes help an IDE

// _mi_prim_thread_id()

// forward declarations

// ------------------------------------------------------

// Free

// ------------------------------------------------------

// forward declaration of multi-threaded free (`_mt`) (or free in huge block if compiled with MI_HUGE_PAGE_ABANDON)

// regular free of a (thread local) block pointer

// fast path written carefully to prevent spilling on the stack

// checks

// huge page content may be already decommitted

// faster then mi_usable_size as we already know the page and that p is unaligned

// actual free: push on the local free list

// Adjust a block that was allocated aligned, to the actual start of the block in the page.

// note: this can be called from `mi_free_generic_mt` where a non-owning thread accesses the 

// `page_start` and `block_size` fields; however these are constant and the page won't be 

// deallocated (as the block we are freeing keeps it alive) and thus safe to read concurrently.

// free a local pointer  (page parameter comes first for better codegen)

/* track stats */

/* check for a full page */

// free a pointer owned by another thread (page parameter comes first for better codegen)

// don't check `has_aligned` flag to avoid a race (issue #865)

// generic free (for runtime integration)

// Get the segment data belonging to a pointer

// This is just a single `and` in release mode but does further checks in debug mode

// (and secure mode) to see if this was a valid pointer.

// linux tends to align large blocks above 0x7F000000000 (issue #640)

// Free a block

// Fast path written carefully to prevent register spilling on the stack

// thread-local free?

// and it is not a full page (full pages need to move from the full bin), nor has aligned blocks (aligned blocks need to be unaligned)

// thread-local, aligned, and not a full page

/* track stats */

/* no need to check if the page is full */

// page is full or contains (inner) aligned blocks; use generic path

// not thread-local; use generic path

// return true if successful

// get segment and page

// Clear the no-delayed flag so delayed freeing is used again for this page.

// This must be done before collecting the free lists on this page -- otherwise

// some blocks may end up in the page `thread_free` list with no blocks in the

// heap `thread_delayed_free` list which may cause the page to be never freed!

// (it would only be freed if we happen to scan it in `mi_page_queue_find_free_ex`)

/* dont overwrite never delayed */

// collect all other non-local frees (move from `thread_free` to `free`) to ensure up-to-date `used` count

// and free the block (possibly freeing the page as well since `used` is updated)

/* stats have already been adjusted */

/* check for a full page */

// ------------------------------------------------------

// Multi-threaded Free (`_mt`)

// ------------------------------------------------------

// Push a block that is owned by another thread on its page-local thread free

// list or it's heap delayed free list. Such blocks are later collected by

// the owning thread in `_mi_free_delayed_block`.

// Try to put the block on either the page-local thread free list,

// or the heap delayed free list (if this is the first non-local free in that page)

// unlikely: this only happens on the first concurrent free in a page that is in the full list

// usual: directly add to page thread_free list

// If this was the first non-local free, we need to push it on the heap delayed free list instead

// racy read on `heap`, but ok because MI_DELAYED_FREEING is set (see `mi_heap_delete` and `mi_heap_collect_abandon`)

//mi_page_heap(page);

// add to the delayed free list of this heap. (do this atomically as the lock only protects heap memory validity)

// and reset the MI_DELAYED_FREEING flag

// Multi-threaded free (`_mt`) (or free in huge block if compiled with MI_HUGE_PAGE_ABANDON)

// first see if the segment was abandoned and if we can reclaim it into our thread

// the segment is abandoned, try to reclaim it into our heap

// recursively free as now it will be a local free in our heap

// The padding check may access the non-thread-owned page for the key values.

// that is safe as these are constant and the page won't be freed (as the block is not freed yet).

// adjust stats (after padding check and potentially recursive `mi_free` above)

// stat_free may access the padding

// for small size, ensure we can fit the delayed thread pointers without triggering overflow detection

// huge page segments are always abandoned and can be freed immediately

// huge pages are special as they occupy the entire segment

// as these are large we reset the memory occupied by the page so it is available to other threads

// (as the owning thread needs to actually free the memory later).

// note: when tracking, cannot use mi_usable_size with multi-threading

// and finally free the actual block by pushing it on the owning heap

// thread_delayed free list (or heap delayed free list)

// ------------------------------------------------------

// Usable size

// ------------------------------------------------------

// Bytes available in a block

// split out to separate routine for improved code generation

// ------------------------------------------------------

// Free variants

// ------------------------------------------------------

// ------------------------------------------------------

// Check for double free in secure and debug mode

// This is somewhat expensive so only enabled for secure mode 4

// ------------------------------------------------------

// linear check if the free list contains a specific element

// The decoded value is in the same page (or NULL).

// Walk the free lists to verify positively if it is already freed

// pretend it is freed, and get the decoded first field

// quick check: aligned pointer?

// quick check: in same page or NULL?

// Suspicious: decoded value a in block is in the same page (or NULL) -- maybe a double free?

// (continue in separate function to improve code generation)

// ---------------------------------------------------------------------------

// Check for heap block overflow by setting up padding at the end of the block

// ---------------------------------------------------------------------------

// && !MI_TRACK_ENABLED

// Return the exact usable size of a block.

// When a non-thread-local block is freed, it becomes part of the thread delayed free

// list that is freed later by the owning heap. If the exact usable size is too small to

// contain the pointer for the delayed list, then shrink the padding (by decreasing delta)

// so it will later not trigger an overflow error in `mi_free_block`.

// usually already enough space

// should never happen

// check at most the first N padding bytes

// only maintain stats for smaller objects if requested


=== system/lib/mimalloc/src/heap.c ===
SHA256: 2eea3df2e0597da769b20476bcfd7ab2c09d38ed0d545f1d5b9203fe0f65952a
/*----------------------------------------------------------------------------
Copyright (c) 2018-2021, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// mi_prim_get_default_heap

// memset, memcpy

// non-constant aggregate initializer

/* -----------------------------------------------------------
  Helpers
----------------------------------------------------------- */

// return `true` if ok, `false` to break

// Visit all pages in a heap; returns `false` if break was called.

// visit all pages

// save next in case the page gets removed from the queue

// and continue

/* -----------------------------------------------------------
  "Collect" pages by migrating `local_free` and `thread_free`
  lists and freeing empty pages. This is done when a thread
  stops (and in that case abandons pages if there are still
  blocks alive)
----------------------------------------------------------- */

// note: call before a potential `_mi_page_free` as the segment may be freed if this was the last used page in that segment.

/* force? */

// no more used blocks, free the page.

// note: this will free retired pages as well.

// still used blocks but the thread is done; abandon the page

// don't break

// don't break

// python/cpython#112532: we may be called from a thread that is not the owner of the heap

// note: never reclaim on collect but leave it to threads that need storage to reclaim

// the main thread is abandoned (end-of-program), try to reclaim all abandoned segments.

// if all memory is freed by now, all segments should be freed.

// if abandoning, mark all pages to no longer add to delayed_free

// free all current thread delayed blocks.

// (if abandoning, after this there are no more thread-delayed references into the pages.)

// collect retired pages

// collect all pages owned by this thread

// collect abandoned segments (in particular, purge expired parts of segments in the abandoned segment list)

// note: forced purge can be quite expensive if many threads are created/destroyed so we do not force on abandonment

/* force? */

// if forced, collect thread data cache on program-exit (or shared library unload)

// collect thread data cache

// collect arenas (this is program wide so don't force purges on abandonment of threads)

/* force purge? */

/* -----------------------------------------------------------
  Heap new
----------------------------------------------------------- */

// push on the thread local heaps list

// todo: OS allocate in secure mode?

// don't reclaim abandoned pages or otherwise destroy is unsafe  

/* no reclaim */

/* default tag */

// zero out the page queues

// TODO: copy full empty heap instead?

// called from `mi_heap_destroy` and `mi_heap_delete` to free the internal heap resources.

// dont free the backing heap

// reset default

// remove ourselves from the thread local heaps list

// linear search but we expect the number of heaps to be relatively small

// and free the used memory

// return a heap on the same thread as `heap` specialized for the specified tag (if it exists)

/* -----------------------------------------------------------
  Heap destroy
----------------------------------------------------------- */

// ensure no more thread_delayed_free will be added

// stats

// update used count

// todo: off for aligned blocks...

/// pretend it is all free now

// and free the page

// mi_page_free(page,false);

/* no force? */

// keep going

// don't free in case it may contain reclaimed pages

// track all blocks as freed

// free all pages

// forcefully destroy all heaps in the current thread

/* -----------------------------------------------------------
  Safe Heap delete
----------------------------------------------------------- */

// Transfer the pages from one heap to the other

// reduce the size of the delayed frees

// transfer all pages by appending the queues; this will set a new heap field

// so threads may do delayed frees in either heap for a while.

// note: appending waits for each page to not be in the `MI_DELAYED_FREEING` state

// so after this only the new heap will get delayed frees

// and do outstanding delayed frees in the `from` heap

// note: be careful here as the `heap` field in all those pages no longer point to `from`,

// turns out to be ok as `_mi_heap_delayed_free` only visits the list and calls a

// the regular `_mi_free_delayed_block` which is safe.

// somehow the following line gives an error in VS2015, issue #353

// and reset the `from` heap

// Safe delete a heap without freeing any still allocated blocks in that heap.

// transfer still used pages to the backing heap

// the backing heap abandons its pages

/* -----------------------------------------------------------
  Analysis
----------------------------------------------------------- */

// static since it is not thread safe to access heaps from other threads.

// continue if not found

// only aligned pointers

/* -----------------------------------------------------------
  Visit all heap blocks and areas
  Todo: enable visiting abandoned pages, and
        enable visiting all blocks of all heaps across threads
----------------------------------------------------------- */

// Separate struct to keep `mi_page_t` out of the public interface

// without padding

// optimize page with one block

// create a bitmap of free blocks.

// Todo: avoid division?

// walk through all blocks skipping the free ones

// skip a run of free blocks

// number of blocks in use (#553)

// Visit all heap pages as areas

// note: function pointer to void* :-{

// Just to pass arguments

// Visit all blocks in a heap


=== system/lib/mimalloc/src/init.c ===
SHA256: 64766b3df71a6b1012eea3f3662603008bcc6b5af77b2e0bc6f57edae0cf375f
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2022, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// memcpy, memset

// atexit

// Empty page used to initialize the small free pages array

// capacity

// reserved capacity

// flags

// is_zero

// retire_expire

// free

// local_free

// used

// block size shift

// heap tag

// block_size

// page_start

// xthread_free

// xheap

// padding

// Empty page queues for every bin

/* 8 */

/* 16 */

/* 24 */

/* 32 */

/* 40 */

/* 48 */

/* 56 */

/* 64 */

/* 72 */

/* 655360, Huge queue */

/* Full queue */

// Empty statistics

// Empty slice span queues for every bin

/*  8 */

/* 16 */

/* 24 */

/* 32 */

/* 35 */

// --------------------------------------------------------

// Statically allocate an empty heap as the initial

// thread local value for the default heap,

// and statically allocate the backing heap for the main

// thread so it can function without doing any allocation

// itself (as accessing a thread local for the first time

// may lead to allocation itself on some platforms)

// --------------------------------------------------------

// tid

// cookie

// arena id

// keys

// random

// page count

// page retired min/max

// next

// can reclaim

// tag

// segments

// os

// stats

// the thread-local default heap for allocation

// segments

// os

// stats

// thread id

// initial cookie

// arena id

// the key of the main heap can be fixed (unlike page keys that need to be secure!)

// random

// page count

// page retired min/max

// next heap

// can reclaim

// tag

// set to `true` in `mi_process_init`.

// prevent allocation failure during bcrypt dll initialization with static linking

/* -----------------------------------------------------------
  Initialization and freeing of the thread local heaps
----------------------------------------------------------- */

// note: in x64 in release build `sizeof(mi_thread_data_t)` is under 4KiB (= OS page size).

// must come first due to cast in `_mi_heap_done`

// must come last due to zero'ing

// Thread meta-data is allocated directly from the OS. For

// some programs that do not use thread pools and allocate and

// destroy many OS threads, this may causes too much overhead

// per thread so we maintain a small cache of recently freed metadata.

// try to find thread metadata in the cache

// found cached allocation, try use it

// if that fails, allocate as meta data

// if this fails, try once more. (issue #257)

// really out of memory

// try to add the thread metadata to the cache

// if that fails, just free it directly

// free all thread metadata from the cache

// Initialize the thread local default heap, called from `mi_thread_init`

// mi_assert_internal(_mi_heap_main.thread_id != 0);  // can happen on freeBSD where alloc is called before any initialization

// the main heap is statically allocated

//mi_assert_internal(_mi_heap_default->tld->heap_backing == mi_prim_get_default_heap());

// use `_mi_os_alloc` to allocate directly from the OS

// must be before `_mi_heap_init`

/* can reclaim */

/* default tag */

// initialize thread local data

// Free the thread local default heap (called from `mi_thread_done`)

// reset default heap

// switch to backing heap

// delete all non-backing heaps in this thread

// save `next` as `curr` will be freed

// collect if not the main thread

// merge stats

// free if not the main thread

// the following assertion does not always hold for huge segments as those are always treated

// as abondened: one may allocate it in one thread, but deallocate in another in which case

// the count can be too large or negative. todo: perhaps not count huge segments? see issue #363

// mi_assert_internal(heap->tld->segments.count == 0 || heap->thread_id != _mi_thread_id());

// never free the main thread even in debug mode; if a dll is linked statically with mimalloc,

// there may still be delete/free calls after the mi_fls_done is called. Issue #207

// --------------------------------------------------------

// Try to run `mi_thread_done()` automatically so any memory

// owned by the thread but not yet released can be abandoned

// and re-owned by another thread.

//

// 1. windows dynamic library:

//     call from DllMain on DLL_THREAD_DETACH

// 2. windows static library:

//     use `FlsAlloc` to call a destructor when the thread is done

// 3. unix, pthreads:

//     use a pthread key to call a destructor when a pthread is done

//

// In the last two cases we also need to call `mi_process_init`

// to set up the thread local keys.

// --------------------------------------------------------

// Set up handlers so `mi_thread_done` is called automatically

// fine if it races

// This is called from the `mi_malloc_generic`

// ensure our process has started already

// initialize the thread local default heap

// (this will call `_mi_heap_set_default_direct` and thus set the

//  fiber/pthread key to a non-zero value, ensuring `_mi_thread_done` is called)

// returns true if already initialized

//_mi_verbose_message("thread init: 0x%zx\n", _mi_thread_id());

// calling with NULL implies using the default heap

// prevent re-entrancy through heap_done/heap_set_default_direct (issue #699)

// adjust stats

// check thread-id as on Windows shutdown with FLS the main (exit) thread may call this on thread-local heaps...

// abandon the thread local heap

// returns true if already ran

// we use _mi_heap_default_key

// ensure the default heap is passed to `_mi_thread_done`

// setting to a non-NULL value also ensures `mi_thread_done` is called.

// --------------------------------------------------------

// Run functions on process init/done, and thread init/done

// --------------------------------------------------------

// true until this module is initialized

// true if malloc redirects to mi_malloc

// Returns true if this module has not been initialized; Don't use C runtime routines until it returns false.

// Communicate with the redirection module on Windows

// called on redirection; careful as this may be called before DllMain

// nothing to do

// Called once by the process loader

// access TLS to allocate it before setting tls_initialized to true;

// use dummy or otherwise the access may get optimized away (issue #697)

// use Dll process detach (see below) instead of atexit (issue #521)

// show message from the redirector (if present)

// reseed random

// FSRM for fast rep movsb support (AMD Zen3+ (~2020) or Intel Ice Lake+ (~2017))

// bit 4 of EDX : see <https://en.wikipedia.org/wiki/CPUID#EAX=7,_ECX=0:_Extended_Features>

// nothing

// Initialize the process; called by thread_init or the process loader

// ensure we are called once

// vs2017 can dynamically re-initialize _mi_heap_main

// On windows, when building as a static lib the FLS cleanup happens to early for the main thread.

// To avoid this, set the FLS value for the main thread to NULL so the fls cleanup

// will not call _mi_thread_done on the (still executing) main thread. See issue #508.

// only call stat reset *after* thread init (or the heap tld == NULL)

/* commit? */

/* allow large pages? */

// Called when the process is done (through `at_exit`)

// only shutdown if we were initialized

// ensure we are called once

// release any thread specific resources and ensure _mi_thread_done is called on all but the main thread

// free all memory if possible on process exit. This is not needed for a stand-alone process

// but should be done if mimalloc is statically linked into another shared library which

// is repeatedly loaded/unloaded, see issue #281.

/* force */

// Forcefully release all retained memory; this can be dangerous in general if overriding regular malloc/free

// since after process_done there might still be other code running that calls `free` (like at_exit routines,

// or C-runtime termination code.

/* force */

// forcefully release all memory held by all heaps (of this thread only!)

// don't call the C runtime anymore

// Windows DLL: easy to hook into process_init and thread_done

// MSVC: use data section magic for static libraries

// See <https://www.codeguru.com/cpp/misc/misc/applicationcontrol/article.php/c6945/Running-Code-Before-and-After-Main.htm>

// C++: use static initialization to detect process start

// GCC,Clang: use the constructor attribute


=== system/lib/mimalloc/src/libc.c ===
SHA256: c6feea12f7ce01804a63cddcd7545771940248c0f154bbd20b8f470c77592b5e
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2023, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// --------------------------------------------------------

// This module defines various std libc functions to reduce

// the dependency on libc, and also prevent errors caused 

// by some libc implementations when called before `main`

// executes (due to malloc redirection)

// --------------------------------------------------------

// mi_prim_getenv

// copy until end of src, or when dest is (almost) full

// always zero terminate

// find end of string in the dest buffer

// and catenate

// --------------------------------------------------------

// Define our own limited `_mi_vsnprintf` and `_mi_snprintf`

// This is mostly to avoid calling these when libc is not yet

// initialized (and to reduce dependencies)

// 

// format:      d i, p x u, s

// prec:        z l ll L

// width:       10

// align-left:  -

// fill:        0

// plus:        +

// --------------------------------------------------------

// move `len` characters to the right (in reverse since it can overlap)

// and fill the start

// output digits in reverse

// and reverse in-place

// output visible ascii or standard control only

// extra check due to while

// string

// unsigned

// unsigned ptrdiff_t

// signed

// unknown format

// fill & align


=== system/lib/mimalloc/src/options.c ===
SHA256: 3b2a1466f24d3bd85740a7ad1b6696fcfc9a7dbc09e236cfb02a290c9aba096c
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2021, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// mi_prim_out_stderr

// stdin/stdout

// abort

// stop outputting errors after this (use < 0 for no limit)

// stop outputting warnings after this (use < 0 for no limit)

// --------------------------------------------------------

// Options

// These can be accessed by multiple threads and may be

// concurrently initialized, but an initializing data race

// is ok since they resolve to the same value.

// --------------------------------------------------------

// not yet initialized

// not found in the environment, use default value

// found in environment or set explicitly

// the value

// is it initialized yet? (from the environment)

// for debugging: the option index should match the option

// option name without `mimalloc_` prefix

// potential legacy option name

// stable options

// the following options are experimental and not all combinations make sense.

// commit per segment directly (4MiB)  (but see also `eager_commit_delay`)

// eager commit arena's? 2 is used to enable this only on an OS that has overcommit (i.e. linux)

// purge decommits memory (instead of reset) (note: on linux this uses MADV_DONTNEED for decommit)

// use large OS pages, use only with eager commit to prevent fragmentation of VMA's

// per 1GiB huge pages

// reserve huge pages at node N

// reserve N KiB OS memory in advance (use `option_get_size`)

// cache N segments per thread

// reset page memory on free

// reset free page memory when a thread terminates

// reset segment memory on free (needs eager commit)

// the first N segments per thread are not eagerly committed

// the first N segments per thread are not eagerly committed (but per page in the segment on demand)

// purge delay in milli-seconds

// 0 = use available numa nodes, otherwise use at most N nodes.

// 1 = do not use OS memory for allocation (but only reserved arenas)

// only apple specific for now but might serve more or less related purpose

// maximum errors that are output

// maximum warnings that are output

// max. percentage of the abandoned segments to be reclaimed per try.

// release all OS memory on process exit; careful with dangling pointer or after-exit frees!

// reserve memory N KiB at a time (=1GiB) (use `option_get_size`)

// =128MiB on 32-bit

// purge delay multiplier for arena's

// reclaim an abandoned segment on a free

// 1 = do not use arena's for allocation (except if using specific arena id's)

// windows only: retry on out-of-memory for N milli seconds (=400), set to 0 to disable retries.

// called on process load; should not be called before the CRT is initialized!

// (e.g. do not call this from process_init as that may run before CRT initialization)

// now it safe to use stderr for output

// initialize

// if (option != mi_option_verbose)

// index should match the option

// index should match the option

// Since an output function can be registered earliest in the `main`

// function we also buffer output that happens earlier. When

// an output function is registered it is called immediately with

// the output up to that point.

// claim space

// check bound

// claim (if `no_more_buf == true`, no more output will be added after this point)

// and output the current contents

// if continue with the buffer, insert a newline

// Once this module is loaded, switch to this routine

// which outputs to stderr and the delayed output buffer.

// --------------------------------------------------------

// Default output handler

// --------------------------------------------------------

// Should be atomic but gives errors on many platforms as generally we cannot cast a function pointer to a uintptr_t.

// For now, don't register output from multiple threads.

// = NULL

// = NULL

// stop using the delayed output buffer

// output all the delayed output now

// add stderr to the delayed output after the module is loaded

// flush current contents to stderr

// and add stderr to the delayed output

// --------------------------------------------------------

// Messages, all end up calling `_mi_fputs`.

// --------------------------------------------------------

// = 0;  // when >= max_error_count stop emitting errors

// = 0;  // when >= max_warning_count stop emitting warnings

// When overriding malloc, we may recurse into mi_vfprintf if an allocation

// inside the C runtime causes another message.

// In some cases (like on macOS) the loader already allocates which

// calls into mimalloc; if we then access thread locals (like `recurse`)

// this may crash as the access may call _tlv_bootstrap that tries to

// (recursively) invoke malloc again to allocate space for the thread local

// variables on demand. This is why we use a _mi_preloading test on such

// platforms. However, C code generator may move the initial thread local address

// load before the `if` and we therefore split it out in a separate funcion.

// TODO: use mi_out_stderr for stderr?

// Define our own limited `fprintf` that avoids memory allocation.

// We do this using `_mi_vsnprintf` with a limited buffer.

// only with verbose level 2 or higher

// --------------------------------------------------------

// Errors

// --------------------------------------------------------

// = NULL

// = NULL

// abort on serious errors in secure mode (corrupted meta-data)

// abort on memory allocation fails in xmalloc mode

// can be NULL

// show detailed error message

// and call the error handler which may abort (or return normally)

// --------------------------------------------------------

// Initialize options by checking the environment

// --------------------------------------------------------

// TODO: implement ourselves to reduce dependencies on the C runtime

// strtol

// strstr

// Read option value from the environment

// this option is interpreted in KiB to prevent overflow of `long` for large allocations 

// (long is 32-bit on 64-bit windows, which allows for 4TiB max.)

// KiB, MiB, GiB, TiB

// Kb, Mb, Gb, Tb

// set `init` first to avoid recursion through _mi_warning_message on mimalloc_verbose.

// if the 'mimalloc_verbose' env var has a bogus value we'd never know

// (since the value defaults to 'off') so in that case briefly enable verbose


=== system/lib/mimalloc/src/os.c ===
SHA256: 476c5514c389add41a1a876c325510dac9d333bc07c08131010b82292b9329ce
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2023, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

/* -----------------------------------------------------------
  Initialization. 
----------------------------------------------------------- */

// page size

// large page size (usually 2MiB)

// allocation granularity

// has overcommit?  (if true we use MAP_NORESERVE on mmap systems)

// can we partially free allocated blocks? (on mmap systems we can free anywhere in a mapped range, but on Windows we must free the entire span)

// has virtual reserve? (if true we can reserve virtual address space without using commit or physical memory)

// OS (small) page size

// if large OS pages are supported (2 or 4MiB), then return the size, otherwise return the small page size (4KiB)

// if we have access, check the size and alignment requirements

// round to a good OS allocation size (bounded by max 12.5% waste)

// possible overflow?

/* -----------------------------------------------------------
  Util
-------------------------------------------------------------- */

/* -----------------------------------------------------------
  aligned hinting
-------------------------------------------------------------- */

// On 64-bit systems, we can do efficient aligned allocation by using

// the 2TiB to 30TiB area to allocate those.

// Return a MI_SEGMENT_SIZE aligned address that is probably available.

// If this returns NULL, the OS will determine the address but on some OS's that may not be

// properly aligned which can be more costly as it needs to be adjusted afterwards.

// For a size > 1GiB this always returns NULL in order to guarantee good ASLR randomization;

// (otherwise an initial large allocation of say 2TiB has a 50% chance to include (known) addresses

//  in the middle of the 2TiB - 6TiB address range (see issue #372))

// 2TiB start

// upto 6TiB   (since before win8 there is "only" 8TiB available to processes)

// wrap after 30TiB (area after 32TiB is used for huge OS pages)

// guarantee the chance of fixed valid address is at most 1/(MI_HINT_AREA / 1<<30) = 1/4096.

// put in `MI_SEGMENT_SIZE` virtual gaps between hinted blocks; this splits VLA's but increases guarded areas.

// wrap or initialize

// security: randomize start of aligned allocations unless in debug mode

// (randomly 20 bits)*4MiB == 0 to 4TiB

// this may still give 0 or > MI_HINT_MAX but that is ok, it is a hint after all

/* -----------------------------------------------------------
  Free memory
-------------------------------------------------------------- */

// || _mi_os_is_huge_reserved(addr)

// different base? (due to alignment)

// free it

// nothing to do

/* -----------------------------------------------------------
   Primitive allocation from the OS.
-------------------------------------------------------------- */

// Note: the `try_alignment` is just a hint and the returned pointer is not guaranteed to be aligned.

// avoid 0 to ensure there will be no divide by zero when aligning

// seems needed for asan (or `mimalloc-test-api` fails)

// Primitive aligned allocation from the OS.

// This function guarantees the allocated memory is aligned.

// try first with a hint (this will be aligned directly on Win 10+ or BSD)

// aligned already?

// if not aligned, free it, overallocate, and unmap around it

// overflow

// win32 virtualAlloc cannot free parts of an allocated block

// over-allocate uncommitted (virtual) memory

/*alignment*/

/* commit? */

/* allow_large */

// set p to the aligned part in the full region

// note: this is dangerous on Windows as VirtualFree needs the actual base pointer

// this is handled though by having the `base` field in the memid's

// remember the base

// explicitly commit only the aligned part

// mmap can free inside an allocation

// overallocate...

// and selectively unmap parts around the over-allocated area. 

// we can return the aligned pointer on `mmap` systems

// since we freed the pre part, `*base == p`.

/* -----------------------------------------------------------
  OS API: alloc and alloc_aligned
----------------------------------------------------------- */

// suppress unused warnings

/* -----------------------------------------------------------
  OS aligned allocation with an offset. This is used
  for large alignments > MI_BLOCK_ALIGNMENT_MAX. We use a large mimalloc
  page where the object can be aligned at an offset from the start of the segment.
  As we may need to overallocate, we need to free such pointers using `mi_free_aligned`
  to use the actual start of the memory region.
----------------------------------------------------------- */

// regular aligned allocation

// overallocate to align at an offset

// decommit the overallocation at the start

/* -----------------------------------------------------------
  OS memory API: reset, commit, decommit, protect, unprotect.
----------------------------------------------------------- */

// OS page align within a given area, either conservative (pages inside the area only),

// or not (straddling pages outside the area is possible)

// page align conservatively within the range

// use size for precise commit vs. decommit

// page align range

/* conservative? */

// commit

// note: the following seems required for asan (otherwise `mimalloc-test-stress` fails)

// page align

// decommit

// Signal to the OS that the address range is no longer in use

// but may be used later again. This will release physical memory

// pages and reduce swapping while keeping the memory committed.

// We page align to a conservative area inside the range to reset.

// page align conservatively within the range

// || _mi_os_is_huge_reserved(addr)

// && !MI_TSAN

// pretend it is eagerly reset

// either resets or decommits memory, returns true if the memory needs

// to be recommitted if it is to be re-used later on.

// is purging allowed?

// should decommit?

// don't decommit during preloading (unsafe)

// this can sometimes be not allowed if the range is not fully committed

// needs no recommit

// either resets or decommits memory, returns true if the memory needs

// to be recommitted if it is to be re-used later on.

// Protect a region in memory to be not accessible.

// page align conservatively within the range

/*
  if (_mi_os_is_huge_reserved(addr)) {
	  _mi_warning_message("cannot mprotect memory allocated in huge OS pages\n");
  }
  */

/* ----------------------------------------------------------------------------
Support for allocating huge OS pages (1Gib) that are reserved up-front
and possibly associated with a specific NUMA node. (use `numa_node>=0`)
-----------------------------------------------------------------------------*/

// To ensure proper alignment, use our own area for huge OS pages

// = 0

// Claim an aligned address range for huge pages

// Initialize the start address after the 32TiB area

// 32TiB virtual start address

// security: randomize start of huge pages unless in debug mode

// (randomly 12bits)*1GiB == between 0 to 4TiB

// Allocate MI_SEGMENT_SIZE aligned huge pages

// or 32-bit systems

// Allocate one page at the time but try to place them contiguously

// We allocate one page at the time to be able to abort if it takes too long

// or to at least allocate as many as available on the system.

// allocate a page

// Did we succeed at a contiguous address?

// no success, issue a warning and break

// success, record it

// increase before timeout check (see issue #711)

// check for timeout

// seems like we are going to timeout, break

/* is committed */

/* is_large */

// free every huge page in a range individually (as we allocated per page)

// note: needed with VirtualAlloc but could potentially be done in one go on mmap'd systems.

/* ----------------------------------------------------------------------------
Support NUMA aware allocation
-----------------------------------------------------------------------------*/

// = 0   // cache the node count

// given explicitly?

// or detect dynamically

// save it

// optimize on single numa node systems: always node 0

// never more than the node count and >= 0


=== system/lib/mimalloc/src/page-queue.c ===
SHA256: 7802e3d596a383941c2bb116d8eaf2f4ad63673b7372b24f0ab9bc45741cf214
/*----------------------------------------------------------------------------
Copyright (c) 2018-2024, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

/* -----------------------------------------------------------
  Definition of page queues for each block size
----------------------------------------------------------- */

// include to help an IDE

/* -----------------------------------------------------------
  Minimal alignment in machine words (i.e. `sizeof(void*)`)
----------------------------------------------------------- */

// 4 machine words minimal alignment

// 2 machine words minimal alignment

// ok, default alignment is 1 word

/* -----------------------------------------------------------
  Queue query
----------------------------------------------------------- */

/* -----------------------------------------------------------
  Bins
----------------------------------------------------------- */

// Return the bin for a given field size.

// Returns MI_BIN_HUGE if the size is too large.

// We use `wsize` for the size in "machine word sizes",

// i.e. byte size == `wsize*sizeof(void*)`.

// round to double word sizes

// round to double word sizes

// round to 4x word sizes

// find the highest bit

// note: wsize != 0

// and use the top 3 bits to determine the bin (~12.5% worst internal fragmentation).

// - adjust with 3 because we use do not round the first 8 sizes

//   which each get an exact bin

/* -----------------------------------------------------------
  Queue of pages with free blocks
----------------------------------------------------------- */

// Good size for allocation

// The current small page array is for efficiency and for each

// small size (up to 256) it points directly to the page for that

// size without having to compute the bin. This means when the

// current free page queue is updated for a small bin, we need to update a

// range of entries in `_mi_page_small_free`.

// find index in the right direct page array

// already set

// find start slot

// find previous size; due to minimal alignment upto 3 previous bins may need to be skipped

// set size range to the right page

/*
static bool mi_page_queue_is_empty(mi_page_queue_t* queue) {
  return (queue->first == NULL);
}
*/

// update first

// mi_atomic_store_ptr_release(mi_atomic_cast(void*, &page->heap), NULL);

// mi_atomic_store_ptr_release(mi_atomic_cast(void*, &page->heap), heap);

// update direct

// update first

// Only called from `mi_heap_absorb`.

// set append pages to new heap and count

// inline `mi_page_set_heap` to avoid wrong assertion during absorption;

// in this case it is ok to be delayed freeing since both "to" and "from" heap are still alive.

// set the flag to delayed free (not overriding NEVER_DELAYED_FREE) which has as a

// side effect that it spins until any DELAYED_FREEING is finished. This ensures

// that after appending only the new heap will be used for delayed free operations.

// take over afresh

// append to end


=== system/lib/mimalloc/src/page.c ===
SHA256: c64a946aa7144879d6fd23735fa1fada030994f2cd43bfbb7c9cb1ba77123dfb
/*----------------------------------------------------------------------------
Copyright (c) 2018-2024, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

/* -----------------------------------------------------------
  The core of the allocator. Every segment contains
  pages of a certain block size. The main function
  exported is `mi_malloc_generic`.
----------------------------------------------------------- */

/* -----------------------------------------------------------
  Definition of page queues for each block size
----------------------------------------------------------- */

/* -----------------------------------------------------------
  Page helpers
----------------------------------------------------------- */

// Index a block in a page

/*
// Start of the page available memory
static inline uint8_t* mi_page_area(const mi_page_t* page) {
  return _mi_page_start(_mi_page_segment(page), page, NULL);
}
*/

// generally too expensive to check this

//mi_assert_internal(start + page->capacity*page->block_size == page->top);

// generally too expensive to check this

//size_t tfree_count = mi_page_list_count(page, tfree);

//mi_assert_internal(tfree_count <= page->thread_freed + 1);

// has mi_process_init been called?

// note: must acquire as we can break/repeat this loop and not do a CAS;

// give up after 4 tries

// delay until outstanding MI_DELAYED_FREEING are done.

// tfree = mi_tf_set_delayed(tfree, MI_NO_DELAYED_FREE); // will cause CAS to busy fail

// avoid atomic operation if already equal

// leave never-delayed flag set

// success

/* -----------------------------------------------------------
  Page collect the `local_free` and `thread_free` lists
----------------------------------------------------------- */

// Collect the local `thread_free` list using an atomic exchange.

// Note: The exchange must be done atomically as this is used right after

// moving to the full list in `mi_page_collect_ex` and we need to

// ensure that there was no race where the page became unfull just before the move.

// return if the list is empty

// find the tail -- also to get a proper count (without data races)

// cannot collect more than capacity

// if `count > max_count` there was a memory corruption (possibly infinite list due to double multi-threaded free)

// the thread-free items cannot be freed

// and append the current local free list

// update counts now

// collect the thread free list

// quick test to avoid an atomic operation

// and the local free list

// usual case

// append -- only on shutdown (force) as this is a linear operation

/* -----------------------------------------------------------
  Page fresh and retire
----------------------------------------------------------- */

// called from segments when reclaiming abandoned pages

// TODO: push on full queue immediately if it is full?

// allocate a fresh page from a segment

// this may be out-of-memory, or an abandoned page was reclaimed (and in our queue)

// a fresh page was found, initialize it

// see also: mi_segment_huge_page_alloc

// Get a fresh page to use

/* -----------------------------------------------------------
   Do any delayed frees
   (put there by other threads if they deallocated in a full page)
----------------------------------------------------------- */

// returns true if all delayed frees were processed

// take over the list (note: no atomic exchange since it is often NULL)

/* nothing */

// and free them all

// use internal free instead of regular one to keep stats etc correct

// we might already start delayed freeing while another thread has not yet

// reset the delayed_freeing flag; in that case delay it further by reinserting the current block

// into the delayed free list

/* -----------------------------------------------------------
  Unfull, abandon, free and retire
----------------------------------------------------------- */

// Move a page from the full list back to a regular list

// to get the right queue

// try to collect right away in case another thread freed just before MI_USE_DELAYED_FREE was set

// Abandon a page with used blocks at the end of a thread.

// Note: only call if it is ensured that no references exist from

// the `page->heap->thread_delayed_free` into this page.

// Currently only called through `mi_heap_collect_ex` which ensures this.

// remove from our page list

// page is no longer associated with our heap

// check there are no references left..

// and abandon it

// Free a page with no more free blocks

// no more aligned blocks in here

// remove from the page list

// (no need to do _mi_heap_delayed_free first as all blocks are already free)

// and free it

// should be less than size for MI_BIN_HUGE

// Retire a page with no more used blocks

// Important to not retire too quickly though as new

// allocations might coming.

// Note: called from `mi_free` and benchmarks often

// trigger this due to freeing everything and then

// allocating again so careful when changing this.

// don't retire too often..

// (or we end up retiring and re-allocating most of the time)

// NOTE: refine this more: we should not retire if this

// is the only page left with free blocks. It is not clear

// how to check this efficiently though...

// for now, we don't retire if it is the only page left of this size class.

/* bsize < MI_MAX_RETIRE_SIZE && */

// not full or huge queue?

// the only page in the queue?

// don't free after all

// free retired pages: we don't need to look at the entire queues

// since we only retire pages that are at the head position in a queue.

// keep retired, update min/max

/* -----------------------------------------------------------
  Initialize the initial free list in a page.
  In secure mode we initialize a randomized list by
  alternating between slices.
----------------------------------------------------------- */

// at most 64 slices

// initialize a randomized free list

// set up `slice_count` slices to alternate between

// current start of the slice

// available objects in the slice

// final slice holds the modulus too (todo: distribute evenly?)

// and initialize the free list by randomly threading through them

// set up first element

// and iterate through the rest; use `random_shuffle` for performance

// ensure not 0

// call random_shuffle only every INTPTR_SIZE rounds

// select a random next slice index

// ensure it still has space

// and link the current block to it

// bump to the following block

// and set next; note: we may have `current == next`

// prepend to the free list (usually NULL)

// end of the list

// initialize a sequential free list

// prepend to free list (usually `NULL`)

/* -----------------------------------------------------------
  Page initialize and extend the capacity
----------------------------------------------------------- */

// heuristic, one OS page seems to work well.

// extend at least by this many

// Extend the capacity (up to reserved) by initializing a free list

// We do at most `MI_MAX_EXTEND` to avoid touching too much memory

// Note: we also experimented with "bump" allocation on the first

// allocations but this did not speed up any benchmark (due to an

// extra test in malloc? or cache effects?)

// calculate the extend count

// ensure we don't touch memory beyond the page to reduce page commit.

// the `lean` benchmark tests this. Going from 1 to 8 increases rss by 50%.

// and append the extend the free list

//!mi_option_is_enabled(mi_option_secure)) {

// enable the new free list

// Initialize a fresh page

// set fields

// initialize an initial free list

/* -----------------------------------------------------------
  Find pages with free blocks
-------------------------------------------------------------*/

// Find a page with free blocks of `page->block_size`.

// search through the pages in "next fit" order

// remember next

// 0. collect freed blocks by us and other threads

// 1. if the page contains free blocks, we are done

// pick this one

// 2. Try to extend

// 3. If the page is completely full, move it to the `mi_pages_full`

// queue so we don't visit long-lived pages too often.

// for each page

// perhaps make a page available?

// out-of-memory _or_ an abandoned page with free blocks was reclaimed, try once again

// Find a page with free blocks of `size`.

// in secure mode, we extend half the time to increase randomness

// fast path

/* -----------------------------------------------------------
  Users can register a deferred free function called
  when the `free` list is empty. Since the `local_free`
  is separate this is deterministically called after
  a certain number of allocations.
----------------------------------------------------------- */

// = NULL

/* -----------------------------------------------------------
  General allocation
----------------------------------------------------------- */

// Large and huge page allocation.

// Huge pages contain just one block, and the segment contains just that page (as `MI_SEGMENT_HUGE`).

// Huge pages are also use if the requested alignment is very large (> MI_BLOCK_ALIGNMENT_MAX)

// so their size is not always `> MI_LARGE_OBJ_SIZE_MAX`.

// abandoned, not in the huge queue

// note: not `mi_page_block_size` to account for padding

// Allocate a page

// Note: in debug mode the size includes MI_PADDING_SIZE and might have overflowed.

// huge allocation?

// correct for padding_size in case of an overflow on `size`

// otherwise find a page with free blocks in our size segregated queues

// Generic allocation routine if the fast path (`alloc.c:mi_page_malloc`) does not succeed.

// Note: in debug mode the size includes MI_PADDING_SIZE and might have overflowed.

// The `huge_alignment` is normally 0 but is set to a multiple of MI_SEGMENT_SIZE for

// very large requested alignments in which case we use a huge segment.

// initialize if necessary

// calls mi_thread_init

// call potential deferred free routines

// free delayed frees from other threads (but skip contended ones)

// find (or allocate) a page of the right size

// first time out of memory, try to collect and retry the allocation once more

/* force */

// out of memory

// correct for padding_size in case of an overflow on `size`

// and try again, this time succeeding! (i.e. this should never recurse through _mi_page_malloc)

// note: we cannot call _mi_page_malloc with zeroing for huge blocks; we zero it afterwards in that case.


=== system/lib/mimalloc/src/prim/emscripten/prim.c ===
SHA256: d82f236d70cb29a5f5383e5677e62c0926c783024328c24dca606b3f3eb006a5
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2023, Microsoft Research, Daan Leijen, Alon Zakai
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// This file is included in `src/prim/prim.c`

// Design

// ======

//

// mimalloc is built on top of emmalloc. emmalloc is a minimal allocator on top

// of sbrk. The reason for having three layers here is that we want mimalloc to

// be able to allocate and release system memory properly, the same way it would

// when using VirtualAlloc on Windows or mmap on POSIX, and sbrk is too limited.

// Specifically, sbrk can only go up and down, and not "skip" over regions, and

// so we end up either never freeing memory to the system, or we can get stuck

// with holes.

//

// Atm wasm generally does *not* free memory back the system: once grown, we do

// not shrink back down (https://github.com/WebAssembly/design/issues/1397).

// However, that is expected to improve

// (https://github.com/WebAssembly/memory-control/blob/main/proposals/memory-control/Overview.md)

// and so we do not want to bake those limitations in here.

//

// Even without that issue, we want our system allocator to handle holes, that

// is, it should merge freed regions and allow allocating new content there of

// the full size, etc., so that we do not waste space. That means that the

// system allocator really does need to handle the general problem of allocating

// and freeing variable-sized chunks of memory in a random order, like malloc/

// free do. And so it makes sense to layer mimalloc on top of such an

// implementation.

//

// emmalloc makes sense for the lower level because it is small and simple while

// still fully handling merging of holes etc. It is not the most efficient

// allocator, but our assumption is that mimalloc needs to be fast while the

// system allocator underneath it is called much less frequently.

//

//---------------------------------------------

// init

//---------------------------------------------

// WebAssembly has a fixed page size: 64KiB

//---------------------------------------------

// Allocation

//---------------------------------------------

// Note: the `try_alignment` is just a hint and the returned pointer is not guaranteed to be aligned.

// TODO: Track the highest address ever seen; first uses of it are zeroes.

//       That assumes no one else uses sbrk but us (they could go up,

//       scribble, and then down), but we could assert on that perhaps.

// emmalloc has a minimum alignment size.

//---------------------------------------------

// Commit/Reset

//---------------------------------------------

// See TODO above.

//---------------------------------------------

// Huge pages and NUMA nodes

//---------------------------------------------

//----------------------------------------------------------------

// Clock

//----------------------------------------------------------------

//----------------------------------------------------------------

// Process info

//----------------------------------------------------------------

// use defaults

//----------------------------------------------------------------

// Output

//----------------------------------------------------------------

//----------------------------------------------------------------

// Environment

//----------------------------------------------------------------

// For code size reasons, do not support environ customization for now.

//----------------------------------------------------------------

// Random

//----------------------------------------------------------------

//----------------------------------------------------------------

// Thread init/done

//----------------------------------------------------------------

// use pthread local storage keys to detect thread ending

// (and used with MI_TLS_PTHREADS for the default heap)

// do not leak the key, see issue #809

// can happen during recursive invocation on freeBSD

// nothing

// nothing


=== system/lib/mimalloc/src/prim/osx/alloc-override-zone.c ===
SHA256: 05b2e1ea84d20e2cca9cb6423896e0fbeb2db0ca464e3adbb0d4edae6c3198d1
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2022, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

/* ------------------------------------------------------
   Override system malloc on macOS
   This is done through the malloc zone interface.
   It seems to be most robust in combination with interposing
   though or otherwise we may get zone errors as there are could
   be allocations done by the time we take over the
   zone.
------------------------------------------------------ */

// memset

// only available from OSX 10.6

/* ------------------------------------------------------
   malloc zone members
------------------------------------------------------ */

// not our pointer, bail out

// todo: ignore for now?

/* ------------------------------------------------------
   Introspection members
------------------------------------------------------ */

// todo: enumerate all memory

// todo?

// todo?

// todo?

// todo...

/* ------------------------------------------------------
  At process start, override the default allocator
------------------------------------------------------ */

// note: even with designators, the order is important for C++ compilation

//.reserved1 = NULL,

//.reserved2 = NULL,

// switch to version 9+ on OSX 10.6 to support memalign.

// ------------------------------------------------------

// Override malloc_xxx and malloc_zone_xxx api's to use only

// our mimalloc zone. Since even the loader uses malloc

// on macOS, this ensures that all allocations go through

// mimalloc (as all calls are interposed).

// The main `malloc`, `free`, etc calls are interposed in `alloc-override.c`,

// Here, we also override macOS specific API's like

// `malloc_zone_calloc` etc. see <https://github.com/aosm/libmalloc/blob/master/man/malloc_zone_malloc.3>

// ------------------------------------------------------

// by calling register we avoid a zone error on free (see <http://eatmyrandom.blogspot.com/2010/03/mallocfree-interception-on-mac-os-x.html>)

// nothing.

// or 0 for no error?

// nothing

// nothing

// nothing

// use interposing so `DYLD_INSERT_LIBRARIES` works without `DYLD_FORCE_FLAT_NAMESPACE=1`

// See: <https://books.google.com/books?id=K8vUkpOXhN4C&pg=PA73>

// ------------------------------------------------------

// hook into the zone api's without interposing

// This is the official way of adding an allocator but

// it seems less robust than using interpose.

// ------------------------------------------------------

// The first returned zone is the real default

// fallback

// seems not supported by g++-11 on the M1

// force the purgeable zone to exist to avoid strange bugs

// Register our zone.

// thomcc: I think this is still needed to put us in the zone list.

// Unregister the default zone, this makes our zone the new default

// as that was the last registered.

// thomcc: Unsure if the next test is *always* false or just false in the

// cases I've tried. I'm also unsure if the code inside is needed. at all

// Reregister the default zone so free and realloc in that zone keep working.

// Unregister, and re-register the purgeable_zone to avoid bugs if it occurs

// earlier than the default zone.

// MI_OSX_INTERPOSE

// MI_MALLOC_OVERRIDE


=== system/lib/mimalloc/src/prim/osx/prim.c ===
SHA256: 247a9952465eb105be03a9962e922b085ce5d52034775551a61cd8594275be73
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2023, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// We use the unix/prim.c with the mmap API on macOSX


=== system/lib/mimalloc/src/prim/prim.c ===
SHA256: fa92e5b4d869017b32297eb60672e028ea9c323c1858cb3fae450e295d5108a9
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2023, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// Select the implementation of the primitives

// depending on the OS.

// VirtualAlloc (Windows)

// macOSX (actually defers to mmap in unix/prim.c)

// memory-grow or sbrk (Wasm)

// emmalloc_*, + pthread support

// mmap() (Linux, macOSX, BSD, Illumnos, Haiku, DragonFly, etc.)


=== system/lib/mimalloc/src/prim/unix/prim.c ===
SHA256: 0a9cbaed86705fdeab9b1141b0315de077241db153d214c6929abfc1b6dfc8ce
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2023, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// This file is included in `src/prim/prim.c`

// ensure mmap flags and syscall are defined

// illumos provides new mman.h api when any of these are defined

// otherwise the old api based on caddr_t which predates the void pointers one.

// stock solaris provides only the former, chose to atomically to discard those

// flags only here rather than project wide tough.

// mmap

// sysconf

// open, close, read, access

// linux mmap flags

// see issue #879, used to be (!TARGET_IOS_IPHONE && !TARGET_IOS_SIMULATOR)

// VM_MAKE_TAG, VM_FLAGS_SUPERPAGE_SIZE_2MB, etc.

//------------------------------------------------------------------------------------

// Use syscalls for some primitives to allow for libraries that override open/read/close etc.

// and do allocation themselves; using syscalls prevents recursion when mimalloc is

// still initializing (issue #713)

// Declare inline to avoid unused function warnings.

//------------------------------------------------------------------------------------

//---------------------------------------------

// init

//---------------------------------------------

// <https://www.kernel.org/doc/Documentation/vm/overcommit-accounting>

// 0: heuristic overcommit, 1: always overcommit, 2: never overcommit (ignore NORESERVE)

// default: overcommit is true

// TODO: can we query the OS for this?

// mmap can free in parts

// todo: check if this true for NetBSD?  (for anonymous mmap with PROT_NONE)

// disable transparent huge pages for this process?

// disable THP also if large OS pages are not allowed in the options

// Most likely since distros often come with always/madvise settings.

// Disabling only for mimalloc process rather than touching system wide settings

//---------------------------------------------

// free

//---------------------------------------------

//---------------------------------------------

// mmap

//---------------------------------------------

// Solaris needs cast (issue #520)

// BSD

// alignment is a power of 2 and 4096 <= alignment <= 1GiB

// fall back to regular mmap

// Solaris

// addr parameter is the required alignment

// fall back to regular mmap

// on 64-bit systems, use the virtual address area after 2TiB for 4MiB aligned allocations

// asan sometimes does not instrument errno correctly?

// fall back to regular mmap

// regular mmap

// failed to allocate

// macOS: tracking anonymous page with a specific ID. (All up to 98 are taken officially but LLVM sanitizers had taken 99)

// BSD

// huge page allocation

// = 0;

// If the OS is not configured for large OS pages, or the user does not have

// enough permission, the `mmap` will always fail (but it might also fail for other reasons).

// Therefore, once a large page allocation failed, we don't try again for `large_page_try_ok` times

// to avoid too many failing calls to mmap.

// using NORESERVE on huge pages seems to fail on Linux

// try large OS page allocation

// don't try huge 1GiB pages again

// on error, don't try again for the next N allocations

// regular allocation

// Many Linux systems don't allow MAP_HUGETLB but they support instead

// transparent huge pages (THP). Generally, it is not required to call `madvise` with MADV_HUGE

// though since properly aligned allocations will already use large pages if available

// in that case -- in particular for our large regions (in `memory.c`).

// However, some systems only allow THP if called with explicit `madvise`, so

// when large OS pages are enabled for mimalloc, we call `madvise` anyways.

// possibly

// Note: the `try_alignment` is just a hint and the returned pointer is not guaranteed to be aligned.

//---------------------------------------------

// Commit/Reset

//---------------------------------------------

// guard page around every mimalloc page

// commit: ensure we can access the area

// note: we may think that *is_zero can be true since the memory

// was either from mmap PROT_NONE, or from decommit MADV_DONTNEED, but

// we sometimes call commit on a range with still partially committed

// memory and `mprotect` does not zero the range.

// decommit: use MADV_DONTNEED as it decreases rss immediately (unlike MADV_FREE)

/*
  // decommit: use mmap with MAP_FIXED and PROT_NONE to discard the existing memory (and reduce rss)
  *needs_recommit = true;
  const int fd = unix_mmap_fd();
  void* p = mmap(start, size, PROT_NONE, (MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE), fd, 0);
  if (p != start) { err = errno; }
  */

// We try to use `MADV_FREE` as that is the fastest. A drawback though is that it

// will not reduce the `rss` stats in tools like `top` even though the memory is available

// to other processes. With the default `MIMALLOC_PURGE_DECOMMITS=1` we ensure that by

// default `MADV_DONTNEED` is used though.

// if MADV_FREE is not supported, fall back to MADV_DONTNEED from now on

//---------------------------------------------

// Huge page allocation

//---------------------------------------------

// at most 64 nodes

// TODO: does `mbind` work correctly for huge OS pages? should we

// use `set_mempolicy` before calling mmap instead?

// see: <https://lkml.org/lkml/2017/2/9/875>

//---------------------------------------------

// NUMA nodes

//---------------------------------------------

// enumerate node entries -- todo: it there a more efficient way to do this? (but ensure there is no allocation)

// TODO: DragonFly does not seem to provide any userland means to get this information.

// ----------------------------------------------------------------

// Clock

// ----------------------------------------------------------------

// low resolution timer

//----------------------------------------------------------------

// Process info

//----------------------------------------------------------------

// Haiku does not have (yet?) a way to

// get these stats per process

// macos reports in bytes

// Linux/BSD report in KiB

// use defaults for commit

// WebAssembly instances are not processes

// use defaults

//----------------------------------------------------------------

// Output

//----------------------------------------------------------------

//----------------------------------------------------------------

// Environment

//----------------------------------------------------------------

// On Posix systemsr use `environ` to access environment variables

// even before the C runtime is initialized.

// compare up to 10000 entries

// case insensitive

// found it

// fallback: use standard C `getenv` but this cannot be used while initializing the C runtime

// cannot call getenv() when still initializing the C runtime.

// we check the upper case name too.

// !MI_USE_ENVIRON

//----------------------------------------------------------------

// Random

//----------------------------------------------------------------

// We prefere CCRandomGenerateBytes as it returns an error code while arc4random_buf

// may fail silently on macOS. See PR #390, and <https://opensource.apple.com/source/Libc/Libc-1439.40.11/gen/FreeBSD/arc4random.c.auto.html>

// also for old apple versions < 10.7 (issue #829)

// Modern Linux provides `getrandom` but different distributions either use `sys/random.h` or `linux/random.h`

// and for the latter the actual `getrandom` call is not always defined.

// (see <https://stackoverflow.com/questions/45237324/why-doesnt-getrandom-compile>)

// We therefore use a syscall directly and fall back dynamically to /dev/urandom when needed.

// = 0

// don't call again, and fall back to /dev/urandom

//----------------------------------------------------------------

// Thread init/done

//----------------------------------------------------------------

// use pthread local storage keys to detect thread ending

// (and used with MI_TLS_PTHREADS for the default heap)

// do not leak the key, see issue #809

// can happen during recursive invocation on freeBSD

// nothing

// nothing


=== system/lib/mimalloc/src/prim/wasi/prim.c ===
SHA256: bfac56a07b2eb8fef65e06e23a33291f57eefc26b21c97398cabf9ebe3183579
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2023, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// This file is included in `src/prim/prim.c`

// fputs

// getenv

//---------------------------------------------

// Initialize

//---------------------------------------------

// WebAssembly has a fixed page size: 64KiB

//---------------------------------------------

// Free

//---------------------------------------------

// wasi heap cannot be shrunk

//---------------------------------------------

// Allocation: sbrk or memory_grow

//---------------------------------------------

// for sbrk

// on wasi this is always zero initialized already (?)

// `sbrk` is not thread safe in general so try to protect it (we could skip this on WASM but leave it in for now)

// to allocate aligned use a lock to try to avoid thread interaction

// between getting the current size and actual allocation

// (also, `sbrk` is not thread safe in general)

// get current size

// and align from there to minimize wasted space

// another thread used wasm_memory_grow/sbrk in-between and we do not have enough

// space after alignment. Give up (and waste the space as we cannot shrink :-( )

// (in `mi_os_mem_alloc_aligned` this will fall back to overallocation to align)

/*
  if (p == NULL) {
    _mi_warning_message("unable to allocate sbrk/wasm_memory_grow OS memory (%zu bytes, %zu alignment)\n", size, try_alignment);
    errno = ENOMEM;
    return NULL;
  }
  */

// Note: the `try_alignment` is just a hint and the returned pointer is not guaranteed to be aligned.

//---------------------------------------------

// Commit/Reset/Protect

//---------------------------------------------

//---------------------------------------------

// Huge pages and NUMA nodes

//---------------------------------------------

//----------------------------------------------------------------

// Clock

//----------------------------------------------------------------

// low resolution timer

//----------------------------------------------------------------

// Process info

//----------------------------------------------------------------

// use defaults

//----------------------------------------------------------------

// Output

//----------------------------------------------------------------

//----------------------------------------------------------------

// Environment

//----------------------------------------------------------------

// cannot call getenv() when still initializing the C runtime.

// we check the upper case name too.

//----------------------------------------------------------------

// Random

//----------------------------------------------------------------

//----------------------------------------------------------------

// Thread init/done

//----------------------------------------------------------------

// nothing

// nothing


=== system/lib/mimalloc/src/prim/windows/etw.h ===
SHA256: 4f3110ef2054c95cb275be96cb279224d3d46a728c5117bd1435425f382de778
//**********************************************************************`

//* This is an include file generated by Message Compiler.             *`

//*                                                                    *`

//* Copyright (c) Microsoft Corporation. All Rights Reserved.          *`

//**********************************************************************`

//*****************************************************************************

//

// Notes on the ETW event code generated by MC:

//

// - Structures and arrays of structures are treated as an opaque binary blob.

//   The caller is responsible for packing the data for the structure into a

//   single region of memory, with no padding between values. The macro will

//   have an extra parameter for the length of the blob.

// - Arrays of nul-terminated strings must be packed by the caller into a

//   single binary blob containing the correct number of strings, with a nul

//   after each string. The size of the blob is specified in characters, and

//   includes the final nul.

// - Arrays of SID are treated as a single binary blob. The caller is

//   responsible for packing the SID values into a single region of memory with

//   no padding.

// - The length attribute on the data element in the manifest is significant

//   for values with intype win:UnicodeString, win:AnsiString, or win:Binary.

//   The length attribute must be specified for win:Binary, and is optional for

//   win:UnicodeString and win:AnsiString (if no length is given, the strings

//   are assumed to be nul-terminated). For win:UnicodeString, the length is

//   measured in characters, not bytes.

// - For an array of win:UnicodeString, win:AnsiString, or win:Binary, the

//   length attribute applies to every value in the array, so every value in

//   the array must have the same length. The values in the array are provided

//   to the macro via a single pointer -- the caller is responsible for packing

//   all of the values into a single region of memory with no padding between

//   values.

// - Values of type win:CountedUnicodeString, win:CountedAnsiString, and

//   win:CountedBinary can be generated and collected on Vista or later.

//   However, they may not decode properly without the Windows 10 2018 Fall

//   Update.

// - Arrays of type win:CountedUnicodeString, win:CountedAnsiString, and

//   win:CountedBinary must be packed by the caller into a single region of

//   memory. The format for each item is a UINT16 byte-count followed by that

//   many bytes of data. When providing the array to the generated macro, you

//   must provide the total size of the packed array data, including the UINT16

//   sizes for each item. In the case of win:CountedUnicodeString, the data

//   size is specified in WCHAR (16-bit) units. In the case of

//   win:CountedAnsiString and win:CountedBinary, the data size is specified in

//   bytes.

//

//*****************************************************************************

// In kernel mode, save stack space by never inlining templates.

// In user mode, save code size by inlining templates as appropriate.

// ETW_INLINE

//

// MCGEN_DISABLE_PROVIDER_CODE_GENERATION macro:

// Define this macro to have the compiler skip the generated functions in this

// header.

//

//

// MCGEN_USE_KERNEL_MODE_APIS macro:

// Controls whether the generated code uses kernel-mode or user-mode APIs.

// - Set to 0 to use Windows user-mode APIs such as EventRegister.

// - Set to 1 to use Windows kernel-mode APIs such as EtwRegister.

// Default is based on whether the _ETW_KM_ macro is defined (i.e. by wdm.h).

// Note that the APIs can also be overridden directly, e.g. by setting the

// MCGEN_EVENTWRITETRANSFER or MCGEN_EVENTREGISTER macros.

//

// MCGEN_USE_KERNEL_MODE_APIS

//

// MCGEN_HAVE_EVENTSETINFORMATION macro:

// Controls how McGenEventSetInformation uses the EventSetInformation API.

// - Set to 0 to disable the use of EventSetInformation

//   (McGenEventSetInformation will always return an error).

// - Set to 1 to directly invoke MCGEN_EVENTSETINFORMATION.

// - Set to 2 to to locate EventSetInformation at runtime via GetProcAddress

//   (user-mode) or MmGetSystemRoutineAddress (kernel-mode).

// Default is determined as follows:

// - If MCGEN_EVENTSETINFORMATION has been customized, set to 1

//   (i.e. use MCGEN_EVENTSETINFORMATION).

// - Else if the target OS version has EventSetInformation, set to 1

//   (i.e. use MCGEN_EVENTSETINFORMATION).

// - Else set to 2 (i.e. try to dynamically locate EventSetInformation).

// Note that an McGenEventSetInformation function will only be generated if one

// or more provider in a manifest has provider traits.

//

// if MCGEN_EVENTSETINFORMATION has been customized,

//   directly invoke MCGEN_EVENTSETINFORMATION(...).

// else if using kernel-mode APIs,

//   if target OS is Windows 10 or later,

//     directly invoke MCGEN_EVENTSETINFORMATION(...).

//   else

//     find "EtwSetInformation" via MmGetSystemRoutineAddress.

// else (using user-mode APIs)

//   if target OS and SDK is Windows 8 or later,

//     directly invoke MCGEN_EVENTSETINFORMATION(...).

//   else

//     find "EventSetInformation" via GetModuleHandleExW/GetProcAddress.

// MCGEN_HAVE_EVENTSETINFORMATION

//

// MCGEN Override Macros

//

// The following override macros may be defined before including this header

// to control the APIs used by this header:

//

// - MCGEN_EVENTREGISTER

// - MCGEN_EVENTUNREGISTER

// - MCGEN_EVENTSETINFORMATION

// - MCGEN_EVENTWRITETRANSFER

//

// If the the macro is undefined, the MC implementation will default to the

// corresponding ETW APIs. For example, if the MCGEN_EVENTREGISTER macro is

// undefined, the EventRegister[MyProviderName] macro will use EventRegister

// in user mode and will use EtwRegister in kernel mode.

//

// To prevent issues from conflicting definitions of these macros, the value

// of the override macro will be used as a suffix in certain internal function

// names. Because of this, the override macros must follow certain rules:

//

// - The macro must be defined before any MC-generated header is included and

//   must not be undefined or redefined after any MC-generated header is

//   included. Different translation units (i.e. different .c or .cpp files)

//   may set the macros to different values, but within a translation unit

//   (within a single .c or .cpp file), the macro must be set once and not

//   changed.

// - The override must be an object-like macro, not a function-like macro

//   (i.e. the override macro must not have a parameter list).

// - The override macro's value must be a simple identifier, i.e. must be

//   something that starts with a letter or '_' and contains only letters,

//   numbers, and '_' characters.

// - If the override macro's value is the name of a second object-like macro,

//   the second object-like macro must follow the same rules. (The override

//   macro's value can also be the name of a function-like macro, in which

//   case the function-like macro does not need to follow the same rules.)

//

// For example, the following will cause compile errors:

//

//   #define MCGEN_EVENTWRITETRANSFER MyNamespace::MyClass::MyFunction // Value has non-identifier characters (colon).

//   #define MCGEN_EVENTWRITETRANSFER GetEventWriteFunctionPointer(7)  // Value has non-identifier characters (parentheses).

//   #define MCGEN_EVENTWRITETRANSFER(h,e,a,r,c,d) EventWrite(h,e,c,d) // Override is defined as a function-like macro.

//   #define MY_OBJECT_LIKE_MACRO     MyNamespace::MyClass::MyEventWriteFunction

//   #define MCGEN_EVENTWRITETRANSFER MY_OBJECT_LIKE_MACRO // Evaluates to something with non-identifier characters (colon).

//

// The following would be ok:

//

//   #define MCGEN_EVENTWRITETRANSFER  MyEventWriteFunction1  // OK, suffix will be "MyEventWriteFunction1".

//   #define MY_OBJECT_LIKE_MACRO      MyEventWriteFunction2

//   #define MCGEN_EVENTWRITETRANSFER  MY_OBJECT_LIKE_MACRO   // OK, suffix will be "MyEventWriteFunction2".

//   #define MY_FUNCTION_LIKE_MACRO(h,e,a,r,c,d) MyNamespace::MyClass::MyEventWriteFunction3(h,e,c,d)

//   #define MCGEN_EVENTWRITETRANSFER  MY_FUNCTION_LIKE_MACRO // OK, suffix will be "MY_FUNCTION_LIKE_MACRO".

//

// MCGEN_EVENTREGISTER

// MCGEN_EVENTUNREGISTER

// MCGEN_EVENTSETINFORMATION

// MCGEN_EVENTWRITETRANSFER

//

// MCGEN_EVENT_ENABLED macro:

// Override to control how the EventWrite[EventName] macros determine whether

// an event is enabled. The default behavior is for EventWrite[EventName] to

// use the EventEnabled[EventName] macros.

//

//

// MCGEN_EVENT_ENABLED_FORCONTEXT macro:

// Override to control how the EventWrite[EventName]_ForContext macros

// determine whether an event is enabled. The default behavior is for

// EventWrite[EventName]_ForContext to use the

// EventEnabled[EventName]_ForContext macros.

//

//

// MCGEN_ENABLE_CHECK macro:

// Determines whether the specified event would be considered as enabled

// based on the state of the specified context. Slightly faster than calling

// McGenEventEnabled directly.

//

// This structure is for use by MC-generated code and should not be used directly.

// Used as pointer to provider traits.

// MCGEN_TRACE_CONTEXT_DEF

//

// Determines whether an event with a given Level and Keyword would be

// considered as enabled based on the state of the specified context.

// Note that you may want to use MCGEN_ENABLE_CHECK instead of calling this

// function directly.

//

//

// Check if the event Level is lower than the level at which

// the channel is enabled.

// If the event Level is 0 or the channel is enabled at level 0,

// all levels are enabled.

//

// This also covers the case of Level == 0.

//

// Check if Keyword is enabled

//

// MCGEN_LEVEL_KEYWORD_ENABLED_DEF

//

// Determines whether the specified event would be considered as enabled based

// on the state of the specified context. Note that you may want to use

// MCGEN_ENABLE_CHECK instead of calling this function directly.

//

// MCGEN_EVENT_ENABLED_DEF

// This function is for use by MC-generated code and should not be used directly.

/*++

Routine Description:

    This is the notification callback for Windows Vista and later.

Arguments:

    SourceId - The GUID that identifies the session that enabled the provider.

    ControlCode - The parameter indicates whether the provider
                  is being enabled or disabled.

    Level - The level at which the event is enabled.

    MatchAnyKeyword - The bitmask of keywords that the provider uses to
                      determine the category of events that it writes.

    MatchAllKeyword - This bitmask additionally restricts the category
                      of events that the provider writes.

    FilterData - The provider-defined data.

    CallbackContext - The context of the callback that is defined when the provider
                      called EtwRegister to register itself.

Remarks:

    ETW calls this function to notify provider of enable/disable

--*/

// Arithmetic overflow cannot occur, no matter the value of EnableBitCount

//

// Call user defined callback

//

// MCGEN_PRIVATE_ENABLE_CALLBACK_V2

// MCGEN_CONTROL_CALLBACK

// _mcgen_PENABLECALLBACK

// This macro is for use by MC-generated code and should not be used directly.

// _mcgen_PASTE2

// This macro is for use by MC-generated code and should not be used directly.

// _mcgen_PASTE3

//

// Macro validation

//

// Validate MCGEN_EVENTREGISTER:

// Trigger an error if MCGEN_EVENTREGISTER is not an unqualified (simple) identifier:

// Trigger an error if MCGEN_EVENTREGISTER is redefined:

// Trigger an error if MCGEN_EVENTREGISTER is defined as a function-like macro:

// Validate MCGEN_EVENTUNREGISTER:

// Trigger an error if MCGEN_EVENTUNREGISTER is not an unqualified (simple) identifier:

// Trigger an error if MCGEN_EVENTUNREGISTER is redefined:

// Trigger an error if MCGEN_EVENTUNREGISTER is defined as a function-like macro:

// Validate MCGEN_EVENTSETINFORMATION:

// Trigger an error if MCGEN_EVENTSETINFORMATION is not an unqualified (simple) identifier:

// Trigger an error if MCGEN_EVENTSETINFORMATION is redefined:

// Trigger an error if MCGEN_EVENTSETINFORMATION is defined as a function-like macro:

// Validate MCGEN_EVENTWRITETRANSFER:

// Trigger an error if MCGEN_EVENTWRITETRANSFER is not an unqualified (simple) identifier:

// Trigger an error if MCGEN_EVENTWRITETRANSFER is redefined:

// Trigger an error if MCGEN_EVENTWRITETRANSFER is defined as a function-like macro:

// This macro is for use by MC-generated code and should not be used directly.

// This function is for use by MC-generated code and should not be used directly.

// Some customized MCGEN_EVENTWRITETRANSFER macros might ignore ActivityId.

// EVENT_DATA_DESCRIPTOR_TYPE_PROVIDER_METADATA

// McGenEventWrite_def

// This macro is for use by MC-generated code and should not be used directly.

// This function is for use by MC-generated code and should not be used directly.

/*++

Routine Description:

    This function registers the provider with ETW.

Arguments:

    ProviderId - Provider ID to register with ETW.

    EnableCallback - Callback to be used.

    CallbackContext - Context for the callback.

    RegHandle - Pointer to registration handle.

Remarks:

    Should not be called if the provider is already registered (i.e. should not
    be called if *RegHandle != 0). Repeatedly registering a provider is a bug
    and may indicate a race condition. However, for compatibility with previous
    behavior, this function will return SUCCESS in this case.

--*/

// ERROR_SUCCESS

// This macro is for use by MC-generated code and should not be used directly.

// This function is for use by MC-generated code and should not be used directly.

/*++

Routine Description:

    Unregister from ETW and set *RegHandle = 0.

Arguments:

    RegHandle - the pointer to the provider registration handle

Remarks:

    If provider has not been registered (i.e. if *RegHandle == 0),
    return SUCCESS. It is safe to call McGenEventUnregister even if the
    call to McGenEventRegister returned an error.

--*/

// ERROR_SUCCESS

// McGenEventRegisterUnregister

// This macro is for use by MC-generated code and should not be used directly.

// CPU type

// This macro is for use by MC-generated code and should not be used directly.

// CPU type

// _mcgen_EVENT_BIT_SET

// MCGEN_DISABLE_PROVIDER_CODE_GENERATION

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// Provider "microsoft-windows-mimalloc" event count 2

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// Provider GUID = 138f4dbb-ee04-4899-aa0a-572ad4475779

// ETW_MI_Provider_Traits

//

// Event Descriptors

//

//

// MCGEN_DISABLE_PROVIDER_CODE_GENERATION macro:

// Define this macro to have the compiler skip the generated functions in this

// header.

//

//

// Event Enablement Bits

// These variables are for use by MC-generated code and should not be used directly.

//

//

// Provider context

//

//

// Provider REGHANDLE

//

//

// This macro is set to 0, indicating that the EventWrite[Name] macros do not

// have an Activity parameter. This is controlled by the -km and -um options.

//

//

// Register with ETW using the control GUID specified in the manifest.

// Invoke this macro during module initialization (i.e. program startup,

// DLL process attach, or driver load) to initialize the provider.

// Note that if this function returns an error, the error means that

// will not work, but no action needs to be taken -- even if EventRegister

// returns an error, it is generally safe to use EventWrite and

// EventUnregister macros (they will be no-ops if EventRegister failed).

//

//

// Register with ETW using a specific control GUID (i.e. a GUID other than what

// is specified in the manifest). Advanced scenarios only.

//

//

// Unregister with ETW and close the provider.

// Invoke this macro during module shutdown (i.e. program exit, DLL process

// detach, or driver unload) to unregister the provider.

// Note that you MUST call EventUnregister before DLL or driver unload

// (not optional): failure to unregister a provider before DLL or driver unload

// will result in crashes.

//

//

// MCGEN_ENABLE_FORCONTEXT_CODE_GENERATION macro:

// Define this macro to enable support for caller-allocated provider context.

//

//

// Advanced scenarios: Caller-allocated provider context.

// Use when multiple differently-configured provider handles are needed,

// e.g. for container-aware drivers, one context per container.

//

// Usage:

//

// - Caller enables the feature before including this header, e.g.

//   #define MCGEN_ENABLE_FORCONTEXT_CODE_GENERATION 1

// - Caller allocates memory, e.g. pContext = malloc(sizeof(McGenContext_microsoft_windows_mimalloc));

// - Caller registers the provider, e.g. EventRegistermicrosoft_windows_mimalloc_ForContext(pContext);

// - Caller writes events, e.g. EventWriteMyEvent_ForContext(pContext, ...);

// - Caller unregisters, e.g. EventUnregistermicrosoft_windows_mimalloc_ForContext(pContext);

// - Caller frees memory, e.g. free(pContext);

//

// The fields of this structure are subject to change and should

// not be accessed directly. To access the provider's REGHANDLE,

// use microsoft_windows_mimallocHandle_ForContext(pContext).

//

// Provider REGHANDLE for caller-allocated context.

//

// This function is for use by MC-generated code and should not be used directly.

// Initialize and register the caller-allocated context.

// This function is for use by MC-generated code and should not be used directly.

// Trigger a compile error if called with the wrong parameter type.

// MCGEN_ENABLE_FORCONTEXT_CODE_GENERATION

//

// Enablement check macro for event "ETW_MI_ALLOC"

//

//

// Event write macros for event "ETW_MI_ALLOC"

//

// This macro is for use by MC-generated code and should not be used directly.

//

// Enablement check macro for event "ETW_MI_FREE"

//

//

// Event write macros for event "ETW_MI_FREE"

//

// This macro is for use by MC-generated code and should not be used directly.

// MCGEN_DISABLE_PROVIDER_CODE_GENERATION

//

// MCGEN_DISABLE_PROVIDER_CODE_GENERATION macro:

// Define this macro to have the compiler skip the generated functions in this

// header.

//

//

// Template Functions

//

//

// Function for template "ETW_CUSTOM_HEAP_ALLOC_DATA" (and possibly others).

// This function is for use by MC-generated code and should not be used directly.

//

// McTemplateU0xx_def

// MCGEN_DISABLE_PROVIDER_CODE_GENERATION


=== system/lib/mimalloc/src/prim/windows/prim.c ===
SHA256: ba8fcdc7c34246a2c7ff0274bf661358599b37f25c9ae9c776d72d7a96beebf6
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2023, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// This file is included in `src/prim/prim.c`

// fputs, stderr

//---------------------------------------------

// Dynamically bind Windows API points for portability

//---------------------------------------------

// We use VirtualAlloc2 for aligned allocation, but it is only supported on Windows 10 and Windows Server 2016.

// So, we need to look it up dynamically to run on older systems. (use __stdcall for 32-bit compatibility)

// NtAllocateVirtualAllocEx is used for huge OS page allocation (1GiB)

// We define a minimal MEM_EXTENDED_PARAMETER ourselves in order to be able to compile with older SDK's.

// Similarly, GetNumaProcesorNodeEx is only supported since Windows 7

//---------------------------------------------

// Enable large page support dynamically (if possible)

//---------------------------------------------

// Try to see if large OS pages are supported

// To use large pages on Windows, we first need access permission

// Set "Lock pages in memory" permission in the group policy editor

// <https://devblogs.microsoft.com/oldnewthing/20110128-00/?p=11643>

//---------------------------------------------

// Initialize

//---------------------------------------------

// get the page size

// get the VirtualAlloc2 function

// use VirtualAlloc2FromApp if possible as it is available to Windows store apps

// NtAllocateVirtualMemoryEx is used for huge page allocation

// Try to use Win7+ numa API

//---------------------------------------------

// Free

//---------------------------------------------

// In mi_os_mem_alloc_aligned the fallback path may have returned a pointer inside

// the memory region returned by VirtualAlloc; in that case we need to free using

// the start of the region.

//---------------------------------------------

// VirtualAlloc

//---------------------------------------------

// on 64-bit systems, try to use the virtual address area after 2TiB for 4MiB aligned allocations

// fall through on error

// on modern Windows try use VirtualAlloc2 for aligned allocation

// fall through on error

// last resort

// at most 2 seconds

// if one sets the option to "true"

// try at most 10 times (=2200ms)

// success, return the address

// if committing regular memory and being out-of-memory, 

// keep trying for a bit in case memory frees up after all. See issue #894

// increasing waits

// otherwise return with an error

// = 0;

// Try to allocate large OS pages (2MiB) if allowed or required.

// if a large page allocation fails, it seems the calls to VirtualAlloc get very expensive.

// therefore, once a large page allocation failed, we don't try again for `large_page_try_ok` times.

// large OS pages must always reserve and commit.

// fall back to non-large page allocation on error (`p == NULL`).

// on error, don't try again for the next N allocations

// Fall back to regular page allocation

//if (p == NULL) { _mi_warning_message("unable to allocate OS memory (%zu bytes, error code: 0x%x, address: %p, alignment: %zu, flags: 0x%x, large only: %d, allow large: %d)\n", size, GetLastError(), addr, try_alignment, flags, large_only, allow_large); }

//---------------------------------------------

// Commit/Reset/Protect

//---------------------------------------------

// suppress warning calling VirtualFree without MEM_RELEASE (for decommit)

/*
  // zero'ing only happens on an initial commit... but checking upfront seems expensive..
  _MEMORY_BASIC_INFORMATION meminfo; _mi_memzero_var(meminfo);
  if (VirtualQuery(addr, &meminfo, size) > 0) {
    if ((meminfo.State & MEM_COMMIT) == 0) {
      *is_zero = true;
    }
  }
  */

// commit

// for safety, assume always decommitted even in the case of an error.

// VirtualUnlock after MEM_RESET removes the memory directly from the working set

//---------------------------------------------

// Huge page allocation

//---------------------------------------------

// on modern Windows try use NtAllocateVirtualMemoryEx for 1GiB huge pages

// fall back to regular large pages

// don't try further huge pages

// on modern Windows try use VirtualAlloc2 for numa aware large OS page allocation

// otherwise use regular virtual alloc on older windows

//---------------------------------------------

// Numa nodes

//---------------------------------------------

// Extended API is supported

// Vista or earlier, use older API that is limited to 64 processors. Issue #277

// find the highest node number that has actual processors assigned to it. Issue #282

// Extended API is supported

// found the maximum non-empty node

// Vista or earlier, use older API that is limited to 64 processors.

// found the maximum non-empty node

// max node was invalid or had no processor assigned, try again

//----------------------------------------------------------------

// Clock

//----------------------------------------------------------------

// = 0

//----------------------------------------------------------------

// Process Info

//----------------------------------------------------------------

// FILETIME is in 100 nano seconds

// load psapi on demand

// get process info

//----------------------------------------------------------------

// Output

//----------------------------------------------------------------

// on windows with redirection, the C runtime cannot handle locale dependent output

// after the main thread closes so we use direct console output.

// _cputs(msg);  // _cputs cannot be used as it aborts when failing to lock the console

// use direct write if stderr was redirected

// finally fall back to fputs after all

//----------------------------------------------------------------

// Environment

//----------------------------------------------------------------

// On Windows use GetEnvironmentVariable instead of getenv to work

// reliably even when this is invoked before the C runtime is initialized.

// i.e. when `_mi_preloading() == true`.

// Note: on windows, environment names are not case sensitive.

//----------------------------------------------------------------

// Random

//----------------------------------------------------------------

// || defined(__cplusplus)

// We prefer to use BCryptGenRandom instead of (the unofficial) RtlGenRandom but when using

// dynamic overriding, we observed it can raise an exception when compiled with C++, and

// sometimes deadlocks when also running under the VS debugger.

// In contrast, issue #623 implies that on Windows Server 2019 we need to use BCryptGenRandom.

// To be continued..

// MI_USE_RTLGENRANDOM

//----------------------------------------------------------------

// Thread init/done

//----------------------------------------------------------------

// use thread local storage keys to detect thread ending

// note: another design could be to use special linker sections (see issue #869)

// before Windows Vista

// prevent recursion as _mi_thread_done may set it back to the main heap, issue #672

// call thread-done on all threads (except the main thread) to prevent 

// dangling callback pointer if statically linked with a DLL; Issue #208

// Dll; nothing to do as in that case thread_done is handled through the DLL_THREAD_DETACH event.


=== system/lib/mimalloc/src/random.c ===
SHA256: d642a722e93e6e5f2fb49881fefda72ab05d0d43838ec727871e82e6a684f6cd
/* ----------------------------------------------------------------------------
Copyright (c) 2019-2021, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// _mi_prim_random_buf

// memset

/* ----------------------------------------------------------------------------
We use our own PRNG to keep predictable performance of random number generation
and to avoid implementations that use a lock. We only use the OS provided
random source to initialize the initial seeds. Since we do not need ultimate
performance but we do rely on the security (for secret cookies in secure mode)
we use a cryptographically secure generator (chacha20).
-----------------------------------------------------------------------------*/

// perhaps use 12 for better performance?

/* ----------------------------------------------------------------------------
Chacha20 implementation as the original algorithm with a 64-bit nonce
and counter: https://en.wikipedia.org/wiki/Salsa20
The input matrix has sixteen 32-bit values:
Position  0 to  3: constant key
Position  4 to 11: the key
Position 12 to 13: the counter.
Position 14 to 15: the nonce.

The implementation uses regular C code which compiles very well on modern compilers.
(gcc x64 has no register spills, and clang 6+ uses SSE instructions)
-----------------------------------------------------------------------------*/

// scramble into `x`

// add scrambled data to the initial state

// increment the counter for the next round

// and keep increasing into the nonce

// (assign again to suppress static analysis warning)

// reset once the data is handed out

// since we only use chacha for randomness (and not encryption) we

// do not _need_ to read 32-bit values as little endian but we do anyways

// just for being compatible :-)

// do not reuse nonces!

/* ----------------------------------------------------------------------------
Random interface
-----------------------------------------------------------------------------*/

/*nonce*/

/* ----------------------------------------------------------------------------
To initialize a fresh random context.
If we cannot get good randomness, we fall back to weak randomness based on a timer and ASLR.
-----------------------------------------------------------------------------*/

// ASLR makes the address random

// and do a few randomization steps

// if we fail to get random data from the OS, we fall back to a

// weak random source based on the current time

// key is eight 32-bit words.

/*nonce*/

/* --------------------------------------------------------
test vectors from <https://tools.ietf.org/html/rfc8439>
----------------------------------------------------------- */

/*
static bool array_equals(uint32_t* x, uint32_t* y, size_t n) {
  for (size_t i = 0; i < n; i++) {
    if (x[i] != y[i]) return false;
  }
  return true;
}
static void chacha_test(void)
{
  uint32_t x[4] = { 0x11111111, 0x01020304, 0x9b8d6f43, 0x01234567 };
  uint32_t x_out[4] = { 0xea2a92f4, 0xcb1cf8ce, 0x4581472e, 0x5881c4bb };
  qround(x, 0, 1, 2, 3);
  mi_assert_internal(array_equals(x, x_out, 4));

  uint32_t y[16] = {
       0x879531e0,  0xc5ecf37d,  0x516461b1,  0xc9a62f8a,
       0x44c20ef3,  0x3390af7f,  0xd9fc690b,  0x2a5f714c,
       0x53372767,  0xb00a5631,  0x974c541a,  0x359e9963,
       0x5c971061,  0x3d631689,  0x2098d9d6,  0x91dbd320 };
  uint32_t y_out[16] = {
       0x879531e0,  0xc5ecf37d,  0xbdb886dc,  0xc9a62f8a,
       0x44c20ef3,  0x3390af7f,  0xd9fc690b,  0xcfacafd2,
       0xe46bea80,  0xb00a5631,  0x974c541a,  0x359e9963,
       0x5c971061,  0xccc07c79,  0x2098d9d6,  0x91dbd320 };
  qround(y, 2, 7, 8, 13);
  mi_assert_internal(array_equals(y, y_out, 16));

  mi_random_ctx_t r = {
    { 0x61707865, 0x3320646e, 0x79622d32, 0x6b206574,
      0x03020100, 0x07060504, 0x0b0a0908, 0x0f0e0d0c,
      0x13121110, 0x17161514, 0x1b1a1918, 0x1f1e1d1c,
      0x00000001, 0x09000000, 0x4a000000, 0x00000000 },
    {0},
    0
  };
  uint32_t r_out[16] = {
       0xe4e7f110, 0x15593bd1, 0x1fdd0f50, 0xc47120a3,
       0xc7f4d1c7, 0x0368c033, 0x9aaa2204, 0x4e6cd4c3,
       0x466482d2, 0x09aa9f07, 0x05d7c214, 0xa2028bd9,
       0xd19c12b5, 0xb94e16de, 0xe883d0cb, 0x4e3c50a2 };
  chacha_block(&r);
  mi_assert_internal(array_equals(r.output, r_out, 16));
}
*/


=== system/lib/mimalloc/src/segment-map.c ===
SHA256: b51ddc6bb26eb0729784d940601de6c20c470b70f77c7bb0db0eea47731b8a57
/* ----------------------------------------------------------------------------
Copyright (c) 2019-2023, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

/* -----------------------------------------------------------
  The following functions are to reliably find the segment or
  block that encompasses any pointer p (or NULL if it is not
  in any of our segments).
  We maintain a bitmap of all memory with 1 bit per MI_SEGMENT_SIZE (64MiB)
  set to 1 if it contains the segment meta data.
----------------------------------------------------------- */

// 140TB (see issue #881)

// 40TB (to include huge page areas)

// 2Gb

// 2KiB per TB with 64MiB segments

// note: segment can be invalid or NULL.

// is it aligned on MI_SEGMENT_SIZE?

// Determine the segment belonging to a pointer or NULL if it is not in a valid segment.

// segment can be NULL  

// fast path: for any pointer to valid small/medium/large object or first MI_SEGMENT_SIZE in huge

// yes, allocated by us

// TODO: maintain max/min allocated range for efficiency for more efficient rejection of invalid pointers?

// search downwards for the first segment in case it is an interior pointer

// could be slow but searches in MI_INTPTR_SIZE * MI_SEGMENT_SIZE (512MiB) steps trough

// valid huge objects

// note: we could maintain a lowest index to speed up the path for invalid pointers?

// lobits != 0

// lomask != 0

// take difference as the addresses could be larger than the MAX_ADDRESS space.

// outside the range

// Is this a valid pointer in our heap?

/*
// Return the full segment range belonging to a pointer
static void* mi_segment_range_of(const void* p, size_t* size) {
  mi_segment_t* segment = _mi_segment_of(p);
  if (segment == NULL) {
    if (size != NULL) *size = 0;
    return NULL;
  }
  else {
    if (size != NULL) *size = segment->segment_size;
    return segment;
  }
  mi_assert_expensive(page == NULL || mi_segment_is_valid(_mi_page_segment(page),tld));
  mi_assert_internal(page == NULL || (mi_segment_page_size(_mi_page_segment(page)) - (MI_SECURE == 0 ? 0 : _mi_os_page_size())) >= block_size);
  mi_reset_delayed(tld);
  mi_assert_internal(page == NULL || mi_page_not_in_queue(page, tld));
  return page;
}
*/


=== system/lib/mimalloc/src/segment.c ===
SHA256: a6d6318587f3e967fbe025e3368b32b5fb0be15955dfa1dac5b39f8120e86b3c
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2024, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// memset

// -------------------------------------------------------------------

// Segments

// mimalloc pages reside in segments. See `mi_segment_valid` for invariants.

// -------------------------------------------------------------------

// -------------------------------------------------------------------

// commit mask

// -------------------------------------------------------------------

// todo: use popcount

// we use total since for huge segments each commit bit may represent a larger size

// find first ones

// not found

// found, count ones

/* --------------------------------------------------------------------------------
  Segment allocation
-------------------------------------------------------------------------------- */

/* -----------------------------------------------------------
   Slices
----------------------------------------------------------- */

/* -----------------------------------------------------------
   Bins
----------------------------------------------------------- */

// Use bit scan forward to quickly find the first zero bit if it is available

// slice_count > 1

/* -----------------------------------------------------------
   Slice span queues
----------------------------------------------------------- */

// todo: or push to the end?

// paranoia

// free

// should work too if the queue does not contain slice (which can happen during reclaim)

// no more free

/* -----------------------------------------------------------
 Invariant checking
----------------------------------------------------------- */

// can only decommit committed blocks

//mi_assert_internal(segment->segment_info_size % MI_SEGMENT_SLICE_SIZE == 0);

// a page in use, we need at least MAX_SLICE_OFFSET_COUNT valid back offsets

// and the last entry as well (for coalescing)

// free range of slices; only last slice needs a valid back offset

// segment is not huge or abandoned

/* -----------------------------------------------------------
 Segment size calculations
----------------------------------------------------------- */

// make the start not OS page aligned for smaller blocks to avoid page/cache effects

// note: the offset must always be a block_size multiple since we assume small allocations

// are aligned (see `mi_heap_malloc_aligned`).

// for small objects, ensure the page start is aligned with the block size (PR#66 by kickunderscore)

// Start of the page available memory; can be used on uninitialized pages

// in secure mode, we set up a protected page in between the segment info

// and the page data (and one at the end of the segment)

/* ----------------------------------------------------------------------------
Segment caches
We keep a small segment cache per thread to increase local
reuse and avoid setting/clearing guard pages in secure mode.
------------------------------------------------------------------------------- */

// _mi_os_unprotect(segment, mi_segment_size(segment)); // ensure no more guard pages are set

// unprotect the guard pages; we cannot just unprotect the whole segment size as part may be decommitted

// purge delayed decommits now? (no, leave it to the arena)

// mi_segment_try_purge(segment,true,tld->stats);

// wait until safe to free

/* -----------------------------------------------------------
   Commit/Decommit ranges
----------------------------------------------------------- */

// decommit conservative

// commit liberal

// note: the mask is also calculated for an initial commit of the info area

// can be 0

// commit liberal

/* conservative? */

// committing

// adjust for overlap

// increase purge expiration when using part of delayed purges -- we assume more allocations are coming soon.

// always clear any delayed purges in our range (as they are either committed now)

// note: assumes commit_mask is always full for huge segments as otherwise the commit mask bits can overflow

// fully committed

// purge conservative

/* conservative? */

// purging

// reset or decommit

// adjust for double counting

// always clear any scheduled purges in our range

// register for future purge in the purge mask

/*conservative*/

// update delayed commit

// only purge what is committed; span_free may try to decommit more

// no previous purgess, initialize now

// previous purge mask already expired

// (mi_option_get(mi_option_purge_delay) / 8); // wait a tiny bit longer in case there is a series of free's

// previous purge mask is not yet expired, increase the expiration by a bit.

// if found, decommit that sequence

// called from `mi_heap_collect_ex`

// this can be called per-page so it is important that try_purge has fast exit path

/* -----------------------------------------------------------
   Span free
----------------------------------------------------------- */

// note: can be called on abandoned segments

// set first and last slice (the intermediates can be undetermined)

// no overflow?

// perhaps decommit

// and push it on the free page queue (if it was not a huge page)

// mark huge page as free anyways

/*
// called from reclaim to add existing free spans
static void mi_segment_span_add_free(mi_slice_t* slice, mi_segments_tld_t* tld) {
  mi_segment_t* segment = _mi_ptr_segment(slice);
  mi_assert_internal(slice->xblock_size==0 && slice->slice_count>0 && slice->slice_offset==0);
  size_t slice_index = mi_slice_index(slice);
  mi_segment_span_free(segment,slice_index,slice->slice_count,tld);
}
*/

// note: can be called on abandoned segments

// mi_segment_is_abandoned(segment);

// for huge pages, just mark as free but don't add to the queues

// issue #691: segment->used can be 0 if the huge page block was freed while abandoned (reclaim will get here in that case)

// decreased right after this call in `mi_segment_page_clear`

// mark as free anyways

// we should mark the last slice `xblock_size=0` now to maintain invariants but we skip it to

// avoid a possible cache miss (and the segment is about to be freed)

// otherwise coalesce the span and add to the free span queues

// free next block -- remove it from free and merge

// extend

// free previous slice -- remove it from free and merge

// and add the new free page

/* -----------------------------------------------------------
   Page allocation
----------------------------------------------------------- */

// Note: may still return NULL if committing the memory failed

// commit before changing the slice data

// commit failed!

// convert the slices to a page

// set slice back pointers for the first MI_MAX_SLICE_OFFSET_COUNT entries

// huge objects may have more slices than avaiable entries in the segment->slices

// and also for the last one (if not set already) (the last one is needed for coalescing and for large alignments)

// note: the cast is needed for ubsan since the index can be larger than MI_SLICES_PER_SEGMENT for huge allocations (see #543)

// and initialize the page

// no more in free queue

/* don't purge left-over part */

// search from best fit up

// found one

// found a suitable page span

// commit failed; return NULL but first restore the slice

// could not find a page..

/* -----------------------------------------------------------
   Segment allocation
----------------------------------------------------------- */

// only allow large OS pages once we are no longer lazy

// mi_assert_internal(huge_page != NULL);

// recalculate due to potential guard pages

// failed to allocate

// ensure metadata part of the segment is committed

// at least commit the info slices

// Allocate a segment from the OS aligned to `MI_SEGMENT_SIZE` .

// calculate needed sizes first

// Commit eagerly only if not the first N lazy segments (to reduce impact of many threads that allocate just a little)

// !_mi_os_has_overcommit() &&             // never delay on overcommit systems

// do not delay for the first N threads

// Allocate the segment from the OS

// zero the segment info? -- not always needed as it may be zero initialized from the OS

// one more

// initialize the rest of the segment info

// _mi_memzero(segment->slices, sizeof(mi_slice_t)*(info_slices+1));

// set up guard pages

// in secure mode, we set up a protected page in between the segment info

// and the page data, and at the end of the segment.

// don't use the last slice :-(

// reserve first slices for segment info

// cannot fail as we always commit in advance

// don't count our internal slices towards usage

// initialize initial free pages

// not a huge page

/* don't purge */

// cannot fail as we commit in advance

// Remove the free pages

// no more used pages ..

// first page is allocated by the segment itself

// stats

// return it to the OS

/* -----------------------------------------------------------
   Page Free
----------------------------------------------------------- */

// note: can be called on abandoned pages

// reset the page memory to reduce memory pressure?

// zero the page data, but not the segment fields and heap tag

// and free it

// cannot assert segment valid as it is called during reclaim

// mi_assert_expensive(mi_segment_is_valid(segment, tld));

// mark it as free now

// no more used pages; remove from the free list and free the segment

// only abandoned pages; remove from free list and abandon

// perform delayed purges

/* force? */

/* -----------------------------------------------------------
Abandonment

When threads terminate, they can leave segments with
live blocks (reachable through other threads). Such segments
are "abandoned" and will be reclaimed by other threads to
reuse their pages and/or free them eventually. The
`thread_id` of such segments is 0.

When a block is freed in an abandoned segment, the segment
is reclaimed into that thread.

Moreover, if threads are looking for a fresh segment, they
will first consider abondoned segments -- these can be found
by scanning the arena memory
(segments outside arena memoryare only reclaimed by a free).
----------------------------------------------------------- */

// legacy: Wait until there are no more pending reads on segments that used to be in the abandoned list

// nothing needed

/* -----------------------------------------------------------
   Abandon segment/page
----------------------------------------------------------- */

// remove the free pages from the free page queues

// a free page

// but keep it free

// perform delayed decommits (forcing is much slower on mstress)

// Only abandoned segments in arena memory can be reclaimed without a free

// so if a segment is not from an arena we force purge here to be conservative.

// all pages in the segment are abandoned; add it to the abandoned list

// from 0 to 1 to signify it is abandoned

// all pages are abandoned, abandon the entire segment

/* -----------------------------------------------------------
  Reclaim abandoned pages
----------------------------------------------------------- */

// segment allocated page

// skip the first segment allocated page

// Possibly free pages and check if free space is available

// for all slices

// used page

// ensure used count is up to date and collect potential concurrent frees

// if this page is all free now, free it without adding to any queues (yet)

// re-assign slice due to coalesce!

// a page has available free blocks of the right size

// empty span

// Reclaim an abandoned segment; returns NULL if the segment was freed

// set `right_page_reclaimed` to `true` if it reclaimed a page of the right `block_size` that was not full.

// can be 0 still with abandoned_next, or already a thread id for segments outside an arena that are reclaimed on a free.

// for all slices

// in use: reclaim the page in our heap

// set the heap again and allow heap thread delayed free again.

// allow custom heaps to separate objects

// override never (after heap is set)

// ensure used count is up to date

// if everything free by now, free the page

// set slice again due to coalesceing

// otherwise reclaim it into the heap

// the span is free, add it to our page queues

// set slice again due to coalesceing

// due to page_clear

// attempt to reclaim a particular segment (called from multi threaded free `alloc.c:mi_free_block_mt`)

// it is not abandoned

// don't reclaim more from a free than half the current segments

// this is to prevent a pure free-ing thread to start owning too many segments

// atomically unabandon

// limit the tries to 10% (default) of the abandoned segments with at least 8 and at most 1024 tries.

// avoid overflow

// todo: should we respect numa affinity for abondoned reclaim? perhaps only for the first visit?

// todo: an arena exclusive heap will potentially visit many abandoned unsuitable segments and use many tries

// Perhaps we can skip non-suitable ones in a better way?

// try to free up pages (due to concurrent frees)

// free the segment (by forced reclaim) to make it available to other threads.

// note1: we prefer to free a segment as that might lead to reclaiming another

// segment that is still partially used.

// note2: we could in principle optimize this by skipping reclaim and directly

// freeing but that would violate some invariants temporarily)

// found a large enough free span, or a page of the right block_size with free space

// we return the result of reclaim (which is usually `segment`) as it might free

// the segment due to concurrent frees (in which case `NULL` is returned).

// always reclaim on 3rd visit to limit the abandoned queue length.

// otherwise, push on the visited list so it gets not looked at too quickly again

/* true force? */

// force purge if needed as we may not visit soon again

// limit latency

// try to free up pages (due to concurrent frees)

// free the segment (by forced reclaim) to make it available to other threads.

// note: we could in principle optimize this by skipping reclaim and directly

// freeing but that would violate some invariants temporarily)

// otherwise, purge if needed and push on the visited list

// note: forced purge can be expensive if many threads are destroyed/created as in mstress.

/* -----------------------------------------------------------
   Reclaim or allocate
----------------------------------------------------------- */

// 1. try to reclaim an abandoned segment

// reclaimed the right page right into the heap

// pretend out-of-memory as the page will be in the page queue of the heap with available blocks

// reclaimed a segment with a large enough empty span in it

// 2. otherwise allocate a fresh segment

/* -----------------------------------------------------------
   Page allocation
----------------------------------------------------------- */

// find a free page

//(required <= MI_SMALL_SIZE_MAX ? 0 : slices_needed), tld);

// no free page, allocate a new segment and try again

// OOM or reclaimed a good page in the heap

// otherwise try again

/* -----------------------------------------------------------
   Huge page allocation
----------------------------------------------------------- */

// huge segments are immediately abandoned

// for huge pages we initialize the block_size as we may

// overallocate to accommodate large alignments.

// decommit the part of the prefix of a page that will not be used; this can be quite large (close to MI_SEGMENT_SIZE)

// for the free list

// note: cannot use segment_decommit on huge segments

// free huge block from another thread

// huge page segments are always abandoned and can be freed immediately by any thread

// claim it and free

// issue #221; don't use the internal get_default_heap as we need to ensure the thread is initialized.

// paranoia: if this it the last reference, the cas should always succeed

// reset memory of a huge block from another thread

// this is called just before the free

// note: cannot use segment_decommit on huge segments

/* -----------------------------------------------------------
   Page allocation and free
----------------------------------------------------------- */


=== system/lib/mimalloc/src/static.c ===
SHA256: 54251e90068191b62b6a71196db22ea8a947665667fd21ffa56750e4d3de5afb
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2020, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// same remarks as os.c for the static's context.

// For a static override we create a single object file

// containing the whole library. If it is linked first

// it will override all the standard library allocation

// functions (on Unix's).

// includes alloc-override.c

// includes page-queue.c


=== system/lib/mimalloc/src/stats.c ===
SHA256: cb85cb7c4a4a1229776f6430233269ab6cf19c03c0c7d4a389e250a2196b8f1f
/* ----------------------------------------------------------------------------
Copyright (c) 2018-2021, Microsoft Research, Daan Leijen
This is free software; you can redistribute it and/or modify it under the
terms of the MIT license. A copy of the license can be found in the file
"LICENSE" at the root of this distribution.
-----------------------------------------------------------------------------*/

// memset

// non-constant aggregate initializer

/* -----------------------------------------------------------
  Statistics operations
----------------------------------------------------------- */

// add atomically (for abandoned pages)

// add thread local

// must be thread safe as it is called from stats_merge

// peak scores do not work across threads..

// must be thread safe as it is called from stats_merge

/* -----------------------------------------------------------
  Display statistics
----------------------------------------------------------- */

// unit > 0 : size in binary bytes

// unit == 0: count as decimal

// unit < 0 : count in binary

// skip printing 1 B for the unit column

// no freed

//------------------------------------------------------------

// Use an output wrapper for line-buffered output

// (which is nice when using loggers etc.)

//------------------------------------------------------------

// original output function

// and state

// local buffer of at least size `count+1`

// currently used chars `used <= count`

// total chars available for output

//------------------------------------------------------------

// Print statistics

//------------------------------------------------------------

// wrap the output function to be line buffered

// and print using that

// = 0

// called from `mi_thread_done`

// for compatibility there is an `out` parameter (which can be `stdout` or `stderr`)

// ----------------------------------------------------------------

// Basic timer for convenience; use milli-seconds to avoid doubles

// ----------------------------------------------------------------

// --------------------------------------------------------

// Basic process statistics

// --------------------------------------------------------


=== system/lib/pthread/em_task_queue.c ===
SHA256: 241f7b1e734b91ae4f3f3a0c0367836a6e2fd8d825e86e40c740c25732ae2f5e
/*
 * Copyright 2021 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Task Queue Lifetime Management

// -------------------------------

//

// When tasks are added to a task queue, the Worker running the target thread

// receives an event that will cause it to execute the queue when it next

// returns to its event loop. In some cases the queue will already have been

// executed before then, but the event is still received and the queue is still

// executed. These events contain references to the queue so that the target

// thread will know which queue to execute.

//

// To avoid use-after-free bugs, we cannot free a task queue immediately when

// `em_task_queue_destroy` is called; instead, we must defer freeing the queue

// until all of its outstanding notifications have been processed. We defer

// freeing the queue using an atomic flag. Each time a notification containing a

// reference to a task queue is generated, we set the flag on that task queue.

// Each time that task queue is processed, we clear the flag as long as another

// notification for the queue has not been generated in the mean time. The

// proxying queue can only be freed once `em_task_queue_destroy` has been called

// and its notification flag has been cleared.

//

// But an extra complication is that the target thread may have died by the time

// it gets back to its event loop to process its notifications. In that case the

// thread's Worker will still receive a notification and have to clear the

// notification flag without a live runtime. Without a live runtime, there is no

// stack, so the worker cannot safely free the queue at this point even if the

// notification flag is cleared. We need a separate thread with a live runtime

// to perform the free.

//

// To ensure that queues are eventually freed, we place destroyed queues in a

// global "zombie list" where they wait for their notification flags to be

// cleared. The zombie list is scanned and zombie queues without outstanding

// notifications are freed whenever a new queue is constructed. In principle the

// zombie list could be scanned at any time, but the queue constructor is a nice

// place to do it because scanning there is sufficient to keep the number of

// zombie queues from growing without bound; creating a new zombie ultimately

// requires creating a new queue.

//

// -------------------------------

// The head of the zombie list. Its mutex protects access to the list and its

// other fields are not used.

// Some other thread is already culling. In principle there may be new

// cullable zombies after it finishes, but it's not worth waiting to find

// out.

// Remove the zombie from the list and free it.

// Free any queue that has been destroyed and is safe to free.

// No outstanding references to the queue, so we can go ahead and free it.

// Otherwise add the queue to the zombie list so that it will eventually be

// freed safely.

// Not thread safe. Returns 1 on success and 0 on failure.

// Allocate a larger task queue.

// Copy the tasks such that the head of the queue is at the beginning of the

// buffer. There are two cases to handle: either the queue wraps around the

// end of the old buffer or it does not.

// No wrap. Copy the tasks in one chunk.

// Wrap. Copy `first_queued` tasks up to the end of the old buffer and

// `last_queued` tasks at the beginning of the old buffer.

// Unlock while the task is running to allow more work to be queued in

// parallel.

// Any subsequent messages to this queue (for example if a pthread struct is

// reused for a future thread, potentially on a different worker) will require

// a new notification. Clearing the flag is safe here because in both the

// proxying queue and mailbox cases, there are no more outstanding references

// to the queue after thread shutdown.

// Ensure the target mailbox will remain open or detect that it is already

// closed.

// We're done if there is already a pending notification for this task queue.

// Otherwise, we will send one.


=== system/lib/pthread/em_task_queue.h ===
SHA256: 107938925db3110eddc398f9ab8c6f9414def7f49847c2edd73830c66137780f
/*
 * Copyright 2021 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// A task is an arbitrary function combined with some arbitrary state.

// A task queue holding tasks to be processed by a particular thread. The only

// "public" field is `notification`. All other fields should be considered

// private implementation details.

// Flag encoding the state of postMessage notifications for this task queue.

// Accessed directly from JS, so must be the first member.

// Protects all modifications to mutable `em_task_queue` state.

// The target thread for this em_task_queue. Immutable and accessible without

// acquiring the mutex.

// Recursion guard. Only accessed on the target thread, so there's no need to

// hold the lock when accessing it. TODO: We disallow recursive processing

// because that's what the old proxying API does, so it is safer to start with

// the same behavior. Experiment with relaxing this restriction.

// Ring buffer of tasks of size `capacity`. New tasks are enqueued at

// `tail` and dequeued at `head`.

// Doubly linked list pointers for the zombie list. See em_task_queue.c for

// details.

// Execute tasks until an empty queue is observed. Internally locks the queue.

// Cancel all tasks in the queue. Internally locks the queue.

// Not thread safe.

// Not thread safe.

// Not thread safe. Returns true on success and false on failure.

// Not thread safe. Assumes the queue is not empty.

// Atomically enqueue the task and schedule the queue to be executed next time

// its owning thread returns to its event loop. Returns true on success and

// false otherwise. Internally locks the queue.


=== system/lib/pthread/emscripten_futex_wait.c ===
SHA256: eab2c6d69316987fbdccaf5ffe18023d6fc8b30c2a4012938157a71ac2ae0f7f
/*
 * Copyright 2021 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Atomics.wait is not available in the main browser thread, so simulate it

// via busy spinning. Only the main browser thread is allowed to call into

// this function. It is not thread-safe to be called from any other thread.

// Register globally which address the main thread is simulating to be waiting

// on. When zero, the main thread is not waiting on anything, and on nonzero,

// the contents of the address pointed by _emscripten_main_thread_futex tell

// which address the main thread is simulating its wait on.  We need to be

// careful of recursion here: If we wait on a futex, and then call

// _emscripten_yield() below, that will call code that takes the proxying

// mutex - which can once more reach this code in a nested call. To avoid

// interference between the two (there is just a single

// _emscripten_main_thread_futex at a time), unmark ourselves before calling

// the potentially-recursive call. See below for how we handle the case of our

// futex being notified during the time in between when we are not set as the

// value of _emscripten_main_thread_futex.

// We must not have already been waiting.

// Check for a timeout.

// We timed out, so stop marking ourselves as waiting.

// The current value must have been our address which we set, or

// in a race it was set to 0 which means another thread just allowed

// us to run, but (tragically) that happened just a bit too late.

// We are performing a blocking loop here, so we must handle proxied

// events from pthreads, to avoid deadlocks.

// Note that we have to do so carefully, as we may take a lock while

// doing so, which can recurse into this function; stop marking

// ourselves as waiting while we do so.

// We were told to stop waiting, so stop.

// Check the value, as if we were starting the futex all over again.

// This handles the following case:

//

//  * wait on futex A

//  * recurse into _emscripten_yield(),

//    which waits on futex B. that sets the _emscripten_main_thread_futex

//    address to futex B, and there is no longer any mention of futex A.

//  * a worker is done with futex A. it checks _emscripten_main_thread_futex

//    but does not see A, so it does nothing special for the main thread.

//  * a worker is done with futex B. it flips mainThreadMutex from B

//    to 0, ending the wait on futex B.

//  * we return to the wait on futex A. _emscripten_main_thread_futex is 0,

//    but that is because of futex B being done - we can't tell from

//    _emscripten_main_thread_futex whether A is done or not. therefore,

//    check the memory value of the futex.

//

// That case motivates the design here. Given that, checking the memory

// address is also necessary for other reasons: we unset and re-set our

// address in _emscripten_main_thread_futex around calls to

// _emscripten_yield(), and a worker could

// attempt to wake us up right before/after such times.

//

// Note that checking the memory value of the futex is valid to do: we

// could easily have been delayed (relative to the worker holding on

// to futex A), which means we could be starting all of our work at the

// later time when there is no need to block. The only "odd" thing is

// that we may have caused side effects in that "delay" time. But the

// only side effects we can have are to call

// _emscripten_yield(). That is always ok to

// do on the main thread (it's why it is ok for us to call it in the

// middle of this function, and elsewhere). So if we check the value

// here and return, it's the same is if what happened on the main thread

// was the same as calling _emscripten_yield()

// a few times before calling emscripten_futex_wait().

// Mark us as waiting once more, and continue the loop.

// Pass 0 here, which means we don't have access to the current time in this

// function.  This tells _emscripten_yield to call emscripten_get_now if (and

// only if) it needs to know the time.

// For the main browser thread and audio worklets we can't use

// __builtin_wasm_memory_atomic_wait32 so we have busy wait instead.

// -1 (or any negative number) means wait indefinitely.

// After the main thread queues dlopen events, it checks if the target threads

// are sleeping.

// If `sleeping` is set then the main thread knows that event will be

// processed after the sleep (before any other user code).  In this case the

// main thread does not wait for any kind of response form the thread.

// If `sleeping` is not set then we know we should wait for the thread process

// the queue, either from the call here directly after setting `sleeping` to

// 1, or from another callsite (e.g. the one in `emscripten_yield`).

// memory.atomic.wait32 returns:

//   0 => "ok", woken by another agent.

//   1 => "not-equal", loaded value != expected value

//   2 => "timed-out", the timeout expired


=== system/lib/pthread/emscripten_futex_wake.c ===
SHA256: bdd4a2dfc9e29a8cb2242af031bf5f68ce1bcb77a6111d022fb07b369c9b51ea
/*
 * Copyright 2021 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Stores the memory address that the main thread is waiting on, if any. If

// the main thread is waiting, we wake it up before waking up any workers.

// Returns the number of threads (>= 0) woken up, or the value -EINVAL on error.

// Pass count == INT_MAX to wake up all threads.

// See if main thread is waiting on this address? If so, wake it up by

// resetting its wake location to zero.  Note that this is not a fair

// procedure, since we always wake main thread first before any workers, so

// this scheme does not adhere to real queue-based waiting.

// The main browser thread must never try to wake itself up!

// Wake any workers waiting on this address.


=== system/lib/pthread/emscripten_thread_init.c ===
SHA256: bc22d00df973ea641fe1059337013efffeb0b980c90482c38287b34f3da040d3
/*
 * Copyright 2021 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Set `__default_stacksize` just once when the main runtime thread is

// started.  The value of `DEFAULT_PTHREAD_STACK_SIZE` is passed in here as

// `default_stacksize`.


=== system/lib/pthread/emscripten_thread_primitives.c ===
SHA256: acd30d60cf0bc2dfba21426ad5071280e0c79aae052bb5c8a8a76c87ab7ee1f5
/*
 * Copyright 2026 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 *
 * Low level threading primitives for lock, condvar and mutex, build on the
 * emscripten atomics API.
 */

// TODO: we changed the performance_now calls to get_now, which can be applied

// to the remaining code (since all calls defer to the best internal option).

// TODO: Shave off maxWaitNanoseconds


=== system/lib/pthread/emscripten_thread_state.S ===
SHA256: 9d89e8ca678c4e5e53373aa109f42327070b56bcdc4e50794bfbd5ed98998910
#ifdef __wasm64__
#define PTR i64
#else
#define PTR i32
#endif

.section .globals,"",@

.globaltype thread_ptr, PTR
thread_ptr:

.globaltype is_main_thread, i32
is_main_thread:

.globaltype is_runtime_thread, i32
is_runtime_thread:

.globaltype supports_wait, i32
supports_wait:

#if WASM_WORKERS_ONLY
.globaltype done_init, i32
done_init:
#endif

.section .text,"",@

.globl __set_thread_state
__set_thread_state:
  .functype __set_thread_state (PTR, i32, i32, i32) -> ()
  local.get 0
  global.set thread_ptr
  local.get 1
  global.set is_main_thread
  local.get 2
  global.set is_runtime_thread
  local.get 3
  global.set supports_wait
  end_function

#if WASM_WORKERS_ONLY
// With Wasm Workers we do lazy initializtion of the thread
// state so that only workers that call these APIs actually
// initializes their state.
.functype __do_set_thread_state () -> ()

lazy_init_thread_state:
  .functype lazy_init_thread_state () -> ()
  block
    global.get done_init
    br_if 0
    call __do_set_thread_state
    i32.const 1
    global.set done_init
  end_block
  end_function
#endif

.globl __get_tp
__get_tp:
  .functype __get_tp () -> (PTR)
#if WASM_WORKERS_ONLY
  call lazy_init_thread_state
#endif
  global.get thread_ptr
  end_function

# Semantically the same as testing "!ENVIRONMENT_IS_PTHREAD" in JS
.globl emscripten_is_main_runtime_thread
emscripten_is_main_runtime_thread:
  .functype emscripten_is_main_runtime_thread () -> (i32)
#if WASM_WORKERS_ONLY
  call lazy_init_thread_state
#endif
  global.get is_runtime_thread
  end_function

# Semantically the same as testing "!ENVIRONMENT_IS_WORKER" in JS
.globl emscripten_is_main_browser_thread
emscripten_is_main_browser_thread:
  .functype emscripten_is_main_browser_thread () -> (i32)
#if WASM_WORKERS_ONLY
  call lazy_init_thread_state
#endif
  global.get is_main_thread
  end_function

# Semantically the same as testing "!ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_AUDIO_WORKLET" in JS
.globl _emscripten_thread_supports_atomics_wait
_emscripten_thread_supports_atomics_wait:
  .functype _emscripten_thread_supports_atomics_wait () -> (i32)
#if WASM_WORKERS_ONLY
  call lazy_init_thread_state
#endif
  global.get supports_wait
  end_function



=== system/lib/pthread/emscripten_tls_init.c ===
SHA256: d43f28feec77ac19e11f95c4f2c90c7ea0e22f57532150323b2b7816e7c5301c
/*
 * Copyright 2019 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Uncomment to trace TLS allocations.

// #define DEBUG_TLS

// linker-generated symbol that loads static TLS data at the given location.

// Create a thread-local wasm global which signals that the current thread is not

// to use the primary/static TLS region.  Once this gets set it forces that all

// future calls to emscripten_tls_init to dynamically allocate TLS.

// This is needed because emscripten re-uses module instances owned by the

// worker for new pthreads.  This in turn means that stale values of __tls_base

// from a previous pthreads need to be ignored.

// If this global is true then TLS needs to be dynamically allocated, if it's

// false we are free to use the existing/global __tls_base.

// The TLS block for the main module is allocated alongside the pthread

// itself and its stack.

// For non-main modules we do a dynamic allocation.


=== system/lib/pthread/emscripten_yield.c ===
SHA256: da6616261d4bbdef35c48b06cb02fc54a6af3e7d746dcf22c9134d738c600552
// When a secondary thread crashes, we need to be able to interrupt the main

// thread even if it's in a blocking/looping on a mutex.  We want to avoid

// using the normal proxying mechanism to send this message since it can

// allocate (or otherwise itself crash) so use a low level atomic primitive

// for this signal.

// Mark the crashed thread as strongly referenced so that Node.js doesn't

// exit while the pthread is propagating the uncaught exception back to

// the main thread.

// Return the event loop so we can handle the message from the crashed

// thread.

// This is no-op in programs that don't include use of itimer/alarm.

// Assist other threads by executing proxied operations that are effectively

// singlethreaded.


=== system/lib/pthread/library_pthread.c ===
SHA256: f78515d20c9f23b51ae80f163a2ce258136d9e7b9595c8464c50fab2c17b3f55
/*
 * Copyright 2015 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Web workers do not actually support prioritizing threads,

// but mimic values that Linux apparently reports, see

// http://man7.org/linux/man-pages/man2/sched_get_priority_min.2.html

// Web workers do not actually support prioritizing threads,

// but mimic values that Linux apparently reports, see

// http://man7.org/linux/man-pages/man2/sched_get_priority_min.2.html

// Not supported either in Emscripten or musl, return a faked value.

// Not supported either in Emscripten or musl, return an error.

// If we have less than this many msecs left to wait, busy spin that instead.

// runtime thread may need to run proxied calls, so sleep in very small slices to be responsive.

// Keep processing the main loop of the calling thread.

// pthreads spec: sleep is a cancellation point, so must test if this

// thread is cancelled during the sleep.

// See system/lib/README.md for static constructor ordering.

// The pthread struct has a field that points to itself - this is used as

// a magic ID to detect whether the pthread_t structure is 'alive'.

// pthread struct robust_list head should point to itself.

// Main thread ID is always 1.  It can't be 0 because musl assumes

// tid is always non-zero.

// pthread struct prev and next should initially point to itself (see __init_tp),

// this is used by pthread_key_delete for deleting thread-specific data.


=== system/lib/pthread/proxying.c ===
SHA256: 9b404cba2854f13aac9651fd7e5d938953b350b113085369709f09688eb7ffbb
/*
 * Copyright 2021 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Protects all accesses to em_task_queues, size, and capacity.

// `size` task queue pointers stored in an array of size `capacity`.

// The system proxying queue.

// Allocate the new queue.

// Not thread safe. Returns NULL if there are no tasks for the thread.

// Not thread safe.

// There were no tasks for the thread; initialize a new em_task_queue. If

// there are not enough queues, allocate more.

// Initialize the next available task queue.

// Below is a recursion and deadlock guard: The recursion guard is to avoid

// infinite recursion when we arrive here from the pthread_lock call below

// that executes the system queue. The per-task_queue recursion lock can't

// catch these recursions because it can only be checked after the lock has

// been acquired.

//

// This also guards against deadlocks when adding to the system queue. When

// the current thread is adding tasks, it locks the queue, but we can

// potentially try to execute the queue during the add (from emscripten_yield

// when malloc takes a lock). This will deadlock the thread, so only try to

// take the lock if the current thread is not using the queue. We then hope

// the queue is executed later when it is unlocked.

// Found the task queue and it is not already being processed; process it.

// The user-provided function and argument.

// Context for synchronous proxying.

// Update `state` and signal the condition variable once the proxied task

// is done or canceled.

// Context for proxying with callbacks.

// A doubly linked list of contexts associated with active work on a single

// thread. If the thread is canceled, it will traverse this list to find

// contexts that need to be canceled.

// The key that `cancel_active_ctxs` is bound to so that it runs when a thread

// is canceled or exits.

// This is the only active context; initialize the active contexts list.

// Insert this context at the tail of the list just before `head`.

// This is the only active context; clear the active contexts list.

// Update the list head if we are removing the current head.

// Remove the context from the list.

// TODO: We should probably have some kind of refcounting scheme to keep

// `queue` alive for callback ctxs.

// Free the callback info on the same thread it was originally allocated on.

// This may be more efficient.

// Schedule the callback on the caller thread. If the caller thread has

// already died or dies before the callback is executed, then at least make

// sure the context is freed.

// Helper for wrapping the call with ctx as a `void (*)(void*)`.

// Helper for signaling the end of the task after the user function returns.

// Allocate the em_proxying_ctx and the user ctx as a single block that will

// be freed when the `em_proxying_ctx` is freed.

// Return a separate promise to ensure that the internal promise will stay

// alive until the callbacks are called.

// Allocate the em_proxying_ctx and promise ctx as a single block that will be

// freed when the `em_proxying_ctx` is freed.

// Allocate the em_proxying_ctx, promise ctx, and user task as a single block

// that will be freed when the `em_proxying_ctx` is freed.

// run_js_func_with_ctx is always synchronously proxied and therefore arg

// should never be owned on the main thread (i.e. the argument here always

// exists on the stack of the calling thread, it's never copied/malloced).

/*
 * The 'proxy_mode' argument to _emscripten_run_js_on_main_thread has 3 possible
 * values:
 *
 * - PROXY_ASYNC: Returns immediately on the calling thread, does not signal
 * - PROXY_SYNC: Synchronous on the calling thread, and also on the main thread
 * - PROXY_SYNC_ASYNC: Synchronous on the calling thread, but async on the main
 *   thread.
 *
 * Note: 'PROXY_SYNC_ASYNC' is only passed when a function is marked as
 * both "__async" and "__proxy: 'sync'"
 */

// Make a heap allocated copy of the proxied_js_func_t

// Also make a copy of the argBuffer.


=== system/lib/pthread/proxying_legacy.c ===
SHA256: b02696f679062b05dc14029b5bdaea3683830500412c5cbfd6e9799d834687aa
/*
 * Copyright 2023 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Sets the PThread.currentProxiedOperationCallerThread global for the

// duration of the proxied call.

// An optional pointer to a secondary data block that should be free()d when

// this queued call is freed.

// If true, the caller has "detached" itself from this call object and the

// Emscripten main runtime thread should free up this em_queued_call object

// after it has been executed. If false, the caller is in control of the

// memory.

// Proxied C/C++ functions support at most this many arguments. Dispatch is

// static/strongly typed by signature.

// Allocator and deallocator for em_queued_call objects.

// Not a programming error, but use assert() in debug builds to catch OOM scenarios.

// C function pointer

// If the caller is detached from this operation, it is the main thread's responsibility to free

// up the call object.

// No need to wake a listener, nothing is listening to this since the call object is detached.

// The caller owns this call object, it is listening to it and will free it up.

// Execute `call` and return 1 only if already on the `target_thread`. Otherwise

// return 0.

// Execute or proxy `call`. Return 1 if the work was executed or otherwise

// return 0.

// TODO: handle errors in a better way, this pattern appears in several places

//       in this file. The current behavior makes the calling thread hang as

//       it waits (for synchronous calls).

// If we failed to allocate, return 0 which means we did not execute anything

// (we also never will in that case).

// `q` will not be used after it is called, so let the call clean it up.

// Check if we are already on the target thread.

// Setup is the same as in emscripten_dispatch_to_thread_args.

// Schedule the call to run later on this thread.

// Otherwise, dispatch as usual.

// Enter to wait for the operation to complete.

// 'async' runs are fire and forget, where the caller detaches itself from the call object after

// returning here, and it is the callee's responsibility to free up the memory after the call has

// been performed.

// 'async waitable' runs are waited on by the caller, so the call object needs to remain alive for

// the caller to access it after the operation is done. The caller is responsible in cleaning up

// the object after done.


=== system/lib/pthread/pthread_create.c ===
SHA256: 12897ef4213686d8e8f00690e3df04d9f843b6344be1d69f9ff0995ee54c8c38
/*
 * Copyright 2021 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Comment this line to enable tracing of thread creation and destruction:

// #define PTHREAD_DEBUG

// See musl's pthread_create.c

// In case the stub syscall is not linked it

/* pthread_key_create.c overrides this */

// Note on LSAN: lsan intercepts/wraps calls to pthread_create so any

// allocation we do here should be considered leaks.

// See: lsan_interceptors.cpp.

// Create threads with monotonically increasing TID starting with the main

// thread which has TID == PID.

// Allocate memory for new thread.  The layout of the thread block is

// as follows.  From low to high address:

//

// 1. pthread struct (sizeof struct pthread)

// 2. tls data       (__builtin_wasm_tls_size())

// 3. tsd pointers   (__pthread_tsd_size)

// 4. stack          (__default_stacksize AKA -sDEFAULT_PTHREAD_STACK_SIZE)

// Allocate all the data for the new thread and zero-initialize all parts

// except for the stack.

// 1. pthread struct

// The pthread struct has a field that points to itself - this is used as a

// magic ID to detect whether the pthread_t structure is 'alive'.

// pthread struct robust_list head should point to itself.

// 2. tls data

// 3. tsd slots

// 4. stack data

// musl stores top of the stack in pthread_t->stack (i.e. the high

// end from which it grows down).

// Check that we didn't use more data than we allocated.

// thread may already be running/exited after the _pthread_create_js call below

// Set libc.need_locks before calling __pthread_create_js since

// by the time it returns the thread could be running and we

// want libc.need_locks to be set from the moment it starts.

// Assign the pthread_t object over immediately, so that by the time pthread_create_js()

// is dispatched to a pthread and the pthread main runs, the value will be visible to

// the thread to examine.

// Use __atomic_store_n() instead of a_store() to avoid splicing the pointer.

// Reset the pthread_t return value to zero (we assigned to it above,

// so by clearing it here we won't litter bits to caller)

// undo previous addition to the thread list

/*
 * Called from JS main thread to free data associated with a thread
 * that is no longer running.
 */

// A thread can never free its own thread data.

// Free all the entire thread block (called map_base because

// musl normally allocates this using mmap).  This region

// includes the pthread structure itself.

// To aid in debugging, set the entire region to zero.

// Run any handlers registered with pthread_cleanup_push

// Call into the musl function that runs destructors of all thread-specific data.

/* Process robust list in userspace to handle non-pshared mutexes
   * and the detached thread case where the robust list head will
   * be invalid when the kernel would process it. */

// Not hosting a pthread anymore in this worker set __pthread_self to NULL

/* This atomic potentially competes with a concurrent pthread_detach
   * call; the loser is responsible for freeing thread resources. */

// Mark the thread as no longer running, so it can be joined.

// Once we publish this, any threads that are waiting to join with us can

// proceed and this worker can be recycled and used on another thread.

// When dynamic linking is enabled we need to keep track of zombie threads

// Wake any joiner.

// Mark as `no_sanitize("address"` since emscripten_pthread_exit destroys

// the current thread and runs its exit handlers.  Without this asan injects

// a call to __asan_handle_no_return before emscripten_unwind_to_js_event_loop

// which seem to cause a crash later down the line.


=== system/lib/pthread/pthread_kill.c ===
SHA256: be63e7106849731a5afab09769b41a395058a6ed7ba42fb05fc6133936d7039b
/*
 * Copyright 2022 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// For `SIGCANCEL` there is no need to actually call raise to run the

// handler function.  The calling thread (the one calling `pthread_cancel`)

// will already have marked us as being cancelled.  All we need to do is

// ensure that `pthread_testcancel` is eventually called and that will cause

// this thread to exit.  We can't call `pthread_testcancel` here (since we

// are being called from the proxy queue process and we don't want to leave

// that in a bad state by unwinding).  Instead, we rely on

// `pthread_testcancel` at the end of `_emscripten_check_mailbox`.  Before

// we return, we do want to make sure we clear the keepalive state so that

// the thread will exit even if it has a reason to stay alive.  TODO(sbc):

// Is this the correct behaviour, should `pthread_cancel` instead wait for

// threads to be done with outstanding work/event loops?

// signal == 0 is a no-op.

// signal == 0 is a no-op.

// The job of pthread_kill is basically to run the (process-wide) signal

// handler on the target thread.


=== system/lib/pthread/thread_mailbox.c ===
SHA256: f9914ec9049995b54e43e5acff02a42553544b86f6a14be47a1682fe459c838c
/*
 * Copyright 2023 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Attempt to increment the refcount, being careful not to increment it if we

// ever observe a 0.

// The mailbox is already closed!

// Decrement and return the refcount.

// The count is now zero. The thread that owns this queue may be waiting to

// shut down. Notify the thread that it is safe to proceed now that the

// mailbox is closed.

// Decrement the refcount and wait for it to reach zero.

// The mailbox is now closed. No more messages will be enqueued. Run the

// shutdown handler for any message already in the queue.

// The mailbox is now empty and will not be accessed again after this point.

// Internal function, called from runtime_pthread.js

// Before we attempt to execute a request from another thread make sure we

// are in sync with all the loaded code.

// For example, in PROXY_TO_PTHREAD the atexit functions are called via

// a proxied call, and without this call to synchronize we would crash if

// any atexit functions were registered from a side module.

// After every mailbox check we call `__pthread_testcancel` in case

// one of the proxied functions was from pthread_kill(SIGCANCEL).

// If there is no pending notification for this mailbox, create one. If an old

// notification is currently being processed, it may or may not execute the

// new work. In case it does not, the new notification will ensure the work is

// still executed.


=== system/lib/pthread/thread_mailbox.h ===
SHA256: 58c8b7dd944366fa57537e86b89e2d5fe2e240cce1c513bfe2e74bb55edc5843
/*
 * Copyright 2023 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Try to increment the refcount of the mailbox, ensuring it will stay open

// until the refcount is decremented again. Returns 1 on success or 0 if the

// mailbox is already closed.

// Decrement the mailbox's refcount.

// Send a message to the given `thread`. This should only be called after

// incrementing the mailbox refcount to ensure it stays open. The receiving

// thread will receive the message the next time it returns to its event loop,

// or if the target thread shuts down before then, the message's shutdown

// handler will be called instead.

// Initialize the mailbox on a pthread struct. Called during `pthread_create`.

// Close the mailbox and cancel any pending messages.

// Send a postMessage notification telling the target thread to check its

// mailbox when it returns to its event loop. Pass in the current thread id

// minimize calls back into Wasm.


=== system/lib/pthread/threading_internal.h ===
SHA256: 1e654d37ab83bdcd6c7eadfd04045ec70e85b2c6e268578b54d598792ff6ad0f
/*
 * Copyright 2021 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Performing an unconditional sleep (usleep, etc.)

// Waiting for an explicit low-level futex (emscripten_futex_wait)

// Waiting for a pthread_mutex_t

// Waiting for a proxied operation to finish.

// One of THREAD_STATUS_*

// Wallclock time denoting when the current thread state was entered in.

// Accumulated duration times denoting how much time has been spent in each

// state, in msecs.

// A human-readable name for this thread.

// Called whenever a thread performs a blocking action (or calls sched_yield).

// This function takes care of running the event queue and other housekeeping

// tasks.

//

// If the caller already knows the current time it can pass it via the now

// argument.  This can save _emscripten_check_timers from needing to call out to

// JS to get the current time.  Passing 0 means that caller doesn't know the

// current time.

// Marks the given thread as strongly referenced. This is used to prevent the

// Node.js application from exiting as long as there are strongly referenced

// threads still running. Normally you don't need to call this function, and

// the pthread behaviour will match native in that background threads won't

// keep runtime alive, but waiting for them via e.g. pthread_join will. 

// However, this is useful for features like PROXY_TO_PTHREAD where we want to

// keep running as long as the detached pthread is.

// Checks certain structural invariants.  This allows us to detect when

// already-freed threads are used in some APIs.  Technically this is undefined

// behaviour, but we have a couple of places where we add these checks so that

// we can pass more of the posixtest suite than vanilla musl.

// Allocate the thread profile block for the given thread.

// Sets the profiler status of the calling thread. This is a no-op if thread

// profiling is not active.

// This is an internal function and generally not intended for user code.

// When thread profiler is not enabled (not building with --threadprofiler),

// this is a no-op.

// Sets the profiler status of the calling thread, but only if it was in the

// expected status beforehand.

// This is an internal function and generally not intended for user code.

// When thread profiler is not enabled (not building with --threadprofiler),

// this is a no-op.

// Return non-zero if the calling thread supports Atomic.wait (For example

// if called from the main browser thread, this function will return zero

// since blocking is not allowed there).


=== system/lib/standalone/__main_void.c ===
SHA256: 6da9cec9fdd7aa7908b13e6a96f4a9f325e03012c28d351a0348b49b68ec76ca
/*
 * Copyright 2019 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Much of this code comes from:

// https://github.com/CraneStation/wasi-libc/blob/master/libc-bottom-half/crt/crt1.c

// Converted malloc() calls to alloca() to avoid including malloc in all programs.

// If the application's `main` does not uses argc/argv, then it will be defined

// (by llvm) with an __main_void alias, and therefore this function will not

// be included, and `_start` will call the application's `__main_void` directly.

//

// If the application's `main` does use argc/argv, then _start will call this

// function which loads argv values and sends them to the

// application's `main` which gets mangled to `__main_argc_argv` by llvm.

/* Fill in the arguments from WASI syscalls. */

/* Get the sizes of the arrays we'll have to create to copy in the args. */

/* Allocate memory for the array of pointers, adding null terminator. */

/* Allocate memory for storing the argument chars. */

/* Make sure the last pointer in the array is NULL. */

/* Fill the argument chars, and the argv array with pointers into those chars. */


=== system/lib/standalone/standalone.c ===
SHA256: abe4a969fb926852fa693d60d21a6e9a568da12aca37a904d3487a234d06af57
/*
 * Copyright 2019 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

/*
 * WASI support code. These are compiled with the program, and call out
 * using wasi APIs, which can be provided either by a wasi VM or by our
 * emitted JS.
 */

// libc

/* Beyond this point should be unreachable. */

// mmap support is nonexistent. TODO: emulate simple mmaps using

// stdio + malloc, which is slow but may help some things?

// Mark these as weak so that wasmfs does not collide with it. That is, if

// wasmfs is in use, we want to use that and not this.

// open(), etc. - we just support the standard streams, with no

// corner case error checking; everything else is not permitted.

// TODO: full file support for WASI, or an option for it

// open()

// Emscripten additions

// In standalone mode we don't have any wasm instructions to access the max

// memory size so the best we can do (without calling an import) is return

// the current heap size.

// Success, update JS (see https://github.com/WebAssembly/WASI/issues/82)

// Call clock_gettime with a particular clock and return the result in ms.

// C++ ABI

// When exception catching is disabled, we stub out calls to `__cxa_throw`.

// Otherwise, `__cxa_throw` will be imported from the host.

// WasmFS integration. We stub out file preloading and such, that are not

// expected to work anyhow.

// Import the VM's fd_write under a different name. Then we can interpose in

// between it and WasmFS's fd_write. That is, libc calls fd_write, which WasmFS

// implements. And WasmFS will forward actual writing to stdout/stderr to the

// VM's fd_write. (This allows WasmFS to do work in the middle, for example, it

// could support embedded files and other functionality.)

// Write a buffer + a newline.

// In the non-standalone build we define this helper function in JS to avoid

// signature mismatch issues.

// See: https://github.com/emscripten-core/posixtestsuite/issues/6

// There is no API to let us set timers in standalone mode atm. Return an

// error.


=== system/lib/standalone/standalone_wasm_stdio.c ===
SHA256: 630ec7980a81c1ab9d519474f6fc2ab1c8db69ba6b61ce19db83303c7175c468
/*
 * Copyright 2019 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */


=== system/lib/stb_image.c ===
SHA256: 0e60ce25d61dfae523c88a50e21918318b413f8c2cc81e045d5e874a105fe0e5
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// stb_image 2.x need to have STB_IMAGE_IMPLEMENTATION defined to include

// the implementation when compiling


=== system/lib/wasm_worker/library_wasm_worker.c ===
SHA256: 61603f3a319d5f2448124d5e670aa78f5a591ef275b6155e7b171cb478c943ab
// For MAX()

// Options:

// #define STACK_OVERFLOW_CHECK 0/1/2 : set to the current stack overflow check mode

// Guard against a programming oopsie: The target Worker's stack cannot be part of the calling

// thread's stack.

// The Worker's TLS area will be spliced off from the stack region, so the

// stack needs to be at least as large as the TLS region.

// The TLS region lives at the start of the stack region (the lowest address

// of the stack).  Since the TLS data alignment may be larger than stack

// alignment, we may need to round up the lowest stack address to meet this

// requirement.

// Add the TLS size to the provided stackSize so that the allocation

// will always be large enough to hold the worker TLS data.


=== system/lib/wasm_worker/wasm_worker_initialize.S ===
SHA256: 9cf17b589545026d9145b768012c0468c107191b996a924dfe16b923550d5dea
.extern __stack_pointer

#ifdef __wasm64__
#define PTR i64
#define ALIGN 3
#define PTRSTORE .int64
#else
#define PTR i32
#define ALIGN 2
#define PTRSTORE .int32
#endif

.globaltype __stack_pointer, PTR
.globaltype __tls_size, PTR, immutable
.functype emscripten_stack_set_limits (PTR /*base*/, PTR /*end*/) -> ()

.globl _emscripten_wasm_worker_initialize
_emscripten_wasm_worker_initialize:
  .functype _emscripten_wasm_worker_initialize (PTR /*stackLowestAddress*/, i32 /*stackSize*/) -> ()
  .local PTR, PTR

  // stack_end = stackLowestAddress + (__builtin_wasm_tls_size() + 15) & -16;
  local.get 0
  global.get __tls_size
  PTR.add
  PTR.const 0xf
  PTR.add
  PTR.const -0x10
  PTR.and
  local.set 2

  // stack_base = stackLowestAddress + stackSize;
  local.get 0
  local.get 1
#ifdef __wasm64__
  i64.extend_i32_u
#endif
  PTR.add
  local.set 3

  local.get 3
  local.get 2
  // emscripten_stack_set_limits(stack_base, stack_end);
  call emscripten_stack_set_limits

// TODO: We'd like to do this here to avoid JS side calls to __set_stack_limits.
//       (or even better, we'd like to avoid duplicate versions of the stack variables)
// See https://github.com/emscripten-core/emscripten/issues/16496
//  global.get __stack_base
//  global.get __stack_end
//  .functype __set_stack_limits (PTR, PTR) -> ()
//  call __set_stack_limits


  // __wasm_init_tls(stackLowestAddress);
  local.get 0
  .functype __wasm_init_tls (PTR) -> ()
  call __wasm_init_tls

  // N.b. The function __wasm_init_tls above does not need
  // __stack_pointer initialized, and it destroys the value it was set to.
  // So we must initialize __stack_pointer only *after* completing __wasm_init_tls:

  // __stack_pointer = stack_base;
  local.get 3
  global.set __stack_pointer

  end_function



=== system/lib/wasmfs/backend.h ===
SHA256: 51c634e5e6a1984acfdadb8cca9e3012348703cf7d56bc1fb61993c7343e1009
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// This file defines the modular backend abstract class.

// A backend (or modular backend) provides a base to extend WasmFS with new

// storage capabilities. Files and directories will be represented in the file

// system structure, but their underlying backing could exist in persistent

// storage, another thread, etc.

// namespace wasmfs


=== system/lib/wasmfs/backends/fetch_backend.cpp ===
SHA256: 1ff8036c23e9defca0b4987262fcacf6c388c7405d63e3946858eb56c8fe1f33
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// This file defines the fetch backend.

// ProxyWorker cannot safely be synchronously spawned from the main browser

// thread. See comment in thread_utils.h for more details.

// namespace wasmfs


=== system/lib/wasmfs/backends/fetch_backend.h ===
SHA256: 73b0e31908d6f655130c8447a3d0af088ecaef51c8c6a6f130bb4d8b3da9c11c
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// See library_wasmfs_fetch.js


=== system/lib/wasmfs/backends/ignore_case_backend.cpp ===
SHA256: 5818dd21cc7c2c98fd92b87c54f9ab31e9b91cfdf7fdc1ea80b2a68bd59c31da
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// A virtual backend that adapts any underlying backend to be

// case-insensitive. IgnoreCaseDirectory intercepts all directory operations,

// normalizes paths to be lower case, then forwards the operations with the new

// paths to the underlying backend. It stores the original, non-normalized names

// internally so they can be returned later, giving the appearance of a

// case-insensitive but case-preserving file system.

//

// See the comment in virtual.h for an explanation of why DataFiles and Symlinks

// must have no-op wrappers.

// anonymous namespace

// Map normalized names to virtual files and their non-normalized names.

// Wrap a real file in an IgnoreCase virtual file of the same kind.

// Delete the entry in the old parent.

// Unlink the overwritten entry if it exists.

// Inserts into the real backing directory won't work if it doesn't appear

// to be linked, so give it a parent.

// TODO: Break this reference cycle in a destructor somewhere.

// Create an ignore case backend by supplying another backend.

// C API FOR creating an ignore case backend by supplying a pointer to another

// backend.

// extern "C"

// namespace wasmfs


=== system/lib/wasmfs/backends/js_file_backend.cpp ===
SHA256: 1d9516af0b84bfe2ca96a6d20f8eed2c2f3893ca1f9743fe52ac5ccb41d1ed74
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// This file defines the JS file backend.

// namespace wasmfs


=== system/lib/wasmfs/backends/js_file_backend.h ===
SHA256: 43b248e28991944a4f93ed0d784ab56ce375fb8edc723df478def8227b20c561
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// These helper functions are defined in library_wasmfs_js_file.js


=== system/lib/wasmfs/backends/memory_backend.cpp ===
SHA256: 92ddc592f70e39ac3317d0ba12acc93cfd35554807ed576ca0ef2e2c9758a374
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// This file defines the memory file backend.

// Overflow: the necessary size fits in an off_t, but cannot fit in the

// container.

// extern "C"

// namespace wasmfs


=== system/lib/wasmfs/backends/node_backend.cpp ===
SHA256: 0244135107920ef1f744e22451e838630f59b3f8c0707315d318e097377ced47
// Copyright 2022 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// The state of a file on the underlying Node file system.

// Map all separate WasmFS opens of a file to a single underlying fd.

// Attempt to open the file with the given flags, returning 0 on success or an

// error code.

// No existing fd, so open a fresh one.

// TODO(sbc): Specific handling of O_WRONLY.

// There is no simple way to map O_WRONLY to an fopen-style

// mode string since the only two modes that are write only

// are `w` and `a`.  The problem with the former is that it

// truncates to file.  The problem with the latter is that it

// opens for appending.  For now simply opening in O_RDWR

// mode is enough to pass all our tests.

// Fall through to update our state with the new result.

// We already have a file descriptor, but we need to replace it with a new

// fd with more access.

// Success! Close the old fd before updating it.

// Fall through to update our state with the new result.

// Reuse the existing file descriptor.

// Update our state for the new fd.

// TODO: This should really be using a 64-bit file size type.

// TODO: Make this fallible.

// TODO: Make this fallible.

// TODO: also retrieve and set ctime, atime, ino, etc.

// Unrecognized file kind not made visible to WasmFS.

// Try both `unlink` and `rmdir`.

// TODO: optimize this?

// The underlying Node FS path of this backend's mount points.

// TODO: symlink

// extern "C"

// namespace wasmfs


=== system/lib/wasmfs/backends/node_backend.h ===
SHA256: 1ec334ab9c4e1b7c4a260cfaf49d6d7ef3490e9bc220b81dd1c6f9ff0b5efdd7
// Copyright 2022 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// for mode_t

// These helper functions are defined in library_wasmfs_node.js.

// Fill `entries` and return 0 or an error code.

/* std::vector<Directory::Entry>*/

// Write `mode` and return 0 or an error code.

// Write `size` and return 0 or an error code.

// Create a new file system entry and return 0 or an error code.

// Unlink the given file and return 0 or an error code.

// Open the file and return the underlying file descriptor.

// Close the underlying file descriptor.

// Read up to `size` bytes into `buf` from position `pos` in the file, writing

// the number of bytes read to `nread`. Return 0 on success or an error code.

// Write up to `size` bytes from `buf` at position `pos` in the file, writing

// the number of bytes written to `nread`. Return 0 on success or an error code.

// extern "C"


=== system/lib/wasmfs/backends/noderawfs_root.cpp ===
SHA256: 9f18e7e729268b7090757a57c405ab26adb7b408a484961e0eb481450ac5aad5
// Copyright 2023 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.


=== system/lib/wasmfs/backends/opfs_backend.cpp ===
SHA256: cdb5a22f6f9cc6807042808e323f50772b3310a41fe27c2c9b56bab8b250ccc3
// Copyright 2022 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// When used with JSPI on the main thread the various wasmfs_opfs_* functions

// can be directly executed since they are all async.

// TODO: Find a way to remove this, since it's unused.

// If we need write access, try to open an AccessHandle.

// TODO: Fall back to open as a blob instead.

// We only need read access, so open as a Blob

// Try to upgrade to an AccessHandle.

// We have an AccessHandle, so close the blob.

// TODO: Downgrade to Blob access once the last writable file descriptor has

// been closed.

// We don't support `truncate` in blob mode because the blob would

// become invalidated and refreshing it while ensuring other in-flight

// operations on the same file do not observe the invalidated blob would

// be extremely complicated.

// TODO: Can we assume there are no other in-flight operations on this

// file and do something better here?

// TODO: use an i64 here.

// TODO: use an i64 here.

// The ID of this directory in the JS library.

// Never free the root directory ID.

// TODO: More fine-grained error reporting.

// TODO: Propagate specific errors.

// TODO: Propagate specific errors.

// Symlinks not supported.

// TODO: Propagate EPERM specifically.

// TODO: Support moving directories once OPFS supports that.

// EBUSY can be returned when the directory is "in use by the system,"

// which can mean whatever we want.

// No way to support a raw file without a parent directory.

// TODO: update the core system to document this as a possible result of

// `createFile` and to handle it gracefully.

// Symlinks not supported.

// anonymous namespace

// ProxyWorker cannot safely be synchronously spawned from the main browser

// thread. See comment in thread_utils.h for more details.

// extern "C"


=== system/lib/wasmfs/backends/opfs_backend.h ===
SHA256: afc016e564247119a2fb41225df5869071714f897dd187b68586ac931c7e9e55
// Ensure that the root OPFS directory is initialized with ID 0.

// Look up the child under `parent` with `name`. Write 1 to `child_type` if it's

// a regular file or 2 if it's a directory. Write the child's file or directory

// ID to `child_id`, or -1 if the child does not exist, or -2 if the child

// exists but cannot be opened.

// Create a file under `parent` with `name` and store its ID in `child_id`.

// Create a directory under `parent` with `name` and store its ID in `child_id`.

// Synchronous read. Return the number of bytes read.

// Synchronous write. Return the number of bytes written.

// Get the size via an AccessHandle.

// Get the size of a file handle via a File Blob.

// extern "C"


=== system/lib/wasmfs/emscripten.cpp ===
SHA256: 73d82fd31a62f26ff7a486153edf943aba2d2c0046291b81e239a49498d30738
// Copyright 2023 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

//

// This file contains implementations of emscripten APIs that are compatible

// with WasmFS. These replace APIs in src/library*js, and basically do things

// in a simpler manner for the situation where the FS is in wasm and not JS

// (in particular, these implementations avoid calling from JS to wasm, and

// dependency issues that arise from that).

//

// Given an fd, returns the string path that the fd refers to.

// TODO: full error handling

// TODO: maybe make this a public API, as it is useful for debugging

// Check if the parent exists. The parent may not exist if curr was

// unlinked.

// namespace wasmfs

// extern "C"


=== system/lib/wasmfs/file.cpp ===
SHA256: 1e3fe3a5f00e39d63780b93d19d9ff23a542d465fb2ba0e9ddcd6e134164495f
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// This file defines the file object.

//

// DataFile

//

// TODO: Each Datafile type could have its own impl of file preloading.

// Create a buffer with the required file size.

// Ensure that files are preloaded from the main thread.

// Load data into the in-memory buffer.

//

// Directory

//

// Update the dcache if the backend hasn't opted out of using the dcache or if

// this is a mount point, in which case it is not under the control of the

// backend.

// Set the child's parent.

// Unlinked directories must be empty, without even "." or ".."

// Check whether the cache already contains this child.

// Otherwise check whether the backend contains an underlying file we don't

// know about.

// Cannot insert into an unlinked directory.

// Cannot insert into an unlinked directory.

// Cannot insert into an unlinked directory.

// Cannot insert into an unlinked directory.

// TODO: consider moving this to be `Backend::move` to avoid asymmetry between

// the source and destination directories and/or taking `Directory::Handle`

// arguments to prove that the directories have already been locked.

// Cannot insert into an unlinked directory.

// Look up the file in its old parent's cache.

// TODO: Handle moving mount points correctly by only updating caches without

// involving the backend.

// Attempt the move.

// Do the move and update the caches.

// Update parent pointers and caches to reflect the successful move.

// Update and overwrite the overwritten file.

// This backend doesn't use the dcache.

// TODO: Moving mount points probably shouldn't update the mtime.

// If this is a mount, we don't need to call into the backend.

// namespace wasmfs


=== system/lib/wasmfs/file.h ===
SHA256: 4a64829af28afda2b60a0d6fdabf86ec45e135240cc7bc6842df6d43c8ea22b7
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// This file defines the file object.

// Note: The general locking strategy for all Files is to only hold 1 lock at a

// time to prevent deadlock. This methodology can be seen in getDirs().

// This represents an opaque pointer to a Backend. A user may use this to

// specify a backend in file operations.

// Access mode, file creation and file status flags for open.

// An abstract representation of an underlying file. All `File` objects

// correspond to underlying (real or conceptual) files in a file system managed

// by some backend, but not all underlying files have a corresponding `File`

// object. For example, a persistent backend may contain some files that have

// not yet been discovered by WasmFS and that therefore do not yet have

// corresponding `File` objects. Backends override the `File` family of classes

// to implement the mapping from `File` objects to their underlying files.

// Set inode number to the file pointer. This gives a unique inode number.

// TODO: For security it would be better to use an indirect mapping.

// Ensure that the pointer will not overflow an ino_t.

// A mutex is needed for multiple accesses to the same file.

// The size in bytes of a file or return a negative error code. May be

// called on files that have not been opened.

// User and group mode bits for access permission.

// Time when the content was last accessed, in ms.

// Time when the file content was last modified, in ms.

// Time when the file node was last modified, in ms.

// Reference to parent of current file node. This can be used to

// traverse up the directory tree. A weak_ptr ensures that the ref

// count is not incremented. This also ensures that there are no cyclic

// dependencies where the parent and child have shared_ptrs that reference

// each other. This prevents the case in which an uncollectable cycle occurs.

// This specifies which backend a file is associated with. It may be null

// (NullBackend) if there is no particular backend associated with the file.

// By default files are seekable. The rare exceptions are things like pipes

// and sockets.

// Notify the backend when this file is opened or closed. The backend is

// responsible for keeping files accessible as long as they are open, even if

// they are unlinked. Returns 0 on success or a negative error code.

// Return the accessed length or a negative error code. It is not an error to

// access fewer bytes than requested. Will only be called on opened files.

// TODO: Allow backends to override the version of read with

// multiple iovecs to make it possible to implement pipes. See #16269.

// Sets the size of the file to a specific size. If new space is allocated, it

// should be zero-initialized. May be called on files that have not been

// opened. Returns 0 on success or a negative error code.

// Sync the file data to the underlying persistent storage, if any. Returns 0

// on success or a negative error code.

// The directory cache, or `dcache`, stores `File` objects for the children of

// each directory so that subsequent lookups do not need to query the backend.

// It also supports cross-backend mount point children that are stored

// exclusively in the cache and not reflected in any backend.

// TODO: Use a cache data structure with smaller code size.

// Return the `File` object corresponding to the file with the given name or

// null if there is none.

// Inserts a file with the given name, kind, and mode. Returns a `File` object

// corresponding to the newly created file or nullptr if the new file could

// not be created. Assumes a child with this name does not already exist.

// If the operation failed, returns nullptr.

// Move the file represented by `file` from its current directory to this

// directory with the new `name`, possibly overwriting another file that

// already exists with that name. The old directory may be the same as this

// directory. On success return 0 and otherwise return a negative error code

// without changing any underlying state.

// Remove the file with the given name. Returns zero on success or if the

// child has already been removed and otherwise returns a negative error code

// if the child cannot be removed.

// The number of entries in this directory. Returns the number of entries or a

// negative error code.

// The list of entries in this directory or a negative error code.

// Only backends that maintain file identity themselves (see below) need to

// implement this.

// Whether this directory implementation always returns the same `File` object

// for a given file. Most backends can be much simpler if they don't handle

// this themselves. Instead, they rely on the directory cache (dcache) to

// maintain file identity for them by ensuring each file is looked up in the

// backend only once. Some backends, however, already track file identity, so

// the dcache is not necessary (or would even introduce problems).

//

// When this is `true`, backends are responsible for:

//

//  1. Ensuring that all insert* and getChild calls returning a particular

//     file return the same File object.

//

//  2. Clearing unlinked Files' parents in `removeChild` and `insertMove`.

//

//  3. Implementing `getName`, since it cannot be implemented in terms of the

//     dcache.

// 4096 bytes is the size of a block in ext4.

// This value was also copied from the JS file system.

// Note that symlinks provide a mode of 0 to File. The mode of a symlink does

// not matter, so that value will never be read (what matters is the mode of

// the target).

// Constant, and therefore thread-safe, and can be done without locking.

// This mutex is needed when one needs to access access a previously locked

// file in the same thread. For example, rename will need to traverse

// 2 paths and access the same locked directory twice.

// TODO: During benchmarking, test recursive vs normal mutex performance.

// The type bits can never be changed (whether something is a file or a

// directory, for example).

// updateCTime() updates the ctime to the current time.

// updateMTime() updates the mtime to the current time.

// updateATime() updates the atime to the current time.

// Note: parent.lock() creates a new shared_ptr to the same Directory

// specified by the parent weak_ptr.

// TODO: Design a proper API for flushing files.

// This function loads preloaded files from JS Memory into this DataFile.

// TODO: Make this virtual so specific backends can specialize it for better

// performance.

// Retrieve the child if it is in the dcache and otherwise forward the request

// to the backend, caching any `File` object it returns.

// Add a child to this directory's entry cache without actually inserting it

// in the underlying backend. Assumes a child with this name does not already

// exist. Return `true` on success and `false` otherwise.

// Insert a child of the given name, kind, and mode in the underlying backend,

// which will allocate and return a corresponding `File` on success or return

// nullptr otherwise. Assumes a child with this name does not already exist.

// If the operation failed, returns nullptr.

// Move the file represented by `file` from its current directory to this

// directory with the new `name`, possibly overwriting another file that

// already exists with that name. The old directory may be the same as this

// directory. On success return 0 and otherwise return a negative error code

// without changing any underlying state. This should only be called from

// renameat with the locks on the old and new parents already held.

// Remove the file with the given name. Returns zero on success or if the

// child has already been removed and otherwise returns a negative error code

// if the child cannot be removed.

// namespace wasmfs


=== system/lib/wasmfs/file_table.cpp ===
SHA256: b6e60f63c15a8c64e966e5d1eda0b6fb0fb2dd69bdb39e9329322842a029b215
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// This file defines the open file table.

// TODO: add freelist to avoid linear lookup time.

// We are opening a directory; cache its contents for subsequent reads.

// namespace wasmfs


=== system/lib/wasmfs/file_table.h ===
SHA256: b1507da8c0fddc7e01e3c9c80136f19a22043662c3ca80e4c4da240ccff04271
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// This file defines the open file table.

// Copied from legacy FS (FS.MAX_OPEN_FDS)

// Overflow and underflow behaviour are only defined for unsigned types.

// RD_ONLY, WR_ONLY, RDWR

// An OpenFileState needs a mutex if there are concurrent accesses on one open

// file descriptor. This could occur if there are multiple seeks on the same

// open file descriptor.

// The number of times this OpenFileState appears in the table. Use this

// instead of shared_ptr::use_count to avoid accidentally counting temporary

// objects.

// We can't make the constructor private because std::make_shared needs to be

// able to call it, but we can make it unusable publicly.

// `uses` is protected by the FileTable lock and can be accessed directly by

// `FileTable::Handle.

// Cache directory entries at the moment the directory is opened so that

// subsequent getdents calls have a stable view of the contents. Including

// files removed after the open and excluding files added after the open is

// allowed, and trying to recalculate the directory contents on each getdents

// call could lead to missed directory entries if there are concurrent

// deletions that effectively move entries back past the current read position

// in the open directory.

// Allow WasmFS to construct the FileTable singleton.

// Access to the FileTable must go through a Handle, which holds its lock.

// Set the table slot at `fd` to the given file. If this overwrites the last

// reference to an OpenFileState for a data file in the table, return the

// file so it can be closed by the caller. Do not close the file directly in

// this method so it can be closed later while the FileTable lock is not

// held.

// namespace wasmfs


=== system/lib/wasmfs/fuzzer/fuzzer.cpp ===
SHA256: 6be90f449b6536b6044c7b27e77b485026285fd2169ee6bfec7f24e3488a7842
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// This file defines a fuzzer that validates operations in a multi-threaded

// setting.

// Used to define the size of the bytes to seed the Random object.

// Return a (truly) random 64-bit value.

// Create a workload with the Random seed.

// namespace wasmfs


=== system/lib/wasmfs/fuzzer/parameters.h ===
SHA256: 4897dde33f92454e8727ba5e70ac4f90e103439e70aa42e4743a6a7ec22648be
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// This file defines global parameters used in the fuzzer.

//

// Global var for verbose printing.

//

//

// ReadWrite Parameters

//

// The number of writer threads.

// The number of reader threads.

// The size of the character strings written to a file.

// The number of strings that are written/read.

// The time interval that a reader or writer thread is active.

// namespace wasmfs


=== system/lib/wasmfs/fuzzer/random.cpp ===
SHA256: 9aae782a156b3d849802cddcdec721ad3ebdd0ca747e23b697b3cde0f2f0e9ad
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// Original Source that was modified:

// https://github.com/WebAssembly/binaryen/blob/main/src/tools/fuzzing/random.cpp

// We ran out of input; go back to the start for more.

// use extra bits as "noise" for later

// Returns a random length string of random characters.

// Returns a random length string of the same character.

// namespace wasmfs


=== system/lib/wasmfs/fuzzer/random.h ===
SHA256: 673f28c3ed1171a2049142a491a3509e8f9774b031bd45e63cf2206c1ca4e872
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// Original Source that was modified:

// https://github.com/WebAssembly/binaryen/blob/main/src/tools/fuzzing/random.h

// The input seed bytes.

// The current position in `bytes`.

// Whether we already cycled through all the input (which might mean we should

// try to finish things off).

// After we finish the input, we start going through it again, but xoring

// so it's not identical.

// Methods for getting random data.

// Returns number in the range of [0,x).

// namespace wasmfs


=== system/lib/wasmfs/fuzzer/support/command-line.cpp ===
SHA256: cc032e3012dc58021fd3c6bb51507e590efa0b89697dcbc43135b68f8fc79066
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// Original Source:

// https://github.com/WebAssembly/binaryen/blob/main/src/support/command-line.cpp

// setDebugEnabled(arguments.c_str());

// "-" alone is a positional option

// Positional.

// Optional arguments must use --flag=A format, and not separated by

// spaces (which would be ambiguous).

// Non-positional.


=== system/lib/wasmfs/fuzzer/support/command-line.h ===
SHA256: fdedb3321156e788e872875ce37231be589531980d3f4ea8471a0a3909787a05
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// Original Source:

// https://github.com/WebAssembly/binaryen/blob/main/src/support/command-line.h

//

// Command line helpers.

//

// No arguments.

// One argument, in the form  --flag A  or  --flag=A

// Multiple arguments, in the form --flag A B C

// An optional single argument, in the form --flag=A (we disallow --flag A

// as that would be ambiguous regarding whether A is another flag, or an

// argument to us).

// namespace wasmfs


=== system/lib/wasmfs/fuzzer/workload.cpp ===
SHA256: 3aa0ec3127c80ba668277650877fc4c25aefb7944b7e4698635e0211e98dfdc7
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// This file defines fuzzer workloads which primarily fuzz multi-threaded

// operations.

// Add room for null terminator.

// This function should produce a string that consists of 1 character type.

// Generate a test file to read and write to.

// Populate the file with initial data.

// Create writer threads.

// This atomic bool ensures that all threads have an equal chance of

// starting first.

// Stop file operations after pre-defined duration.

// Clean up files.

// namespace wasmfs


=== system/lib/wasmfs/fuzzer/workload.h ===
SHA256: 86ae2fca84948fd3a8680bd9af0bec1bc76eb8fdb1ba097155ada801c23d307a
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// This file defines fuzzer workloads which primarily fuzz multi-threaded

// operations.

// This abstract class defines a fuzzer workload. It sets up a series of file

// system operations and then validates that the expected outcome is observed.

// This function generates a workload based on a Random seed. It will test a

// file system property, using any required syscalls.

// This workload class attempts to fuzz for tearing in reads and writes.

// This should validate that writes are atomic (i.e. that a read interleaved

// between two writes should not read a portion of the first write and a portion

// of the second write). Writer threads should write a uniform string of the

// same character. Reader threads should validate that file content is not

// intermixed (it should check that all characters in the file content are the

// same).

// Work describes the list of strings being written to a test file.

// namespace wasmfs


=== system/lib/wasmfs/js_api.cpp ===
SHA256: 28d100b02ff2674649dc9ff431f6ae347b4d1f72ded572f2947e797006c3e8b9
// Copyright 2022 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// Some APIs return data using a thread-local allocation that is never freed.

// This is simpler and more efficient as it avoids the JS caller needing to free

// the allocation (which would have both the overhead of free, and also of a

// call back into wasm), but on the other hand it does mean more memory may be

// used. This seems a reasonable tradeoff as heavy workloads should ideally

// avoid the JS API anyhow.

// Copy the file specified by the pathname into JS.

// Return zero on success, errno on failure.

// Output point and length are written to `out_buf` and `out_size` params.

// TODO: Generalize this so that it is thread-proof.

// Must guarantee that the file size has not changed by the time it is read.

// Writes to a file, possibly creating it, and returns the number of bytes

// written successfully. If the file already exists, appends to it.

// Lookup failed; try creating the file.

// File creation failed; nothing else to do.

// There is something here but it isn't a data file.

// The legacy JS API requires a mountpoint to already exist, so  WasmFS will

// attempt to remove the target directory if it exists before replacing it with

// a mounted directory.

// The legacy JS API mount requires the directory to already exist, but we

// will also allow it to be missing.

// Helper method that identifies what a path is:

//   ENOENT - if nothing exists there

//   EISDIR - if it is a directory

//   EEXIST - if it is a normal file

// TODO: PATH_MAX is 4K atm, so it might be good to reduce this somehow.

// extern "C"


=== system/lib/wasmfs/js_impl_backend.h ===
SHA256: 06eb70f413db5eb54f63d9f1d45181370f0de82493529993c6d3f398581558cf
// Copyright 2022 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

//

// A JS Impl backend has files that are implemented by JS code. Each backend

// object in C++ can call JS to define the proper JS code on that side, and we

// keep a mapping of C++ pointer of backend => JS code in JS. Then, when we do

// something like a read from a JSImplFile we pass it the backend, find the

// proper code to run, and run it. This adds a layer of indirection at the JS

// level that makes it easy to write new backends in 99% JS.

//

// Each file operation in the _wasmfs_jsimpl_* APIs that we call from here take

// the backend and a pointer to this file itself. Those allow the JS to identify

// both the backend and the particular file. TODO: We could use dense indexes

// instead of pointers, and use an array instead of a map.

//

// To write a new backend in JS, you basically do the following:

//

//  1. Add a declaration of the C function to create the backend in the

//     "backend creation" section of emscripten/wasmfs.h. (One line.)

//  2. Add a cpp file for the new backend, and implement the C function from 1,

//     which should create it on both the C++ (using JSImplBackend) and JS

//     sides. (By convention, the C function should just call into C++ and JS

//     which do the interesting work; the C is just a thin wrapper.) (A few

//     lines.)

// 3. Write a new JS library, and add the implementation of the JS method just

//    mentioned, which should set up the mapping from the C++ backend object's

//    address to the JS code containing the hooks to read and write etc. (99%

//    of the work happens here.)

//

// For a simple example, see js_file_backend.cpp and library_wasmfs_js_file.js

//

// Index type that is used on the JS side to refer to backends and file

// handles.  Currently these are both passed as raw pointers rather than

// integer handles which is why we use uintptr_t here.

// TODO: Use a narrower type here and avoid passing raw pointers.

// JSImpl API (see below for overview).

// TODO: Notify the JS about open and close events?

// extern "C"

// namespace wasmfs


=== system/lib/wasmfs/memory_backend.h ===
SHA256: 44cee0d6d92758c6edc340c12e167921d0692d76f9f1612aae3ad20afd520b11
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// This file defines the memory file class. This should be the only backend file

// type defined in a header since it is the default type.

// This class describes a file that lives in Wasm Memory.

// Use a vector instead of a map to save code size.

// Since we internally track files with `File` objects, we don't need the

// dcache as well.

// namespace wasmfs


=== system/lib/wasmfs/no_fs.c ===
SHA256: c14378b6ab8f6c3357210d56e0ba151a7bd03c6cc254a0cd5058107b32daac4f
//

// "No-FS" implementation for WasmFS. This file implements just enough of the

// syscall API to support printf. In particular, enough for a program that

// only does some file writes, but no open() or such. Then those writes must be

// to the standard streams, and we can implement very simple printing for them

// as opposed to linking in all of WasmFS.

//

// This uses weak linking, and as such it depends on all the normal syscalls

// being implemented in a single file, which is the case (syscalls.cpp). That

// way, if that single other file is included then all these methods get

// overridden. (Otherwise, if we had multiple files, we could end up with a mix

// of this file's functions and others.)

//

// Import the outside (JS or VM) fd_write under a different name. We must

// implement __wasi_fd_write in this file so that all the normal WasmFS code is

// not included - that is the point of no-fs mode - since if we don't implement

// it here then the normal WasmFS code for that function will be linked in. But

// in the cases where this file is linked in, we just want to direct all calls

// to the outside fd_write.

// The only possible file descriptors are the standard streams, and there is

// nothing special to do to close them.

// This operation is not supported (but it does appear in system libraries

// even in hello world, even if it isn't actually called, so we do need to

// implement this stub here).


=== system/lib/wasmfs/paths.cpp ===
SHA256: e77cab7c84e1bf5a95bc8b1c50934b8ef6340dcb21687c90e0ba1f026666d4a2
// Copyright 2022 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// Empty paths never exist.

// Handle absolute paths.

// Ignore trailing '/'.

// An empty path here means that the path was equivalent to "/" and does not

// contain a child segment for us to return. The root is its own parent, so we

// can handle this by returning (root, ".").

// Skip any leading '/' for each segment.

// If this is the leaf segment, return.

// Try to descend into the child segment.

// TODO: Check permissions on intermediate directories.

// anonymous namespace

// Don't parse a path, just use `dirfd` directly.

// namespace wasmfs::path


=== system/lib/wasmfs/paths.h ===
SHA256: 6fd0b038bf53d1d6b821e516c3deed3004a032f1590a867fb36dcb4534fe9cb4
// Copyright 2022 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// Typically -ENOTDIR or -ENOENT.

// The parent directory and the name of an entry within it. The returned string

// view is either backed by the same memory as the view passed to `parseParent`

// or is a view into a static string.

// If the path refers to a link, whether we should follow that link. Links among

// the parent directories in the path are always followed.

// Always ok to call, returns 0 if there is no error.

// Call only after checking for an error.

// Always ok to call. Returns 0 if there is no error.

// Call only after checking for an error.

// Like `parseFile`, but handle the cases where flags include `AT_EMPTY_PATH` or

// AT_SYMLINK_NOFOLLOW. Does not validate the flags since different callers have

// different allowed flags.

// Like `parseFile`, but parse the path relative to the given directory.

// namespace wasmfs::path


=== system/lib/wasmfs/pipe_backend.h ===
SHA256: 477a1c8f72b91064c700baee9e71d51f37eb6cca956bb91a63de9b7ae1d63640
// Copyright 2022 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// The data shared between the two sides of a pipe.

// TODO: Consider switching to a ring buffer for performance and code size if we

//       don't need unbounded pipes.

// A PipeFile is a simple file that has a reference to a PipeData that it

// either reads from or writes to. A pair of PipeFiles comprise the two ends of

// a pipe.

// TODO: Should this return an error?

// PipeFiles do not have or need a backend. Pass NullBackend to the parent for

// that.

// Reads are always from the front; writes always to the end.

// namespace wasmfs


=== system/lib/wasmfs/proxied_async_js_impl_backend.h ===
SHA256: 8ecfd6f9a303d6c4be90872d5804462d22194a3a4bd325dc1c905e696e6f290b
// Copyright 2022 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

//

// Similar to JSImplBackend, but proxies to another thread where the JS can be

// async.

//

// To write a new async backend in JS, you basically do the following:

//

//  1. Add a declaration of the C function to create the backend in the

//     "backend creation" section of emscripten/wasmfs.h. (One line.)

//  2. Add a cpp file for the new backend, and implement the C function from 1,

//     which should create a ProxiedAsyncJSBackend while passing it code to

//     set up the JS side. (A few lines.)

//  3. Write a new JS library, and add the implementation of the JS method just

//     mentioned, which should set up the mapping from the C++ backend object's

//     address to the JS code containing the hooks to read and write etc. The

//     hooks should each return a JS Promise. (99% of the work happens here.)

//

// This is basically the same as JSImplBackend, except that the code in step #3

// is async (also, step #2 looks slightly different, but is similarly very

// short).

//

// For a simple example, see fetch_backend.cpp and library_wasmfs_fetch.js.

//

// JSImpl async API.

// TODO: Notify the JS about open and close events?

// Receives as a parameter a function to call on the proxied thread, which is

// useful for doing setup there.

// namespace wasmfs


=== system/lib/wasmfs/special_files.cpp ===
SHA256: 799911496ec7b992cb564f97280a961bd2a47b492eafa847d2ba51e97903be8c
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// This file defines the standard streams.

// No-op reads and writes: /dev/null

// No more input can be read, return what we did read.

// A standard stream that writes: stdout or stderr.

// Write a null to flush the output if we have content.

// Flush on either a null or a newline.

// for null-terminated C strings

// Node and worker threads issue in Emscripten:

// https://github.com/emscripten-core/emscripten/issues/14804.

// Issue filed in Node: https://github.com/nodejs/node/issues/40961

// This is confirmed to occur when running with EXIT_RUNTIME and

// PROXY_TO_PTHREAD. This results in only a single console.log statement

// being outputted. The solution for now is to use out() and err() instead.

// Similar issue with Node and worker threads as emscripten_out.

// TODO: May not want to proxy stderr (fd == 2) to the main thread, as

//       emscripten_err does.

//       This will not show in HTML - a console.warn in a worker is

//       sufficient. This would be a change from the current FS.

// anonymous namespace

// namespace wasmfs::SpecialFiles


=== system/lib/wasmfs/special_files.h ===
SHA256: 9816fe180bb437e657af16106251620fd6ff4d1cabd66682fd888d81013178b1
// Copyright 2022 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// /dev/null

// /dev/stdin

// /dev/stdout

// /dev/stderr

// /dev/random

// /dev/urandom

// namespace wasmfs::SpecialFiles


=== system/lib/wasmfs/support.cpp ===
SHA256: 6bab842d381dd6cee52d95d66934fa545e004fc281acee55fe409ca9be461d58
// Copyright 2022 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// In emscripten, avoid iostream to avoid using WasmFS code during logging.

// EMSCRIPTEN

// TODO: sanitizer integration, see binaryen's similar code

// namespace wasmfs


=== system/lib/wasmfs/support.h ===
SHA256: c09c1eaa1001497a34ed857f304ae67d74f01e3e9fdeaadb27007651ea151589
// Copyright 2022 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// In debug builds show a message.

// In release builds trap in a compact manner.


=== system/lib/wasmfs/syscalls.cpp ===
SHA256: 37ef15d7c4b8701c24dfbc967c1a5d550f1dbbc237829b25a986582462e84194
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// Syscall implementations.

// For F_GETLK64 etc

// File permission macros for wasmfs.

// Used to improve readability compared to those in stat.h

// In Linux, the maximum length for a filename is 255 bytes.

// TODO: Test this case.

// If the file descriptor newfd was previously open, it will just be

// overwritten silently.

// Check that an open file exists corresponding to the given fd.

// This enum specifies whether file offset will be provided by the open file

// state or provided by argument in the case of pread or pwrite.

// Internal write function called by __wasi_fd_write and __wasi_fd_pwrite

// Receives an open file state offset.

// Optionally sets open file state offset.

// Translate to WASI standard of positive return codes.

// TODO: Check open file access mode for write permissions.

// Check if buf_len specifies a positive length buffer but buf is a

// null pointer

// Check if the sum of the buf_len values overflows an off_t (63 bits).

// This individual write failed. Report the error unless we've already

// written some bytes, in which case report a successful short write.

// The write was successful.

// The write was short, so stop here.

// Internal read function called by __wasi_fd_read and __wasi_fd_pread

// Receives an open file state offset.

// Optionally sets open file state offset.

// TODO: combine this with writeAtOffset because the code is nearly identical.

// TODO: Check open file access mode for read permissions.

// If file is nullptr, then the file was not a DataFile.

// TODO: Check for overflow when adding offset + bytesRead.

// This individual read failed. Report the error unless we've already read

// some bytes, in which case report a successful short read.

// The read was successful.

// Backends must only return len or less.

// The read was short, so stop here.

// Do not hold the file table lock while performing the close.

// Translate to WASI standard of positive return codes.

// Nothing to flush for anything but a data file, but also not an error either

// way. TODO: in the future we may want syncing of directories.

// Translate to WASI standard of positive return codes.

// TODO: Optimize this to avoid unnecessarily flushing unnecessary metadata.

// This function is exposed to users to allow them to obtain a backend_t for a

// specified path.

// Could not find the file.

// seconds

// nanoseconds

// Only accept valid flags.

// TODO: Test this case.

// Extract the information from the file.

// ATTN: hard-coded constant values are copied from the existing JS file

// system. Specific values were chosen to match existing library_fs.js

// values.

// ID of device containing file: Hardcode 1 for now, no meaning at the

// moment for Emscripten.

// The number of hard links is 1 since they are unsupported.

// Device ID (if special file) No meaning right now for Emscripten.

// The syscall docs state this is hardcoded to # of 512 byte blocks.

// Specifies the preferred blocksize for efficient disk I/O.

// When calling doOpen(), we may request an FD be returned, or we may not need

// that return value (in which case no FD need be allocated, and we return 0 on

// success).

// TODO: remove assert when all functionality is complete.

// The requested node was not found.

// If curr is the last element and the create flag is specified

// If O_DIRECTORY is also specified, still create a regular file:

// https://man7.org/linux/man-pages/man2/open.2.html#BUGS

// Inserting into an unlinked directory is not allowed.

// Mask out everything except the permissions bits.

// If there is no explicitly provided backend, use the parent's backend.

// TODO: Check write permissions on the parent directory.

// TODO Receive a specific error code, and report it here. For now,

//      report a generic error.

// TODO Receive a specific error code, and report it here. For now,

//      report a generic error.

// TODO: Check that the insert actually succeeds.

// TODO: The link dereference count starts back at 0 here. We could

// propagate it from the previous path parsing instead.

// Return an error if the file exists and O_CREAT and O_EXCL are specified.

// Check user permissions.

// Fail if O_DIRECTORY is specified and pathname is not a directory

// Note that we open the file before truncating it because some backends may

// truncate opened files more efficiently (e.g. OPFS).

// If O_TRUNC, truncate the file if possible.

// Try to truncate the file, continuing silently if we cannot.

// This function is exposed to users and allows users to create a file in a

// specific backend. An fd to an open file is returned.

// TODO: Test this with non-AT_FDCWD values.

// TODO: support special devices

// Check if the requested directory already exists.

// Mask rwx permissions for user, group and others, and the sticky bit.

// This prevents users from entering S_IFREG for example.

// https://www.gnu.org/software/libc/manual/html_node/Permission-Bits.html

// By default, the backend that the directory is created in is the same as

// the parent directory. However, if a backend is passed as a parameter,

// then that backend is used.

// TODO Receive a specific error code, and report it here. For now, report

//      a generic error.

// TODO Receive a specific error code, and report it here. For now, report

//      a generic error.

// TODO: Check that the insertion is successful.

// This function is exposed to users and allows users to specify a particular

// backend that a directory should be created within.

// TODO: Test this.

// Only the open file state is altered in seek. Locking the underlying

// data file here once is sufficient.

// Translate to WASI standard of positive return codes.

// Check if buf points to a bad address.

// Check if the size argument is zero and buf is not a null pointer.

// Check if the parent exists. The parent may not exist if the CWD or one

// of its ancestors has been unlinked.

// Check if the cwd is the root directory.

// Check if the size argument is less than the length of the absolute

// pathname of the working directory, including null terminator.

// Return value is a null-terminated c string.

// TODO: This is only partial implementation of __wasi_fd_fdstat_get. Enough

// to get __wasi_fd_is_valid working.

// There are other fields in the stat structure that we should really

// be filling in here.

// TODO: Test this with non-AT_FDCWD values.

// TODO: Test this case.

// It is invalid for rmdir paths to end in ".", but we need to distinguish

// this case from the case of `parseParent` returning (root, '.') when parsing

// "/", so we need to find the invalid "/." manually.

// Ignore trailing '/'.

// Disallow removing the root directory, even if it is empty.

// A directory can only be removed if it has no entries.

// A normal file or symlink.

// Cannot unlink/rmdir if the parent dir doesn't have write permissions.

// Input is valid, perform the unlink.

// wasmfs_unmount is similar to __syscall_unlinkat, but assumes AT_REMOVEDIR is

// true and will only unlink mountpoints (Empty and nonempty).

// Disallow removing the root directory, even if it is empty.

// A normal file or symlink.

// The child is not a valid mountpoint.

// Input is valid, perform the unlink.

// Check if the result buffer is too small.

// A directory's position corresponds to the index in its entries vector.

// If this directory has been unlinked and has no parent, then it is

// completely empty.

// Update position

// TODO: Test this with non-AT_FDCWD values.

// Rename is the only syscall that needs to (or is allowed to) acquire locks

// on two directories at once. It requires locks on both the old and new

// parent directories to ensure that the moved file can be atomically removed

// from the old directory and added to the new directory without something

// changing that would prevent the move.

//

// To prevent deadlock in the case of simultaneous renames, serialize renames

// with an additional global lock.

// Get the old directory.

// Get the new directory.

// Lock both directories.

// Get the source and destination files.

// If the source and destination are the same, do nothing.

// Never allow renaming or overwriting the root.

// Cannot modify either directory without write permissions.

// Both parents must have the same backend.

// Check that oldDir is not an ancestor of newDir.

// The new file will be removed if it already exists.

// Cannot overwrite a directory with a non-directory.

// Cannot overwrite a non-empty directory.

// Cannot overwrite a non-directory with a directory.

// Perform the move.

// TODO: Test this with non-AT_FDCWD values.

// TODO: Test this with non-AT_FDCWD values.

// TODO: Handle empty paths.

// TODO: Test this with non-AT_FDCWD values.

// TODO: Test this case.

// Add AT_EMPTY_PATH as Linux (and so, musl, and us) has a nonstandard

// behavior in which an empty path means to operate on whatever is in dirFD

// (directory or not), which is exactly the behavior of AT_EMPTY_PATH (but

// without passing that in). See "C library/kernel ABI differences" in

// https://man7.org/linux/man-pages/man2/utimensat.2.html

//

// TODO: Handle AT_SYMLINK_NOFOLLOW once we traverse symlinks correctly.

// TODO: Handle tv_nsec being UTIME_NOW or UTIME_OMIT.

// TODO: Check for write access to the file (see man page for specifics).

// TODO: Test this with non-AT_FDCWD values.

// TODO: Test this case.

// On POSIX, ctime is updated on metadata changes, like chmod.

// Only accept valid flags.

// TODO: Test this case.

// Ignore the actual owner and group because we don't track those.

// TODO: Update metadata time stamp.

// TODO: Test this with non-AT_FDCWD values.

// The input must be F_OK (check for existence) or a combination of [RWX]_OK

// flags.

// TODO: Test this case.

// TODO: Handle AT_SYMLINK_NOFOLLOW once we traverse symlinks correctly.

// XXX It is not clear from the docs why ftruncate would differ from

//     truncate here. However, on Linux this definitely happens, and the old

//     FS matches that as well, so do the same here.

// TODO: Full TTY support. For now, just see stdin/out/err as terminals and

//       nothing else.

// TODO: Full TTY support. For now this is limited, and matches the old FS.

// TTY operations that we do nothing for anyhow can just be ignored.

// not supported

// Make a pipe: Two PipeFiles that share a single data source between them, so

// that writing to one can be read in the other.

//

// No backend is needed here, so pass in nullptr for that.

// int poll(struct pollfd* fds, nfds_t nfds, int timeout);

// Process the list of FDs and compute their revents masks. Count the number

// of nonzero such masks, which is our return value.

// Negative FDs are ignored in poll().

// Assume invalid, unless there is an open file.

// If there is data in the file, then there is also the ability to read.

// TODO: Does this need to consider the position as well? That is, if

// the position is at the end, we can't read from the current position

// at least. If we update this, make sure the size isn't an error!

// TODO: get mask from File dynamically using a poll() hook?

// TODO: set the state based on the state of the other end of the pipe, for

//       pipes (POLLERR | POLLHUP)

// TODO: This should block based on the timeout. The old FS did not do so due

//       to web limitations, which we should perhaps revisit (especially with

//       pthreads and asyncify).

// TODO, but other modes were never supported in the old FS

// TODO: support for symlinks.

// TODO: We could only fill zeros for regions that were completely unused

//       before, which for a backend with sparse data storage could make a

//       difference. For that we'd need a new backend API.

// Find the first available fd at arg or after.

// TODO: Should we check for a limit on the max FD number, if we have one?

// FD_CLOEXEC makes no sense for a single process.

// This syscall should ignore most flags.

// Also ignore this flag which musl always adds constantly, but does not

// matter for us.

// On linux only a few flags can be modified, and we support only a subset

// of those. Error on anything else.

// If these constants differ then we'd need a case for both.

// We're always unlocked for now, until we implement byte-range locks.

// Pretend that the locking is successful. These are process-level locks,

// and Emscripten programs are a single process. If we supported linking a

// filesystem between programs, we'd need to do more here.

// See https://github.com/emscripten-core/emscripten/issues/23697

// TODO: support any remaining cmds

// We only know how to write to a standard statfs, not even a truncated one.

// NOTE: None of the constants here are true. We're just returning safe and

//       sane values, that match the long-existing JS FS behavior (except for

//       the inode number, where we can do better).

// PROT_EXEC is not supported (although we pretend to support the absence of

// PROT_READ or PROT_WRITE).

// One of MAP_PRIVATE, MAP_SHARED, or MAP_SHARED_VALIDATE must be used.

// Keep the open file info locked only for as long as we need that.

// Check permissions. We always need read permissions, since we need to read

// the data in the file to map it.

// According to the POSIX spec it is possible to write to a file opened in

// read-only mode with MAP_PRIVATE flag, as all modifications will be

// visible only in the memory of the current process.

// TODO: On MAP_SHARED, install the mapping on the DataFile object itself so

// that reads and writes can be redirected to the mapped region and so that

// the mapping can correctly outlive the file being closed. This will require

// changes to emscripten_mmap.c as well.

// Align to a wasm page size, as we expect in the future to get wasm

// primitives to do this work, and those would presumably be aligned to a page

// size. Aligning now avoids confusion later.

// The read failed. Report the error, but first free the allocation.

// From here on, we have succeeded, and can mark the allocation as having

// occurred (which means that the caller has the responsibility to free it).

// The read must be of a valid amount, or we have had an internal logic error.

// mmap clears any extra bytes after the data itself.

// TODO: This is not correct! Mappings should be associated with files, not

// fds. Only need to sync if shared and writes are allowed.

// Translate from WASI positive error codes to negative error codes.

// TODO: This is not correct! Mappings should be associated with files, not

// fds.

// TODO: Syncing should probably be handled in __syscall_munmap instead.

// Stubs (at least for now)

// Advice is currently ignored. TODO some backends might use it

// extern "C"


=== system/lib/wasmfs/thread_utils.h ===
SHA256: 5423c4a73b787e6b8e90cfa857a5bb5d39302f3cb98e7af94076606fb8088f48
/*
 * Copyright 2021 The Emscripten Authors.  All rights reserved.
 * Emscripten is available under two separate licenses, the MIT license and the
 * University of Illinois/NCSA Open Source License.  Both these licenses can be
 * found in the LICENSE file.
 */

// Helper class for synchronously proxying work to a dedicated worker thread,

// including where the work is asynchronous.

// The queue we use to proxy work and the dedicated worker.

// Used to notify the calling thread once the worker has been started.

// Declare the thread last since it's dependent on the above member variables.

// Declaring it last isn't strictly needed since the thread is initialized in

// the body of the constructor, but is done out of caution.

// Spawn the worker thread.

// Initialize the thread in the constructor to ensure the object has been

// fully constructed before thread starts using the object to avoid a data

// race. See #24370.

// Notify the caller that we have started.

// Sometimes the main thread is spinning, waiting on a WasmFS lock held

// by a thread trying to proxy work to this dedicated worker. In that

// case, the proxying message won't be relayed by the main thread and

// the system will deadlock. This heartbeat ensures that proxying work

// eventually gets done so the thread holding the lock can make forward

// progress even if the main thread is blocked.

//

// TODO: Remove this once we can postMessage directly between workers

// without involving the main thread or once all browsers ship

// Atomics.waitAsync.

//

// Note that this requires adding _emscripten_proxy_execute_queue to

// EXPORTED_FUNCTIONS.

// Sit in the event loop performing work as it comes in.

// Make sure the thread has actually started before returning. This allows

// subsequent code to assume the thread has already been spawned and not

// worry about potential deadlocks where it holds a lock while proxying an

// operation and meanwhile the main thread is blocked trying to acquire the

// same lock so is never able to spawn the worker thread.

//

// Unfortunately, this solution would cause the main thread to deadlock on

// itself, so for now assert that we are not on the main thread. In the

// future, we could provide an asynchronous version of this utility that

// calls a user callback once the worker has been started. This asynchronous

// version would be safe to use on the main thread.

// Kill the worker thread.

// Proxy synchronous work.

// Proxy asynchronous work that calls `finish()` on the ctx parameter to mark

// its end.

// namespace emscripten


=== system/lib/wasmfs/virtual.h ===
SHA256: bace64ebb06b88562c602c1101f021afe03f833609cdf382880e05d1ed42aa5f
// Copyright 2022 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// Utilities for creating virtual backends that forward operations to underlying

// "real" files. Virtual backends must wrap all underlying files, even if the

// wrapper is a no-op, so that no part of the system observes mixed backends. To

// the backend-independent code, the root directory of the virtual backend and

// all of its descendants must appear to have the same virtual backend. To the

// underlying "real" backend, all of its files must appear to have parents of

// the same real backend. Without these invariants, renames would not work

// correctly and without wrapping all files, these invariants would not be

// upheld.

// Forward operations through Directory::Handle to get the proper dcache logic.

// Unwrap a virtual file and get the underlying real file of the same kind.

// namespace wasmfs


=== system/lib/wasmfs/wasmfs.cpp ===
SHA256: bc77fc51224c21c472dae309db9eaa7d05f9bcdd92b40f156ee02bf3124428c3
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// This file defines the global state.

// The below lines are included to make the compiler believe that the global

// constructor is part of a system header, which is necessary to work around a

// compilation error about using a reserved init priority less than 101. This

// ensures that the global state of the file system is constructed before

// anything else. ATTENTION: No other static global objects should be defined

// besides wasmFS. Due to # define _LIBCPP_INIT_PRIORITY_MAX

// __attribute__((init_priority(101))), we must use init priority 100 (reserved

// system priority) since wasmFS is a system level component.

// TODO: consider instead adding this in libc's startup code.

// WARNING: Maintain # n + 1 "wasmfs.cpp" 3 where n = line number.

// If the user does not implement this hook, do nothing.

// Set up global data structures and preload files.

// Manual integration with LSan. LSan installs itself during startup at the

// first allocation, which happens inside WasmFS code (since the WasmFS global

// object creates some data structures). As a result LSan's atexit() destructor

// will be called last, after WasmFS is cleaned up, since atexit() calls work

// are LIFO (like a stack). But that is a problem, since if WasmFS has shut

// down and deallocated itself then the leak code cannot actually print any of

// its findings, if it has any. To avoid that, define the LSan entry point as a

// weak symbol, and call it; if LSan is not enabled this can be optimized out,

// and if LSan is enabled then we'll check for leaks right at the start of the

// WasmFS destructor, which is the last time during which it is valid to print.

// (Note that this means we can't find leaks inside WasmFS code itself, but that

// seems fundamentally impossible for the above reasons, unless we made LSan log

// its findings in a way that does not depend on normal file I/O.)

// Flush musl libc streams.

// Flush our own streams. TODO: flush all backends.

// See comment above on this function.

//

// Note that it is ok for us to call it here, as LSan internally makes all

// calls after the first into no-ops. That is, calling it here makes the one

// time that leak checks are run be done here, or potentially earlier, but not

// later; and as mentioned in the comment above, this is the latest possible

// time for the checks to run (since right after this nothing can be printed).

// TODO: Integrate musl exit() which would flush the libc part for us. That

//       might also help with destructor priority - we need to happen last.

//       (But we would still need to flush the internal WasmFS buffers, see

//       wasmfs_flush() and the comment on it in the header.)

// Break the reference cycle caused by the root directory being its own

// parent.

// Special backends that want to install themselves as the root use this hook.

// Otherwise, we use the default backends.

// The root directory is its own parent.

// If the /dev/ directory does not already exist, create it. (It may already

// exist in NODERAWFS mode, or if those files have been preloaded.)

// As with the /dev/ directory, it is not an error for /tmp/ to already

// exist.

// Initialize files specified by the --preload-file option.

// Set up directories and files in wasmFS$preloadedDirs and

// wasmFS$preloadedFiles from JS. This function will be called before any file

// operation to ensure any preloaded files are eagerly available for use.

// Debug builds only: add check to ensure preloadFiles() is called once.

// Ensure that files are preloaded from the main thread.

// If there are no preloaded files, exit early.

// Iterate through wasmFS$preloadedDirs to obtain a parent and child pair.

// Ex. Module['FS_createPath']("/foo/parent", "child", true, true);

// The child already exists, so we don't need to do anything here.

// namespace wasmfs


=== system/lib/wasmfs/wasmfs.h ===
SHA256: 27a2172cba0fbbfec1d004fccdd5907ee0306098f9f64533625179246b0cc0eb
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// This file defines the global state.

// Private method to initialize root directory once.

// Initializes default directories including dev/stdin, dev/stdout,

// dev/stderr. Refers to the same std streams in the open file table.

// Initialize files specified by --preload-file option.

// Global state instance.

// namespace wasmfs


=== system/lib/wasmfs/wasmfs_internal.h ===
SHA256: 39bfcb3544a5bb1dee1645b70cd3f6e3f6cc143a04a181bb507bc1adcc29144e
// Copyright 2021 The Emscripten Authors.  All rights reserved.

// Emscripten is available under two separate licenses, the MIT license and the

// University of Illinois/NCSA Open Source License.  Both these licenses can be

// found in the LICENSE file.

// These helper functions are defined in library_wasmfs.js.

// Returns the next character from stdin, or -1 on EOF.


=== system/lib/websocket/websocket_to_posix_socket.c ===
SHA256: e95fcadf7dad4c88ea593bb620bf7b0e2621ae11cf899e64f2ea491c51855043
// Alternative socket system implementation that gets compiled to

// libsockets_proxy.a and included when the `-sPROXY_POSIX_SOCKETS`

// is used.

// Uncomment to enable debug printing

// #define POSIX_SOCKET_DEBUG

// Uncomment to enable more verbose debug printing (in addition to uncommenting POSIX_SOCKET_DEBUG)

// #define POSIX_SOCKET_DEEP_DEBUG

// Each proxied socket call has at least the following data.

// Each socket call returns at least the following data.

// Buffer can contain more data here, conceptually:

// uint8_t extraData[];

// Before the call has finished, this field represents the minimum expected

// number of bytes that server will need to report back.  After the call has

// finished, this field reports back the number of bytes pointed to by data,

// >= the expected value.

// Result data:

// Shield multithreaded accesses to POSIX sockets functions in the program,

// namely the two variables 'bridgeSocket' and 'callResultHead' below.

// Socket handle for the connection from browser WebSocket to the sockets bridge

// proxy server.

// Stores a linked list of all currently pending sockets operations (ones that

// are waiting for a reply back from the sockets proxy server)

// Guard multithreaded access to 'callResultHead' and 'nextId' below

// Guard multithreaded access to 'callResultHead'

// TODO: Craft a socket result that signifies a failure, and wake the listening thread

// TODO: Craft a socket result that signifies a failure, and wake the listening thread

// Guard multithreaded access to 'bridgeSocket'

/*socklen_t*/

/*socklen_t*/

// TODO

/*socklen_t*/

/*socklen_t*/

/*socklen_t*/

/*size_t*/

/*size_t*/

/*size_t*/

/*socklen_t*/

/*size_t*/

/*socklen_t*/

// N.B. this is the reported address length of the sender, that may be larger than what is actually serialized to this message.

// TODO

// TODO

/*socklen_t*/

// Host name resolution: <netdb.h>

// Arbitrary max length limit

// Arbitrary max length limit

/*socklen_t*/

/*sockaddr **/

/*ResAddrinfo[]*/

// TODO

// POSIX_SOCKET_MSG_GETNAMEINFO

// TODO:

// const char *gai_strerror(int);
