{"version":3,"sources":["./stb_image.h","platform_sdl.cpp","./include/imgui_platform.h","/usr/lib/emscripten/system/include/libcxx/string","/usr/lib/emscripten/system/include/libcxx/fstream","/usr/lib/emscripten/system/include/libcxx/ios","/usr/lib/emscripten/system/include/libcxx/istream","/usr/lib/emscripten/system/include/libcxx/__nullptr","/usr/lib/emscripten/system/include/libcxx/iosfwd","/usr/lib/emscripten/system/include/libcxx/vector","/usr/lib/emscripten/system/include/libcxx/iterator","/usr/lib/emscripten/system/include/libcxx/algorithm","/usr/lib/emscripten/system/include/libcxx/memory","/usr/lib/emscripten/system/include/libcxx/math.h","/usr/lib/emscripten/system/include/libcxx/type_traits","/usr/lib/emscripten/system/include/libcxx/__locale","/usr/lib/emscripten/system/include/libcxx/streambuf","/usr/lib/emscripten/system/include/libcxx/typeinfo","/usr/lib/emscripten/system/include/libcxx/__string","/usr/lib/emscripten/system/include/libcxx/__split_buffer","/usr/lib/emscripten/system/include/libcxx/new","/usr/lib/emscripten/system/include/libcxx/stdexcept","main.cpp","./platform_sdl.h"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;AAGA;AAEA;AACA;AAEA;AAAA;AAMA;AAAA;;AACA;AAAA;AAAA;AACA;AA4CA;AAAA;;AAzCA;AAAA;AAAA;AACA;AAAA;;AACA;AAAA;AAAA;AACA;AAsCA;AAAA;;AAnCA;AACA;AAAA;AACA;AAAA;;AACA;AAAA;AAAA;AAAA;AACA;AA+BA;AAAA;;AA5BA;AACA;AACA;AACA;;AAIA;AAGA;AAEA;AACA;AAEA;AACA;AAAA;AACA;AAAA;AAAA;AAEA;AACA;AACA;AAAA;AAEA;AACA;AACA;AAEA;AACA;AAAA;;AAxBA;AACA;AAuBA;AAAA","file":"out/main.js","sourcesContent":["/* stb_image - v2.14 - public domain image loader - http://nothings.org/stb_image.h\n no warranty implied; use at your own risk\n\n Do this:\n #define STB_IMAGE_IMPLEMENTATION\n before you include this file in *one* C or C++ file to create the implementation.\n\n // i.e. it should look like this:\n #include ...\n #include ...\n #include ...\n #define STB_IMAGE_IMPLEMENTATION\n #include \"stb_image.h\"\n\n You can #define STBI_ASSERT(x) before the #include to avoid using assert.h.\n And #define STBI_MALLOC, STBI_REALLOC, and STBI_FREE to avoid using malloc,realloc,free\n\n\n QUICK NOTES:\n Primarily of interest to game developers and other people who can\n avoid problematic images and only need the trivial interface\n\n JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib)\n PNG 1/2/4/8-bit-per-channel (16 bpc not supported)\n\n TGA (not sure what subset, if a subset)\n BMP non-1bpp, non-RLE\n PSD (composited view only, no extra channels, 8/16 bit-per-channel)\n\n GIF (*comp always reports as 4-channel)\n HDR (radiance rgbE format)\n PIC (Softimage PIC)\n PNM (PPM and PGM binary only)\n\n Animated GIF still needs a proper API, but here's one way to do it:\n http://gist.github.com/urraka/685d9a6340b26b830d49\n\n - decode from memory or through FILE (define STBI_NO_STDIO to remove code)\n - decode from arbitrary I/O callbacks\n - SIMD acceleration on x86/x64 (SSE2) and ARM (NEON)\n\n Full documentation under \"DOCUMENTATION\" below.\n\n\n Revision 2.00 release notes:\n\n - Progressive JPEG is now supported.\n\n - PPM and PGM binary formats are now supported, thanks to Ken Miller.\n\n - x86 platforms now make use of SSE2 SIMD instructions for\n JPEG decoding, and ARM platforms can use NEON SIMD if requested.\n This work was done by Fabian \"ryg\" Giesen. SSE2 is used by\n default, but NEON must be enabled explicitly; see docs.\n\n With other JPEG optimizations included in this version, we see\n 2x speedup on a JPEG on an x86 machine, and a 1.5x speedup\n on a JPEG on an ARM machine, relative to previous versions of this\n library. The same results will not obtain for all JPGs and for all\n x86/ARM machines. (Note that progressive JPEGs are significantly\n slower to decode than regular JPEGs.) This doesn't mean that this\n is the fastest JPEG decoder in the land; rather, it brings it\n closer to parity with standard libraries. If you want the fastest\n decode, look elsewhere. (See \"Philosophy\" section of docs below.)\n\n See final bullet items below for more info on SIMD.\n\n - Added STBI_MALLOC, STBI_REALLOC, and STBI_FREE macros for replacing\n the memory allocator. Unlike other STBI libraries, these macros don't\n support a context parameter, so if you need to pass a context in to\n the allocator, you'll have to store it in a global or a thread-local\n variable.\n\n - Split existing STBI_NO_HDR flag into two flags, STBI_NO_HDR and\n STBI_NO_LINEAR.\n STBI_NO_HDR: suppress implementation of .hdr reader format\n STBI_NO_LINEAR: suppress high-dynamic-range light-linear float API\n\n - You can suppress implementation of any of the decoders to reduce\n your code footprint by #defining one or more of the following\n symbols before creating the implementation.\n\n STBI_NO_JPEG\n STBI_NO_PNG\n STBI_NO_BMP\n STBI_NO_PSD\n STBI_NO_TGA\n STBI_NO_GIF\n STBI_NO_HDR\n STBI_NO_PIC\n STBI_NO_PNM (.ppm and .pgm)\n\n - You can request *only* certain decoders and suppress all other ones\n (this will be more forward-compatible, as addition of new decoders\n doesn't require you to disable them explicitly):\n\n STBI_ONLY_JPEG\n STBI_ONLY_PNG\n STBI_ONLY_BMP\n STBI_ONLY_PSD\n STBI_ONLY_TGA\n STBI_ONLY_GIF\n STBI_ONLY_HDR\n STBI_ONLY_PIC\n STBI_ONLY_PNM (.ppm and .pgm)\n\n Note that you can define multiples of these, and you will get all\n of them (\"only x\" and \"only y\" is interpreted to mean \"only x&y\").\n\n - If you use STBI_NO_PNG (or _ONLY_ without PNG), and you still\n want the zlib decoder to be available, #define STBI_SUPPORT_ZLIB\n\n - Compilation of all SIMD code can be suppressed with\n #define STBI_NO_SIMD\n It should not be necessary to disable SIMD unless you have issues\n compiling (e.g. using an x86 compiler which doesn't support SSE\n intrinsics or that doesn't support the method used to detect\n SSE2 support at run-time), and even those can be reported as\n bugs so I can refine the built-in compile-time checking to be\n smarter.\n\n - The old STBI_SIMD system which allowed installing a user-defined\n IDCT etc. has been removed. If you need this, don't upgrade. My\n assumption is that almost nobody was doing this, and those who\n were will find the built-in SIMD more satisfactory anyway.\n\n - RGB values computed for JPEG images are slightly different from\n previous versions of stb_image. (This is due to using less\n integer precision in SIMD.) The C code has been adjusted so\n that the same RGB values will be computed regardless of whether\n SIMD support is available, so your app should always produce\n consistent results. But these results are slightly different from\n previous versions. (Specifically, about 3% of available YCbCr values\n will compute different RGB results from pre-1.49 versions by +-1;\n most of the deviating values are one smaller in the G channel.)\n\n - If you must produce consistent results with previous versions of\n stb_image, #define STBI_JPEG_OLD and you will get the same results\n you used to; however, you will not get the SIMD speedups for\n the YCbCr-to-RGB conversion step (although you should still see\n significant JPEG speedup from the other changes).\n\n Please note that STBI_JPEG_OLD is a temporary feature; it will be\n removed in future versions of the library. It is only intended for\n near-term back-compatibility use.\n\n\n Latest revision history:\n 2.13 (2016-12-04) experimental 16-bit API, only for PNG so far; fixes\n 2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes\n 2.11 (2016-04-02) 16-bit PNGS; enable SSE2 in non-gcc x64\n RGB-format JPEG; remove white matting in PSD;\n allocate large structures on the stack; \n correct channel count for PNG & BMP\n 2.10 (2016-01-22) avoid warning introduced in 2.09\n 2.09 (2016-01-16) 16-bit TGA; comments in PNM files; STBI_REALLOC_SIZED\n 2.08 (2015-09-13) fix to 2.07 cleanup, reading RGB PSD as RGBA\n 2.07 (2015-09-13) partial animated GIF support\n limited 16-bit PSD support\n minor bugs, code cleanup, and compiler warnings\n\n See end of file for full revision history.\n\n\n ============================ Contributors =========================\n\n Image formats Extensions, features\n Sean Barrett (jpeg, png, bmp) Jetro Lauha (stbi_info)\n Nicolas Schulz (hdr, psd) Martin \"SpartanJ\" Golini (stbi_info)\n Jonathan Dummer (tga) James \"moose2000\" Brown (iPhone PNG)\n Jean-Marc Lienher (gif) Ben \"Disch\" Wenger (io callbacks)\n Tom Seddon (pic) Omar Cornut (1/2/4-bit PNG)\n Thatcher Ulrich (psd) Nicolas Guillemot (vertical flip)\n Ken Miller (pgm, ppm) Richard Mitton (16-bit PSD)\n github:urraka (animated gif) Junggon Kim (PNM comments)\n Daniel Gibson (16-bit TGA)\n socks-the-fox (16-bit TGA)\n Optimizations & bugfixes\n Fabian \"ryg\" Giesen\n Arseny Kapoulkine\n\n Bug & warning fixes\n Marc LeBlanc David Woo Guillaume George Martins Mozeiko\n Christpher Lloyd Martin Golini Jerry Jansson Joseph Thomson\n Dave Moore Roy Eltham Hayaki Saito Phil Jordan\n Won Chun Luke Graham Johan Duparc Nathan Reed\n the Horde3D community Thomas Ruf Ronny Chevalier Nick Verigakis\n Janez Zemva John Bartholomew Michal Cichon github:svdijk\n Jonathan Blow Ken Hamada Tero Hanninen Baldur Karlsson\n Laurent Gomila Cort Stratton Sergio Gonzalez github:romigrou\n Aruelien Pocheville Thibault Reuille Cass Everitt Matthew Gregan\n Ryamond Barbiero Paul Du Bois Engin Manap github:snagar\n Michaelangel007@github Oriol Ferrer Mesia Dale Weiler github:Zelex\n Philipp Wiesemann Josh Tobin github:rlyeh github:grim210@github\n Blazej Dariusz Roszkowski github:sammyhw\n\n\nLICENSE\n\nThis software is dual-licensed to the public domain and under the following\nlicense: you are granted a perpetual, irrevocable license to copy, modify,\npublish, and distribute this file as you see fit.\n\n*/\n\n#ifndef STBI_INCLUDE_STB_IMAGE_H\n#define STBI_INCLUDE_STB_IMAGE_H\n\n// DOCUMENTATION\n//\n// Limitations:\n// - no 16-bit-per-channel PNG\n// - no 12-bit-per-channel JPEG\n// - no JPEGs with arithmetic coding\n// - no 1-bit BMP\n// - GIF always returns *comp=4\n//\n// Basic usage (see HDR discussion below for HDR usage):\n// int x,y,n;\n// unsigned char *data = stbi_load(filename, &x, &y, &n, 0);\n// // ... process data if not NULL ...\n// // ... x = width, y = height, n = # 8-bit components per pixel ...\n// // ... replace '0' with '1'..'4' to force that many components per pixel\n// // ... but 'n' will always be the number that it would have been if you said 0\n// stbi_image_free(data)\n//\n// Standard parameters:\n// int *x -- outputs image width in pixels\n// int *y -- outputs image height in pixels\n// int *channels_in_file -- outputs # of image components in image file\n// int desired_channels -- if non-zero, # of image components requested in result\n//\n// The return value from an image loader is an 'unsigned char *' which points\n// to the pixel data, or NULL on an allocation failure or if the image is\n// corrupt or invalid. The pixel data consists of *y scanlines of *x pixels,\n// with each pixel consisting of N interleaved 8-bit components; the first\n// pixel pointed to is top-left-most in the image. There is no padding between\n// image scanlines or between pixels, regardless of format. The number of\n// components N is 'req_comp' if req_comp is non-zero, or *comp otherwise.\n// If req_comp is non-zero, *comp has the number of components that _would_\n// have been output otherwise. E.g. if you set req_comp to 4, you will always\n// get RGBA output, but you can check *comp to see if it's trivially opaque\n// because e.g. there were only 3 channels in the source image.\n//\n// An output image with N components has the following components interleaved\n// in this order in each pixel:\n//\n// N=#comp components\n// 1 grey\n// 2 grey, alpha\n// 3 red, green, blue\n// 4 red, green, blue, alpha\n//\n// If image loading fails for any reason, the return value will be NULL,\n// and *x, *y, *comp will be unchanged. The function stbi_failure_reason()\n// can be queried for an extremely brief, end-user unfriendly explanation\n// of why the load failed. Define STBI_NO_FAILURE_STRINGS to avoid\n// compiling these strings at all, and STBI_FAILURE_USERMSG to get slightly\n// more user-friendly ones.\n//\n// Paletted PNG, BMP, GIF, and PIC images are automatically depalettized.\n//\n// ===========================================================================\n//\n// Philosophy\n//\n// stb libraries are designed with the following priorities:\n//\n// 1. easy to use\n// 2. easy to maintain\n// 3. good performance\n//\n// Sometimes I let \"good performance\" creep up in priority over \"easy to maintain\",\n// and for best performance I may provide less-easy-to-use APIs that give higher\n// performance, in addition to the easy to use ones. Nevertheless, it's important\n// to keep in mind that from the standpoint of you, a client of this library,\n// all you care about is #1 and #3, and stb libraries do not emphasize #3 above all.\n//\n// Some secondary priorities arise directly from the first two, some of which\n// make more explicit reasons why performance can't be emphasized.\n//\n// - Portable (\"ease of use\")\n// - Small footprint (\"easy to maintain\")\n// - No dependencies (\"ease of use\")\n//\n// ===========================================================================\n//\n// I/O callbacks\n//\n// I/O callbacks allow you to read from arbitrary sources, like packaged\n// files or some other source. Data read from callbacks are processed\n// through a small internal buffer (currently 128 bytes) to try to reduce\n// overhead.\n//\n// The three functions you must define are \"read\" (reads some bytes of data),\n// \"skip\" (skips some bytes of data), \"eof\" (reports if the stream is at the end).\n//\n// ===========================================================================\n//\n// SIMD support\n//\n// The JPEG decoder will try to automatically use SIMD kernels on x86 when\n// supported by the compiler. For ARM Neon support, you must explicitly\n// request it.\n//\n// (The old do-it-yourself SIMD API is no longer supported in the current\n// code.)\n//\n// On x86, SSE2 will automatically be used when available based on a run-time\n// test; if not, the generic C versions are used as a fall-back. On ARM targets,\n// the typical path is to have separate builds for NEON and non-NEON devices\n// (at least this is true for iOS and Android). Therefore, the NEON support is\n// toggled by a build flag: define STBI_NEON to get NEON loops.\n//\n// The output of the JPEG decoder is slightly different from versions where\n// SIMD support was introduced (that is, for versions before 1.49). The\n// difference is only +-1 in the 8-bit RGB channels, and only on a small\n// fraction of pixels. You can force the pre-1.49 behavior by defining\n// STBI_JPEG_OLD, but this will disable some of the SIMD decoding path\n// and hence cost some performance.\n//\n// If for some reason you do not want to use any of SIMD code, or if\n// you have issues compiling it, you can disable it entirely by\n// defining STBI_NO_SIMD.\n//\n// ===========================================================================\n//\n// HDR image support (disable by defining STBI_NO_HDR)\n//\n// stb_image now supports loading HDR images in general, and currently\n// the Radiance .HDR file format, although the support is provided\n// generically. You can still load any file through the existing interface;\n// if you attempt to load an HDR file, it will be automatically remapped to\n// LDR, assuming gamma 2.2 and an arbitrary scale factor defaulting to 1;\n// both of these constants can be reconfigured through this interface:\n//\n// stbi_hdr_to_ldr_gamma(2.2f);\n// stbi_hdr_to_ldr_scale(1.0f);\n//\n// (note, do not use _inverse_ constants; stbi_image will invert them\n// appropriately).\n//\n// Additionally, there is a new, parallel interface for loading files as\n// (linear) floats to preserve the full dynamic range:\n//\n// float *data = stbi_loadf(filename, &x, &y, &n, 0);\n//\n// If you load LDR images through this interface, those images will\n// be promoted to floating point values, run through the inverse of\n// constants corresponding to the above:\n//\n// stbi_ldr_to_hdr_scale(1.0f);\n// stbi_ldr_to_hdr_gamma(2.2f);\n//\n// Finally, given a filename (or an open file or memory block--see header\n// file for details) containing image data, you can query for the \"most\n// appropriate\" interface to use (that is, whether the image is HDR or\n// not), using:\n//\n// stbi_is_hdr(char *filename);\n//\n// ===========================================================================\n//\n// iPhone PNG support:\n//\n// By default we convert iphone-formatted PNGs back to RGB, even though\n// they are internally encoded differently. You can disable this conversion\n// by by calling stbi_convert_iphone_png_to_rgb(0), in which case\n// you will always just get the native iphone \"format\" through (which\n// is BGR stored in RGB).\n//\n// Call stbi_set_unpremultiply_on_load(1) as well to force a divide per\n// pixel to remove any premultiplied alpha *only* if the image file explicitly\n// says there's premultiplied data (currently only happens in iPhone images,\n// and only if iPhone convert-to-rgb processing is on).\n//\n\n\n#ifndef STBI_NO_STDIO\n#include \n#endif // STBI_NO_STDIO\n\n#define STBI_VERSION 1\n\nenum\n{\n STBI_default = 0, // only used for req_comp\n\n STBI_grey = 1,\n STBI_grey_alpha = 2,\n STBI_rgb = 3,\n STBI_rgb_alpha = 4\n};\n\ntypedef unsigned char stbi_uc;\ntypedef unsigned short stbi_us;\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#ifdef STB_IMAGE_STATIC\n#define STBIDEF static\n#else\n#define STBIDEF extern\n#endif\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// PRIMARY API - works on images of any type\n//\n\n//\n// load image by filename, open file, or memory buffer\n//\n\ntypedef struct\n{\n int (*read) (void *user,char *data,int size); // fill 'data' with 'size' bytes. return number of bytes actually read\n void (*skip) (void *user,int n); // skip the next 'n' bytes, or 'unget' the last -n bytes if negative\n int (*eof) (void *user); // returns nonzero if we are at end of file/data\n} stbi_io_callbacks;\n\n////////////////////////////////////\n//\n// 8-bits-per-channel interface\n//\n\nSTBIDEF stbi_uc *stbi_load (char const *filename, int *x, int *y, int *channels_in_file, int desired_channels);\nSTBIDEF stbi_uc *stbi_load_from_memory (stbi_uc const *buffer, int len , int *x, int *y, int *channels_in_file, int desired_channels);\nSTBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk , void *user, int *x, int *y, int *channels_in_file, int desired_channels);\n\n#ifndef STBI_NO_STDIO\nSTBIDEF stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y, int *channels_in_file, int desired_channels);\n// for stbi_load_from_file, file pointer is left pointing immediately after image\n#endif\n\n////////////////////////////////////\n//\n// 16-bits-per-channel interface\n//\n\nSTBIDEF stbi_us *stbi_load_16(char const *filename, int *x, int *y, int *channels_in_file, int desired_channels);\n#ifndef STBI_NO_STDIO\nSTBIDEF stbi_us *stbi_load_from_file_16(FILE *f, int *x, int *y, int *channels_in_file, int desired_channels);\n#endif\n// @TODO the other variants\n\n////////////////////////////////////\n//\n// float-per-channel interface\n//\n#ifndef STBI_NO_LINEAR\n STBIDEF float *stbi_loadf (char const *filename, int *x, int *y, int *channels_in_file, int desired_channels);\n STBIDEF float *stbi_loadf_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *channels_in_file, int desired_channels);\n STBIDEF float *stbi_loadf_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *channels_in_file, int desired_channels);\n\n #ifndef STBI_NO_STDIO\n STBIDEF float *stbi_loadf_from_file (FILE *f, int *x, int *y, int *channels_in_file, int desired_channels);\n #endif\n#endif\n\n#ifndef STBI_NO_HDR\n STBIDEF void stbi_hdr_to_ldr_gamma(float gamma);\n STBIDEF void stbi_hdr_to_ldr_scale(float scale);\n#endif // STBI_NO_HDR\n\n#ifndef STBI_NO_LINEAR\n STBIDEF void stbi_ldr_to_hdr_gamma(float gamma);\n STBIDEF void stbi_ldr_to_hdr_scale(float scale);\n#endif // STBI_NO_LINEAR\n\n// stbi_is_hdr is always defined, but always returns false if STBI_NO_HDR\nSTBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user);\nSTBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len);\n#ifndef STBI_NO_STDIO\nSTBIDEF int stbi_is_hdr (char const *filename);\nSTBIDEF int stbi_is_hdr_from_file(FILE *f);\n#endif // STBI_NO_STDIO\n\n\n// get a VERY brief reason for failure\n// NOT THREADSAFE\nSTBIDEF const char *stbi_failure_reason (void);\n\n// free the loaded image -- this is just free()\nSTBIDEF void stbi_image_free (void *retval_from_stbi_load);\n\n// get image dimensions & components without fully decoding\nSTBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp);\nSTBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp);\n\n#ifndef STBI_NO_STDIO\nSTBIDEF int stbi_info (char const *filename, int *x, int *y, int *comp);\nSTBIDEF int stbi_info_from_file (FILE *f, int *x, int *y, int *comp);\n\n#endif\n\n\n\n// for image formats that explicitly notate that they have premultiplied alpha,\n// we just return the colors as stored in the file. set this flag to force\n// unpremultiplication. results are undefined if the unpremultiply overflow.\nSTBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply);\n\n// indicate whether we should process iphone images back to canonical format,\n// or just pass them through \"as-is\"\nSTBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert);\n\n// flip the image vertically, so the first pixel in the output array is the bottom left\nSTBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip);\n\n// ZLIB client - used by PNG, available for other purposes\n\nSTBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen);\nSTBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header);\nSTBIDEF char *stbi_zlib_decode_malloc(const char *buffer, int len, int *outlen);\nSTBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, const char *ibuffer, int ilen);\n\nSTBIDEF char *stbi_zlib_decode_noheader_malloc(const char *buffer, int len, int *outlen);\nSTBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen);\n\n\n#ifdef __cplusplus\n}\n#endif\n\n//\n//\n//// end header file /////////////////////////////////////////////////////\n#endif // STBI_INCLUDE_STB_IMAGE_H\n\n#ifdef STB_IMAGE_IMPLEMENTATION\n\n#if defined(STBI_ONLY_JPEG) || defined(STBI_ONLY_PNG) || defined(STBI_ONLY_BMP) \\\n || defined(STBI_ONLY_TGA) || defined(STBI_ONLY_GIF) || defined(STBI_ONLY_PSD) \\\n || defined(STBI_ONLY_HDR) || defined(STBI_ONLY_PIC) || defined(STBI_ONLY_PNM) \\\n || defined(STBI_ONLY_ZLIB)\n #ifndef STBI_ONLY_JPEG\n #define STBI_NO_JPEG\n #endif\n #ifndef STBI_ONLY_PNG\n #define STBI_NO_PNG\n #endif\n #ifndef STBI_ONLY_BMP\n #define STBI_NO_BMP\n #endif\n #ifndef STBI_ONLY_PSD\n #define STBI_NO_PSD\n #endif\n #ifndef STBI_ONLY_TGA\n #define STBI_NO_TGA\n #endif\n #ifndef STBI_ONLY_GIF\n #define STBI_NO_GIF\n #endif\n #ifndef STBI_ONLY_HDR\n #define STBI_NO_HDR\n #endif\n #ifndef STBI_ONLY_PIC\n #define STBI_NO_PIC\n #endif\n #ifndef STBI_ONLY_PNM\n #define STBI_NO_PNM\n #endif\n#endif\n\n#if defined(STBI_NO_PNG) && !defined(STBI_SUPPORT_ZLIB) && !defined(STBI_NO_ZLIB)\n#define STBI_NO_ZLIB\n#endif\n\n\n#include \n#include // ptrdiff_t on osx\n#include \n#include \n#include \n\n#if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR)\n#include // ldexp\n#endif\n\n#ifndef STBI_NO_STDIO\n#include \n#endif\n\n#ifndef STBI_ASSERT\n#include \n#define STBI_ASSERT(x) assert(x)\n#endif\n\n\n#ifndef _MSC_VER\n #ifdef __cplusplus\n #define stbi_inline inline\n #else\n #define stbi_inline\n #endif\n#else\n #define stbi_inline __forceinline\n#endif\n\n\n#ifdef _MSC_VER\ntypedef unsigned short stbi__uint16;\ntypedef signed short stbi__int16;\ntypedef unsigned int stbi__uint32;\ntypedef signed int stbi__int32;\n#else\n#include \ntypedef uint16_t stbi__uint16;\ntypedef int16_t stbi__int16;\ntypedef uint32_t stbi__uint32;\ntypedef int32_t stbi__int32;\n#endif\n\n// should produce compiler error if size is wrong\ntypedef unsigned char validate_uint32[sizeof(stbi__uint32)==4 ? 1 : -1];\n\n#ifdef _MSC_VER\n#define STBI_NOTUSED(v) (void)(v)\n#else\n#define STBI_NOTUSED(v) (void)sizeof(v)\n#endif\n\n#ifdef _MSC_VER\n#define STBI_HAS_LROTL\n#endif\n\n#ifdef STBI_HAS_LROTL\n #define stbi_lrot(x,y) _lrotl(x,y)\n#else\n #define stbi_lrot(x,y) (((x) << (y)) | ((x) >> (32 - (y))))\n#endif\n\n#if defined(STBI_MALLOC) && defined(STBI_FREE) && (defined(STBI_REALLOC) || defined(STBI_REALLOC_SIZED))\n// ok\n#elif !defined(STBI_MALLOC) && !defined(STBI_FREE) && !defined(STBI_REALLOC) && !defined(STBI_REALLOC_SIZED)\n// ok\n#else\n#error \"Must define all or none of STBI_MALLOC, STBI_FREE, and STBI_REALLOC (or STBI_REALLOC_SIZED).\"\n#endif\n\n#ifndef STBI_MALLOC\n#define STBI_MALLOC(sz) malloc(sz)\n#define STBI_REALLOC(p,newsz) realloc(p,newsz)\n#define STBI_FREE(p) free(p)\n#endif\n\n#ifndef STBI_REALLOC_SIZED\n#define STBI_REALLOC_SIZED(p,oldsz,newsz) STBI_REALLOC(p,newsz)\n#endif\n\n// x86/x64 detection\n#if defined(__x86_64__) || defined(_M_X64)\n#define STBI__X64_TARGET\n#elif defined(__i386) || defined(_M_IX86)\n#define STBI__X86_TARGET\n#endif\n\n#if defined(__GNUC__) && (defined(STBI__X86_TARGET) || defined(STBI__X64_TARGET)) && !defined(__SSE2__) && !defined(STBI_NO_SIMD)\n// NOTE: not clear do we actually need this for the 64-bit path?\n// gcc doesn't support sse2 intrinsics unless you compile with -msse2,\n// (but compiling with -msse2 allows the compiler to use SSE2 everywhere;\n// this is just broken and gcc are jerks for not fixing it properly\n// http://www.virtualdub.org/blog/pivot/entry.php?id=363 )\n#define STBI_NO_SIMD\n#endif\n\n#if defined(__MINGW32__) && defined(STBI__X86_TARGET) && !defined(STBI_MINGW_ENABLE_SSE2) && !defined(STBI_NO_SIMD)\n// Note that __MINGW32__ doesn't actually mean 32-bit, so we have to avoid STBI__X64_TARGET\n//\n// 32-bit MinGW wants ESP to be 16-byte aligned, but this is not in the\n// Windows ABI and VC++ as well as Windows DLLs don't maintain that invariant.\n// As a result, enabling SSE2 on 32-bit MinGW is dangerous when not\n// simultaneously enabling \"-mstackrealign\".\n//\n// See https://github.com/nothings/stb/issues/81 for more information.\n//\n// So default to no SSE2 on 32-bit MinGW. If you've read this far and added\n// -mstackrealign to your build settings, feel free to #define STBI_MINGW_ENABLE_SSE2.\n#define STBI_NO_SIMD\n#endif\n\n#if !defined(STBI_NO_SIMD) && (defined(STBI__X86_TARGET) || defined(STBI__X64_TARGET))\n#define STBI_SSE2\n#include \n\n#ifdef _MSC_VER\n\n#if _MSC_VER >= 1400 // not VC6\n#include // __cpuid\nstatic int stbi__cpuid3(void)\n{\n int info[4];\n __cpuid(info,1);\n return info[3];\n}\n#else\nstatic int stbi__cpuid3(void)\n{\n int res;\n __asm {\n mov eax,1\n cpuid\n mov res,edx\n }\n return res;\n}\n#endif\n\n#define STBI_SIMD_ALIGN(type, name) __declspec(align(16)) type name\n\nstatic int stbi__sse2_available()\n{\n int info3 = stbi__cpuid3();\n return ((info3 >> 26) & 1) != 0;\n}\n#else // assume GCC-style if not VC++\n#define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16)))\n\nstatic int stbi__sse2_available()\n{\n#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 // GCC 4.8 or later\n // GCC 4.8+ has a nice way to do this\n return __builtin_cpu_supports(\"sse2\");\n#else\n // portable way to do this, preferably without using GCC inline ASM?\n // just bail for now.\n return 0;\n#endif\n}\n#endif\n#endif\n\n// ARM NEON\n#if defined(STBI_NO_SIMD) && defined(STBI_NEON)\n#undef STBI_NEON\n#endif\n\n#ifdef STBI_NEON\n#include \n// assume GCC or Clang on ARM targets\n#define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16)))\n#endif\n\n#ifndef STBI_SIMD_ALIGN\n#define STBI_SIMD_ALIGN(type, name) type name\n#endif\n\n///////////////////////////////////////////////\n//\n// stbi__context struct and start_xxx functions\n\n// stbi__context structure is our basic context used by all images, so it\n// contains all the IO context, plus some basic image information\ntypedef struct\n{\n stbi__uint32 img_x, img_y;\n int img_n, img_out_n;\n\n stbi_io_callbacks io;\n void *io_user_data;\n\n int read_from_callbacks;\n int buflen;\n stbi_uc buffer_start[128];\n\n stbi_uc *img_buffer, *img_buffer_end;\n stbi_uc *img_buffer_original, *img_buffer_original_end;\n} stbi__context;\n\n\nstatic void stbi__refill_buffer(stbi__context *s);\n\n// initialize a memory-decode context\nstatic void stbi__start_mem(stbi__context *s, stbi_uc const *buffer, int len)\n{\n s->io.read = NULL;\n s->read_from_callbacks = 0;\n s->img_buffer = s->img_buffer_original = (stbi_uc *) buffer;\n s->img_buffer_end = s->img_buffer_original_end = (stbi_uc *) buffer+len;\n}\n\n// initialize a callback-based context\nstatic void stbi__start_callbacks(stbi__context *s, stbi_io_callbacks *c, void *user)\n{\n s->io = *c;\n s->io_user_data = user;\n s->buflen = sizeof(s->buffer_start);\n s->read_from_callbacks = 1;\n s->img_buffer_original = s->buffer_start;\n stbi__refill_buffer(s);\n s->img_buffer_original_end = s->img_buffer_end;\n}\n\n#ifndef STBI_NO_STDIO\n\nstatic int stbi__stdio_read(void *user, char *data, int size)\n{\n return (int) fread(data,1,size,(FILE*) user);\n}\n\nstatic void stbi__stdio_skip(void *user, int n)\n{\n fseek((FILE*) user, n, SEEK_CUR);\n}\n\nstatic int stbi__stdio_eof(void *user)\n{\n return feof((FILE*) user);\n}\n\nstatic stbi_io_callbacks stbi__stdio_callbacks =\n{\n stbi__stdio_read,\n stbi__stdio_skip,\n stbi__stdio_eof,\n};\n\nstatic void stbi__start_file(stbi__context *s, FILE *f)\n{\n stbi__start_callbacks(s, &stbi__stdio_callbacks, (void *) f);\n}\n\n//static void stop_file(stbi__context *s) { }\n\n#endif // !STBI_NO_STDIO\n\nstatic void stbi__rewind(stbi__context *s)\n{\n // conceptually rewind SHOULD rewind to the beginning of the stream,\n // but we just rewind to the beginning of the initial buffer, because\n // we only use it after doing 'test', which only ever looks at at most 92 bytes\n s->img_buffer = s->img_buffer_original;\n s->img_buffer_end = s->img_buffer_original_end;\n}\n\nenum\n{\n STBI_ORDER_RGB,\n STBI_ORDER_BGR\n};\n\ntypedef struct\n{\n int bits_per_channel;\n int num_channels;\n int channel_order;\n} stbi__result_info;\n\n#ifndef STBI_NO_JPEG\nstatic int stbi__jpeg_test(stbi__context *s);\nstatic void *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);\nstatic int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp);\n#endif\n\n#ifndef STBI_NO_PNG\nstatic int stbi__png_test(stbi__context *s);\nstatic void *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);\nstatic int stbi__png_info(stbi__context *s, int *x, int *y, int *comp);\n#endif\n\n#ifndef STBI_NO_BMP\nstatic int stbi__bmp_test(stbi__context *s);\nstatic void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);\nstatic int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp);\n#endif\n\n#ifndef STBI_NO_TGA\nstatic int stbi__tga_test(stbi__context *s);\nstatic void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);\nstatic int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp);\n#endif\n\n#ifndef STBI_NO_PSD\nstatic int stbi__psd_test(stbi__context *s);\nstatic void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri, int bpc);\nstatic int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp);\n#endif\n\n#ifndef STBI_NO_HDR\nstatic int stbi__hdr_test(stbi__context *s);\nstatic float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);\nstatic int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp);\n#endif\n\n#ifndef STBI_NO_PIC\nstatic int stbi__pic_test(stbi__context *s);\nstatic void *stbi__pic_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);\nstatic int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp);\n#endif\n\n#ifndef STBI_NO_GIF\nstatic int stbi__gif_test(stbi__context *s);\nstatic void *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);\nstatic int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp);\n#endif\n\n#ifndef STBI_NO_PNM\nstatic int stbi__pnm_test(stbi__context *s);\nstatic void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);\nstatic int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp);\n#endif\n\n// this is not threadsafe\nstatic const char *stbi__g_failure_reason;\n\nSTBIDEF const char *stbi_failure_reason(void)\n{\n return stbi__g_failure_reason;\n}\n\nstatic int stbi__err(const char *str)\n{\n stbi__g_failure_reason = str;\n return 0;\n}\n\nstatic void *stbi__malloc(size_t size)\n{\n return STBI_MALLOC(size);\n}\n\n// stb_image uses ints pervasively, including for offset calculations.\n// therefore the largest decoded image size we can support with the\n// current code, even on 64-bit targets, is INT_MAX. this is not a\n// significant limitation for the intended use case.\n//\n// we do, however, need to make sure our size calculations don't\n// overflow. hence a few helper functions for size calculations that\n// multiply integers together, making sure that they're non-negative\n// and no overflow occurs.\n\n// return 1 if the sum is valid, 0 on overflow.\n// negative terms are considered invalid.\nstatic int stbi__addsizes_valid(int a, int b)\n{\n if (b < 0) return 0;\n // now 0 <= b <= INT_MAX, hence also\n // 0 <= INT_MAX - b <= INTMAX.\n // And \"a + b <= INT_MAX\" (which might overflow) is the\n // same as a <= INT_MAX - b (no overflow)\n return a <= INT_MAX - b;\n}\n\n// returns 1 if the product is valid, 0 on overflow.\n// negative factors are considered invalid.\nstatic int stbi__mul2sizes_valid(int a, int b)\n{\n if (a < 0 || b < 0) return 0;\n if (b == 0) return 1; // mul-by-0 is always safe\n // portable way to check for no overflows in a*b\n return a <= INT_MAX/b;\n}\n\n// returns 1 if \"a*b + add\" has no negative terms/factors and doesn't overflow\nstatic int stbi__mad2sizes_valid(int a, int b, int add)\n{\n return stbi__mul2sizes_valid(a, b) && stbi__addsizes_valid(a*b, add);\n}\n\n// returns 1 if \"a*b*c + add\" has no negative terms/factors and doesn't overflow\nstatic int stbi__mad3sizes_valid(int a, int b, int c, int add)\n{\n return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a*b, c) &&\n stbi__addsizes_valid(a*b*c, add);\n}\n\n// returns 1 if \"a*b*c*d + add\" has no negative terms/factors and doesn't overflow\nstatic int stbi__mad4sizes_valid(int a, int b, int c, int d, int add)\n{\n return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a*b, c) &&\n stbi__mul2sizes_valid(a*b*c, d) && stbi__addsizes_valid(a*b*c*d, add);\n}\n\n// mallocs with size overflow checking\nstatic void *stbi__malloc_mad2(int a, int b, int add)\n{\n if (!stbi__mad2sizes_valid(a, b, add)) return NULL;\n return stbi__malloc(a*b + add);\n}\n\nstatic void *stbi__malloc_mad3(int a, int b, int c, int add)\n{\n if (!stbi__mad3sizes_valid(a, b, c, add)) return NULL;\n return stbi__malloc(a*b*c + add);\n}\n\nstatic void *stbi__malloc_mad4(int a, int b, int c, int d, int add)\n{\n if (!stbi__mad4sizes_valid(a, b, c, d, add)) return NULL;\n return stbi__malloc(a*b*c*d + add);\n}\n\n// stbi__err - error\n// stbi__errpf - error returning pointer to float\n// stbi__errpuc - error returning pointer to unsigned char\n\n#ifdef STBI_NO_FAILURE_STRINGS\n #define stbi__err(x,y) 0\n#elif defined(STBI_FAILURE_USERMSG)\n #define stbi__err(x,y) stbi__err(y)\n#else\n #define stbi__err(x,y) stbi__err(x)\n#endif\n\n#define stbi__errpf(x,y) ((float *)(size_t) (stbi__err(x,y)?NULL:NULL))\n#define stbi__errpuc(x,y) ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))\n\nSTBIDEF void stbi_image_free(void *retval_from_stbi_load)\n{\n STBI_FREE(retval_from_stbi_load);\n}\n\n#ifndef STBI_NO_LINEAR\nstatic float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp);\n#endif\n\n#ifndef STBI_NO_HDR\nstatic stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp);\n#endif\n\nstatic int stbi__vertically_flip_on_load = 0;\n\nSTBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip)\n{\n stbi__vertically_flip_on_load = flag_true_if_should_flip;\n}\n\nstatic void *stbi__load_main(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri, int bpc)\n{\n memset(ri, 0, sizeof(*ri)); // make sure it's initialized if we add new fields\n ri->bits_per_channel = 8; // default is 8 so most paths don't have to be changed\n ri->channel_order = STBI_ORDER_RGB; // all current input & output are this, but this is here so we can add BGR order\n ri->num_channels = 0;\n\n #ifndef STBI_NO_JPEG\n if (stbi__jpeg_test(s)) return stbi__jpeg_load(s,x,y,comp,req_comp, ri);\n #endif\n #ifndef STBI_NO_PNG\n if (stbi__png_test(s)) return stbi__png_load(s,x,y,comp,req_comp, ri);\n #endif\n #ifndef STBI_NO_BMP\n if (stbi__bmp_test(s)) return stbi__bmp_load(s,x,y,comp,req_comp, ri);\n #endif\n #ifndef STBI_NO_GIF\n if (stbi__gif_test(s)) return stbi__gif_load(s,x,y,comp,req_comp, ri);\n #endif\n #ifndef STBI_NO_PSD\n if (stbi__psd_test(s)) return stbi__psd_load(s,x,y,comp,req_comp, ri, bpc);\n #endif\n #ifndef STBI_NO_PIC\n if (stbi__pic_test(s)) return stbi__pic_load(s,x,y,comp,req_comp, ri);\n #endif\n #ifndef STBI_NO_PNM\n if (stbi__pnm_test(s)) return stbi__pnm_load(s,x,y,comp,req_comp, ri);\n #endif\n\n #ifndef STBI_NO_HDR\n if (stbi__hdr_test(s)) {\n float *hdr = stbi__hdr_load(s, x,y,comp,req_comp, ri);\n return stbi__hdr_to_ldr(hdr, *x, *y, req_comp ? req_comp : *comp);\n }\n #endif\n\n #ifndef STBI_NO_TGA\n // test tga last because it's a crappy test!\n if (stbi__tga_test(s))\n return stbi__tga_load(s,x,y,comp,req_comp, ri);\n #endif\n\n return stbi__errpuc(\"unknown image type\", \"Image not of any known type, or corrupt\");\n}\n\nstatic stbi_uc *stbi__convert_16_to_8(stbi__uint16 *orig, int w, int h, int channels)\n{\n int i;\n int img_len = w * h * channels;\n stbi_uc *reduced;\n\n reduced = (stbi_uc *) stbi__malloc(img_len);\n if (reduced == NULL) return stbi__errpuc(\"outofmem\", \"Out of memory\");\n\n for (i = 0; i < img_len; ++i)\n reduced[i] = (stbi_uc)((orig[i] >> 8) & 0xFF); // top half of each byte is sufficient approx of 16->8 bit scaling\n\n STBI_FREE(orig);\n return reduced;\n}\n\nstatic stbi__uint16 *stbi__convert_8_to_16(stbi_uc *orig, int w, int h, int channels)\n{\n int i;\n int img_len = w * h * channels;\n stbi__uint16 *enlarged;\n\n enlarged = (stbi__uint16 *) stbi__malloc(img_len*2);\n if (enlarged == NULL) return (stbi__uint16 *) stbi__errpuc(\"outofmem\", \"Out of memory\");\n\n for (i = 0; i < img_len; ++i)\n enlarged[i] = (stbi__uint16)((orig[i] << 8) + orig[i]); // replicate to high and low byte, maps 0->0, 255->0xffff\n\n STBI_FREE(orig);\n return enlarged;\n}\n\nstatic unsigned char *stbi__load_and_postprocess_8bit(stbi__context *s, int *x, int *y, int *comp, int req_comp)\n{\n stbi__result_info ri;\n void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 8);\n\n if (result == NULL)\n return NULL;\n\n if (ri.bits_per_channel != 8) {\n STBI_ASSERT(ri.bits_per_channel == 16);\n result = stbi__convert_16_to_8((stbi__uint16 *) result, *x, *y, req_comp == 0 ? *comp : req_comp);\n ri.bits_per_channel = 8;\n }\n\n // @TODO: move stbi__convert_format to here\n\n if (stbi__vertically_flip_on_load) {\n int w = *x, h = *y;\n int channels = req_comp ? req_comp : *comp;\n int row,col,z;\n stbi_uc *image = (stbi_uc *) result;\n\n // @OPTIMIZE: use a bigger temp buffer and memcpy multiple pixels at once\n for (row = 0; row < (h>>1); row++) {\n for (col = 0; col < w; col++) {\n for (z = 0; z < channels; z++) {\n stbi_uc temp = image[(row * w + col) * channels + z];\n image[(row * w + col) * channels + z] = image[((h - row - 1) * w + col) * channels + z];\n image[((h - row - 1) * w + col) * channels + z] = temp;\n }\n }\n }\n }\n\n return (unsigned char *) result;\n}\n\nstatic stbi__uint16 *stbi__load_and_postprocess_16bit(stbi__context *s, int *x, int *y, int *comp, int req_comp)\n{\n stbi__result_info ri;\n void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 16);\n\n if (result == NULL)\n return NULL;\n\n if (ri.bits_per_channel != 16) {\n STBI_ASSERT(ri.bits_per_channel == 8);\n result = stbi__convert_8_to_16((stbi_uc *) result, *x, *y, req_comp == 0 ? *comp : req_comp);\n ri.bits_per_channel = 16;\n }\n\n // @TODO: move stbi__convert_format16 to here\n // @TODO: special case RGB-to-Y (and RGBA-to-YA) for 8-bit-to-16-bit case to keep more precision\n\n if (stbi__vertically_flip_on_load) {\n int w = *x, h = *y;\n int channels = req_comp ? req_comp : *comp;\n int row,col,z;\n stbi__uint16 *image = (stbi__uint16 *) result;\n\n // @OPTIMIZE: use a bigger temp buffer and memcpy multiple pixels at once\n for (row = 0; row < (h>>1); row++) {\n for (col = 0; col < w; col++) {\n for (z = 0; z < channels; z++) {\n stbi__uint16 temp = image[(row * w + col) * channels + z];\n image[(row * w + col) * channels + z] = image[((h - row - 1) * w + col) * channels + z];\n image[((h - row - 1) * w + col) * channels + z] = temp;\n }\n }\n }\n }\n\n return (stbi__uint16 *) result;\n}\n\n#ifndef STBI_NO_HDR\nstatic void stbi__float_postprocess(float *result, int *x, int *y, int *comp, int req_comp)\n{\n if (stbi__vertically_flip_on_load && result != NULL) {\n int w = *x, h = *y;\n int depth = req_comp ? req_comp : *comp;\n int row,col,z;\n float temp;\n\n // @OPTIMIZE: use a bigger temp buffer and memcpy multiple pixels at once\n for (row = 0; row < (h>>1); row++) {\n for (col = 0; col < w; col++) {\n for (z = 0; z < depth; z++) {\n temp = result[(row * w + col) * depth + z];\n result[(row * w + col) * depth + z] = result[((h - row - 1) * w + col) * depth + z];\n result[((h - row - 1) * w + col) * depth + z] = temp;\n }\n }\n }\n }\n}\n#endif\n\n#ifndef STBI_NO_STDIO\n\nstatic FILE *stbi__fopen(char const *filename, char const *mode)\n{\n FILE *f;\n#if defined(_MSC_VER) && _MSC_VER >= 1400\n if (0 != fopen_s(&f, filename, mode))\n f=0;\n#else\n f = fopen(filename, mode);\n#endif\n return f;\n}\n\n\nSTBIDEF stbi_uc *stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp)\n{\n FILE *f = stbi__fopen(filename, \"rb\");\n unsigned char *result;\n if (!f) return stbi__errpuc(\"can't fopen\", \"Unable to open file\");\n result = stbi_load_from_file(f,x,y,comp,req_comp);\n fclose(f);\n return result;\n}\n\nSTBIDEF stbi_uc *stbi_load_from_file(FILE *f, int *x, int *y, int *comp, int req_comp)\n{\n unsigned char *result;\n stbi__context s;\n stbi__start_file(&s,f);\n result = stbi__load_and_postprocess_8bit(&s,x,y,comp,req_comp);\n if (result) {\n // need to 'unget' all the characters in the IO buffer\n fseek(f, - (int) (s.img_buffer_end - s.img_buffer), SEEK_CUR);\n }\n return result;\n}\n\nSTBIDEF stbi__uint16 *stbi_load_from_file_16(FILE *f, int *x, int *y, int *comp, int req_comp)\n{\n stbi__uint16 *result;\n stbi__context s;\n stbi__start_file(&s,f);\n result = stbi__load_and_postprocess_16bit(&s,x,y,comp,req_comp);\n if (result) {\n // need to 'unget' all the characters in the IO buffer\n fseek(f, - (int) (s.img_buffer_end - s.img_buffer), SEEK_CUR);\n }\n return result;\n}\n\nSTBIDEF stbi_us *stbi_load_16(char const *filename, int *x, int *y, int *comp, int req_comp)\n{\n FILE *f = stbi__fopen(filename, \"rb\");\n stbi__uint16 *result;\n if (!f) return (stbi_us *) stbi__errpuc(\"can't fopen\", \"Unable to open file\");\n result = stbi_load_from_file_16(f,x,y,comp,req_comp);\n fclose(f);\n return result;\n}\n\n\n#endif //!STBI_NO_STDIO\n\nSTBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)\n{\n stbi__context s;\n stbi__start_mem(&s,buffer,len);\n return stbi__load_and_postprocess_8bit(&s,x,y,comp,req_comp);\n}\n\nSTBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)\n{\n stbi__context s;\n stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user);\n return stbi__load_and_postprocess_8bit(&s,x,y,comp,req_comp);\n}\n\n#ifndef STBI_NO_LINEAR\nstatic float *stbi__loadf_main(stbi__context *s, int *x, int *y, int *comp, int req_comp)\n{\n unsigned char *data;\n #ifndef STBI_NO_HDR\n if (stbi__hdr_test(s)) {\n stbi__result_info ri;\n float *hdr_data = stbi__hdr_load(s,x,y,comp,req_comp, &ri);\n if (hdr_data)\n stbi__float_postprocess(hdr_data,x,y,comp,req_comp);\n return hdr_data;\n }\n #endif\n data = stbi__load_and_postprocess_8bit(s, x, y, comp, req_comp);\n if (data)\n return stbi__ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp);\n return stbi__errpf(\"unknown image type\", \"Image not of any known type, or corrupt\");\n}\n\nSTBIDEF float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)\n{\n stbi__context s;\n stbi__start_mem(&s,buffer,len);\n return stbi__loadf_main(&s,x,y,comp,req_comp);\n}\n\nSTBIDEF float *stbi_loadf_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)\n{\n stbi__context s;\n stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user);\n return stbi__loadf_main(&s,x,y,comp,req_comp);\n}\n\n#ifndef STBI_NO_STDIO\nSTBIDEF float *stbi_loadf(char const *filename, int *x, int *y, int *comp, int req_comp)\n{\n float *result;\n FILE *f = stbi__fopen(filename, \"rb\");\n if (!f) return stbi__errpf(\"can't fopen\", \"Unable to open file\");\n result = stbi_loadf_from_file(f,x,y,comp,req_comp);\n fclose(f);\n return result;\n}\n\nSTBIDEF float *stbi_loadf_from_file(FILE *f, int *x, int *y, int *comp, int req_comp)\n{\n stbi__context s;\n stbi__start_file(&s,f);\n return stbi__loadf_main(&s,x,y,comp,req_comp);\n}\n#endif // !STBI_NO_STDIO\n\n#endif // !STBI_NO_LINEAR\n\n// these is-hdr-or-not is defined independent of whether STBI_NO_LINEAR is\n// defined, for API simplicity; if STBI_NO_LINEAR is defined, it always\n// reports false!\n\nSTBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len)\n{\n #ifndef STBI_NO_HDR\n stbi__context s;\n stbi__start_mem(&s,buffer,len);\n return stbi__hdr_test(&s);\n #else\n STBI_NOTUSED(buffer);\n STBI_NOTUSED(len);\n return 0;\n #endif\n}\n\n#ifndef STBI_NO_STDIO\nSTBIDEF int stbi_is_hdr (char const *filename)\n{\n FILE *f = stbi__fopen(filename, \"rb\");\n int result=0;\n if (f) {\n result = stbi_is_hdr_from_file(f);\n fclose(f);\n }\n return result;\n}\n\nSTBIDEF int stbi_is_hdr_from_file(FILE *f)\n{\n #ifndef STBI_NO_HDR\n stbi__context s;\n stbi__start_file(&s,f);\n return stbi__hdr_test(&s);\n #else\n STBI_NOTUSED(f);\n return 0;\n #endif\n}\n#endif // !STBI_NO_STDIO\n\nSTBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user)\n{\n #ifndef STBI_NO_HDR\n stbi__context s;\n stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user);\n return stbi__hdr_test(&s);\n #else\n STBI_NOTUSED(clbk);\n STBI_NOTUSED(user);\n return 0;\n #endif\n}\n\n#ifndef STBI_NO_LINEAR\nstatic float stbi__l2h_gamma=2.2f, stbi__l2h_scale=1.0f;\n\nSTBIDEF void stbi_ldr_to_hdr_gamma(float gamma) { stbi__l2h_gamma = gamma; }\nSTBIDEF void stbi_ldr_to_hdr_scale(float scale) { stbi__l2h_scale = scale; }\n#endif\n\nstatic float stbi__h2l_gamma_i=1.0f/2.2f, stbi__h2l_scale_i=1.0f;\n\nSTBIDEF void stbi_hdr_to_ldr_gamma(float gamma) { stbi__h2l_gamma_i = 1/gamma; }\nSTBIDEF void stbi_hdr_to_ldr_scale(float scale) { stbi__h2l_scale_i = 1/scale; }\n\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// Common code used by all image loaders\n//\n\nenum\n{\n STBI__SCAN_load=0,\n STBI__SCAN_type,\n STBI__SCAN_header\n};\n\nstatic void stbi__refill_buffer(stbi__context *s)\n{\n int n = (s->io.read)(s->io_user_data,(char*)s->buffer_start,s->buflen);\n if (n == 0) {\n // at end of file, treat same as if from memory, but need to handle case\n // where s->img_buffer isn't pointing to safe memory, e.g. 0-byte file\n s->read_from_callbacks = 0;\n s->img_buffer = s->buffer_start;\n s->img_buffer_end = s->buffer_start+1;\n *s->img_buffer = 0;\n } else {\n s->img_buffer = s->buffer_start;\n s->img_buffer_end = s->buffer_start + n;\n }\n}\n\nstbi_inline static stbi_uc stbi__get8(stbi__context *s)\n{\n if (s->img_buffer < s->img_buffer_end)\n return *s->img_buffer++;\n if (s->read_from_callbacks) {\n stbi__refill_buffer(s);\n return *s->img_buffer++;\n }\n return 0;\n}\n\nstbi_inline static int stbi__at_eof(stbi__context *s)\n{\n if (s->io.read) {\n if (!(s->io.eof)(s->io_user_data)) return 0;\n // if feof() is true, check if buffer = end\n // special case: we've only got the special 0 character at the end\n if (s->read_from_callbacks == 0) return 1;\n }\n\n return s->img_buffer >= s->img_buffer_end;\n}\n\nstatic void stbi__skip(stbi__context *s, int n)\n{\n if (n < 0) {\n s->img_buffer = s->img_buffer_end;\n return;\n }\n if (s->io.read) {\n int blen = (int) (s->img_buffer_end - s->img_buffer);\n if (blen < n) {\n s->img_buffer = s->img_buffer_end;\n (s->io.skip)(s->io_user_data, n - blen);\n return;\n }\n }\n s->img_buffer += n;\n}\n\nstatic int stbi__getn(stbi__context *s, stbi_uc *buffer, int n)\n{\n if (s->io.read) {\n int blen = (int) (s->img_buffer_end - s->img_buffer);\n if (blen < n) {\n int res, count;\n\n memcpy(buffer, s->img_buffer, blen);\n\n count = (s->io.read)(s->io_user_data, (char*) buffer + blen, n - blen);\n res = (count == (n-blen));\n s->img_buffer = s->img_buffer_end;\n return res;\n }\n }\n\n if (s->img_buffer+n <= s->img_buffer_end) {\n memcpy(buffer, s->img_buffer, n);\n s->img_buffer += n;\n return 1;\n } else\n return 0;\n}\n\nstatic int stbi__get16be(stbi__context *s)\n{\n int z = stbi__get8(s);\n return (z << 8) + stbi__get8(s);\n}\n\nstatic stbi__uint32 stbi__get32be(stbi__context *s)\n{\n stbi__uint32 z = stbi__get16be(s);\n return (z << 16) + stbi__get16be(s);\n}\n\n#if defined(STBI_NO_BMP) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF)\n// nothing\n#else\nstatic int stbi__get16le(stbi__context *s)\n{\n int z = stbi__get8(s);\n return z + (stbi__get8(s) << 8);\n}\n#endif\n\n#ifndef STBI_NO_BMP\nstatic stbi__uint32 stbi__get32le(stbi__context *s)\n{\n stbi__uint32 z = stbi__get16le(s);\n return z + (stbi__get16le(s) << 16);\n}\n#endif\n\n#define STBI__BYTECAST(x) ((stbi_uc) ((x) & 255)) // truncate int to byte without warnings\n\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// generic converter from built-in img_n to req_comp\n// individual types do this automatically as much as possible (e.g. jpeg\n// does all cases internally since it needs to colorspace convert anyway,\n// and it never has alpha, so very few cases ). png can automatically\n// interleave an alpha=255 channel, but falls back to this for other cases\n//\n// assume data buffer is malloced, so malloc a new one and free that one\n// only failure mode is malloc failing\n\nstatic stbi_uc stbi__compute_y(int r, int g, int b)\n{\n return (stbi_uc) (((r*77) + (g*150) + (29*b)) >> 8);\n}\n\nstatic unsigned char *stbi__convert_format(unsigned char *data, int img_n, int req_comp, unsigned int x, unsigned int y)\n{\n int i,j;\n unsigned char *good;\n\n if (req_comp == img_n) return data;\n STBI_ASSERT(req_comp >= 1 && req_comp <= 4);\n\n good = (unsigned char *) stbi__malloc_mad3(req_comp, x, y, 0);\n if (good == NULL) {\n STBI_FREE(data);\n return stbi__errpuc(\"outofmem\", \"Out of memory\");\n }\n\n for (j=0; j < (int) y; ++j) {\n unsigned char *src = data + j * x * img_n ;\n unsigned char *dest = good + j * x * req_comp;\n\n #define STBI__COMBO(a,b) ((a)*8+(b))\n #define STBI__CASE(a,b) case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)\n // convert source image with img_n components to one with req_comp components;\n // avoid switch per pixel, so use switch per scanline and massive macros\n switch (STBI__COMBO(img_n, req_comp)) {\n STBI__CASE(1,2) { dest[0]=src[0], dest[1]=255; } break;\n STBI__CASE(1,3) { dest[0]=dest[1]=dest[2]=src[0]; } break;\n STBI__CASE(1,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=255; } break;\n STBI__CASE(2,1) { dest[0]=src[0]; } break;\n STBI__CASE(2,3) { dest[0]=dest[1]=dest[2]=src[0]; } break;\n STBI__CASE(2,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; } break;\n STBI__CASE(3,4) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; } break;\n STBI__CASE(3,1) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); } break;\n STBI__CASE(3,2) { dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = 255; } break;\n STBI__CASE(4,1) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); } break;\n STBI__CASE(4,2) { dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = src[3]; } break;\n STBI__CASE(4,3) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; } break;\n default: STBI_ASSERT(0);\n }\n #undef STBI__CASE\n }\n\n STBI_FREE(data);\n return good;\n}\n\nstatic stbi__uint16 stbi__compute_y_16(int r, int g, int b)\n{\n return (stbi__uint16) (((r*77) + (g*150) + (29*b)) >> 8);\n}\n\nstatic stbi__uint16 *stbi__convert_format16(stbi__uint16 *data, int img_n, int req_comp, unsigned int x, unsigned int y)\n{\n int i,j;\n stbi__uint16 *good;\n\n if (req_comp == img_n) return data;\n STBI_ASSERT(req_comp >= 1 && req_comp <= 4);\n\n good = (stbi__uint16 *) stbi__malloc(req_comp * x * y * 2);\n if (good == NULL) {\n STBI_FREE(data);\n return (stbi__uint16 *) stbi__errpuc(\"outofmem\", \"Out of memory\");\n }\n\n for (j=0; j < (int) y; ++j) {\n stbi__uint16 *src = data + j * x * img_n ;\n stbi__uint16 *dest = good + j * x * req_comp;\n\n #define STBI__COMBO(a,b) ((a)*8+(b))\n #define STBI__CASE(a,b) case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)\n // convert source image with img_n components to one with req_comp components;\n // avoid switch per pixel, so use switch per scanline and massive macros\n switch (STBI__COMBO(img_n, req_comp)) {\n STBI__CASE(1,2) { dest[0]=src[0], dest[1]=0xffff; } break;\n STBI__CASE(1,3) { dest[0]=dest[1]=dest[2]=src[0]; } break;\n STBI__CASE(1,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=0xffff; } break;\n STBI__CASE(2,1) { dest[0]=src[0]; } break;\n STBI__CASE(2,3) { dest[0]=dest[1]=dest[2]=src[0]; } break;\n STBI__CASE(2,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; } break;\n STBI__CASE(3,4) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=0xffff; } break;\n STBI__CASE(3,1) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]); } break;\n STBI__CASE(3,2) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]), dest[1] = 0xffff; } break;\n STBI__CASE(4,1) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]); } break;\n STBI__CASE(4,2) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]), dest[1] = src[3]; } break;\n STBI__CASE(4,3) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; } break;\n default: STBI_ASSERT(0);\n }\n #undef STBI__CASE\n }\n\n STBI_FREE(data);\n return good;\n}\n\n#ifndef STBI_NO_LINEAR\nstatic float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp)\n{\n int i,k,n;\n float *output;\n if (!data) return NULL;\n output = (float *) stbi__malloc_mad4(x, y, comp, sizeof(float), 0);\n if (output == NULL) { STBI_FREE(data); return stbi__errpf(\"outofmem\", \"Out of memory\"); }\n // compute number of non-alpha components\n if (comp & 1) n = comp; else n = comp-1;\n for (i=0; i < x*y; ++i) {\n for (k=0; k < n; ++k) {\n output[i*comp + k] = (float) (pow(data[i*comp+k]/255.0f, stbi__l2h_gamma) * stbi__l2h_scale);\n }\n if (k < comp) output[i*comp + k] = data[i*comp+k]/255.0f;\n }\n STBI_FREE(data);\n return output;\n}\n#endif\n\n#ifndef STBI_NO_HDR\n#define stbi__float2int(x) ((int) (x))\nstatic stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp)\n{\n int i,k,n;\n stbi_uc *output;\n if (!data) return NULL;\n output = (stbi_uc *) stbi__malloc_mad3(x, y, comp, 0);\n if (output == NULL) { STBI_FREE(data); return stbi__errpuc(\"outofmem\", \"Out of memory\"); }\n // compute number of non-alpha components\n if (comp & 1) n = comp; else n = comp-1;\n for (i=0; i < x*y; ++i) {\n for (k=0; k < n; ++k) {\n float z = (float) pow(data[i*comp+k]*stbi__h2l_scale_i, stbi__h2l_gamma_i) * 255 + 0.5f;\n if (z < 0) z = 0;\n if (z > 255) z = 255;\n output[i*comp + k] = (stbi_uc) stbi__float2int(z);\n }\n if (k < comp) {\n float z = data[i*comp+k] * 255 + 0.5f;\n if (z < 0) z = 0;\n if (z > 255) z = 255;\n output[i*comp + k] = (stbi_uc) stbi__float2int(z);\n }\n }\n STBI_FREE(data);\n return output;\n}\n#endif\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// \"baseline\" JPEG/JFIF decoder\n//\n// simple implementation\n// - doesn't support delayed output of y-dimension\n// - simple interface (only one output format: 8-bit interleaved RGB)\n// - doesn't try to recover corrupt jpegs\n// - doesn't allow partial loading, loading multiple at once\n// - still fast on x86 (copying globals into locals doesn't help x86)\n// - allocates lots of intermediate memory (full size of all components)\n// - non-interleaved case requires this anyway\n// - allows good upsampling (see next)\n// high-quality\n// - upsampled channels are bilinearly interpolated, even across blocks\n// - quality integer IDCT derived from IJG's 'slow'\n// performance\n// - fast huffman; reasonable integer IDCT\n// - some SIMD kernels for common paths on targets with SSE2/NEON\n// - uses a lot of intermediate memory, could cache poorly\n\n#ifndef STBI_NO_JPEG\n\n// huffman decoding acceleration\n#define FAST_BITS 9 // larger handles more cases; smaller stomps less cache\n\ntypedef struct\n{\n stbi_uc fast[1 << FAST_BITS];\n // weirdly, repacking this into AoS is a 10% speed loss, instead of a win\n stbi__uint16 code[256];\n stbi_uc values[256];\n stbi_uc size[257];\n unsigned int maxcode[18];\n int delta[17]; // old 'firstsymbol' - old 'firstcode'\n} stbi__huffman;\n\ntypedef struct\n{\n stbi__context *s;\n stbi__huffman huff_dc[4];\n stbi__huffman huff_ac[4];\n stbi_uc dequant[4][64];\n stbi__int16 fast_ac[4][1 << FAST_BITS];\n\n// sizes for components, interleaved MCUs\n int img_h_max, img_v_max;\n int img_mcu_x, img_mcu_y;\n int img_mcu_w, img_mcu_h;\n\n// definition of jpeg image component\n struct\n {\n int id;\n int h,v;\n int tq;\n int hd,ha;\n int dc_pred;\n\n int x,y,w2,h2;\n stbi_uc *data;\n void *raw_data, *raw_coeff;\n stbi_uc *linebuf;\n short *coeff; // progressive only\n int coeff_w, coeff_h; // number of 8x8 coefficient blocks\n } img_comp[4];\n\n stbi__uint32 code_buffer; // jpeg entropy-coded buffer\n int code_bits; // number of valid bits\n unsigned char marker; // marker seen while filling entropy buffer\n int nomore; // flag if we saw a marker so must stop\n\n int progressive;\n int spec_start;\n int spec_end;\n int succ_high;\n int succ_low;\n int eob_run;\n int rgb;\n\n int scan_n, order[4];\n int restart_interval, todo;\n\n// kernels\n void (*idct_block_kernel)(stbi_uc *out, int out_stride, short data[64]);\n void (*YCbCr_to_RGB_kernel)(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step);\n stbi_uc *(*resample_row_hv_2_kernel)(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs);\n} stbi__jpeg;\n\nstatic int stbi__build_huffman(stbi__huffman *h, int *count)\n{\n int i,j,k=0,code;\n // build size list for each symbol (from JPEG spec)\n for (i=0; i < 16; ++i)\n for (j=0; j < count[i]; ++j)\n h->size[k++] = (stbi_uc) (i+1);\n h->size[k] = 0;\n\n // compute actual symbols (from jpeg spec)\n code = 0;\n k = 0;\n for(j=1; j <= 16; ++j) {\n // compute delta to add to code to compute symbol id\n h->delta[j] = k - code;\n if (h->size[k] == j) {\n while (h->size[k] == j)\n h->code[k++] = (stbi__uint16) (code++);\n if (code-1 >= (1 << j)) return stbi__err(\"bad code lengths\",\"Corrupt JPEG\");\n }\n // compute largest code + 1 for this size, preshifted as needed later\n h->maxcode[j] = code << (16-j);\n code <<= 1;\n }\n h->maxcode[j] = 0xffffffff;\n\n // build non-spec acceleration table; 255 is flag for not-accelerated\n memset(h->fast, 255, 1 << FAST_BITS);\n for (i=0; i < k; ++i) {\n int s = h->size[i];\n if (s <= FAST_BITS) {\n int c = h->code[i] << (FAST_BITS-s);\n int m = 1 << (FAST_BITS-s);\n for (j=0; j < m; ++j) {\n h->fast[c+j] = (stbi_uc) i;\n }\n }\n }\n return 1;\n}\n\n// build a table that decodes both magnitude and value of small ACs in\n// one go.\nstatic void stbi__build_fast_ac(stbi__int16 *fast_ac, stbi__huffman *h)\n{\n int i;\n for (i=0; i < (1 << FAST_BITS); ++i) {\n stbi_uc fast = h->fast[i];\n fast_ac[i] = 0;\n if (fast < 255) {\n int rs = h->values[fast];\n int run = (rs >> 4) & 15;\n int magbits = rs & 15;\n int len = h->size[fast];\n\n if (magbits && len + magbits <= FAST_BITS) {\n // magnitude code followed by receive_extend code\n int k = ((i << len) & ((1 << FAST_BITS) - 1)) >> (FAST_BITS - magbits);\n int m = 1 << (magbits - 1);\n if (k < m) k += (-1 << magbits) + 1;\n // if the result is small enough, we can fit it in fast_ac table\n if (k >= -128 && k <= 127)\n fast_ac[i] = (stbi__int16) ((k << 8) + (run << 4) + (len + magbits));\n }\n }\n }\n}\n\nstatic void stbi__grow_buffer_unsafe(stbi__jpeg *j)\n{\n do {\n int b = j->nomore ? 0 : stbi__get8(j->s);\n if (b == 0xff) {\n int c = stbi__get8(j->s);\n if (c != 0) {\n j->marker = (unsigned char) c;\n j->nomore = 1;\n return;\n }\n }\n j->code_buffer |= b << (24 - j->code_bits);\n j->code_bits += 8;\n } while (j->code_bits <= 24);\n}\n\n// (1 << n) - 1\nstatic stbi__uint32 stbi__bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535};\n\n// decode a jpeg huffman value from the bitstream\nstbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffman *h)\n{\n unsigned int temp;\n int c,k;\n\n if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);\n\n // look at the top FAST_BITS and determine what symbol ID it is,\n // if the code is <= FAST_BITS\n c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);\n k = h->fast[c];\n if (k < 255) {\n int s = h->size[k];\n if (s > j->code_bits)\n return -1;\n j->code_buffer <<= s;\n j->code_bits -= s;\n return h->values[k];\n }\n\n // naive test is to shift the code_buffer down so k bits are\n // valid, then test against maxcode. To speed this up, we've\n // preshifted maxcode left so that it has (16-k) 0s at the\n // end; in other words, regardless of the number of bits, it\n // wants to be compared against something shifted to have 16;\n // that way we don't need to shift inside the loop.\n temp = j->code_buffer >> 16;\n for (k=FAST_BITS+1 ; ; ++k)\n if (temp < h->maxcode[k])\n break;\n if (k == 17) {\n // error! code not found\n j->code_bits -= 16;\n return -1;\n }\n\n if (k > j->code_bits)\n return -1;\n\n // convert the huffman code to the symbol id\n c = ((j->code_buffer >> (32 - k)) & stbi__bmask[k]) + h->delta[k];\n STBI_ASSERT((((j->code_buffer) >> (32 - h->size[c])) & stbi__bmask[h->size[c]]) == h->code[c]);\n\n // convert the id to a symbol\n j->code_bits -= k;\n j->code_buffer <<= k;\n return h->values[c];\n}\n\n// bias[n] = (-1<code_bits < n) stbi__grow_buffer_unsafe(j);\n\n sgn = (stbi__int32)j->code_buffer >> 31; // sign bit is always in MSB\n k = stbi_lrot(j->code_buffer, n);\n STBI_ASSERT(n >= 0 && n < (int) (sizeof(stbi__bmask)/sizeof(*stbi__bmask)));\n j->code_buffer = k & ~stbi__bmask[n];\n k &= stbi__bmask[n];\n j->code_bits -= n;\n return k + (stbi__jbias[n] & ~sgn);\n}\n\n// get some unsigned bits\nstbi_inline static int stbi__jpeg_get_bits(stbi__jpeg *j, int n)\n{\n unsigned int k;\n if (j->code_bits < n) stbi__grow_buffer_unsafe(j);\n k = stbi_lrot(j->code_buffer, n);\n j->code_buffer = k & ~stbi__bmask[n];\n k &= stbi__bmask[n];\n j->code_bits -= n;\n return k;\n}\n\nstbi_inline static int stbi__jpeg_get_bit(stbi__jpeg *j)\n{\n unsigned int k;\n if (j->code_bits < 1) stbi__grow_buffer_unsafe(j);\n k = j->code_buffer;\n j->code_buffer <<= 1;\n --j->code_bits;\n return k & 0x80000000;\n}\n\n// given a value that's at position X in the zigzag stream,\n// where does it appear in the 8x8 matrix coded as row-major?\nstatic stbi_uc stbi__jpeg_dezigzag[64+15] =\n{\n 0, 1, 8, 16, 9, 2, 3, 10,\n 17, 24, 32, 25, 18, 11, 4, 5,\n 12, 19, 26, 33, 40, 48, 41, 34,\n 27, 20, 13, 6, 7, 14, 21, 28,\n 35, 42, 49, 56, 57, 50, 43, 36,\n 29, 22, 15, 23, 30, 37, 44, 51,\n 58, 59, 52, 45, 38, 31, 39, 46,\n 53, 60, 61, 54, 47, 55, 62, 63,\n // let corrupt input sample past end\n 63, 63, 63, 63, 63, 63, 63, 63,\n 63, 63, 63, 63, 63, 63, 63\n};\n\n// decode one 64-entry block--\nstatic int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman *hdc, stbi__huffman *hac, stbi__int16 *fac, int b, stbi_uc *dequant)\n{\n int diff,dc,k;\n int t;\n\n if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);\n t = stbi__jpeg_huff_decode(j, hdc);\n if (t < 0) return stbi__err(\"bad huffman code\",\"Corrupt JPEG\");\n\n // 0 all the ac values now so we can do it 32-bits at a time\n memset(data,0,64*sizeof(data[0]));\n\n diff = t ? stbi__extend_receive(j, t) : 0;\n dc = j->img_comp[b].dc_pred + diff;\n j->img_comp[b].dc_pred = dc;\n data[0] = (short) (dc * dequant[0]);\n\n // decode AC components, see JPEG spec\n k = 1;\n do {\n unsigned int zig;\n int c,r,s;\n if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);\n c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);\n r = fac[c];\n if (r) { // fast-AC path\n k += (r >> 4) & 15; // run\n s = r & 15; // combined length\n j->code_buffer <<= s;\n j->code_bits -= s;\n // decode into unzigzag'd location\n zig = stbi__jpeg_dezigzag[k++];\n data[zig] = (short) ((r >> 8) * dequant[zig]);\n } else {\n int rs = stbi__jpeg_huff_decode(j, hac);\n if (rs < 0) return stbi__err(\"bad huffman code\",\"Corrupt JPEG\");\n s = rs & 15;\n r = rs >> 4;\n if (s == 0) {\n if (rs != 0xf0) break; // end block\n k += 16;\n } else {\n k += r;\n // decode into unzigzag'd location\n zig = stbi__jpeg_dezigzag[k++];\n data[zig] = (short) (stbi__extend_receive(j,s) * dequant[zig]);\n }\n }\n } while (k < 64);\n return 1;\n}\n\nstatic int stbi__jpeg_decode_block_prog_dc(stbi__jpeg *j, short data[64], stbi__huffman *hdc, int b)\n{\n int diff,dc;\n int t;\n if (j->spec_end != 0) return stbi__err(\"can't merge dc and ac\", \"Corrupt JPEG\");\n\n if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);\n\n if (j->succ_high == 0) {\n // first scan for DC coefficient, must be first\n memset(data,0,64*sizeof(data[0])); // 0 all the ac values now\n t = stbi__jpeg_huff_decode(j, hdc);\n diff = t ? stbi__extend_receive(j, t) : 0;\n\n dc = j->img_comp[b].dc_pred + diff;\n j->img_comp[b].dc_pred = dc;\n data[0] = (short) (dc << j->succ_low);\n } else {\n // refinement scan for DC coefficient\n if (stbi__jpeg_get_bit(j))\n data[0] += (short) (1 << j->succ_low);\n }\n return 1;\n}\n\n// @OPTIMIZE: store non-zigzagged during the decode passes,\n// and only de-zigzag when dequantizing\nstatic int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64], stbi__huffman *hac, stbi__int16 *fac)\n{\n int k;\n if (j->spec_start == 0) return stbi__err(\"can't merge dc and ac\", \"Corrupt JPEG\");\n\n if (j->succ_high == 0) {\n int shift = j->succ_low;\n\n if (j->eob_run) {\n --j->eob_run;\n return 1;\n }\n\n k = j->spec_start;\n do {\n unsigned int zig;\n int c,r,s;\n if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);\n c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);\n r = fac[c];\n if (r) { // fast-AC path\n k += (r >> 4) & 15; // run\n s = r & 15; // combined length\n j->code_buffer <<= s;\n j->code_bits -= s;\n zig = stbi__jpeg_dezigzag[k++];\n data[zig] = (short) ((r >> 8) << shift);\n } else {\n int rs = stbi__jpeg_huff_decode(j, hac);\n if (rs < 0) return stbi__err(\"bad huffman code\",\"Corrupt JPEG\");\n s = rs & 15;\n r = rs >> 4;\n if (s == 0) {\n if (r < 15) {\n j->eob_run = (1 << r);\n if (r)\n j->eob_run += stbi__jpeg_get_bits(j, r);\n --j->eob_run;\n break;\n }\n k += 16;\n } else {\n k += r;\n zig = stbi__jpeg_dezigzag[k++];\n data[zig] = (short) (stbi__extend_receive(j,s) << shift);\n }\n }\n } while (k <= j->spec_end);\n } else {\n // refinement scan for these AC coefficients\n\n short bit = (short) (1 << j->succ_low);\n\n if (j->eob_run) {\n --j->eob_run;\n for (k = j->spec_start; k <= j->spec_end; ++k) {\n short *p = &data[stbi__jpeg_dezigzag[k]];\n if (*p != 0)\n if (stbi__jpeg_get_bit(j))\n if ((*p & bit)==0) {\n if (*p > 0)\n *p += bit;\n else\n *p -= bit;\n }\n }\n } else {\n k = j->spec_start;\n do {\n int r,s;\n int rs = stbi__jpeg_huff_decode(j, hac); // @OPTIMIZE see if we can use the fast path here, advance-by-r is so slow, eh\n if (rs < 0) return stbi__err(\"bad huffman code\",\"Corrupt JPEG\");\n s = rs & 15;\n r = rs >> 4;\n if (s == 0) {\n if (r < 15) {\n j->eob_run = (1 << r) - 1;\n if (r)\n j->eob_run += stbi__jpeg_get_bits(j, r);\n r = 64; // force end of block\n } else {\n // r=15 s=0 should write 16 0s, so we just do\n // a run of 15 0s and then write s (which is 0),\n // so we don't have to do anything special here\n }\n } else {\n if (s != 1) return stbi__err(\"bad huffman code\", \"Corrupt JPEG\");\n // sign bit\n if (stbi__jpeg_get_bit(j))\n s = bit;\n else\n s = -bit;\n }\n\n // advance by r\n while (k <= j->spec_end) {\n short *p = &data[stbi__jpeg_dezigzag[k++]];\n if (*p != 0) {\n if (stbi__jpeg_get_bit(j))\n if ((*p & bit)==0) {\n if (*p > 0)\n *p += bit;\n else\n *p -= bit;\n }\n } else {\n if (r == 0) {\n *p = (short) s;\n break;\n }\n --r;\n }\n }\n } while (k <= j->spec_end);\n }\n }\n return 1;\n}\n\n// take a -128..127 value and stbi__clamp it and convert to 0..255\nstbi_inline static stbi_uc stbi__clamp(int x)\n{\n // trick to use a single test to catch both cases\n if ((unsigned int) x > 255) {\n if (x < 0) return 0;\n if (x > 255) return 255;\n }\n return (stbi_uc) x;\n}\n\n#define stbi__f2f(x) ((int) (((x) * 4096 + 0.5)))\n#define stbi__fsh(x) ((x) << 12)\n\n// derived from jidctint -- DCT_ISLOW\n#define STBI__IDCT_1D(s0,s1,s2,s3,s4,s5,s6,s7) \\\n int t0,t1,t2,t3,p1,p2,p3,p4,p5,x0,x1,x2,x3; \\\n p2 = s2; \\\n p3 = s6; \\\n p1 = (p2+p3) * stbi__f2f(0.5411961f); \\\n t2 = p1 + p3*stbi__f2f(-1.847759065f); \\\n t3 = p1 + p2*stbi__f2f( 0.765366865f); \\\n p2 = s0; \\\n p3 = s4; \\\n t0 = stbi__fsh(p2+p3); \\\n t1 = stbi__fsh(p2-p3); \\\n x0 = t0+t3; \\\n x3 = t0-t3; \\\n x1 = t1+t2; \\\n x2 = t1-t2; \\\n t0 = s7; \\\n t1 = s5; \\\n t2 = s3; \\\n t3 = s1; \\\n p3 = t0+t2; \\\n p4 = t1+t3; \\\n p1 = t0+t3; \\\n p2 = t1+t2; \\\n p5 = (p3+p4)*stbi__f2f( 1.175875602f); \\\n t0 = t0*stbi__f2f( 0.298631336f); \\\n t1 = t1*stbi__f2f( 2.053119869f); \\\n t2 = t2*stbi__f2f( 3.072711026f); \\\n t3 = t3*stbi__f2f( 1.501321110f); \\\n p1 = p5 + p1*stbi__f2f(-0.899976223f); \\\n p2 = p5 + p2*stbi__f2f(-2.562915447f); \\\n p3 = p3*stbi__f2f(-1.961570560f); \\\n p4 = p4*stbi__f2f(-0.390180644f); \\\n t3 += p1+p4; \\\n t2 += p2+p3; \\\n t1 += p2+p4; \\\n t0 += p1+p3;\n\nstatic void stbi__idct_block(stbi_uc *out, int out_stride, short data[64])\n{\n int i,val[64],*v=val;\n stbi_uc *o;\n short *d = data;\n\n // columns\n for (i=0; i < 8; ++i,++d, ++v) {\n // if all zeroes, shortcut -- this avoids dequantizing 0s and IDCTing\n if (d[ 8]==0 && d[16]==0 && d[24]==0 && d[32]==0\n && d[40]==0 && d[48]==0 && d[56]==0) {\n // no shortcut 0 seconds\n // (1|2|3|4|5|6|7)==0 0 seconds\n // all separate -0.047 seconds\n // 1 && 2|3 && 4|5 && 6|7: -0.047 seconds\n int dcterm = d[0] << 2;\n v[0] = v[8] = v[16] = v[24] = v[32] = v[40] = v[48] = v[56] = dcterm;\n } else {\n STBI__IDCT_1D(d[ 0],d[ 8],d[16],d[24],d[32],d[40],d[48],d[56])\n // constants scaled things up by 1<<12; let's bring them back\n // down, but keep 2 extra bits of precision\n x0 += 512; x1 += 512; x2 += 512; x3 += 512;\n v[ 0] = (x0+t3) >> 10;\n v[56] = (x0-t3) >> 10;\n v[ 8] = (x1+t2) >> 10;\n v[48] = (x1-t2) >> 10;\n v[16] = (x2+t1) >> 10;\n v[40] = (x2-t1) >> 10;\n v[24] = (x3+t0) >> 10;\n v[32] = (x3-t0) >> 10;\n }\n }\n\n for (i=0, v=val, o=out; i < 8; ++i,v+=8,o+=out_stride) {\n // no fast case since the first 1D IDCT spread components out\n STBI__IDCT_1D(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7])\n // constants scaled things up by 1<<12, plus we had 1<<2 from first\n // loop, plus horizontal and vertical each scale by sqrt(8) so together\n // we've got an extra 1<<3, so 1<<17 total we need to remove.\n // so we want to round that, which means adding 0.5 * 1<<17,\n // aka 65536. Also, we'll end up with -128 to 127 that we want\n // to encode as 0..255 by adding 128, so we'll add that before the shift\n x0 += 65536 + (128<<17);\n x1 += 65536 + (128<<17);\n x2 += 65536 + (128<<17);\n x3 += 65536 + (128<<17);\n // tried computing the shifts into temps, or'ing the temps to see\n // if any were out of range, but that was slower\n o[0] = stbi__clamp((x0+t3) >> 17);\n o[7] = stbi__clamp((x0-t3) >> 17);\n o[1] = stbi__clamp((x1+t2) >> 17);\n o[6] = stbi__clamp((x1-t2) >> 17);\n o[2] = stbi__clamp((x2+t1) >> 17);\n o[5] = stbi__clamp((x2-t1) >> 17);\n o[3] = stbi__clamp((x3+t0) >> 17);\n o[4] = stbi__clamp((x3-t0) >> 17);\n }\n}\n\n#ifdef STBI_SSE2\n// sse2 integer IDCT. not the fastest possible implementation but it\n// produces bit-identical results to the generic C version so it's\n// fully \"transparent\".\nstatic void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64])\n{\n // This is constructed to match our regular (generic) integer IDCT exactly.\n __m128i row0, row1, row2, row3, row4, row5, row6, row7;\n __m128i tmp;\n\n // dot product constant: even elems=x, odd elems=y\n #define dct_const(x,y) _mm_setr_epi16((x),(y),(x),(y),(x),(y),(x),(y))\n\n // out(0) = c0[even]*x + c0[odd]*y (c0, x, y 16-bit, out 32-bit)\n // out(1) = c1[even]*x + c1[odd]*y\n #define dct_rot(out0,out1, x,y,c0,c1) \\\n __m128i c0##lo = _mm_unpacklo_epi16((x),(y)); \\\n __m128i c0##hi = _mm_unpackhi_epi16((x),(y)); \\\n __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \\\n __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \\\n __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \\\n __m128i out1##_h = _mm_madd_epi16(c0##hi, c1)\n\n // out = in << 12 (in 16-bit, out 32-bit)\n #define dct_widen(out, in) \\\n __m128i out##_l = _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \\\n __m128i out##_h = _mm_srai_epi32(_mm_unpackhi_epi16(_mm_setzero_si128(), (in)), 4)\n\n // wide add\n #define dct_wadd(out, a, b) \\\n __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \\\n __m128i out##_h = _mm_add_epi32(a##_h, b##_h)\n\n // wide sub\n #define dct_wsub(out, a, b) \\\n __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \\\n __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)\n\n // butterfly a/b, add bias, then shift by \"s\" and pack\n #define dct_bfly32o(out0, out1, a,b,bias,s) \\\n { \\\n __m128i abiased_l = _mm_add_epi32(a##_l, bias); \\\n __m128i abiased_h = _mm_add_epi32(a##_h, bias); \\\n dct_wadd(sum, abiased, b); \\\n dct_wsub(dif, abiased, b); \\\n out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \\\n out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \\\n }\n\n // 8-bit interleave step (for transposes)\n #define dct_interleave8(a, b) \\\n tmp = a; \\\n a = _mm_unpacklo_epi8(a, b); \\\n b = _mm_unpackhi_epi8(tmp, b)\n\n // 16-bit interleave step (for transposes)\n #define dct_interleave16(a, b) \\\n tmp = a; \\\n a = _mm_unpacklo_epi16(a, b); \\\n b = _mm_unpackhi_epi16(tmp, b)\n\n #define dct_pass(bias,shift) \\\n { \\\n /* even part */ \\\n dct_rot(t2e,t3e, row2,row6, rot0_0,rot0_1); \\\n __m128i sum04 = _mm_add_epi16(row0, row4); \\\n __m128i dif04 = _mm_sub_epi16(row0, row4); \\\n dct_widen(t0e, sum04); \\\n dct_widen(t1e, dif04); \\\n dct_wadd(x0, t0e, t3e); \\\n dct_wsub(x3, t0e, t3e); \\\n dct_wadd(x1, t1e, t2e); \\\n dct_wsub(x2, t1e, t2e); \\\n /* odd part */ \\\n dct_rot(y0o,y2o, row7,row3, rot2_0,rot2_1); \\\n dct_rot(y1o,y3o, row5,row1, rot3_0,rot3_1); \\\n __m128i sum17 = _mm_add_epi16(row1, row7); \\\n __m128i sum35 = _mm_add_epi16(row3, row5); \\\n dct_rot(y4o,y5o, sum17,sum35, rot1_0,rot1_1); \\\n dct_wadd(x4, y0o, y4o); \\\n dct_wadd(x5, y1o, y5o); \\\n dct_wadd(x6, y2o, y5o); \\\n dct_wadd(x7, y3o, y4o); \\\n dct_bfly32o(row0,row7, x0,x7,bias,shift); \\\n dct_bfly32o(row1,row6, x1,x6,bias,shift); \\\n dct_bfly32o(row2,row5, x2,x5,bias,shift); \\\n dct_bfly32o(row3,row4, x3,x4,bias,shift); \\\n }\n\n __m128i rot0_0 = dct_const(stbi__f2f(0.5411961f), stbi__f2f(0.5411961f) + stbi__f2f(-1.847759065f));\n __m128i rot0_1 = dct_const(stbi__f2f(0.5411961f) + stbi__f2f( 0.765366865f), stbi__f2f(0.5411961f));\n __m128i rot1_0 = dct_const(stbi__f2f(1.175875602f) + stbi__f2f(-0.899976223f), stbi__f2f(1.175875602f));\n __m128i rot1_1 = dct_const(stbi__f2f(1.175875602f), stbi__f2f(1.175875602f) + stbi__f2f(-2.562915447f));\n __m128i rot2_0 = dct_const(stbi__f2f(-1.961570560f) + stbi__f2f( 0.298631336f), stbi__f2f(-1.961570560f));\n __m128i rot2_1 = dct_const(stbi__f2f(-1.961570560f), stbi__f2f(-1.961570560f) + stbi__f2f( 3.072711026f));\n __m128i rot3_0 = dct_const(stbi__f2f(-0.390180644f) + stbi__f2f( 2.053119869f), stbi__f2f(-0.390180644f));\n __m128i rot3_1 = dct_const(stbi__f2f(-0.390180644f), stbi__f2f(-0.390180644f) + stbi__f2f( 1.501321110f));\n\n // rounding biases in column/row passes, see stbi__idct_block for explanation.\n __m128i bias_0 = _mm_set1_epi32(512);\n __m128i bias_1 = _mm_set1_epi32(65536 + (128<<17));\n\n // load\n row0 = _mm_load_si128((const __m128i *) (data + 0*8));\n row1 = _mm_load_si128((const __m128i *) (data + 1*8));\n row2 = _mm_load_si128((const __m128i *) (data + 2*8));\n row3 = _mm_load_si128((const __m128i *) (data + 3*8));\n row4 = _mm_load_si128((const __m128i *) (data + 4*8));\n row5 = _mm_load_si128((const __m128i *) (data + 5*8));\n row6 = _mm_load_si128((const __m128i *) (data + 6*8));\n row7 = _mm_load_si128((const __m128i *) (data + 7*8));\n\n // column pass\n dct_pass(bias_0, 10);\n\n {\n // 16bit 8x8 transpose pass 1\n dct_interleave16(row0, row4);\n dct_interleave16(row1, row5);\n dct_interleave16(row2, row6);\n dct_interleave16(row3, row7);\n\n // transpose pass 2\n dct_interleave16(row0, row2);\n dct_interleave16(row1, row3);\n dct_interleave16(row4, row6);\n dct_interleave16(row5, row7);\n\n // transpose pass 3\n dct_interleave16(row0, row1);\n dct_interleave16(row2, row3);\n dct_interleave16(row4, row5);\n dct_interleave16(row6, row7);\n }\n\n // row pass\n dct_pass(bias_1, 17);\n\n {\n // pack\n __m128i p0 = _mm_packus_epi16(row0, row1); // a0a1a2a3...a7b0b1b2b3...b7\n __m128i p1 = _mm_packus_epi16(row2, row3);\n __m128i p2 = _mm_packus_epi16(row4, row5);\n __m128i p3 = _mm_packus_epi16(row6, row7);\n\n // 8bit 8x8 transpose pass 1\n dct_interleave8(p0, p2); // a0e0a1e1...\n dct_interleave8(p1, p3); // c0g0c1g1...\n\n // transpose pass 2\n dct_interleave8(p0, p1); // a0c0e0g0...\n dct_interleave8(p2, p3); // b0d0f0h0...\n\n // transpose pass 3\n dct_interleave8(p0, p2); // a0b0c0d0...\n dct_interleave8(p1, p3); // a4b4c4d4...\n\n // store\n _mm_storel_epi64((__m128i *) out, p0); out += out_stride;\n _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p0, 0x4e)); out += out_stride;\n _mm_storel_epi64((__m128i *) out, p2); out += out_stride;\n _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p2, 0x4e)); out += out_stride;\n _mm_storel_epi64((__m128i *) out, p1); out += out_stride;\n _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p1, 0x4e)); out += out_stride;\n _mm_storel_epi64((__m128i *) out, p3); out += out_stride;\n _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p3, 0x4e));\n }\n\n#undef dct_const\n#undef dct_rot\n#undef dct_widen\n#undef dct_wadd\n#undef dct_wsub\n#undef dct_bfly32o\n#undef dct_interleave8\n#undef dct_interleave16\n#undef dct_pass\n}\n\n#endif // STBI_SSE2\n\n#ifdef STBI_NEON\n\n// NEON integer IDCT. should produce bit-identical\n// results to the generic C version.\nstatic void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64])\n{\n int16x8_t row0, row1, row2, row3, row4, row5, row6, row7;\n\n int16x4_t rot0_0 = vdup_n_s16(stbi__f2f(0.5411961f));\n int16x4_t rot0_1 = vdup_n_s16(stbi__f2f(-1.847759065f));\n int16x4_t rot0_2 = vdup_n_s16(stbi__f2f( 0.765366865f));\n int16x4_t rot1_0 = vdup_n_s16(stbi__f2f( 1.175875602f));\n int16x4_t rot1_1 = vdup_n_s16(stbi__f2f(-0.899976223f));\n int16x4_t rot1_2 = vdup_n_s16(stbi__f2f(-2.562915447f));\n int16x4_t rot2_0 = vdup_n_s16(stbi__f2f(-1.961570560f));\n int16x4_t rot2_1 = vdup_n_s16(stbi__f2f(-0.390180644f));\n int16x4_t rot3_0 = vdup_n_s16(stbi__f2f( 0.298631336f));\n int16x4_t rot3_1 = vdup_n_s16(stbi__f2f( 2.053119869f));\n int16x4_t rot3_2 = vdup_n_s16(stbi__f2f( 3.072711026f));\n int16x4_t rot3_3 = vdup_n_s16(stbi__f2f( 1.501321110f));\n\n#define dct_long_mul(out, inq, coeff) \\\n int32x4_t out##_l = vmull_s16(vget_low_s16(inq), coeff); \\\n int32x4_t out##_h = vmull_s16(vget_high_s16(inq), coeff)\n\n#define dct_long_mac(out, acc, inq, coeff) \\\n int32x4_t out##_l = vmlal_s16(acc##_l, vget_low_s16(inq), coeff); \\\n int32x4_t out##_h = vmlal_s16(acc##_h, vget_high_s16(inq), coeff)\n\n#define dct_widen(out, inq) \\\n int32x4_t out##_l = vshll_n_s16(vget_low_s16(inq), 12); \\\n int32x4_t out##_h = vshll_n_s16(vget_high_s16(inq), 12)\n\n// wide add\n#define dct_wadd(out, a, b) \\\n int32x4_t out##_l = vaddq_s32(a##_l, b##_l); \\\n int32x4_t out##_h = vaddq_s32(a##_h, b##_h)\n\n// wide sub\n#define dct_wsub(out, a, b) \\\n int32x4_t out##_l = vsubq_s32(a##_l, b##_l); \\\n int32x4_t out##_h = vsubq_s32(a##_h, b##_h)\n\n// butterfly a/b, then shift using \"shiftop\" by \"s\" and pack\n#define dct_bfly32o(out0,out1, a,b,shiftop,s) \\\n { \\\n dct_wadd(sum, a, b); \\\n dct_wsub(dif, a, b); \\\n out0 = vcombine_s16(shiftop(sum_l, s), shiftop(sum_h, s)); \\\n out1 = vcombine_s16(shiftop(dif_l, s), shiftop(dif_h, s)); \\\n }\n\n#define dct_pass(shiftop, shift) \\\n { \\\n /* even part */ \\\n int16x8_t sum26 = vaddq_s16(row2, row6); \\\n dct_long_mul(p1e, sum26, rot0_0); \\\n dct_long_mac(t2e, p1e, row6, rot0_1); \\\n dct_long_mac(t3e, p1e, row2, rot0_2); \\\n int16x8_t sum04 = vaddq_s16(row0, row4); \\\n int16x8_t dif04 = vsubq_s16(row0, row4); \\\n dct_widen(t0e, sum04); \\\n dct_widen(t1e, dif04); \\\n dct_wadd(x0, t0e, t3e); \\\n dct_wsub(x3, t0e, t3e); \\\n dct_wadd(x1, t1e, t2e); \\\n dct_wsub(x2, t1e, t2e); \\\n /* odd part */ \\\n int16x8_t sum15 = vaddq_s16(row1, row5); \\\n int16x8_t sum17 = vaddq_s16(row1, row7); \\\n int16x8_t sum35 = vaddq_s16(row3, row5); \\\n int16x8_t sum37 = vaddq_s16(row3, row7); \\\n int16x8_t sumodd = vaddq_s16(sum17, sum35); \\\n dct_long_mul(p5o, sumodd, rot1_0); \\\n dct_long_mac(p1o, p5o, sum17, rot1_1); \\\n dct_long_mac(p2o, p5o, sum35, rot1_2); \\\n dct_long_mul(p3o, sum37, rot2_0); \\\n dct_long_mul(p4o, sum15, rot2_1); \\\n dct_wadd(sump13o, p1o, p3o); \\\n dct_wadd(sump24o, p2o, p4o); \\\n dct_wadd(sump23o, p2o, p3o); \\\n dct_wadd(sump14o, p1o, p4o); \\\n dct_long_mac(x4, sump13o, row7, rot3_0); \\\n dct_long_mac(x5, sump24o, row5, rot3_1); \\\n dct_long_mac(x6, sump23o, row3, rot3_2); \\\n dct_long_mac(x7, sump14o, row1, rot3_3); \\\n dct_bfly32o(row0,row7, x0,x7,shiftop,shift); \\\n dct_bfly32o(row1,row6, x1,x6,shiftop,shift); \\\n dct_bfly32o(row2,row5, x2,x5,shiftop,shift); \\\n dct_bfly32o(row3,row4, x3,x4,shiftop,shift); \\\n }\n\n // load\n row0 = vld1q_s16(data + 0*8);\n row1 = vld1q_s16(data + 1*8);\n row2 = vld1q_s16(data + 2*8);\n row3 = vld1q_s16(data + 3*8);\n row4 = vld1q_s16(data + 4*8);\n row5 = vld1q_s16(data + 5*8);\n row6 = vld1q_s16(data + 6*8);\n row7 = vld1q_s16(data + 7*8);\n\n // add DC bias\n row0 = vaddq_s16(row0, vsetq_lane_s16(1024, vdupq_n_s16(0), 0));\n\n // column pass\n dct_pass(vrshrn_n_s32, 10);\n\n // 16bit 8x8 transpose\n {\n// these three map to a single VTRN.16, VTRN.32, and VSWP, respectively.\n// whether compilers actually get this is another story, sadly.\n#define dct_trn16(x, y) { int16x8x2_t t = vtrnq_s16(x, y); x = t.val[0]; y = t.val[1]; }\n#define dct_trn32(x, y) { int32x4x2_t t = vtrnq_s32(vreinterpretq_s32_s16(x), vreinterpretq_s32_s16(y)); x = vreinterpretq_s16_s32(t.val[0]); y = vreinterpretq_s16_s32(t.val[1]); }\n#define dct_trn64(x, y) { int16x8_t x0 = x; int16x8_t y0 = y; x = vcombine_s16(vget_low_s16(x0), vget_low_s16(y0)); y = vcombine_s16(vget_high_s16(x0), vget_high_s16(y0)); }\n\n // pass 1\n dct_trn16(row0, row1); // a0b0a2b2a4b4a6b6\n dct_trn16(row2, row3);\n dct_trn16(row4, row5);\n dct_trn16(row6, row7);\n\n // pass 2\n dct_trn32(row0, row2); // a0b0c0d0a4b4c4d4\n dct_trn32(row1, row3);\n dct_trn32(row4, row6);\n dct_trn32(row5, row7);\n\n // pass 3\n dct_trn64(row0, row4); // a0b0c0d0e0f0g0h0\n dct_trn64(row1, row5);\n dct_trn64(row2, row6);\n dct_trn64(row3, row7);\n\n#undef dct_trn16\n#undef dct_trn32\n#undef dct_trn64\n }\n\n // row pass\n // vrshrn_n_s32 only supports shifts up to 16, we need\n // 17. so do a non-rounding shift of 16 first then follow\n // up with a rounding shift by 1.\n dct_pass(vshrn_n_s32, 16);\n\n {\n // pack and round\n uint8x8_t p0 = vqrshrun_n_s16(row0, 1);\n uint8x8_t p1 = vqrshrun_n_s16(row1, 1);\n uint8x8_t p2 = vqrshrun_n_s16(row2, 1);\n uint8x8_t p3 = vqrshrun_n_s16(row3, 1);\n uint8x8_t p4 = vqrshrun_n_s16(row4, 1);\n uint8x8_t p5 = vqrshrun_n_s16(row5, 1);\n uint8x8_t p6 = vqrshrun_n_s16(row6, 1);\n uint8x8_t p7 = vqrshrun_n_s16(row7, 1);\n\n // again, these can translate into one instruction, but often don't.\n#define dct_trn8_8(x, y) { uint8x8x2_t t = vtrn_u8(x, y); x = t.val[0]; y = t.val[1]; }\n#define dct_trn8_16(x, y) { uint16x4x2_t t = vtrn_u16(vreinterpret_u16_u8(x), vreinterpret_u16_u8(y)); x = vreinterpret_u8_u16(t.val[0]); y = vreinterpret_u8_u16(t.val[1]); }\n#define dct_trn8_32(x, y) { uint32x2x2_t t = vtrn_u32(vreinterpret_u32_u8(x), vreinterpret_u32_u8(y)); x = vreinterpret_u8_u32(t.val[0]); y = vreinterpret_u8_u32(t.val[1]); }\n\n // sadly can't use interleaved stores here since we only write\n // 8 bytes to each scan line!\n\n // 8x8 8-bit transpose pass 1\n dct_trn8_8(p0, p1);\n dct_trn8_8(p2, p3);\n dct_trn8_8(p4, p5);\n dct_trn8_8(p6, p7);\n\n // pass 2\n dct_trn8_16(p0, p2);\n dct_trn8_16(p1, p3);\n dct_trn8_16(p4, p6);\n dct_trn8_16(p5, p7);\n\n // pass 3\n dct_trn8_32(p0, p4);\n dct_trn8_32(p1, p5);\n dct_trn8_32(p2, p6);\n dct_trn8_32(p3, p7);\n\n // store\n vst1_u8(out, p0); out += out_stride;\n vst1_u8(out, p1); out += out_stride;\n vst1_u8(out, p2); out += out_stride;\n vst1_u8(out, p3); out += out_stride;\n vst1_u8(out, p4); out += out_stride;\n vst1_u8(out, p5); out += out_stride;\n vst1_u8(out, p6); out += out_stride;\n vst1_u8(out, p7);\n\n#undef dct_trn8_8\n#undef dct_trn8_16\n#undef dct_trn8_32\n }\n\n#undef dct_long_mul\n#undef dct_long_mac\n#undef dct_widen\n#undef dct_wadd\n#undef dct_wsub\n#undef dct_bfly32o\n#undef dct_pass\n}\n\n#endif // STBI_NEON\n\n#define STBI__MARKER_none 0xff\n// if there's a pending marker from the entropy stream, return that\n// otherwise, fetch from the stream and get a marker. if there's no\n// marker, return 0xff, which is never a valid marker value\nstatic stbi_uc stbi__get_marker(stbi__jpeg *j)\n{\n stbi_uc x;\n if (j->marker != STBI__MARKER_none) { x = j->marker; j->marker = STBI__MARKER_none; return x; }\n x = stbi__get8(j->s);\n if (x != 0xff) return STBI__MARKER_none;\n while (x == 0xff)\n x = stbi__get8(j->s);\n return x;\n}\n\n// in each scan, we'll have scan_n components, and the order\n// of the components is specified by order[]\n#define STBI__RESTART(x) ((x) >= 0xd0 && (x) <= 0xd7)\n\n// after a restart interval, stbi__jpeg_reset the entropy decoder and\n// the dc prediction\nstatic void stbi__jpeg_reset(stbi__jpeg *j)\n{\n j->code_bits = 0;\n j->code_buffer = 0;\n j->nomore = 0;\n j->img_comp[0].dc_pred = j->img_comp[1].dc_pred = j->img_comp[2].dc_pred = 0;\n j->marker = STBI__MARKER_none;\n j->todo = j->restart_interval ? j->restart_interval : 0x7fffffff;\n j->eob_run = 0;\n // no more than 1<<31 MCUs if no restart_interal? that's plenty safe,\n // since we don't even allow 1<<30 pixels\n}\n\nstatic int stbi__parse_entropy_coded_data(stbi__jpeg *z)\n{\n stbi__jpeg_reset(z);\n if (!z->progressive) {\n if (z->scan_n == 1) {\n int i,j;\n STBI_SIMD_ALIGN(short, data[64]);\n int n = z->order[0];\n // non-interleaved data, we just need to process one block at a time,\n // in trivial scanline order\n // number of blocks to do just depends on how many actual \"pixels\" this\n // component has, independent of interleaved MCU blocking and such\n int w = (z->img_comp[n].x+7) >> 3;\n int h = (z->img_comp[n].y+7) >> 3;\n for (j=0; j < h; ++j) {\n for (i=0; i < w; ++i) {\n int ha = z->img_comp[n].ha;\n if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0;\n z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data);\n // every data block is an MCU, so countdown the restart interval\n if (--z->todo <= 0) {\n if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);\n // if it's NOT a restart, then just bail, so we get corrupt data\n // rather than no data\n if (!STBI__RESTART(z->marker)) return 1;\n stbi__jpeg_reset(z);\n }\n }\n }\n return 1;\n } else { // interleaved\n int i,j,k,x,y;\n STBI_SIMD_ALIGN(short, data[64]);\n for (j=0; j < z->img_mcu_y; ++j) {\n for (i=0; i < z->img_mcu_x; ++i) {\n // scan an interleaved mcu... process scan_n components in order\n for (k=0; k < z->scan_n; ++k) {\n int n = z->order[k];\n // scan out an mcu's worth of this component; that's just determined\n // by the basic H and V specified for the component\n for (y=0; y < z->img_comp[n].v; ++y) {\n for (x=0; x < z->img_comp[n].h; ++x) {\n int x2 = (i*z->img_comp[n].h + x)*8;\n int y2 = (j*z->img_comp[n].v + y)*8;\n int ha = z->img_comp[n].ha;\n if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0;\n z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data);\n }\n }\n }\n // after all interleaved components, that's an interleaved MCU,\n // so now count down the restart interval\n if (--z->todo <= 0) {\n if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);\n if (!STBI__RESTART(z->marker)) return 1;\n stbi__jpeg_reset(z);\n }\n }\n }\n return 1;\n }\n } else {\n if (z->scan_n == 1) {\n int i,j;\n int n = z->order[0];\n // non-interleaved data, we just need to process one block at a time,\n // in trivial scanline order\n // number of blocks to do just depends on how many actual \"pixels\" this\n // component has, independent of interleaved MCU blocking and such\n int w = (z->img_comp[n].x+7) >> 3;\n int h = (z->img_comp[n].y+7) >> 3;\n for (j=0; j < h; ++j) {\n for (i=0; i < w; ++i) {\n short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w);\n if (z->spec_start == 0) {\n if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n))\n return 0;\n } else {\n int ha = z->img_comp[n].ha;\n if (!stbi__jpeg_decode_block_prog_ac(z, data, &z->huff_ac[ha], z->fast_ac[ha]))\n return 0;\n }\n // every data block is an MCU, so countdown the restart interval\n if (--z->todo <= 0) {\n if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);\n if (!STBI__RESTART(z->marker)) return 1;\n stbi__jpeg_reset(z);\n }\n }\n }\n return 1;\n } else { // interleaved\n int i,j,k,x,y;\n for (j=0; j < z->img_mcu_y; ++j) {\n for (i=0; i < z->img_mcu_x; ++i) {\n // scan an interleaved mcu... process scan_n components in order\n for (k=0; k < z->scan_n; ++k) {\n int n = z->order[k];\n // scan out an mcu's worth of this component; that's just determined\n // by the basic H and V specified for the component\n for (y=0; y < z->img_comp[n].v; ++y) {\n for (x=0; x < z->img_comp[n].h; ++x) {\n int x2 = (i*z->img_comp[n].h + x);\n int y2 = (j*z->img_comp[n].v + y);\n short *data = z->img_comp[n].coeff + 64 * (x2 + y2 * z->img_comp[n].coeff_w);\n if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n))\n return 0;\n }\n }\n }\n // after all interleaved components, that's an interleaved MCU,\n // so now count down the restart interval\n if (--z->todo <= 0) {\n if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);\n if (!STBI__RESTART(z->marker)) return 1;\n stbi__jpeg_reset(z);\n }\n }\n }\n return 1;\n }\n }\n}\n\nstatic void stbi__jpeg_dequantize(short *data, stbi_uc *dequant)\n{\n int i;\n for (i=0; i < 64; ++i)\n data[i] *= dequant[i];\n}\n\nstatic void stbi__jpeg_finish(stbi__jpeg *z)\n{\n if (z->progressive) {\n // dequantize and idct the data\n int i,j,n;\n for (n=0; n < z->s->img_n; ++n) {\n int w = (z->img_comp[n].x+7) >> 3;\n int h = (z->img_comp[n].y+7) >> 3;\n for (j=0; j < h; ++j) {\n for (i=0; i < w; ++i) {\n short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w);\n stbi__jpeg_dequantize(data, z->dequant[z->img_comp[n].tq]);\n z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data);\n }\n }\n }\n }\n}\n\nstatic int stbi__process_marker(stbi__jpeg *z, int m)\n{\n int L;\n switch (m) {\n case STBI__MARKER_none: // no marker found\n return stbi__err(\"expected marker\",\"Corrupt JPEG\");\n\n case 0xDD: // DRI - specify restart interval\n if (stbi__get16be(z->s) != 4) return stbi__err(\"bad DRI len\",\"Corrupt JPEG\");\n z->restart_interval = stbi__get16be(z->s);\n return 1;\n\n case 0xDB: // DQT - define quantization table\n L = stbi__get16be(z->s)-2;\n while (L > 0) {\n int q = stbi__get8(z->s);\n int p = q >> 4;\n int t = q & 15,i;\n if (p != 0) return stbi__err(\"bad DQT type\",\"Corrupt JPEG\");\n if (t > 3) return stbi__err(\"bad DQT table\",\"Corrupt JPEG\");\n for (i=0; i < 64; ++i)\n z->dequant[t][stbi__jpeg_dezigzag[i]] = stbi__get8(z->s);\n L -= 65;\n }\n return L==0;\n\n case 0xC4: // DHT - define huffman table\n L = stbi__get16be(z->s)-2;\n while (L > 0) {\n stbi_uc *v;\n int sizes[16],i,n=0;\n int q = stbi__get8(z->s);\n int tc = q >> 4;\n int th = q & 15;\n if (tc > 1 || th > 3) return stbi__err(\"bad DHT header\",\"Corrupt JPEG\");\n for (i=0; i < 16; ++i) {\n sizes[i] = stbi__get8(z->s);\n n += sizes[i];\n }\n L -= 17;\n if (tc == 0) {\n if (!stbi__build_huffman(z->huff_dc+th, sizes)) return 0;\n v = z->huff_dc[th].values;\n } else {\n if (!stbi__build_huffman(z->huff_ac+th, sizes)) return 0;\n v = z->huff_ac[th].values;\n }\n for (i=0; i < n; ++i)\n v[i] = stbi__get8(z->s);\n if (tc != 0)\n stbi__build_fast_ac(z->fast_ac[th], z->huff_ac + th);\n L -= n;\n }\n return L==0;\n }\n // check for comment block or APP blocks\n if ((m >= 0xE0 && m <= 0xEF) || m == 0xFE) {\n stbi__skip(z->s, stbi__get16be(z->s)-2);\n return 1;\n }\n return 0;\n}\n\n// after we see SOS\nstatic int stbi__process_scan_header(stbi__jpeg *z)\n{\n int i;\n int Ls = stbi__get16be(z->s);\n z->scan_n = stbi__get8(z->s);\n if (z->scan_n < 1 || z->scan_n > 4 || z->scan_n > (int) z->s->img_n) return stbi__err(\"bad SOS component count\",\"Corrupt JPEG\");\n if (Ls != 6+2*z->scan_n) return stbi__err(\"bad SOS len\",\"Corrupt JPEG\");\n for (i=0; i < z->scan_n; ++i) {\n int id = stbi__get8(z->s), which;\n int q = stbi__get8(z->s);\n for (which = 0; which < z->s->img_n; ++which)\n if (z->img_comp[which].id == id)\n break;\n if (which == z->s->img_n) return 0; // no match\n z->img_comp[which].hd = q >> 4; if (z->img_comp[which].hd > 3) return stbi__err(\"bad DC huff\",\"Corrupt JPEG\");\n z->img_comp[which].ha = q & 15; if (z->img_comp[which].ha > 3) return stbi__err(\"bad AC huff\",\"Corrupt JPEG\");\n z->order[i] = which;\n }\n\n {\n int aa;\n z->spec_start = stbi__get8(z->s);\n z->spec_end = stbi__get8(z->s); // should be 63, but might be 0\n aa = stbi__get8(z->s);\n z->succ_high = (aa >> 4);\n z->succ_low = (aa & 15);\n if (z->progressive) {\n if (z->spec_start > 63 || z->spec_end > 63 || z->spec_start > z->spec_end || z->succ_high > 13 || z->succ_low > 13)\n return stbi__err(\"bad SOS\", \"Corrupt JPEG\");\n } else {\n if (z->spec_start != 0) return stbi__err(\"bad SOS\",\"Corrupt JPEG\");\n if (z->succ_high != 0 || z->succ_low != 0) return stbi__err(\"bad SOS\",\"Corrupt JPEG\");\n z->spec_end = 63;\n }\n }\n\n return 1;\n}\n\nstatic int stbi__free_jpeg_components(stbi__jpeg *z, int ncomp, int why)\n{\n int i;\n for (i=0; i < ncomp; ++i) {\n if (z->img_comp[i].raw_data) {\n STBI_FREE(z->img_comp[i].raw_data);\n z->img_comp[i].raw_data = NULL;\n z->img_comp[i].data = NULL;\n }\n if (z->img_comp[i].raw_coeff) {\n STBI_FREE(z->img_comp[i].raw_coeff);\n z->img_comp[i].raw_coeff = 0;\n z->img_comp[i].coeff = 0;\n }\n if (z->img_comp[i].linebuf) {\n STBI_FREE(z->img_comp[i].linebuf);\n z->img_comp[i].linebuf = NULL;\n }\n }\n return why;\n}\n\nstatic int stbi__process_frame_header(stbi__jpeg *z, int scan)\n{\n stbi__context *s = z->s;\n int Lf,p,i,q, h_max=1,v_max=1,c;\n Lf = stbi__get16be(s); if (Lf < 11) return stbi__err(\"bad SOF len\",\"Corrupt JPEG\"); // JPEG\n p = stbi__get8(s); if (p != 8) return stbi__err(\"only 8-bit\",\"JPEG format not supported: 8-bit only\"); // JPEG baseline\n s->img_y = stbi__get16be(s); if (s->img_y == 0) return stbi__err(\"no header height\", \"JPEG format not supported: delayed height\"); // Legal, but we don't handle it--but neither does IJG\n s->img_x = stbi__get16be(s); if (s->img_x == 0) return stbi__err(\"0 width\",\"Corrupt JPEG\"); // JPEG requires\n c = stbi__get8(s);\n if (c != 3 && c != 1) return stbi__err(\"bad component count\",\"Corrupt JPEG\"); // JFIF requires\n s->img_n = c;\n for (i=0; i < c; ++i) {\n z->img_comp[i].data = NULL;\n z->img_comp[i].linebuf = NULL;\n }\n\n if (Lf != 8+3*s->img_n) return stbi__err(\"bad SOF len\",\"Corrupt JPEG\");\n\n z->rgb = 0;\n for (i=0; i < s->img_n; ++i) {\n static unsigned char rgb[3] = { 'R', 'G', 'B' };\n z->img_comp[i].id = stbi__get8(s);\n if (z->img_comp[i].id != i+1) // JFIF requires\n if (z->img_comp[i].id != i) { // some version of jpegtran outputs non-JFIF-compliant files!\n // somethings output this (see http://fileformats.archiveteam.org/wiki/JPEG#Color_format)\n if (z->img_comp[i].id != rgb[i])\n return stbi__err(\"bad component ID\",\"Corrupt JPEG\");\n ++z->rgb;\n }\n q = stbi__get8(s);\n z->img_comp[i].h = (q >> 4); if (!z->img_comp[i].h || z->img_comp[i].h > 4) return stbi__err(\"bad H\",\"Corrupt JPEG\");\n z->img_comp[i].v = q & 15; if (!z->img_comp[i].v || z->img_comp[i].v > 4) return stbi__err(\"bad V\",\"Corrupt JPEG\");\n z->img_comp[i].tq = stbi__get8(s); if (z->img_comp[i].tq > 3) return stbi__err(\"bad TQ\",\"Corrupt JPEG\");\n }\n\n if (scan != STBI__SCAN_load) return 1;\n\n if (!stbi__mad3sizes_valid(s->img_x, s->img_y, s->img_n, 0)) return stbi__err(\"too large\", \"Image too large to decode\");\n\n for (i=0; i < s->img_n; ++i) {\n if (z->img_comp[i].h > h_max) h_max = z->img_comp[i].h;\n if (z->img_comp[i].v > v_max) v_max = z->img_comp[i].v;\n }\n\n // compute interleaved mcu info\n z->img_h_max = h_max;\n z->img_v_max = v_max;\n z->img_mcu_w = h_max * 8;\n z->img_mcu_h = v_max * 8;\n // these sizes can't be more than 17 bits\n z->img_mcu_x = (s->img_x + z->img_mcu_w-1) / z->img_mcu_w;\n z->img_mcu_y = (s->img_y + z->img_mcu_h-1) / z->img_mcu_h;\n\n for (i=0; i < s->img_n; ++i) {\n // number of effective pixels (e.g. for non-interleaved MCU)\n z->img_comp[i].x = (s->img_x * z->img_comp[i].h + h_max-1) / h_max;\n z->img_comp[i].y = (s->img_y * z->img_comp[i].v + v_max-1) / v_max;\n // to simplify generation, we'll allocate enough memory to decode\n // the bogus oversized data from using interleaved MCUs and their\n // big blocks (e.g. a 16x16 iMCU on an image of width 33); we won't\n // discard the extra data until colorspace conversion\n //\n // img_mcu_x, img_mcu_y: <=17 bits; comp[i].h and .v are <=4 (checked earlier)\n // so these muls can't overflow with 32-bit ints (which we require)\n z->img_comp[i].w2 = z->img_mcu_x * z->img_comp[i].h * 8;\n z->img_comp[i].h2 = z->img_mcu_y * z->img_comp[i].v * 8;\n z->img_comp[i].coeff = 0;\n z->img_comp[i].raw_coeff = 0;\n z->img_comp[i].linebuf = NULL;\n z->img_comp[i].raw_data = stbi__malloc_mad2(z->img_comp[i].w2, z->img_comp[i].h2, 15);\n if (z->img_comp[i].raw_data == NULL)\n return stbi__free_jpeg_components(z, i+1, stbi__err(\"outofmem\", \"Out of memory\"));\n // align blocks for idct using mmx/sse\n z->img_comp[i].data = (stbi_uc*) (((size_t) z->img_comp[i].raw_data + 15) & ~15);\n if (z->progressive) {\n // w2, h2 are multiples of 8 (see above)\n z->img_comp[i].coeff_w = z->img_comp[i].w2 / 8;\n z->img_comp[i].coeff_h = z->img_comp[i].h2 / 8;\n z->img_comp[i].raw_coeff = stbi__malloc_mad3(z->img_comp[i].w2, z->img_comp[i].h2, sizeof(short), 15);\n if (z->img_comp[i].raw_coeff == NULL)\n return stbi__free_jpeg_components(z, i+1, stbi__err(\"outofmem\", \"Out of memory\"));\n z->img_comp[i].coeff = (short*) (((size_t) z->img_comp[i].raw_coeff + 15) & ~15);\n }\n }\n\n return 1;\n}\n\n// use comparisons since in some cases we handle more than one case (e.g. SOF)\n#define stbi__DNL(x) ((x) == 0xdc)\n#define stbi__SOI(x) ((x) == 0xd8)\n#define stbi__EOI(x) ((x) == 0xd9)\n#define stbi__SOF(x) ((x) == 0xc0 || (x) == 0xc1 || (x) == 0xc2)\n#define stbi__SOS(x) ((x) == 0xda)\n\n#define stbi__SOF_progressive(x) ((x) == 0xc2)\n\nstatic int stbi__decode_jpeg_header(stbi__jpeg *z, int scan)\n{\n int m;\n z->marker = STBI__MARKER_none; // initialize cached marker to empty\n m = stbi__get_marker(z);\n if (!stbi__SOI(m)) return stbi__err(\"no SOI\",\"Corrupt JPEG\");\n if (scan == STBI__SCAN_type) return 1;\n m = stbi__get_marker(z);\n while (!stbi__SOF(m)) {\n if (!stbi__process_marker(z,m)) return 0;\n m = stbi__get_marker(z);\n while (m == STBI__MARKER_none) {\n // some files have extra padding after their blocks, so ok, we'll scan\n if (stbi__at_eof(z->s)) return stbi__err(\"no SOF\", \"Corrupt JPEG\");\n m = stbi__get_marker(z);\n }\n }\n z->progressive = stbi__SOF_progressive(m);\n if (!stbi__process_frame_header(z, scan)) return 0;\n return 1;\n}\n\n// decode image to YCbCr format\nstatic int stbi__decode_jpeg_image(stbi__jpeg *j)\n{\n int m;\n for (m = 0; m < 4; m++) {\n j->img_comp[m].raw_data = NULL;\n j->img_comp[m].raw_coeff = NULL;\n }\n j->restart_interval = 0;\n if (!stbi__decode_jpeg_header(j, STBI__SCAN_load)) return 0;\n m = stbi__get_marker(j);\n while (!stbi__EOI(m)) {\n if (stbi__SOS(m)) {\n if (!stbi__process_scan_header(j)) return 0;\n if (!stbi__parse_entropy_coded_data(j)) return 0;\n if (j->marker == STBI__MARKER_none ) {\n // handle 0s at the end of image data from IP Kamera 9060\n while (!stbi__at_eof(j->s)) {\n int x = stbi__get8(j->s);\n if (x == 255) {\n j->marker = stbi__get8(j->s);\n break;\n } else if (x != 0) {\n return stbi__err(\"junk before marker\", \"Corrupt JPEG\");\n }\n }\n // if we reach eof without hitting a marker, stbi__get_marker() below will fail and we'll eventually return 0\n }\n } else {\n if (!stbi__process_marker(j, m)) return 0;\n }\n m = stbi__get_marker(j);\n }\n if (j->progressive)\n stbi__jpeg_finish(j);\n return 1;\n}\n\n// static jfif-centered resampling (across block boundaries)\n\ntypedef stbi_uc *(*resample_row_func)(stbi_uc *out, stbi_uc *in0, stbi_uc *in1,\n int w, int hs);\n\n#define stbi__div4(x) ((stbi_uc) ((x) >> 2))\n\nstatic stbi_uc *resample_row_1(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)\n{\n STBI_NOTUSED(out);\n STBI_NOTUSED(in_far);\n STBI_NOTUSED(w);\n STBI_NOTUSED(hs);\n return in_near;\n}\n\nstatic stbi_uc* stbi__resample_row_v_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)\n{\n // need to generate two samples vertically for every one in input\n int i;\n STBI_NOTUSED(hs);\n for (i=0; i < w; ++i)\n out[i] = stbi__div4(3*in_near[i] + in_far[i] + 2);\n return out;\n}\n\nstatic stbi_uc* stbi__resample_row_h_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)\n{\n // need to generate two samples horizontally for every one in input\n int i;\n stbi_uc *input = in_near;\n\n if (w == 1) {\n // if only one sample, can't do any interpolation\n out[0] = out[1] = input[0];\n return out;\n }\n\n out[0] = input[0];\n out[1] = stbi__div4(input[0]*3 + input[1] + 2);\n for (i=1; i < w-1; ++i) {\n int n = 3*input[i]+2;\n out[i*2+0] = stbi__div4(n+input[i-1]);\n out[i*2+1] = stbi__div4(n+input[i+1]);\n }\n out[i*2+0] = stbi__div4(input[w-2]*3 + input[w-1] + 2);\n out[i*2+1] = input[w-1];\n\n STBI_NOTUSED(in_far);\n STBI_NOTUSED(hs);\n\n return out;\n}\n\n#define stbi__div16(x) ((stbi_uc) ((x) >> 4))\n\nstatic stbi_uc *stbi__resample_row_hv_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)\n{\n // need to generate 2x2 samples for every one in input\n int i,t0,t1;\n if (w == 1) {\n out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2);\n return out;\n }\n\n t1 = 3*in_near[0] + in_far[0];\n out[0] = stbi__div4(t1+2);\n for (i=1; i < w; ++i) {\n t0 = t1;\n t1 = 3*in_near[i]+in_far[i];\n out[i*2-1] = stbi__div16(3*t0 + t1 + 8);\n out[i*2 ] = stbi__div16(3*t1 + t0 + 8);\n }\n out[w*2-1] = stbi__div4(t1+2);\n\n STBI_NOTUSED(hs);\n\n return out;\n}\n\n#if defined(STBI_SSE2) || defined(STBI_NEON)\nstatic stbi_uc *stbi__resample_row_hv_2_simd(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)\n{\n // need to generate 2x2 samples for every one in input\n int i=0,t0,t1;\n\n if (w == 1) {\n out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2);\n return out;\n }\n\n t1 = 3*in_near[0] + in_far[0];\n // process groups of 8 pixels for as long as we can.\n // note we can't handle the last pixel in a row in this loop\n // because we need to handle the filter boundary conditions.\n for (; i < ((w-1) & ~7); i += 8) {\n#if defined(STBI_SSE2)\n // load and perform the vertical filtering pass\n // this uses 3*x + y = 4*x + (y - x)\n __m128i zero = _mm_setzero_si128();\n __m128i farb = _mm_loadl_epi64((__m128i *) (in_far + i));\n __m128i nearb = _mm_loadl_epi64((__m128i *) (in_near + i));\n __m128i farw = _mm_unpacklo_epi8(farb, zero);\n __m128i nearw = _mm_unpacklo_epi8(nearb, zero);\n __m128i diff = _mm_sub_epi16(farw, nearw);\n __m128i nears = _mm_slli_epi16(nearw, 2);\n __m128i curr = _mm_add_epi16(nears, diff); // current row\n\n // horizontal filter works the same based on shifted vers of current\n // row. \"prev\" is current row shifted right by 1 pixel; we need to\n // insert the previous pixel value (from t1).\n // \"next\" is current row shifted left by 1 pixel, with first pixel\n // of next block of 8 pixels added in.\n __m128i prv0 = _mm_slli_si128(curr, 2);\n __m128i nxt0 = _mm_srli_si128(curr, 2);\n __m128i prev = _mm_insert_epi16(prv0, t1, 0);\n __m128i next = _mm_insert_epi16(nxt0, 3*in_near[i+8] + in_far[i+8], 7);\n\n // horizontal filter, polyphase implementation since it's convenient:\n // even pixels = 3*cur + prev = cur*4 + (prev - cur)\n // odd pixels = 3*cur + next = cur*4 + (next - cur)\n // note the shared term.\n __m128i bias = _mm_set1_epi16(8);\n __m128i curs = _mm_slli_epi16(curr, 2);\n __m128i prvd = _mm_sub_epi16(prev, curr);\n __m128i nxtd = _mm_sub_epi16(next, curr);\n __m128i curb = _mm_add_epi16(curs, bias);\n __m128i even = _mm_add_epi16(prvd, curb);\n __m128i odd = _mm_add_epi16(nxtd, curb);\n\n // interleave even and odd pixels, then undo scaling.\n __m128i int0 = _mm_unpacklo_epi16(even, odd);\n __m128i int1 = _mm_unpackhi_epi16(even, odd);\n __m128i de0 = _mm_srli_epi16(int0, 4);\n __m128i de1 = _mm_srli_epi16(int1, 4);\n\n // pack and write output\n __m128i outv = _mm_packus_epi16(de0, de1);\n _mm_storeu_si128((__m128i *) (out + i*2), outv);\n#elif defined(STBI_NEON)\n // load and perform the vertical filtering pass\n // this uses 3*x + y = 4*x + (y - x)\n uint8x8_t farb = vld1_u8(in_far + i);\n uint8x8_t nearb = vld1_u8(in_near + i);\n int16x8_t diff = vreinterpretq_s16_u16(vsubl_u8(farb, nearb));\n int16x8_t nears = vreinterpretq_s16_u16(vshll_n_u8(nearb, 2));\n int16x8_t curr = vaddq_s16(nears, diff); // current row\n\n // horizontal filter works the same based on shifted vers of current\n // row. \"prev\" is current row shifted right by 1 pixel; we need to\n // insert the previous pixel value (from t1).\n // \"next\" is current row shifted left by 1 pixel, with first pixel\n // of next block of 8 pixels added in.\n int16x8_t prv0 = vextq_s16(curr, curr, 7);\n int16x8_t nxt0 = vextq_s16(curr, curr, 1);\n int16x8_t prev = vsetq_lane_s16(t1, prv0, 0);\n int16x8_t next = vsetq_lane_s16(3*in_near[i+8] + in_far[i+8], nxt0, 7);\n\n // horizontal filter, polyphase implementation since it's convenient:\n // even pixels = 3*cur + prev = cur*4 + (prev - cur)\n // odd pixels = 3*cur + next = cur*4 + (next - cur)\n // note the shared term.\n int16x8_t curs = vshlq_n_s16(curr, 2);\n int16x8_t prvd = vsubq_s16(prev, curr);\n int16x8_t nxtd = vsubq_s16(next, curr);\n int16x8_t even = vaddq_s16(curs, prvd);\n int16x8_t odd = vaddq_s16(curs, nxtd);\n\n // undo scaling and round, then store with even/odd phases interleaved\n uint8x8x2_t o;\n o.val[0] = vqrshrun_n_s16(even, 4);\n o.val[1] = vqrshrun_n_s16(odd, 4);\n vst2_u8(out + i*2, o);\n#endif\n\n // \"previous\" value for next iter\n t1 = 3*in_near[i+7] + in_far[i+7];\n }\n\n t0 = t1;\n t1 = 3*in_near[i] + in_far[i];\n out[i*2] = stbi__div16(3*t1 + t0 + 8);\n\n for (++i; i < w; ++i) {\n t0 = t1;\n t1 = 3*in_near[i]+in_far[i];\n out[i*2-1] = stbi__div16(3*t0 + t1 + 8);\n out[i*2 ] = stbi__div16(3*t1 + t0 + 8);\n }\n out[w*2-1] = stbi__div4(t1+2);\n\n STBI_NOTUSED(hs);\n\n return out;\n}\n#endif\n\nstatic stbi_uc *stbi__resample_row_generic(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)\n{\n // resample with nearest-neighbor\n int i,j;\n STBI_NOTUSED(in_far);\n for (i=0; i < w; ++i)\n for (j=0; j < hs; ++j)\n out[i*hs+j] = in_near[i];\n return out;\n}\n\n#ifdef STBI_JPEG_OLD\n// this is the same YCbCr-to-RGB calculation that stb_image has used\n// historically before the algorithm changes in 1.49\n#define float2fixed(x) ((int) ((x) * 65536 + 0.5))\nstatic void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step)\n{\n int i;\n for (i=0; i < count; ++i) {\n int y_fixed = (y[i] << 16) + 32768; // rounding\n int r,g,b;\n int cr = pcr[i] - 128;\n int cb = pcb[i] - 128;\n r = y_fixed + cr*float2fixed(1.40200f);\n g = y_fixed - cr*float2fixed(0.71414f) - cb*float2fixed(0.34414f);\n b = y_fixed + cb*float2fixed(1.77200f);\n r >>= 16;\n g >>= 16;\n b >>= 16;\n if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; }\n if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; }\n if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; }\n out[0] = (stbi_uc)r;\n out[1] = (stbi_uc)g;\n out[2] = (stbi_uc)b;\n out[3] = 255;\n out += step;\n }\n}\n#else\n// this is a reduced-precision calculation of YCbCr-to-RGB introduced\n// to make sure the code produces the same results in both SIMD and scalar\n#define float2fixed(x) (((int) ((x) * 4096.0f + 0.5f)) << 8)\nstatic void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step)\n{\n int i;\n for (i=0; i < count; ++i) {\n int y_fixed = (y[i] << 20) + (1<<19); // rounding\n int r,g,b;\n int cr = pcr[i] - 128;\n int cb = pcb[i] - 128;\n r = y_fixed + cr* float2fixed(1.40200f);\n g = y_fixed + (cr*-float2fixed(0.71414f)) + ((cb*-float2fixed(0.34414f)) & 0xffff0000);\n b = y_fixed + cb* float2fixed(1.77200f);\n r >>= 20;\n g >>= 20;\n b >>= 20;\n if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; }\n if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; }\n if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; }\n out[0] = (stbi_uc)r;\n out[1] = (stbi_uc)g;\n out[2] = (stbi_uc)b;\n out[3] = 255;\n out += step;\n }\n}\n#endif\n\n#if defined(STBI_SSE2) || defined(STBI_NEON)\nstatic void stbi__YCbCr_to_RGB_simd(stbi_uc *out, stbi_uc const *y, stbi_uc const *pcb, stbi_uc const *pcr, int count, int step)\n{\n int i = 0;\n\n#ifdef STBI_SSE2\n // step == 3 is pretty ugly on the final interleave, and i'm not convinced\n // it's useful in practice (you wouldn't use it for textures, for example).\n // so just accelerate step == 4 case.\n if (step == 4) {\n // this is a fairly straightforward implementation and not super-optimized.\n __m128i signflip = _mm_set1_epi8(-0x80);\n __m128i cr_const0 = _mm_set1_epi16( (short) ( 1.40200f*4096.0f+0.5f));\n __m128i cr_const1 = _mm_set1_epi16( - (short) ( 0.71414f*4096.0f+0.5f));\n __m128i cb_const0 = _mm_set1_epi16( - (short) ( 0.34414f*4096.0f+0.5f));\n __m128i cb_const1 = _mm_set1_epi16( (short) ( 1.77200f*4096.0f+0.5f));\n __m128i y_bias = _mm_set1_epi8((char) (unsigned char) 128);\n __m128i xw = _mm_set1_epi16(255); // alpha channel\n\n for (; i+7 < count; i += 8) {\n // load\n __m128i y_bytes = _mm_loadl_epi64((__m128i *) (y+i));\n __m128i cr_bytes = _mm_loadl_epi64((__m128i *) (pcr+i));\n __m128i cb_bytes = _mm_loadl_epi64((__m128i *) (pcb+i));\n __m128i cr_biased = _mm_xor_si128(cr_bytes, signflip); // -128\n __m128i cb_biased = _mm_xor_si128(cb_bytes, signflip); // -128\n\n // unpack to short (and left-shift cr, cb by 8)\n __m128i yw = _mm_unpacklo_epi8(y_bias, y_bytes);\n __m128i crw = _mm_unpacklo_epi8(_mm_setzero_si128(), cr_biased);\n __m128i cbw = _mm_unpacklo_epi8(_mm_setzero_si128(), cb_biased);\n\n // color transform\n __m128i yws = _mm_srli_epi16(yw, 4);\n __m128i cr0 = _mm_mulhi_epi16(cr_const0, crw);\n __m128i cb0 = _mm_mulhi_epi16(cb_const0, cbw);\n __m128i cb1 = _mm_mulhi_epi16(cbw, cb_const1);\n __m128i cr1 = _mm_mulhi_epi16(crw, cr_const1);\n __m128i rws = _mm_add_epi16(cr0, yws);\n __m128i gwt = _mm_add_epi16(cb0, yws);\n __m128i bws = _mm_add_epi16(yws, cb1);\n __m128i gws = _mm_add_epi16(gwt, cr1);\n\n // descale\n __m128i rw = _mm_srai_epi16(rws, 4);\n __m128i bw = _mm_srai_epi16(bws, 4);\n __m128i gw = _mm_srai_epi16(gws, 4);\n\n // back to byte, set up for transpose\n __m128i brb = _mm_packus_epi16(rw, bw);\n __m128i gxb = _mm_packus_epi16(gw, xw);\n\n // transpose to interleave channels\n __m128i t0 = _mm_unpacklo_epi8(brb, gxb);\n __m128i t1 = _mm_unpackhi_epi8(brb, gxb);\n __m128i o0 = _mm_unpacklo_epi16(t0, t1);\n __m128i o1 = _mm_unpackhi_epi16(t0, t1);\n\n // store\n _mm_storeu_si128((__m128i *) (out + 0), o0);\n _mm_storeu_si128((__m128i *) (out + 16), o1);\n out += 32;\n }\n }\n#endif\n\n#ifdef STBI_NEON\n // in this version, step=3 support would be easy to add. but is there demand?\n if (step == 4) {\n // this is a fairly straightforward implementation and not super-optimized.\n uint8x8_t signflip = vdup_n_u8(0x80);\n int16x8_t cr_const0 = vdupq_n_s16( (short) ( 1.40200f*4096.0f+0.5f));\n int16x8_t cr_const1 = vdupq_n_s16( - (short) ( 0.71414f*4096.0f+0.5f));\n int16x8_t cb_const0 = vdupq_n_s16( - (short) ( 0.34414f*4096.0f+0.5f));\n int16x8_t cb_const1 = vdupq_n_s16( (short) ( 1.77200f*4096.0f+0.5f));\n\n for (; i+7 < count; i += 8) {\n // load\n uint8x8_t y_bytes = vld1_u8(y + i);\n uint8x8_t cr_bytes = vld1_u8(pcr + i);\n uint8x8_t cb_bytes = vld1_u8(pcb + i);\n int8x8_t cr_biased = vreinterpret_s8_u8(vsub_u8(cr_bytes, signflip));\n int8x8_t cb_biased = vreinterpret_s8_u8(vsub_u8(cb_bytes, signflip));\n\n // expand to s16\n int16x8_t yws = vreinterpretq_s16_u16(vshll_n_u8(y_bytes, 4));\n int16x8_t crw = vshll_n_s8(cr_biased, 7);\n int16x8_t cbw = vshll_n_s8(cb_biased, 7);\n\n // color transform\n int16x8_t cr0 = vqdmulhq_s16(crw, cr_const0);\n int16x8_t cb0 = vqdmulhq_s16(cbw, cb_const0);\n int16x8_t cr1 = vqdmulhq_s16(crw, cr_const1);\n int16x8_t cb1 = vqdmulhq_s16(cbw, cb_const1);\n int16x8_t rws = vaddq_s16(yws, cr0);\n int16x8_t gws = vaddq_s16(vaddq_s16(yws, cb0), cr1);\n int16x8_t bws = vaddq_s16(yws, cb1);\n\n // undo scaling, round, convert to byte\n uint8x8x4_t o;\n o.val[0] = vqrshrun_n_s16(rws, 4);\n o.val[1] = vqrshrun_n_s16(gws, 4);\n o.val[2] = vqrshrun_n_s16(bws, 4);\n o.val[3] = vdup_n_u8(255);\n\n // store, interleaving r/g/b/a\n vst4_u8(out, o);\n out += 8*4;\n }\n }\n#endif\n\n for (; i < count; ++i) {\n int y_fixed = (y[i] << 20) + (1<<19); // rounding\n int r,g,b;\n int cr = pcr[i] - 128;\n int cb = pcb[i] - 128;\n r = y_fixed + cr* float2fixed(1.40200f);\n g = y_fixed + cr*-float2fixed(0.71414f) + ((cb*-float2fixed(0.34414f)) & 0xffff0000);\n b = y_fixed + cb* float2fixed(1.77200f);\n r >>= 20;\n g >>= 20;\n b >>= 20;\n if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; }\n if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; }\n if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; }\n out[0] = (stbi_uc)r;\n out[1] = (stbi_uc)g;\n out[2] = (stbi_uc)b;\n out[3] = 255;\n out += step;\n }\n}\n#endif\n\n// set up the kernels\nstatic void stbi__setup_jpeg(stbi__jpeg *j)\n{\n j->idct_block_kernel = stbi__idct_block;\n j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_row;\n j->resample_row_hv_2_kernel = stbi__resample_row_hv_2;\n\n#ifdef STBI_SSE2\n if (stbi__sse2_available()) {\n j->idct_block_kernel = stbi__idct_simd;\n #ifndef STBI_JPEG_OLD\n j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd;\n #endif\n j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd;\n }\n#endif\n\n#ifdef STBI_NEON\n j->idct_block_kernel = stbi__idct_simd;\n #ifndef STBI_JPEG_OLD\n j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd;\n #endif\n j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd;\n#endif\n}\n\n// clean up the temporary component buffers\nstatic void stbi__cleanup_jpeg(stbi__jpeg *j)\n{\n stbi__free_jpeg_components(j, j->s->img_n, 0);\n}\n\ntypedef struct\n{\n resample_row_func resample;\n stbi_uc *line0,*line1;\n int hs,vs; // expansion factor in each axis\n int w_lores; // horizontal pixels pre-expansion\n int ystep; // how far through vertical expansion we are\n int ypos; // which pre-expansion row we're on\n} stbi__resample;\n\nstatic stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp, int req_comp)\n{\n int n, decode_n;\n z->s->img_n = 0; // make stbi__cleanup_jpeg safe\n\n // validate req_comp\n if (req_comp < 0 || req_comp > 4) return stbi__errpuc(\"bad req_comp\", \"Internal error\");\n\n // load a jpeg image from whichever source, but leave in YCbCr format\n if (!stbi__decode_jpeg_image(z)) { stbi__cleanup_jpeg(z); return NULL; }\n\n // determine actual number of components to generate\n n = req_comp ? req_comp : z->s->img_n;\n\n if (z->s->img_n == 3 && n < 3)\n decode_n = 1;\n else\n decode_n = z->s->img_n;\n\n // resample and color-convert\n {\n int k;\n unsigned int i,j;\n stbi_uc *output;\n stbi_uc *coutput[4];\n\n stbi__resample res_comp[4];\n\n for (k=0; k < decode_n; ++k) {\n stbi__resample *r = &res_comp[k];\n\n // allocate line buffer big enough for upsampling off the edges\n // with upsample factor of 4\n z->img_comp[k].linebuf = (stbi_uc *) stbi__malloc(z->s->img_x + 3);\n if (!z->img_comp[k].linebuf) { stbi__cleanup_jpeg(z); return stbi__errpuc(\"outofmem\", \"Out of memory\"); }\n\n r->hs = z->img_h_max / z->img_comp[k].h;\n r->vs = z->img_v_max / z->img_comp[k].v;\n r->ystep = r->vs >> 1;\n r->w_lores = (z->s->img_x + r->hs-1) / r->hs;\n r->ypos = 0;\n r->line0 = r->line1 = z->img_comp[k].data;\n\n if (r->hs == 1 && r->vs == 1) r->resample = resample_row_1;\n else if (r->hs == 1 && r->vs == 2) r->resample = stbi__resample_row_v_2;\n else if (r->hs == 2 && r->vs == 1) r->resample = stbi__resample_row_h_2;\n else if (r->hs == 2 && r->vs == 2) r->resample = z->resample_row_hv_2_kernel;\n else r->resample = stbi__resample_row_generic;\n }\n\n // can't error after this so, this is safe\n output = (stbi_uc *) stbi__malloc_mad3(n, z->s->img_x, z->s->img_y, 1);\n if (!output) { stbi__cleanup_jpeg(z); return stbi__errpuc(\"outofmem\", \"Out of memory\"); }\n\n // now go ahead and resample\n for (j=0; j < z->s->img_y; ++j) {\n stbi_uc *out = output + n * z->s->img_x * j;\n for (k=0; k < decode_n; ++k) {\n stbi__resample *r = &res_comp[k];\n int y_bot = r->ystep >= (r->vs >> 1);\n coutput[k] = r->resample(z->img_comp[k].linebuf,\n y_bot ? r->line1 : r->line0,\n y_bot ? r->line0 : r->line1,\n r->w_lores, r->hs);\n if (++r->ystep >= r->vs) {\n r->ystep = 0;\n r->line0 = r->line1;\n if (++r->ypos < z->img_comp[k].y)\n r->line1 += z->img_comp[k].w2;\n }\n }\n if (n >= 3) {\n stbi_uc *y = coutput[0];\n if (z->s->img_n == 3) {\n if (z->rgb == 3) {\n for (i=0; i < z->s->img_x; ++i) {\n out[0] = y[i];\n out[1] = coutput[1][i];\n out[2] = coutput[2][i];\n out[3] = 255;\n out += n;\n }\n } else {\n z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n);\n }\n } else\n for (i=0; i < z->s->img_x; ++i) {\n out[0] = out[1] = out[2] = y[i];\n out[3] = 255; // not used if n==3\n out += n;\n }\n } else {\n stbi_uc *y = coutput[0];\n if (n == 1)\n for (i=0; i < z->s->img_x; ++i) out[i] = y[i];\n else\n for (i=0; i < z->s->img_x; ++i) *out++ = y[i], *out++ = 255;\n }\n }\n stbi__cleanup_jpeg(z);\n *out_x = z->s->img_x;\n *out_y = z->s->img_y;\n if (comp) *comp = z->s->img_n; // report original components, not output\n return output;\n }\n}\n\nstatic void *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)\n{\n unsigned char* result;\n stbi__jpeg* j = (stbi__jpeg*) stbi__malloc(sizeof(stbi__jpeg));\n j->s = s;\n stbi__setup_jpeg(j);\n result = load_jpeg_image(j, x,y,comp,req_comp);\n STBI_FREE(j);\n return result;\n}\n\nstatic int stbi__jpeg_test(stbi__context *s)\n{\n int r;\n stbi__jpeg j;\n j.s = s;\n stbi__setup_jpeg(&j);\n r = stbi__decode_jpeg_header(&j, STBI__SCAN_type);\n stbi__rewind(s);\n return r;\n}\n\nstatic int stbi__jpeg_info_raw(stbi__jpeg *j, int *x, int *y, int *comp)\n{\n if (!stbi__decode_jpeg_header(j, STBI__SCAN_header)) {\n stbi__rewind( j->s );\n return 0;\n }\n if (x) *x = j->s->img_x;\n if (y) *y = j->s->img_y;\n if (comp) *comp = j->s->img_n;\n return 1;\n}\n\nstatic int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp)\n{\n int result;\n stbi__jpeg* j = (stbi__jpeg*) (stbi__malloc(sizeof(stbi__jpeg)));\n j->s = s;\n result = stbi__jpeg_info_raw(j, x, y, comp);\n STBI_FREE(j);\n return result;\n}\n#endif\n\n// public domain zlib decode v0.2 Sean Barrett 2006-11-18\n// simple implementation\n// - all input must be provided in an upfront buffer\n// - all output is written to a single output buffer (can malloc/realloc)\n// performance\n// - fast huffman\n\n#ifndef STBI_NO_ZLIB\n\n// fast-way is faster to check than jpeg huffman, but slow way is slower\n#define STBI__ZFAST_BITS 9 // accelerate all cases in default tables\n#define STBI__ZFAST_MASK ((1 << STBI__ZFAST_BITS) - 1)\n\n// zlib-style huffman encoding\n// (jpegs packs from left, zlib from right, so can't share code)\ntypedef struct\n{\n stbi__uint16 fast[1 << STBI__ZFAST_BITS];\n stbi__uint16 firstcode[16];\n int maxcode[17];\n stbi__uint16 firstsymbol[16];\n stbi_uc size[288];\n stbi__uint16 value[288];\n} stbi__zhuffman;\n\nstbi_inline static int stbi__bitreverse16(int n)\n{\n n = ((n & 0xAAAA) >> 1) | ((n & 0x5555) << 1);\n n = ((n & 0xCCCC) >> 2) | ((n & 0x3333) << 2);\n n = ((n & 0xF0F0) >> 4) | ((n & 0x0F0F) << 4);\n n = ((n & 0xFF00) >> 8) | ((n & 0x00FF) << 8);\n return n;\n}\n\nstbi_inline static int stbi__bit_reverse(int v, int bits)\n{\n STBI_ASSERT(bits <= 16);\n // to bit reverse n bits, reverse 16 and shift\n // e.g. 11 bits, bit reverse and shift away 5\n return stbi__bitreverse16(v) >> (16-bits);\n}\n\nstatic int stbi__zbuild_huffman(stbi__zhuffman *z, stbi_uc *sizelist, int num)\n{\n int i,k=0;\n int code, next_code[16], sizes[17];\n\n // DEFLATE spec for generating codes\n memset(sizes, 0, sizeof(sizes));\n memset(z->fast, 0, sizeof(z->fast));\n for (i=0; i < num; ++i)\n ++sizes[sizelist[i]];\n sizes[0] = 0;\n for (i=1; i < 16; ++i)\n if (sizes[i] > (1 << i))\n return stbi__err(\"bad sizes\", \"Corrupt PNG\");\n code = 0;\n for (i=1; i < 16; ++i) {\n next_code[i] = code;\n z->firstcode[i] = (stbi__uint16) code;\n z->firstsymbol[i] = (stbi__uint16) k;\n code = (code + sizes[i]);\n if (sizes[i])\n if (code-1 >= (1 << i)) return stbi__err(\"bad codelengths\",\"Corrupt PNG\");\n z->maxcode[i] = code << (16-i); // preshift for inner loop\n code <<= 1;\n k += sizes[i];\n }\n z->maxcode[16] = 0x10000; // sentinel\n for (i=0; i < num; ++i) {\n int s = sizelist[i];\n if (s) {\n int c = next_code[s] - z->firstcode[s] + z->firstsymbol[s];\n stbi__uint16 fastv = (stbi__uint16) ((s << 9) | i);\n z->size [c] = (stbi_uc ) s;\n z->value[c] = (stbi__uint16) i;\n if (s <= STBI__ZFAST_BITS) {\n int j = stbi__bit_reverse(next_code[s],s);\n while (j < (1 << STBI__ZFAST_BITS)) {\n z->fast[j] = fastv;\n j += (1 << s);\n }\n }\n ++next_code[s];\n }\n }\n return 1;\n}\n\n// zlib-from-memory implementation for PNG reading\n// because PNG allows splitting the zlib stream arbitrarily,\n// and it's annoying structurally to have PNG call ZLIB call PNG,\n// we require PNG read all the IDATs and combine them into a single\n// memory buffer\n\ntypedef struct\n{\n stbi_uc *zbuffer, *zbuffer_end;\n int num_bits;\n stbi__uint32 code_buffer;\n\n char *zout;\n char *zout_start;\n char *zout_end;\n int z_expandable;\n\n stbi__zhuffman z_length, z_distance;\n} stbi__zbuf;\n\nstbi_inline static stbi_uc stbi__zget8(stbi__zbuf *z)\n{\n if (z->zbuffer >= z->zbuffer_end) return 0;\n return *z->zbuffer++;\n}\n\nstatic void stbi__fill_bits(stbi__zbuf *z)\n{\n do {\n STBI_ASSERT(z->code_buffer < (1U << z->num_bits));\n z->code_buffer |= (unsigned int) stbi__zget8(z) << z->num_bits;\n z->num_bits += 8;\n } while (z->num_bits <= 24);\n}\n\nstbi_inline static unsigned int stbi__zreceive(stbi__zbuf *z, int n)\n{\n unsigned int k;\n if (z->num_bits < n) stbi__fill_bits(z);\n k = z->code_buffer & ((1 << n) - 1);\n z->code_buffer >>= n;\n z->num_bits -= n;\n return k;\n}\n\nstatic int stbi__zhuffman_decode_slowpath(stbi__zbuf *a, stbi__zhuffman *z)\n{\n int b,s,k;\n // not resolved by fast table, so compute it the slow way\n // use jpeg approach, which requires MSbits at top\n k = stbi__bit_reverse(a->code_buffer, 16);\n for (s=STBI__ZFAST_BITS+1; ; ++s)\n if (k < z->maxcode[s])\n break;\n if (s == 16) return -1; // invalid code!\n // code size is s, so:\n b = (k >> (16-s)) - z->firstcode[s] + z->firstsymbol[s];\n STBI_ASSERT(z->size[b] == s);\n a->code_buffer >>= s;\n a->num_bits -= s;\n return z->value[b];\n}\n\nstbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z)\n{\n int b,s;\n if (a->num_bits < 16) stbi__fill_bits(a);\n b = z->fast[a->code_buffer & STBI__ZFAST_MASK];\n if (b) {\n s = b >> 9;\n a->code_buffer >>= s;\n a->num_bits -= s;\n return b & 511;\n }\n return stbi__zhuffman_decode_slowpath(a, z);\n}\n\nstatic int stbi__zexpand(stbi__zbuf *z, char *zout, int n) // need to make room for n bytes\n{\n char *q;\n int cur, limit, old_limit;\n z->zout = zout;\n if (!z->z_expandable) return stbi__err(\"output buffer limit\",\"Corrupt PNG\");\n cur = (int) (z->zout - z->zout_start);\n limit = old_limit = (int) (z->zout_end - z->zout_start);\n while (cur + n > limit)\n limit *= 2;\n q = (char *) STBI_REALLOC_SIZED(z->zout_start, old_limit, limit);\n STBI_NOTUSED(old_limit);\n if (q == NULL) return stbi__err(\"outofmem\", \"Out of memory\");\n z->zout_start = q;\n z->zout = q + cur;\n z->zout_end = q + limit;\n return 1;\n}\n\nstatic int stbi__zlength_base[31] = {\n 3,4,5,6,7,8,9,10,11,13,\n 15,17,19,23,27,31,35,43,51,59,\n 67,83,99,115,131,163,195,227,258,0,0 };\n\nstatic int stbi__zlength_extra[31]=\n{ 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 };\n\nstatic int stbi__zdist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,\n257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0};\n\nstatic int stbi__zdist_extra[32] =\n{ 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};\n\nstatic int stbi__parse_huffman_block(stbi__zbuf *a)\n{\n char *zout = a->zout;\n for(;;) {\n int z = stbi__zhuffman_decode(a, &a->z_length);\n if (z < 256) {\n if (z < 0) return stbi__err(\"bad huffman code\",\"Corrupt PNG\"); // error in huffman codes\n if (zout >= a->zout_end) {\n if (!stbi__zexpand(a, zout, 1)) return 0;\n zout = a->zout;\n }\n *zout++ = (char) z;\n } else {\n stbi_uc *p;\n int len,dist;\n if (z == 256) {\n a->zout = zout;\n return 1;\n }\n z -= 257;\n len = stbi__zlength_base[z];\n if (stbi__zlength_extra[z]) len += stbi__zreceive(a, stbi__zlength_extra[z]);\n z = stbi__zhuffman_decode(a, &a->z_distance);\n if (z < 0) return stbi__err(\"bad huffman code\",\"Corrupt PNG\");\n dist = stbi__zdist_base[z];\n if (stbi__zdist_extra[z]) dist += stbi__zreceive(a, stbi__zdist_extra[z]);\n if (zout - a->zout_start < dist) return stbi__err(\"bad dist\",\"Corrupt PNG\");\n if (zout + len > a->zout_end) {\n if (!stbi__zexpand(a, zout, len)) return 0;\n zout = a->zout;\n }\n p = (stbi_uc *) (zout - dist);\n if (dist == 1) { // run of one byte; common in images.\n stbi_uc v = *p;\n if (len) { do *zout++ = v; while (--len); }\n } else {\n if (len) { do *zout++ = *p++; while (--len); }\n }\n }\n }\n}\n\nstatic int stbi__compute_huffman_codes(stbi__zbuf *a)\n{\n static stbi_uc length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 };\n stbi__zhuffman z_codelength;\n stbi_uc lencodes[286+32+137];//padding for maximum single op\n stbi_uc codelength_sizes[19];\n int i,n;\n\n int hlit = stbi__zreceive(a,5) + 257;\n int hdist = stbi__zreceive(a,5) + 1;\n int hclen = stbi__zreceive(a,4) + 4;\n int ntot = hlit + hdist;\n\n memset(codelength_sizes, 0, sizeof(codelength_sizes));\n for (i=0; i < hclen; ++i) {\n int s = stbi__zreceive(a,3);\n codelength_sizes[length_dezigzag[i]] = (stbi_uc) s;\n }\n if (!stbi__zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0;\n\n n = 0;\n while (n < ntot) {\n int c = stbi__zhuffman_decode(a, &z_codelength);\n if (c < 0 || c >= 19) return stbi__err(\"bad codelengths\", \"Corrupt PNG\");\n if (c < 16)\n lencodes[n++] = (stbi_uc) c;\n else {\n stbi_uc fill = 0;\n if (c == 16) {\n c = stbi__zreceive(a,2)+3;\n if (n == 0) return stbi__err(\"bad codelengths\", \"Corrupt PNG\");\n fill = lencodes[n-1];\n } else if (c == 17)\n c = stbi__zreceive(a,3)+3;\n else {\n STBI_ASSERT(c == 18);\n c = stbi__zreceive(a,7)+11;\n }\n if (ntot - n < c) return stbi__err(\"bad codelengths\", \"Corrupt PNG\");\n memset(lencodes+n, fill, c);\n n += c;\n }\n }\n if (n != ntot) return stbi__err(\"bad codelengths\",\"Corrupt PNG\");\n if (!stbi__zbuild_huffman(&a->z_length, lencodes, hlit)) return 0;\n if (!stbi__zbuild_huffman(&a->z_distance, lencodes+hlit, hdist)) return 0;\n return 1;\n}\n\nstatic int stbi__parse_uncompressed_block(stbi__zbuf *a)\n{\n stbi_uc header[4];\n int len,nlen,k;\n if (a->num_bits & 7)\n stbi__zreceive(a, a->num_bits & 7); // discard\n // drain the bit-packed data into header\n k = 0;\n while (a->num_bits > 0) {\n header[k++] = (stbi_uc) (a->code_buffer & 255); // suppress MSVC run-time check\n a->code_buffer >>= 8;\n a->num_bits -= 8;\n }\n STBI_ASSERT(a->num_bits == 0);\n // now fill header the normal way\n while (k < 4)\n header[k++] = stbi__zget8(a);\n len = header[1] * 256 + header[0];\n nlen = header[3] * 256 + header[2];\n if (nlen != (len ^ 0xffff)) return stbi__err(\"zlib corrupt\",\"Corrupt PNG\");\n if (a->zbuffer + len > a->zbuffer_end) return stbi__err(\"read past buffer\",\"Corrupt PNG\");\n if (a->zout + len > a->zout_end)\n if (!stbi__zexpand(a, a->zout, len)) return 0;\n memcpy(a->zout, a->zbuffer, len);\n a->zbuffer += len;\n a->zout += len;\n return 1;\n}\n\nstatic int stbi__parse_zlib_header(stbi__zbuf *a)\n{\n int cmf = stbi__zget8(a);\n int cm = cmf & 15;\n /* int cinfo = cmf >> 4; */\n int flg = stbi__zget8(a);\n if ((cmf*256+flg) % 31 != 0) return stbi__err(\"bad zlib header\",\"Corrupt PNG\"); // zlib spec\n if (flg & 32) return stbi__err(\"no preset dict\",\"Corrupt PNG\"); // preset dictionary not allowed in png\n if (cm != 8) return stbi__err(\"bad compression\",\"Corrupt PNG\"); // DEFLATE required for png\n // window = 1 << (8 + cinfo)... but who cares, we fully buffer output\n return 1;\n}\n\n// @TODO: should statically initialize these for optimal thread safety\nstatic stbi_uc stbi__zdefault_length[288], stbi__zdefault_distance[32];\nstatic void stbi__init_zdefaults(void)\n{\n int i; // use <= to match clearly with spec\n for (i=0; i <= 143; ++i) stbi__zdefault_length[i] = 8;\n for ( ; i <= 255; ++i) stbi__zdefault_length[i] = 9;\n for ( ; i <= 279; ++i) stbi__zdefault_length[i] = 7;\n for ( ; i <= 287; ++i) stbi__zdefault_length[i] = 8;\n\n for (i=0; i <= 31; ++i) stbi__zdefault_distance[i] = 5;\n}\n\nstatic int stbi__parse_zlib(stbi__zbuf *a, int parse_header)\n{\n int final, type;\n if (parse_header)\n if (!stbi__parse_zlib_header(a)) return 0;\n a->num_bits = 0;\n a->code_buffer = 0;\n do {\n final = stbi__zreceive(a,1);\n type = stbi__zreceive(a,2);\n if (type == 0) {\n if (!stbi__parse_uncompressed_block(a)) return 0;\n } else if (type == 3) {\n return 0;\n } else {\n if (type == 1) {\n // use fixed code lengths\n if (!stbi__zdefault_distance[31]) stbi__init_zdefaults();\n if (!stbi__zbuild_huffman(&a->z_length , stbi__zdefault_length , 288)) return 0;\n if (!stbi__zbuild_huffman(&a->z_distance, stbi__zdefault_distance, 32)) return 0;\n } else {\n if (!stbi__compute_huffman_codes(a)) return 0;\n }\n if (!stbi__parse_huffman_block(a)) return 0;\n }\n } while (!final);\n return 1;\n}\n\nstatic int stbi__do_zlib(stbi__zbuf *a, char *obuf, int olen, int exp, int parse_header)\n{\n a->zout_start = obuf;\n a->zout = obuf;\n a->zout_end = obuf + olen;\n a->z_expandable = exp;\n\n return stbi__parse_zlib(a, parse_header);\n}\n\nSTBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen)\n{\n stbi__zbuf a;\n char *p = (char *) stbi__malloc(initial_size);\n if (p == NULL) return NULL;\n a.zbuffer = (stbi_uc *) buffer;\n a.zbuffer_end = (stbi_uc *) buffer + len;\n if (stbi__do_zlib(&a, p, initial_size, 1, 1)) {\n if (outlen) *outlen = (int) (a.zout - a.zout_start);\n return a.zout_start;\n } else {\n STBI_FREE(a.zout_start);\n return NULL;\n }\n}\n\nSTBIDEF char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen)\n{\n return stbi_zlib_decode_malloc_guesssize(buffer, len, 16384, outlen);\n}\n\nSTBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header)\n{\n stbi__zbuf a;\n char *p = (char *) stbi__malloc(initial_size);\n if (p == NULL) return NULL;\n a.zbuffer = (stbi_uc *) buffer;\n a.zbuffer_end = (stbi_uc *) buffer + len;\n if (stbi__do_zlib(&a, p, initial_size, 1, parse_header)) {\n if (outlen) *outlen = (int) (a.zout - a.zout_start);\n return a.zout_start;\n } else {\n STBI_FREE(a.zout_start);\n return NULL;\n }\n}\n\nSTBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, char const *ibuffer, int ilen)\n{\n stbi__zbuf a;\n a.zbuffer = (stbi_uc *) ibuffer;\n a.zbuffer_end = (stbi_uc *) ibuffer + ilen;\n if (stbi__do_zlib(&a, obuffer, olen, 0, 1))\n return (int) (a.zout - a.zout_start);\n else\n return -1;\n}\n\nSTBIDEF char *stbi_zlib_decode_noheader_malloc(char const *buffer, int len, int *outlen)\n{\n stbi__zbuf a;\n char *p = (char *) stbi__malloc(16384);\n if (p == NULL) return NULL;\n a.zbuffer = (stbi_uc *) buffer;\n a.zbuffer_end = (stbi_uc *) buffer+len;\n if (stbi__do_zlib(&a, p, 16384, 1, 0)) {\n if (outlen) *outlen = (int) (a.zout - a.zout_start);\n return a.zout_start;\n } else {\n STBI_FREE(a.zout_start);\n return NULL;\n }\n}\n\nSTBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen)\n{\n stbi__zbuf a;\n a.zbuffer = (stbi_uc *) ibuffer;\n a.zbuffer_end = (stbi_uc *) ibuffer + ilen;\n if (stbi__do_zlib(&a, obuffer, olen, 0, 0))\n return (int) (a.zout - a.zout_start);\n else\n return -1;\n}\n#endif\n\n// public domain \"baseline\" PNG decoder v0.10 Sean Barrett 2006-11-18\n// simple implementation\n// - only 8-bit samples\n// - no CRC checking\n// - allocates lots of intermediate memory\n// - avoids problem of streaming data between subsystems\n// - avoids explicit window management\n// performance\n// - uses stb_zlib, a PD zlib implementation with fast huffman decoding\n\n#ifndef STBI_NO_PNG\ntypedef struct\n{\n stbi__uint32 length;\n stbi__uint32 type;\n} stbi__pngchunk;\n\nstatic stbi__pngchunk stbi__get_chunk_header(stbi__context *s)\n{\n stbi__pngchunk c;\n c.length = stbi__get32be(s);\n c.type = stbi__get32be(s);\n return c;\n}\n\nstatic int stbi__check_png_header(stbi__context *s)\n{\n static stbi_uc png_sig[8] = { 137,80,78,71,13,10,26,10 };\n int i;\n for (i=0; i < 8; ++i)\n if (stbi__get8(s) != png_sig[i]) return stbi__err(\"bad png sig\",\"Not a PNG\");\n return 1;\n}\n\ntypedef struct\n{\n stbi__context *s;\n stbi_uc *idata, *expanded, *out;\n int depth;\n} stbi__png;\n\n\nenum {\n STBI__F_none=0,\n STBI__F_sub=1,\n STBI__F_up=2,\n STBI__F_avg=3,\n STBI__F_paeth=4,\n // synthetic filters used for first scanline to avoid needing a dummy row of 0s\n STBI__F_avg_first,\n STBI__F_paeth_first\n};\n\nstatic stbi_uc first_row_filter[5] =\n{\n STBI__F_none,\n STBI__F_sub,\n STBI__F_none,\n STBI__F_avg_first,\n STBI__F_paeth_first\n};\n\nstatic int stbi__paeth(int a, int b, int c)\n{\n int p = a + b - c;\n int pa = abs(p-a);\n int pb = abs(p-b);\n int pc = abs(p-c);\n if (pa <= pb && pa <= pc) return a;\n if (pb <= pc) return b;\n return c;\n}\n\nstatic stbi_uc stbi__depth_scale_table[9] = { 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 };\n\n// create the png data from post-deflated data\nstatic int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y, int depth, int color)\n{\n int bytes = (depth == 16? 2 : 1);\n stbi__context *s = a->s;\n stbi__uint32 i,j,stride = x*out_n*bytes;\n stbi__uint32 img_len, img_width_bytes;\n int k;\n int img_n = s->img_n; // copy it into a local for later\n\n int output_bytes = out_n*bytes;\n int filter_bytes = img_n*bytes;\n int width = x;\n\n STBI_ASSERT(out_n == s->img_n || out_n == s->img_n+1);\n a->out = (stbi_uc *) stbi__malloc_mad3(x, y, output_bytes, 0); // extra bytes to write off the end into\n if (!a->out) return stbi__err(\"outofmem\", \"Out of memory\");\n\n img_width_bytes = (((img_n * x * depth) + 7) >> 3);\n img_len = (img_width_bytes + 1) * y;\n if (s->img_x == x && s->img_y == y) {\n if (raw_len != img_len) return stbi__err(\"not enough pixels\",\"Corrupt PNG\");\n } else { // interlaced:\n if (raw_len < img_len) return stbi__err(\"not enough pixels\",\"Corrupt PNG\");\n }\n\n for (j=0; j < y; ++j) {\n stbi_uc *cur = a->out + stride*j;\n stbi_uc *prior = cur - stride;\n int filter = *raw++;\n\n if (filter > 4)\n return stbi__err(\"invalid filter\",\"Corrupt PNG\");\n\n if (depth < 8) {\n STBI_ASSERT(img_width_bytes <= x);\n cur += x*out_n - img_width_bytes; // store output to the rightmost img_len bytes, so we can decode in place\n filter_bytes = 1;\n width = img_width_bytes;\n }\n\n // if first row, use special filter that doesn't sample previous row\n if (j == 0) filter = first_row_filter[filter];\n\n // handle first byte explicitly\n for (k=0; k < filter_bytes; ++k) {\n switch (filter) {\n case STBI__F_none : cur[k] = raw[k]; break;\n case STBI__F_sub : cur[k] = raw[k]; break;\n case STBI__F_up : cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break;\n case STBI__F_avg : cur[k] = STBI__BYTECAST(raw[k] + (prior[k]>>1)); break;\n case STBI__F_paeth : cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(0,prior[k],0)); break;\n case STBI__F_avg_first : cur[k] = raw[k]; break;\n case STBI__F_paeth_first: cur[k] = raw[k]; break;\n }\n }\n\n if (depth == 8) {\n if (img_n != out_n)\n cur[img_n] = 255; // first pixel\n raw += img_n;\n cur += out_n;\n prior += out_n;\n } else if (depth == 16) {\n if (img_n != out_n) {\n cur[filter_bytes] = 255; // first pixel top byte\n cur[filter_bytes+1] = 255; // first pixel bottom byte\n }\n raw += filter_bytes;\n cur += output_bytes;\n prior += output_bytes;\n } else {\n raw += 1;\n cur += 1;\n prior += 1;\n }\n\n // this is a little gross, so that we don't switch per-pixel or per-component\n if (depth < 8 || img_n == out_n) {\n int nk = (width - 1)*filter_bytes;\n #define STBI__CASE(f) \\\n case f: \\\n for (k=0; k < nk; ++k)\n switch (filter) {\n // \"none\" filter turns into a memcpy here; make that explicit.\n case STBI__F_none: memcpy(cur, raw, nk); break;\n STBI__CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); } break;\n STBI__CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } break;\n STBI__CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); } break;\n STBI__CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],prior[k],prior[k-filter_bytes])); } break;\n STBI__CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); } break;\n STBI__CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],0,0)); } break;\n }\n #undef STBI__CASE\n raw += nk;\n } else {\n STBI_ASSERT(img_n+1 == out_n);\n #define STBI__CASE(f) \\\n case f: \\\n for (i=x-1; i >= 1; --i, cur[filter_bytes]=255,raw+=filter_bytes,cur+=output_bytes,prior+=output_bytes) \\\n for (k=0; k < filter_bytes; ++k)\n switch (filter) {\n STBI__CASE(STBI__F_none) { cur[k] = raw[k]; } break;\n STBI__CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k- output_bytes]); } break;\n STBI__CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } break;\n STBI__CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k- output_bytes])>>1)); } break;\n STBI__CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],prior[k],prior[k- output_bytes])); } break;\n STBI__CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k- output_bytes] >> 1)); } break;\n STBI__CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],0,0)); } break;\n }\n #undef STBI__CASE\n\n // the loop above sets the high byte of the pixels' alpha, but for\n // 16 bit png files we also need the low byte set. we'll do that here.\n if (depth == 16) {\n cur = a->out + stride*j; // start at the beginning of the row again\n for (i=0; i < x; ++i,cur+=output_bytes) {\n cur[filter_bytes+1] = 255;\n }\n }\n }\n }\n\n // we make a separate pass to expand bits to pixels; for performance,\n // this could run two scanlines behind the above code, so it won't\n // intefere with filtering but will still be in the cache.\n if (depth < 8) {\n for (j=0; j < y; ++j) {\n stbi_uc *cur = a->out + stride*j;\n stbi_uc *in = a->out + stride*j + x*out_n - img_width_bytes;\n // unpack 1/2/4-bit into a 8-bit buffer. allows us to keep the common 8-bit path optimal at minimal cost for 1/2/4-bit\n // png guarante byte alignment, if width is not multiple of 8/4/2 we'll decode dummy trailing data that will be skipped in the later loop\n stbi_uc scale = (color == 0) ? stbi__depth_scale_table[depth] : 1; // scale grayscale values to 0..255 range\n\n // note that the final byte might overshoot and write more data than desired.\n // we can allocate enough data that this never writes out of memory, but it\n // could also overwrite the next scanline. can it overwrite non-empty data\n // on the next scanline? yes, consider 1-pixel-wide scanlines with 1-bit-per-pixel.\n // so we need to explicitly clamp the final ones\n\n if (depth == 4) {\n for (k=x*img_n; k >= 2; k-=2, ++in) {\n *cur++ = scale * ((*in >> 4) );\n *cur++ = scale * ((*in ) & 0x0f);\n }\n if (k > 0) *cur++ = scale * ((*in >> 4) );\n } else if (depth == 2) {\n for (k=x*img_n; k >= 4; k-=4, ++in) {\n *cur++ = scale * ((*in >> 6) );\n *cur++ = scale * ((*in >> 4) & 0x03);\n *cur++ = scale * ((*in >> 2) & 0x03);\n *cur++ = scale * ((*in ) & 0x03);\n }\n if (k > 0) *cur++ = scale * ((*in >> 6) );\n if (k > 1) *cur++ = scale * ((*in >> 4) & 0x03);\n if (k > 2) *cur++ = scale * ((*in >> 2) & 0x03);\n } else if (depth == 1) {\n for (k=x*img_n; k >= 8; k-=8, ++in) {\n *cur++ = scale * ((*in >> 7) );\n *cur++ = scale * ((*in >> 6) & 0x01);\n *cur++ = scale * ((*in >> 5) & 0x01);\n *cur++ = scale * ((*in >> 4) & 0x01);\n *cur++ = scale * ((*in >> 3) & 0x01);\n *cur++ = scale * ((*in >> 2) & 0x01);\n *cur++ = scale * ((*in >> 1) & 0x01);\n *cur++ = scale * ((*in ) & 0x01);\n }\n if (k > 0) *cur++ = scale * ((*in >> 7) );\n if (k > 1) *cur++ = scale * ((*in >> 6) & 0x01);\n if (k > 2) *cur++ = scale * ((*in >> 5) & 0x01);\n if (k > 3) *cur++ = scale * ((*in >> 4) & 0x01);\n if (k > 4) *cur++ = scale * ((*in >> 3) & 0x01);\n if (k > 5) *cur++ = scale * ((*in >> 2) & 0x01);\n if (k > 6) *cur++ = scale * ((*in >> 1) & 0x01);\n }\n if (img_n != out_n) {\n int q;\n // insert alpha = 255\n cur = a->out + stride*j;\n if (img_n == 1) {\n for (q=x-1; q >= 0; --q) {\n cur[q*2+1] = 255;\n cur[q*2+0] = cur[q];\n }\n } else {\n STBI_ASSERT(img_n == 3);\n for (q=x-1; q >= 0; --q) {\n cur[q*4+3] = 255;\n cur[q*4+2] = cur[q*3+2];\n cur[q*4+1] = cur[q*3+1];\n cur[q*4+0] = cur[q*3+0];\n }\n }\n }\n }\n } else if (depth == 16) {\n // force the image data from big-endian to platform-native.\n // this is done in a separate pass due to the decoding relying\n // on the data being untouched, but could probably be done\n // per-line during decode if care is taken.\n stbi_uc *cur = a->out;\n stbi__uint16 *cur16 = (stbi__uint16*)cur;\n\n for(i=0; i < x*y*out_n; ++i,cur16++,cur+=2) {\n *cur16 = (cur[0] << 8) | cur[1];\n }\n }\n\n return 1;\n}\n\nstatic int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stbi__uint32 image_data_len, int out_n, int depth, int color, int interlaced)\n{\n int bytes = (depth == 16 ? 2 : 1);\n int out_bytes = out_n * bytes;\n stbi_uc *final;\n int p;\n if (!interlaced)\n return stbi__create_png_image_raw(a, image_data, image_data_len, out_n, a->s->img_x, a->s->img_y, depth, color);\n\n // de-interlacing\n final = (stbi_uc *) stbi__malloc_mad3(a->s->img_x, a->s->img_y, out_bytes, 0);\n for (p=0; p < 7; ++p) {\n int xorig[] = { 0,4,0,2,0,1,0 };\n int yorig[] = { 0,0,4,0,2,0,1 };\n int xspc[] = { 8,8,4,4,2,2,1 };\n int yspc[] = { 8,8,8,4,4,2,2 };\n int i,j,x,y;\n // pass1_x[4] = 0, pass1_x[5] = 1, pass1_x[12] = 1\n x = (a->s->img_x - xorig[p] + xspc[p]-1) / xspc[p];\n y = (a->s->img_y - yorig[p] + yspc[p]-1) / yspc[p];\n if (x && y) {\n stbi__uint32 img_len = ((((a->s->img_n * x * depth) + 7) >> 3) + 1) * y;\n if (!stbi__create_png_image_raw(a, image_data, image_data_len, out_n, x, y, depth, color)) {\n STBI_FREE(final);\n return 0;\n }\n for (j=0; j < y; ++j) {\n for (i=0; i < x; ++i) {\n int out_y = j*yspc[p]+yorig[p];\n int out_x = i*xspc[p]+xorig[p];\n memcpy(final + out_y*a->s->img_x*out_bytes + out_x*out_bytes,\n a->out + (j*x+i)*out_bytes, out_bytes);\n }\n }\n STBI_FREE(a->out);\n image_data += img_len;\n image_data_len -= img_len;\n }\n }\n a->out = final;\n\n return 1;\n}\n\nstatic int stbi__compute_transparency(stbi__png *z, stbi_uc tc[3], int out_n)\n{\n stbi__context *s = z->s;\n stbi__uint32 i, pixel_count = s->img_x * s->img_y;\n stbi_uc *p = z->out;\n\n // compute color-based transparency, assuming we've\n // already got 255 as the alpha value in the output\n STBI_ASSERT(out_n == 2 || out_n == 4);\n\n if (out_n == 2) {\n for (i=0; i < pixel_count; ++i) {\n p[1] = (p[0] == tc[0] ? 0 : 255);\n p += 2;\n }\n } else {\n for (i=0; i < pixel_count; ++i) {\n if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2])\n p[3] = 0;\n p += 4;\n }\n }\n return 1;\n}\n\nstatic int stbi__compute_transparency16(stbi__png *z, stbi__uint16 tc[3], int out_n)\n{\n stbi__context *s = z->s;\n stbi__uint32 i, pixel_count = s->img_x * s->img_y;\n stbi__uint16 *p = (stbi__uint16*) z->out;\n\n // compute color-based transparency, assuming we've\n // already got 65535 as the alpha value in the output\n STBI_ASSERT(out_n == 2 || out_n == 4);\n\n if (out_n == 2) {\n for (i = 0; i < pixel_count; ++i) {\n p[1] = (p[0] == tc[0] ? 0 : 65535);\n p += 2;\n }\n } else {\n for (i = 0; i < pixel_count; ++i) {\n if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2])\n p[3] = 0;\n p += 4;\n }\n }\n return 1;\n}\n\nstatic int stbi__expand_png_palette(stbi__png *a, stbi_uc *palette, int len, int pal_img_n)\n{\n stbi__uint32 i, pixel_count = a->s->img_x * a->s->img_y;\n stbi_uc *p, *temp_out, *orig = a->out;\n\n p = (stbi_uc *) stbi__malloc_mad2(pixel_count, pal_img_n, 0);\n if (p == NULL) return stbi__err(\"outofmem\", \"Out of memory\");\n\n // between here and free(out) below, exitting would leak\n temp_out = p;\n\n if (pal_img_n == 3) {\n for (i=0; i < pixel_count; ++i) {\n int n = orig[i]*4;\n p[0] = palette[n ];\n p[1] = palette[n+1];\n p[2] = palette[n+2];\n p += 3;\n }\n } else {\n for (i=0; i < pixel_count; ++i) {\n int n = orig[i]*4;\n p[0] = palette[n ];\n p[1] = palette[n+1];\n p[2] = palette[n+2];\n p[3] = palette[n+3];\n p += 4;\n }\n }\n STBI_FREE(a->out);\n a->out = temp_out;\n\n STBI_NOTUSED(len);\n\n return 1;\n}\n\nstatic int stbi__unpremultiply_on_load = 0;\nstatic int stbi__de_iphone_flag = 0;\n\nSTBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply)\n{\n stbi__unpremultiply_on_load = flag_true_if_should_unpremultiply;\n}\n\nSTBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert)\n{\n stbi__de_iphone_flag = flag_true_if_should_convert;\n}\n\nstatic void stbi__de_iphone(stbi__png *z)\n{\n stbi__context *s = z->s;\n stbi__uint32 i, pixel_count = s->img_x * s->img_y;\n stbi_uc *p = z->out;\n\n if (s->img_out_n == 3) { // convert bgr to rgb\n for (i=0; i < pixel_count; ++i) {\n stbi_uc t = p[0];\n p[0] = p[2];\n p[2] = t;\n p += 3;\n }\n } else {\n STBI_ASSERT(s->img_out_n == 4);\n if (stbi__unpremultiply_on_load) {\n // convert bgr to rgb and unpremultiply\n for (i=0; i < pixel_count; ++i) {\n stbi_uc a = p[3];\n stbi_uc t = p[0];\n if (a) {\n p[0] = p[2] * 255 / a;\n p[1] = p[1] * 255 / a;\n p[2] = t * 255 / a;\n } else {\n p[0] = p[2];\n p[2] = t;\n }\n p += 4;\n }\n } else {\n // convert bgr to rgb\n for (i=0; i < pixel_count; ++i) {\n stbi_uc t = p[0];\n p[0] = p[2];\n p[2] = t;\n p += 4;\n }\n }\n }\n}\n\n#define STBI__PNG_TYPE(a,b,c,d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d))\n\nstatic int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)\n{\n stbi_uc palette[1024], pal_img_n=0;\n stbi_uc has_trans=0, tc[3];\n stbi__uint16 tc16[3];\n stbi__uint32 ioff=0, idata_limit=0, i, pal_len=0;\n int first=1,k,interlace=0, color=0, is_iphone=0;\n stbi__context *s = z->s;\n\n z->expanded = NULL;\n z->idata = NULL;\n z->out = NULL;\n\n if (!stbi__check_png_header(s)) return 0;\n\n if (scan == STBI__SCAN_type) return 1;\n\n for (;;) {\n stbi__pngchunk c = stbi__get_chunk_header(s);\n switch (c.type) {\n case STBI__PNG_TYPE('C','g','B','I'):\n is_iphone = 1;\n stbi__skip(s, c.length);\n break;\n case STBI__PNG_TYPE('I','H','D','R'): {\n int comp,filter;\n if (!first) return stbi__err(\"multiple IHDR\",\"Corrupt PNG\");\n first = 0;\n if (c.length != 13) return stbi__err(\"bad IHDR len\",\"Corrupt PNG\");\n s->img_x = stbi__get32be(s); if (s->img_x > (1 << 24)) return stbi__err(\"too large\",\"Very large image (corrupt?)\");\n s->img_y = stbi__get32be(s); if (s->img_y > (1 << 24)) return stbi__err(\"too large\",\"Very large image (corrupt?)\");\n z->depth = stbi__get8(s); if (z->depth != 1 && z->depth != 2 && z->depth != 4 && z->depth != 8 && z->depth != 16) return stbi__err(\"1/2/4/8/16-bit only\",\"PNG not supported: 1/2/4/8/16-bit only\");\n color = stbi__get8(s); if (color > 6) return stbi__err(\"bad ctype\",\"Corrupt PNG\");\n\t\t\tif (color == 3 && z->depth == 16) return stbi__err(\"bad ctype\",\"Corrupt PNG\");\n if (color == 3) pal_img_n = 3; else if (color & 1) return stbi__err(\"bad ctype\",\"Corrupt PNG\");\n comp = stbi__get8(s); if (comp) return stbi__err(\"bad comp method\",\"Corrupt PNG\");\n filter= stbi__get8(s); if (filter) return stbi__err(\"bad filter method\",\"Corrupt PNG\");\n interlace = stbi__get8(s); if (interlace>1) return stbi__err(\"bad interlace method\",\"Corrupt PNG\");\n if (!s->img_x || !s->img_y) return stbi__err(\"0-pixel image\",\"Corrupt PNG\");\n if (!pal_img_n) {\n s->img_n = (color & 2 ? 3 : 1) + (color & 4 ? 1 : 0);\n if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err(\"too large\", \"Image too large to decode\");\n if (scan == STBI__SCAN_header) return 1;\n } else {\n // if paletted, then pal_n is our final components, and\n // img_n is # components to decompress/filter.\n s->img_n = 1;\n if ((1 << 30) / s->img_x / 4 < s->img_y) return stbi__err(\"too large\",\"Corrupt PNG\");\n // if SCAN_header, have to scan to see if we have a tRNS\n }\n break;\n }\n\n case STBI__PNG_TYPE('P','L','T','E'): {\n if (first) return stbi__err(\"first not IHDR\", \"Corrupt PNG\");\n if (c.length > 256*3) return stbi__err(\"invalid PLTE\",\"Corrupt PNG\");\n pal_len = c.length / 3;\n if (pal_len * 3 != c.length) return stbi__err(\"invalid PLTE\",\"Corrupt PNG\");\n for (i=0; i < pal_len; ++i) {\n palette[i*4+0] = stbi__get8(s);\n palette[i*4+1] = stbi__get8(s);\n palette[i*4+2] = stbi__get8(s);\n palette[i*4+3] = 255;\n }\n break;\n }\n\n case STBI__PNG_TYPE('t','R','N','S'): {\n if (first) return stbi__err(\"first not IHDR\", \"Corrupt PNG\");\n if (z->idata) return stbi__err(\"tRNS after IDAT\",\"Corrupt PNG\");\n if (pal_img_n) {\n if (scan == STBI__SCAN_header) { s->img_n = 4; return 1; }\n if (pal_len == 0) return stbi__err(\"tRNS before PLTE\",\"Corrupt PNG\");\n if (c.length > pal_len) return stbi__err(\"bad tRNS len\",\"Corrupt PNG\");\n pal_img_n = 4;\n for (i=0; i < c.length; ++i)\n palette[i*4+3] = stbi__get8(s);\n } else {\n if (!(s->img_n & 1)) return stbi__err(\"tRNS with alpha\",\"Corrupt PNG\");\n if (c.length != (stbi__uint32) s->img_n*2) return stbi__err(\"bad tRNS len\",\"Corrupt PNG\");\n has_trans = 1;\n if (z->depth == 16) {\n for (k = 0; k < s->img_n; ++k) tc16[k] = (stbi__uint16)stbi__get16be(s); // copy the values as-is\n } else {\n for (k = 0; k < s->img_n; ++k) tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; // non 8-bit images will be larger\n }\n }\n break;\n }\n\n case STBI__PNG_TYPE('I','D','A','T'): {\n if (first) return stbi__err(\"first not IHDR\", \"Corrupt PNG\");\n if (pal_img_n && !pal_len) return stbi__err(\"no PLTE\",\"Corrupt PNG\");\n if (scan == STBI__SCAN_header) { s->img_n = pal_img_n; return 1; }\n if ((int)(ioff + c.length) < (int)ioff) return 0;\n if (ioff + c.length > idata_limit) {\n stbi__uint32 idata_limit_old = idata_limit;\n stbi_uc *p;\n if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096;\n while (ioff + c.length > idata_limit)\n idata_limit *= 2;\n STBI_NOTUSED(idata_limit_old);\n p = (stbi_uc *) STBI_REALLOC_SIZED(z->idata, idata_limit_old, idata_limit); if (p == NULL) return stbi__err(\"outofmem\", \"Out of memory\");\n z->idata = p;\n }\n if (!stbi__getn(s, z->idata+ioff,c.length)) return stbi__err(\"outofdata\",\"Corrupt PNG\");\n ioff += c.length;\n break;\n }\n\n case STBI__PNG_TYPE('I','E','N','D'): {\n stbi__uint32 raw_len, bpl;\n if (first) return stbi__err(\"first not IHDR\", \"Corrupt PNG\");\n if (scan != STBI__SCAN_load) return 1;\n if (z->idata == NULL) return stbi__err(\"no IDAT\",\"Corrupt PNG\");\n // initial guess for decoded data size to avoid unnecessary reallocs\n bpl = (s->img_x * z->depth + 7) / 8; // bytes per line, per component\n raw_len = bpl * s->img_y * s->img_n /* pixels */ + s->img_y /* filter mode per row */;\n z->expanded = (stbi_uc *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, raw_len, (int *) &raw_len, !is_iphone);\n if (z->expanded == NULL) return 0; // zlib should set error\n STBI_FREE(z->idata); z->idata = NULL;\n if ((req_comp == s->img_n+1 && req_comp != 3 && !pal_img_n) || has_trans)\n s->img_out_n = s->img_n+1;\n else\n s->img_out_n = s->img_n;\n if (!stbi__create_png_image(z, z->expanded, raw_len, s->img_out_n, z->depth, color, interlace)) return 0;\n if (has_trans) {\n if (z->depth == 16) {\n if (!stbi__compute_transparency16(z, tc16, s->img_out_n)) return 0;\n } else {\n if (!stbi__compute_transparency(z, tc, s->img_out_n)) return 0;\n }\n }\n if (is_iphone && stbi__de_iphone_flag && s->img_out_n > 2)\n stbi__de_iphone(z);\n if (pal_img_n) {\n // pal_img_n == 3 or 4\n s->img_n = pal_img_n; // record the actual colors we had\n s->img_out_n = pal_img_n;\n if (req_comp >= 3) s->img_out_n = req_comp;\n if (!stbi__expand_png_palette(z, palette, pal_len, s->img_out_n))\n return 0;\n }\n STBI_FREE(z->expanded); z->expanded = NULL;\n return 1;\n }\n\n default:\n // if critical, fail\n if (first) return stbi__err(\"first not IHDR\", \"Corrupt PNG\");\n if ((c.type & (1 << 29)) == 0) {\n #ifndef STBI_NO_FAILURE_STRINGS\n // not threadsafe\n static char invalid_chunk[] = \"XXXX PNG chunk not known\";\n invalid_chunk[0] = STBI__BYTECAST(c.type >> 24);\n invalid_chunk[1] = STBI__BYTECAST(c.type >> 16);\n invalid_chunk[2] = STBI__BYTECAST(c.type >> 8);\n invalid_chunk[3] = STBI__BYTECAST(c.type >> 0);\n #endif\n return stbi__err(invalid_chunk, \"PNG not supported: unknown PNG chunk type\");\n }\n stbi__skip(s, c.length);\n break;\n }\n // end of PNG chunk, read and skip CRC\n stbi__get32be(s);\n }\n}\n\nstatic void *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req_comp, stbi__result_info *ri)\n{\n void *result=NULL;\n if (req_comp < 0 || req_comp > 4) return stbi__errpuc(\"bad req_comp\", \"Internal error\");\n if (stbi__parse_png_file(p, STBI__SCAN_load, req_comp)) {\n if (p->depth < 8)\n ri->bits_per_channel = 8;\n else\n ri->bits_per_channel = p->depth;\n result = p->out;\n p->out = NULL;\n if (req_comp && req_comp != p->s->img_out_n) {\n if (ri->bits_per_channel == 8)\n result = stbi__convert_format((unsigned char *) result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y);\n else\n result = stbi__convert_format16((stbi__uint16 *) result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y);\n p->s->img_out_n = req_comp;\n if (result == NULL) return result;\n }\n *x = p->s->img_x;\n *y = p->s->img_y;\n if (n) *n = p->s->img_n;\n }\n STBI_FREE(p->out); p->out = NULL;\n STBI_FREE(p->expanded); p->expanded = NULL;\n STBI_FREE(p->idata); p->idata = NULL;\n\n return result;\n}\n\nstatic void *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)\n{\n stbi__png p;\n p.s = s;\n return stbi__do_png(&p, x,y,comp,req_comp, ri);\n}\n\nstatic int stbi__png_test(stbi__context *s)\n{\n int r;\n r = stbi__check_png_header(s);\n stbi__rewind(s);\n return r;\n}\n\nstatic int stbi__png_info_raw(stbi__png *p, int *x, int *y, int *comp)\n{\n if (!stbi__parse_png_file(p, STBI__SCAN_header, 0)) {\n stbi__rewind( p->s );\n return 0;\n }\n if (x) *x = p->s->img_x;\n if (y) *y = p->s->img_y;\n if (comp) *comp = p->s->img_n;\n return 1;\n}\n\nstatic int stbi__png_info(stbi__context *s, int *x, int *y, int *comp)\n{\n stbi__png p;\n p.s = s;\n return stbi__png_info_raw(&p, x, y, comp);\n}\n#endif\n\n// Microsoft/Windows BMP image\n\n#ifndef STBI_NO_BMP\nstatic int stbi__bmp_test_raw(stbi__context *s)\n{\n int r;\n int sz;\n if (stbi__get8(s) != 'B') return 0;\n if (stbi__get8(s) != 'M') return 0;\n stbi__get32le(s); // discard filesize\n stbi__get16le(s); // discard reserved\n stbi__get16le(s); // discard reserved\n stbi__get32le(s); // discard data offset\n sz = stbi__get32le(s);\n r = (sz == 12 || sz == 40 || sz == 56 || sz == 108 || sz == 124);\n return r;\n}\n\nstatic int stbi__bmp_test(stbi__context *s)\n{\n int r = stbi__bmp_test_raw(s);\n stbi__rewind(s);\n return r;\n}\n\n\n// returns 0..31 for the highest set bit\nstatic int stbi__high_bit(unsigned int z)\n{\n int n=0;\n if (z == 0) return -1;\n if (z >= 0x10000) n += 16, z >>= 16;\n if (z >= 0x00100) n += 8, z >>= 8;\n if (z >= 0x00010) n += 4, z >>= 4;\n if (z >= 0x00004) n += 2, z >>= 2;\n if (z >= 0x00002) n += 1, z >>= 1;\n return n;\n}\n\nstatic int stbi__bitcount(unsigned int a)\n{\n a = (a & 0x55555555) + ((a >> 1) & 0x55555555); // max 2\n a = (a & 0x33333333) + ((a >> 2) & 0x33333333); // max 4\n a = (a + (a >> 4)) & 0x0f0f0f0f; // max 8 per 4, now 8 bits\n a = (a + (a >> 8)); // max 16 per 8 bits\n a = (a + (a >> 16)); // max 32 per 8 bits\n return a & 0xff;\n}\n\nstatic int stbi__shiftsigned(int v, int shift, int bits)\n{\n int result;\n int z=0;\n\n if (shift < 0) v <<= -shift;\n else v >>= shift;\n result = v;\n\n z = bits;\n while (z < 8) {\n result += v >> z;\n z += bits;\n }\n return result;\n}\n\ntypedef struct\n{\n int bpp, offset, hsz;\n unsigned int mr,mg,mb,ma, all_a;\n} stbi__bmp_data;\n\nstatic void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info)\n{\n int hsz;\n if (stbi__get8(s) != 'B' || stbi__get8(s) != 'M') return stbi__errpuc(\"not BMP\", \"Corrupt BMP\");\n stbi__get32le(s); // discard filesize\n stbi__get16le(s); // discard reserved\n stbi__get16le(s); // discard reserved\n info->offset = stbi__get32le(s);\n info->hsz = hsz = stbi__get32le(s);\n info->mr = info->mg = info->mb = info->ma = 0;\n \n if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108 && hsz != 124) return stbi__errpuc(\"unknown BMP\", \"BMP type not supported: unknown\");\n if (hsz == 12) {\n s->img_x = stbi__get16le(s);\n s->img_y = stbi__get16le(s);\n } else {\n s->img_x = stbi__get32le(s);\n s->img_y = stbi__get32le(s);\n }\n if (stbi__get16le(s) != 1) return stbi__errpuc(\"bad BMP\", \"bad BMP\");\n info->bpp = stbi__get16le(s);\n if (info->bpp == 1) return stbi__errpuc(\"monochrome\", \"BMP type not supported: 1-bit\");\n if (hsz != 12) {\n int compress = stbi__get32le(s);\n if (compress == 1 || compress == 2) return stbi__errpuc(\"BMP RLE\", \"BMP type not supported: RLE\");\n stbi__get32le(s); // discard sizeof\n stbi__get32le(s); // discard hres\n stbi__get32le(s); // discard vres\n stbi__get32le(s); // discard colorsused\n stbi__get32le(s); // discard max important\n if (hsz == 40 || hsz == 56) {\n if (hsz == 56) {\n stbi__get32le(s);\n stbi__get32le(s);\n stbi__get32le(s);\n stbi__get32le(s);\n }\n if (info->bpp == 16 || info->bpp == 32) {\n if (compress == 0) {\n if (info->bpp == 32) {\n info->mr = 0xffu << 16;\n info->mg = 0xffu << 8;\n info->mb = 0xffu << 0;\n info->ma = 0xffu << 24;\n info->all_a = 0; // if all_a is 0 at end, then we loaded alpha channel but it was all 0\n } else {\n info->mr = 31u << 10;\n info->mg = 31u << 5;\n info->mb = 31u << 0;\n }\n } else if (compress == 3) {\n info->mr = stbi__get32le(s);\n info->mg = stbi__get32le(s);\n info->mb = stbi__get32le(s);\n // not documented, but generated by photoshop and handled by mspaint\n if (info->mr == info->mg && info->mg == info->mb) {\n // ?!?!?\n return stbi__errpuc(\"bad BMP\", \"bad BMP\");\n }\n } else\n return stbi__errpuc(\"bad BMP\", \"bad BMP\");\n }\n } else {\n int i;\n if (hsz != 108 && hsz != 124)\n return stbi__errpuc(\"bad BMP\", \"bad BMP\");\n info->mr = stbi__get32le(s);\n info->mg = stbi__get32le(s);\n info->mb = stbi__get32le(s);\n info->ma = stbi__get32le(s);\n stbi__get32le(s); // discard color space\n for (i=0; i < 12; ++i)\n stbi__get32le(s); // discard color space parameters\n if (hsz == 124) {\n stbi__get32le(s); // discard rendering intent\n stbi__get32le(s); // discard offset of profile data\n stbi__get32le(s); // discard size of profile data\n stbi__get32le(s); // discard reserved\n }\n }\n }\n return (void *) 1;\n}\n\n\nstatic void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)\n{\n stbi_uc *out;\n unsigned int mr=0,mg=0,mb=0,ma=0, all_a;\n stbi_uc pal[256][4];\n int psize=0,i,j,width;\n int flip_vertically, pad, target;\n stbi__bmp_data info;\n STBI_NOTUSED(ri);\n\n info.all_a = 255; \n if (stbi__bmp_parse_header(s, &info) == NULL)\n return NULL; // error code already set\n\n flip_vertically = ((int) s->img_y) > 0;\n s->img_y = abs((int) s->img_y);\n\n mr = info.mr;\n mg = info.mg;\n mb = info.mb;\n ma = info.ma;\n all_a = info.all_a;\n\n if (info.hsz == 12) {\n if (info.bpp < 24)\n psize = (info.offset - 14 - 24) / 3;\n } else {\n if (info.bpp < 16)\n psize = (info.offset - 14 - info.hsz) >> 2;\n }\n\n s->img_n = ma ? 4 : 3;\n if (req_comp && req_comp >= 3) // we can directly decode 3 or 4\n target = req_comp;\n else\n target = s->img_n; // if they want monochrome, we'll post-convert\n\n // sanity-check size\n if (!stbi__mad3sizes_valid(target, s->img_x, s->img_y, 0))\n return stbi__errpuc(\"too large\", \"Corrupt BMP\");\n\n out = (stbi_uc *) stbi__malloc_mad3(target, s->img_x, s->img_y, 0);\n if (!out) return stbi__errpuc(\"outofmem\", \"Out of memory\");\n if (info.bpp < 16) {\n int z=0;\n if (psize == 0 || psize > 256) { STBI_FREE(out); return stbi__errpuc(\"invalid\", \"Corrupt BMP\"); }\n for (i=0; i < psize; ++i) {\n pal[i][2] = stbi__get8(s);\n pal[i][1] = stbi__get8(s);\n pal[i][0] = stbi__get8(s);\n if (info.hsz != 12) stbi__get8(s);\n pal[i][3] = 255;\n }\n stbi__skip(s, info.offset - 14 - info.hsz - psize * (info.hsz == 12 ? 3 : 4));\n if (info.bpp == 4) width = (s->img_x + 1) >> 1;\n else if (info.bpp == 8) width = s->img_x;\n else { STBI_FREE(out); return stbi__errpuc(\"bad bpp\", \"Corrupt BMP\"); }\n pad = (-width)&3;\n for (j=0; j < (int) s->img_y; ++j) {\n for (i=0; i < (int) s->img_x; i += 2) {\n int v=stbi__get8(s),v2=0;\n if (info.bpp == 4) {\n v2 = v & 15;\n v >>= 4;\n }\n out[z++] = pal[v][0];\n out[z++] = pal[v][1];\n out[z++] = pal[v][2];\n if (target == 4) out[z++] = 255;\n if (i+1 == (int) s->img_x) break;\n v = (info.bpp == 8) ? stbi__get8(s) : v2;\n out[z++] = pal[v][0];\n out[z++] = pal[v][1];\n out[z++] = pal[v][2];\n if (target == 4) out[z++] = 255;\n }\n stbi__skip(s, pad);\n }\n } else {\n int rshift=0,gshift=0,bshift=0,ashift=0,rcount=0,gcount=0,bcount=0,acount=0;\n int z = 0;\n int easy=0;\n stbi__skip(s, info.offset - 14 - info.hsz);\n if (info.bpp == 24) width = 3 * s->img_x;\n else if (info.bpp == 16) width = 2*s->img_x;\n else /* bpp = 32 and pad = 0 */ width=0;\n pad = (-width) & 3;\n if (info.bpp == 24) {\n easy = 1;\n } else if (info.bpp == 32) {\n if (mb == 0xff && mg == 0xff00 && mr == 0x00ff0000 && ma == 0xff000000)\n easy = 2;\n }\n if (!easy) {\n if (!mr || !mg || !mb) { STBI_FREE(out); return stbi__errpuc(\"bad masks\", \"Corrupt BMP\"); }\n // right shift amt to put high bit in position #7\n rshift = stbi__high_bit(mr)-7; rcount = stbi__bitcount(mr);\n gshift = stbi__high_bit(mg)-7; gcount = stbi__bitcount(mg);\n bshift = stbi__high_bit(mb)-7; bcount = stbi__bitcount(mb);\n ashift = stbi__high_bit(ma)-7; acount = stbi__bitcount(ma);\n }\n for (j=0; j < (int) s->img_y; ++j) {\n if (easy) {\n for (i=0; i < (int) s->img_x; ++i) {\n unsigned char a;\n out[z+2] = stbi__get8(s);\n out[z+1] = stbi__get8(s);\n out[z+0] = stbi__get8(s);\n z += 3;\n a = (easy == 2 ? stbi__get8(s) : 255);\n all_a |= a;\n if (target == 4) out[z++] = a;\n }\n } else {\n int bpp = info.bpp;\n for (i=0; i < (int) s->img_x; ++i) {\n stbi__uint32 v = (bpp == 16 ? (stbi__uint32) stbi__get16le(s) : stbi__get32le(s));\n int a;\n out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mr, rshift, rcount));\n out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mg, gshift, gcount));\n out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mb, bshift, bcount));\n a = (ma ? stbi__shiftsigned(v & ma, ashift, acount) : 255);\n all_a |= a;\n if (target == 4) out[z++] = STBI__BYTECAST(a);\n }\n }\n stbi__skip(s, pad);\n }\n }\n \n // if alpha channel is all 0s, replace with all 255s\n if (target == 4 && all_a == 0)\n for (i=4*s->img_x*s->img_y-1; i >= 0; i -= 4)\n out[i] = 255;\n\n if (flip_vertically) {\n stbi_uc t;\n for (j=0; j < (int) s->img_y>>1; ++j) {\n stbi_uc *p1 = out + j *s->img_x*target;\n stbi_uc *p2 = out + (s->img_y-1-j)*s->img_x*target;\n for (i=0; i < (int) s->img_x*target; ++i) {\n t = p1[i], p1[i] = p2[i], p2[i] = t;\n }\n }\n }\n\n if (req_comp && req_comp != target) {\n out = stbi__convert_format(out, target, req_comp, s->img_x, s->img_y);\n if (out == NULL) return out; // stbi__convert_format frees input on failure\n }\n\n *x = s->img_x;\n *y = s->img_y;\n if (comp) *comp = s->img_n;\n return out;\n}\n#endif\n\n// Targa Truevision - TGA\n// by Jonathan Dummer\n#ifndef STBI_NO_TGA\n// returns STBI_rgb or whatever, 0 on error\nstatic int stbi__tga_get_comp(int bits_per_pixel, int is_grey, int* is_rgb16)\n{\n // only RGB or RGBA (incl. 16bit) or grey allowed\n if(is_rgb16) *is_rgb16 = 0;\n switch(bits_per_pixel) {\n case 8: return STBI_grey;\n case 16: if(is_grey) return STBI_grey_alpha;\n // else: fall-through\n case 15: if(is_rgb16) *is_rgb16 = 1;\n return STBI_rgb;\n case 24: // fall-through\n case 32: return bits_per_pixel/8;\n default: return 0;\n }\n}\n\nstatic int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp)\n{\n int tga_w, tga_h, tga_comp, tga_image_type, tga_bits_per_pixel, tga_colormap_bpp;\n int sz, tga_colormap_type;\n stbi__get8(s); // discard Offset\n tga_colormap_type = stbi__get8(s); // colormap type\n if( tga_colormap_type > 1 ) {\n stbi__rewind(s);\n return 0; // only RGB or indexed allowed\n }\n tga_image_type = stbi__get8(s); // image type\n if ( tga_colormap_type == 1 ) { // colormapped (paletted) image\n if (tga_image_type != 1 && tga_image_type != 9) {\n stbi__rewind(s);\n return 0;\n }\n stbi__skip(s,4); // skip index of first colormap entry and number of entries\n sz = stbi__get8(s); // check bits per palette color entry\n if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) {\n stbi__rewind(s);\n return 0;\n }\n stbi__skip(s,4); // skip image x and y origin\n tga_colormap_bpp = sz;\n } else { // \"normal\" image w/o colormap - only RGB or grey allowed, +/- RLE\n if ( (tga_image_type != 2) && (tga_image_type != 3) && (tga_image_type != 10) && (tga_image_type != 11) ) {\n stbi__rewind(s);\n return 0; // only RGB or grey allowed, +/- RLE\n }\n stbi__skip(s,9); // skip colormap specification and image x/y origin\n tga_colormap_bpp = 0;\n }\n tga_w = stbi__get16le(s);\n if( tga_w < 1 ) {\n stbi__rewind(s);\n return 0; // test width\n }\n tga_h = stbi__get16le(s);\n if( tga_h < 1 ) {\n stbi__rewind(s);\n return 0; // test height\n }\n tga_bits_per_pixel = stbi__get8(s); // bits per pixel\n stbi__get8(s); // ignore alpha bits\n if (tga_colormap_bpp != 0) {\n if((tga_bits_per_pixel != 8) && (tga_bits_per_pixel != 16)) {\n // when using a colormap, tga_bits_per_pixel is the size of the indexes\n // I don't think anything but 8 or 16bit indexes makes sense\n stbi__rewind(s);\n return 0;\n }\n tga_comp = stbi__tga_get_comp(tga_colormap_bpp, 0, NULL);\n } else {\n tga_comp = stbi__tga_get_comp(tga_bits_per_pixel, (tga_image_type == 3) || (tga_image_type == 11), NULL);\n }\n if(!tga_comp) {\n stbi__rewind(s);\n return 0;\n }\n if (x) *x = tga_w;\n if (y) *y = tga_h;\n if (comp) *comp = tga_comp;\n return 1; // seems to have passed everything\n}\n\nstatic int stbi__tga_test(stbi__context *s)\n{\n int res = 0;\n int sz, tga_color_type;\n stbi__get8(s); // discard Offset\n tga_color_type = stbi__get8(s); // color type\n if ( tga_color_type > 1 ) goto errorEnd; // only RGB or indexed allowed\n sz = stbi__get8(s); // image type\n if ( tga_color_type == 1 ) { // colormapped (paletted) image\n if (sz != 1 && sz != 9) goto errorEnd; // colortype 1 demands image type 1 or 9\n stbi__skip(s,4); // skip index of first colormap entry and number of entries\n sz = stbi__get8(s); // check bits per palette color entry\n if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) goto errorEnd;\n stbi__skip(s,4); // skip image x and y origin\n } else { // \"normal\" image w/o colormap\n if ( (sz != 2) && (sz != 3) && (sz != 10) && (sz != 11) ) goto errorEnd; // only RGB or grey allowed, +/- RLE\n stbi__skip(s,9); // skip colormap specification and image x/y origin\n }\n if ( stbi__get16le(s) < 1 ) goto errorEnd; // test width\n if ( stbi__get16le(s) < 1 ) goto errorEnd; // test height\n sz = stbi__get8(s); // bits per pixel\n if ( (tga_color_type == 1) && (sz != 8) && (sz != 16) ) goto errorEnd; // for colormapped images, bpp is size of an index\n if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) goto errorEnd;\n\n res = 1; // if we got this far, everything's good and we can return 1 instead of 0\n\nerrorEnd:\n stbi__rewind(s);\n return res;\n}\n\n// read 16bit value and convert to 24bit RGB\nstatic void stbi__tga_read_rgb16(stbi__context *s, stbi_uc* out)\n{\n stbi__uint16 px = (stbi__uint16)stbi__get16le(s);\n stbi__uint16 fiveBitMask = 31;\n // we have 3 channels with 5bits each\n int r = (px >> 10) & fiveBitMask;\n int g = (px >> 5) & fiveBitMask;\n int b = px & fiveBitMask;\n // Note that this saves the data in RGB(A) order, so it doesn't need to be swapped later\n out[0] = (stbi_uc)((r * 255)/31);\n out[1] = (stbi_uc)((g * 255)/31);\n out[2] = (stbi_uc)((b * 255)/31);\n\n // some people claim that the most significant bit might be used for alpha\n // (possibly if an alpha-bit is set in the \"image descriptor byte\")\n // but that only made 16bit test images completely translucent..\n // so let's treat all 15 and 16bit TGAs as RGB with no alpha.\n}\n\nstatic void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)\n{\n // read in the TGA header stuff\n int tga_offset = stbi__get8(s);\n int tga_indexed = stbi__get8(s);\n int tga_image_type = stbi__get8(s);\n int tga_is_RLE = 0;\n int tga_palette_start = stbi__get16le(s);\n int tga_palette_len = stbi__get16le(s);\n int tga_palette_bits = stbi__get8(s);\n int tga_x_origin = stbi__get16le(s);\n int tga_y_origin = stbi__get16le(s);\n int tga_width = stbi__get16le(s);\n int tga_height = stbi__get16le(s);\n int tga_bits_per_pixel = stbi__get8(s);\n int tga_comp, tga_rgb16=0;\n int tga_inverted = stbi__get8(s);\n // int tga_alpha_bits = tga_inverted & 15; // the 4 lowest bits - unused (useless?)\n // image data\n unsigned char *tga_data;\n unsigned char *tga_palette = NULL;\n int i, j;\n unsigned char raw_data[4] = {0};\n int RLE_count = 0;\n int RLE_repeating = 0;\n int read_next_pixel = 1;\n STBI_NOTUSED(ri);\n\n // do a tiny bit of precessing\n if ( tga_image_type >= 8 )\n {\n tga_image_type -= 8;\n tga_is_RLE = 1;\n }\n tga_inverted = 1 - ((tga_inverted >> 5) & 1);\n\n // If I'm paletted, then I'll use the number of bits from the palette\n if ( tga_indexed ) tga_comp = stbi__tga_get_comp(tga_palette_bits, 0, &tga_rgb16);\n else tga_comp = stbi__tga_get_comp(tga_bits_per_pixel, (tga_image_type == 3), &tga_rgb16);\n\n if(!tga_comp) // shouldn't really happen, stbi__tga_test() should have ensured basic consistency\n return stbi__errpuc(\"bad format\", \"Can't find out TGA pixelformat\");\n\n // tga info\n *x = tga_width;\n *y = tga_height;\n if (comp) *comp = tga_comp;\n\n if (!stbi__mad3sizes_valid(tga_width, tga_height, tga_comp, 0))\n return stbi__errpuc(\"too large\", \"Corrupt TGA\");\n\n tga_data = (unsigned char*)stbi__malloc_mad3(tga_width, tga_height, tga_comp, 0);\n if (!tga_data) return stbi__errpuc(\"outofmem\", \"Out of memory\");\n\n // skip to the data's starting position (offset usually = 0)\n stbi__skip(s, tga_offset );\n\n if ( !tga_indexed && !tga_is_RLE && !tga_rgb16 ) {\n for (i=0; i < tga_height; ++i) {\n int row = tga_inverted ? tga_height -i - 1 : i;\n stbi_uc *tga_row = tga_data + row*tga_width*tga_comp;\n stbi__getn(s, tga_row, tga_width * tga_comp);\n }\n } else {\n // do I need to load a palette?\n if ( tga_indexed)\n {\n // any data to skip? (offset usually = 0)\n stbi__skip(s, tga_palette_start );\n // load the palette\n tga_palette = (unsigned char*)stbi__malloc_mad2(tga_palette_len, tga_comp, 0);\n if (!tga_palette) {\n STBI_FREE(tga_data);\n return stbi__errpuc(\"outofmem\", \"Out of memory\");\n }\n if (tga_rgb16) {\n stbi_uc *pal_entry = tga_palette;\n STBI_ASSERT(tga_comp == STBI_rgb);\n for (i=0; i < tga_palette_len; ++i) {\n stbi__tga_read_rgb16(s, pal_entry);\n pal_entry += tga_comp;\n }\n } else if (!stbi__getn(s, tga_palette, tga_palette_len * tga_comp)) {\n STBI_FREE(tga_data);\n STBI_FREE(tga_palette);\n return stbi__errpuc(\"bad palette\", \"Corrupt TGA\");\n }\n }\n // load the data\n for (i=0; i < tga_width * tga_height; ++i)\n {\n // if I'm in RLE mode, do I need to get a RLE stbi__pngchunk?\n if ( tga_is_RLE )\n {\n if ( RLE_count == 0 )\n {\n // yep, get the next byte as a RLE command\n int RLE_cmd = stbi__get8(s);\n RLE_count = 1 + (RLE_cmd & 127);\n RLE_repeating = RLE_cmd >> 7;\n read_next_pixel = 1;\n } else if ( !RLE_repeating )\n {\n read_next_pixel = 1;\n }\n } else\n {\n read_next_pixel = 1;\n }\n // OK, if I need to read a pixel, do it now\n if ( read_next_pixel )\n {\n // load however much data we did have\n if ( tga_indexed )\n {\n // read in index, then perform the lookup\n int pal_idx = (tga_bits_per_pixel == 8) ? stbi__get8(s) : stbi__get16le(s);\n if ( pal_idx >= tga_palette_len ) {\n // invalid index\n pal_idx = 0;\n }\n pal_idx *= tga_comp;\n for (j = 0; j < tga_comp; ++j) {\n raw_data[j] = tga_palette[pal_idx+j];\n }\n } else if(tga_rgb16) {\n STBI_ASSERT(tga_comp == STBI_rgb);\n stbi__tga_read_rgb16(s, raw_data);\n } else {\n // read in the data raw\n for (j = 0; j < tga_comp; ++j) {\n raw_data[j] = stbi__get8(s);\n }\n }\n // clear the reading flag for the next pixel\n read_next_pixel = 0;\n } // end of reading a pixel\n\n // copy data\n for (j = 0; j < tga_comp; ++j)\n tga_data[i*tga_comp+j] = raw_data[j];\n\n // in case we're in RLE mode, keep counting down\n --RLE_count;\n }\n // do I need to invert the image?\n if ( tga_inverted )\n {\n for (j = 0; j*2 < tga_height; ++j)\n {\n int index1 = j * tga_width * tga_comp;\n int index2 = (tga_height - 1 - j) * tga_width * tga_comp;\n for (i = tga_width * tga_comp; i > 0; --i)\n {\n unsigned char temp = tga_data[index1];\n tga_data[index1] = tga_data[index2];\n tga_data[index2] = temp;\n ++index1;\n ++index2;\n }\n }\n }\n // clear my palette, if I had one\n if ( tga_palette != NULL )\n {\n STBI_FREE( tga_palette );\n }\n }\n\n // swap RGB - if the source data was RGB16, it already is in the right order\n if (tga_comp >= 3 && !tga_rgb16)\n {\n unsigned char* tga_pixel = tga_data;\n for (i=0; i < tga_width * tga_height; ++i)\n {\n unsigned char temp = tga_pixel[0];\n tga_pixel[0] = tga_pixel[2];\n tga_pixel[2] = temp;\n tga_pixel += tga_comp;\n }\n }\n\n // convert to target component count\n if (req_comp && req_comp != tga_comp)\n tga_data = stbi__convert_format(tga_data, tga_comp, req_comp, tga_width, tga_height);\n\n // the things I do to get rid of an error message, and yet keep\n // Microsoft's C compilers happy... [8^(\n tga_palette_start = tga_palette_len = tga_palette_bits =\n tga_x_origin = tga_y_origin = 0;\n // OK, done\n return tga_data;\n}\n#endif\n\n// *************************************************************************************************\n// Photoshop PSD loader -- PD by Thatcher Ulrich, integration by Nicolas Schulz, tweaked by STB\n\n#ifndef STBI_NO_PSD\nstatic int stbi__psd_test(stbi__context *s)\n{\n int r = (stbi__get32be(s) == 0x38425053);\n stbi__rewind(s);\n return r;\n}\n\nstatic int stbi__psd_decode_rle(stbi__context *s, stbi_uc *p, int pixelCount)\n{\n int count, nleft, len;\n\n count = 0;\n while ((nleft = pixelCount - count) > 0) {\n len = stbi__get8(s);\n if (len == 128) {\n // No-op.\n } else if (len < 128) {\n // Copy next len+1 bytes literally.\n len++;\n if (len > nleft) return 0; // corrupt data\n count += len;\n while (len) {\n *p = stbi__get8(s);\n p += 4;\n len--;\n }\n } else if (len > 128) {\n stbi_uc val;\n // Next -len+1 bytes in the dest are replicated from next source byte.\n // (Interpret len as a negative 8-bit int.)\n len = 257 - len;\n if (len > nleft) return 0; // corrupt data\n val = stbi__get8(s);\n count += len;\n while (len) {\n *p = val;\n p += 4;\n len--;\n }\n }\n }\n\n return 1;\n}\n\nstatic void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri, int bpc)\n{\n int pixelCount;\n int channelCount, compression;\n int channel, i;\n int bitdepth;\n int w,h;\n stbi_uc *out;\n STBI_NOTUSED(ri);\n\n // Check identifier\n if (stbi__get32be(s) != 0x38425053) // \"8BPS\"\n return stbi__errpuc(\"not PSD\", \"Corrupt PSD image\");\n\n // Check file type version.\n if (stbi__get16be(s) != 1)\n return stbi__errpuc(\"wrong version\", \"Unsupported version of PSD image\");\n\n // Skip 6 reserved bytes.\n stbi__skip(s, 6 );\n\n // Read the number of channels (R, G, B, A, etc).\n channelCount = stbi__get16be(s);\n if (channelCount < 0 || channelCount > 16)\n return stbi__errpuc(\"wrong channel count\", \"Unsupported number of channels in PSD image\");\n\n // Read the rows and columns of the image.\n h = stbi__get32be(s);\n w = stbi__get32be(s);\n\n // Make sure the depth is 8 bits.\n bitdepth = stbi__get16be(s);\n if (bitdepth != 8 && bitdepth != 16)\n return stbi__errpuc(\"unsupported bit depth\", \"PSD bit depth is not 8 or 16 bit\");\n\n // Make sure the color mode is RGB.\n // Valid options are:\n // 0: Bitmap\n // 1: Grayscale\n // 2: Indexed color\n // 3: RGB color\n // 4: CMYK color\n // 7: Multichannel\n // 8: Duotone\n // 9: Lab color\n if (stbi__get16be(s) != 3)\n return stbi__errpuc(\"wrong color format\", \"PSD is not in RGB color format\");\n\n // Skip the Mode Data. (It's the palette for indexed color; other info for other modes.)\n stbi__skip(s,stbi__get32be(s) );\n\n // Skip the image resources. (resolution, pen tool paths, etc)\n stbi__skip(s, stbi__get32be(s) );\n\n // Skip the reserved data.\n stbi__skip(s, stbi__get32be(s) );\n\n // Find out if the data is compressed.\n // Known values:\n // 0: no compression\n // 1: RLE compressed\n compression = stbi__get16be(s);\n if (compression > 1)\n return stbi__errpuc(\"bad compression\", \"PSD has an unknown compression format\");\n\n // Check size\n if (!stbi__mad3sizes_valid(4, w, h, 0))\n return stbi__errpuc(\"too large\", \"Corrupt PSD\");\n\n // Create the destination image.\n\n if (!compression && bitdepth == 16 && bpc == 16) {\n out = (stbi_uc *) stbi__malloc_mad3(8, w, h, 0);\n ri->bits_per_channel = 16;\n } else\n out = (stbi_uc *) stbi__malloc(4 * w*h);\n\n if (!out) return stbi__errpuc(\"outofmem\", \"Out of memory\");\n pixelCount = w*h;\n\n // Initialize the data to zero.\n //memset( out, 0, pixelCount * 4 );\n\n // Finally, the image data.\n if (compression) {\n // RLE as used by .PSD and .TIFF\n // Loop until you get the number of unpacked bytes you are expecting:\n // Read the next source byte into n.\n // If n is between 0 and 127 inclusive, copy the next n+1 bytes literally.\n // Else if n is between -127 and -1 inclusive, copy the next byte -n+1 times.\n // Else if n is 128, noop.\n // Endloop\n\n // The RLE-compressed data is preceeded by a 2-byte data count for each row in the data,\n // which we're going to just skip.\n stbi__skip(s, h * channelCount * 2 );\n\n // Read the RLE data by channel.\n for (channel = 0; channel < 4; channel++) {\n stbi_uc *p;\n\n p = out+channel;\n if (channel >= channelCount) {\n // Fill this channel with default data.\n for (i = 0; i < pixelCount; i++, p += 4)\n *p = (channel == 3 ? 255 : 0);\n } else {\n // Read the RLE data.\n if (!stbi__psd_decode_rle(s, p, pixelCount)) {\n STBI_FREE(out);\n return stbi__errpuc(\"corrupt\", \"bad RLE data\");\n }\n }\n }\n\n } else {\n // We're at the raw image data. It's each channel in order (Red, Green, Blue, Alpha, ...)\n // where each channel consists of an 8-bit (or 16-bit) value for each pixel in the image.\n\n // Read the data by channel.\n for (channel = 0; channel < 4; channel++) {\n if (channel >= channelCount) {\n // Fill this channel with default data.\n if (bitdepth == 16 && bpc == 16) {\n stbi__uint16 *q = ((stbi__uint16 *) out) + channel;\n stbi__uint16 val = channel == 3 ? 65535 : 0;\n for (i = 0; i < pixelCount; i++, q += 4)\n *q = val;\n } else {\n stbi_uc *p = out+channel;\n stbi_uc val = channel == 3 ? 255 : 0;\n for (i = 0; i < pixelCount; i++, p += 4)\n *p = val;\n }\n } else {\n if (ri->bits_per_channel == 16) { // output bpc\n stbi__uint16 *q = ((stbi__uint16 *) out) + channel;\n for (i = 0; i < pixelCount; i++, q += 4)\n *q = (stbi__uint16) stbi__get16be(s);\n } else {\n stbi_uc *p = out+channel;\n if (bitdepth == 16) { // input bpc\n for (i = 0; i < pixelCount; i++, p += 4)\n *p = (stbi_uc) (stbi__get16be(s) >> 8);\n } else {\n for (i = 0; i < pixelCount; i++, p += 4)\n *p = stbi__get8(s);\n }\n }\n }\n }\n }\n\n // remove weird white matte from PSD\n if (channelCount >= 4) {\n if (ri->bits_per_channel == 16) {\n for (i=0; i < w*h; ++i) {\n stbi__uint16 *pixel = (stbi__uint16 *) out + 4*i;\n if (pixel[3] != 0 && pixel[3] != 65535) {\n float a = pixel[3] / 65535.0f;\n float ra = 1.0f / a;\n float inv_a = 65535.0f * (1 - ra);\n pixel[0] = (stbi__uint16) (pixel[0]*ra + inv_a);\n pixel[1] = (stbi__uint16) (pixel[1]*ra + inv_a);\n pixel[2] = (stbi__uint16) (pixel[2]*ra + inv_a);\n }\n }\n } else {\n for (i=0; i < w*h; ++i) {\n unsigned char *pixel = out + 4*i;\n if (pixel[3] != 0 && pixel[3] != 255) {\n float a = pixel[3] / 255.0f;\n float ra = 1.0f / a;\n float inv_a = 255.0f * (1 - ra);\n pixel[0] = (unsigned char) (pixel[0]*ra + inv_a);\n pixel[1] = (unsigned char) (pixel[1]*ra + inv_a);\n pixel[2] = (unsigned char) (pixel[2]*ra + inv_a);\n }\n }\n }\n }\n\n // convert to desired output format\n if (req_comp && req_comp != 4) {\n if (ri->bits_per_channel == 16)\n out = (stbi_uc *) stbi__convert_format16((stbi__uint16 *) out, 4, req_comp, w, h);\n else\n out = stbi__convert_format(out, 4, req_comp, w, h);\n if (out == NULL) return out; // stbi__convert_format frees input on failure\n }\n\n if (comp) *comp = 4;\n *y = h;\n *x = w;\n\n return out;\n}\n#endif\n\n// *************************************************************************************************\n// Softimage PIC loader\n// by Tom Seddon\n//\n// See http://softimage.wiki.softimage.com/index.php/INFO:_PIC_file_format\n// See http://ozviz.wasp.uwa.edu.au/~pbourke/dataformats/softimagepic/\n\n#ifndef STBI_NO_PIC\nstatic int stbi__pic_is4(stbi__context *s,const char *str)\n{\n int i;\n for (i=0; i<4; ++i)\n if (stbi__get8(s) != (stbi_uc)str[i])\n return 0;\n\n return 1;\n}\n\nstatic int stbi__pic_test_core(stbi__context *s)\n{\n int i;\n\n if (!stbi__pic_is4(s,\"\\x53\\x80\\xF6\\x34\"))\n return 0;\n\n for(i=0;i<84;++i)\n stbi__get8(s);\n\n if (!stbi__pic_is4(s,\"PICT\"))\n return 0;\n\n return 1;\n}\n\ntypedef struct\n{\n stbi_uc size,type,channel;\n} stbi__pic_packet;\n\nstatic stbi_uc *stbi__readval(stbi__context *s, int channel, stbi_uc *dest)\n{\n int mask=0x80, i;\n\n for (i=0; i<4; ++i, mask>>=1) {\n if (channel & mask) {\n if (stbi__at_eof(s)) return stbi__errpuc(\"bad file\",\"PIC file too short\");\n dest[i]=stbi__get8(s);\n }\n }\n\n return dest;\n}\n\nstatic void stbi__copyval(int channel,stbi_uc *dest,const stbi_uc *src)\n{\n int mask=0x80,i;\n\n for (i=0;i<4; ++i, mask>>=1)\n if (channel&mask)\n dest[i]=src[i];\n}\n\nstatic stbi_uc *stbi__pic_load_core(stbi__context *s,int width,int height,int *comp, stbi_uc *result)\n{\n int act_comp=0,num_packets=0,y,chained;\n stbi__pic_packet packets[10];\n\n // this will (should...) cater for even some bizarre stuff like having data\n // for the same channel in multiple packets.\n do {\n stbi__pic_packet *packet;\n\n if (num_packets==sizeof(packets)/sizeof(packets[0]))\n return stbi__errpuc(\"bad format\",\"too many packets\");\n\n packet = &packets[num_packets++];\n\n chained = stbi__get8(s);\n packet->size = stbi__get8(s);\n packet->type = stbi__get8(s);\n packet->channel = stbi__get8(s);\n\n act_comp |= packet->channel;\n\n if (stbi__at_eof(s)) return stbi__errpuc(\"bad file\",\"file too short (reading packets)\");\n if (packet->size != 8) return stbi__errpuc(\"bad format\",\"packet isn't 8bpp\");\n } while (chained);\n\n *comp = (act_comp & 0x10 ? 4 : 3); // has alpha channel?\n\n for(y=0; ytype) {\n default:\n return stbi__errpuc(\"bad format\",\"packet has bad compression type\");\n\n case 0: {//uncompressed\n int x;\n\n for(x=0;xchannel,dest))\n return 0;\n break;\n }\n\n case 1://Pure RLE\n {\n int left=width, i;\n\n while (left>0) {\n stbi_uc count,value[4];\n\n count=stbi__get8(s);\n if (stbi__at_eof(s)) return stbi__errpuc(\"bad file\",\"file too short (pure read count)\");\n\n if (count > left)\n count = (stbi_uc) left;\n\n if (!stbi__readval(s,packet->channel,value)) return 0;\n\n for(i=0; ichannel,dest,value);\n left -= count;\n }\n }\n break;\n\n case 2: {//Mixed RLE\n int left=width;\n while (left>0) {\n int count = stbi__get8(s), i;\n if (stbi__at_eof(s)) return stbi__errpuc(\"bad file\",\"file too short (mixed read count)\");\n\n if (count >= 128) { // Repeated\n stbi_uc value[4];\n\n if (count==128)\n count = stbi__get16be(s);\n else\n count -= 127;\n if (count > left)\n return stbi__errpuc(\"bad file\",\"scanline overrun\");\n\n if (!stbi__readval(s,packet->channel,value))\n return 0;\n\n for(i=0;ichannel,dest,value);\n } else { // Raw\n ++count;\n if (count>left) return stbi__errpuc(\"bad file\",\"scanline overrun\");\n\n for(i=0;ichannel,dest))\n return 0;\n }\n left-=count;\n }\n break;\n }\n }\n }\n }\n\n return result;\n}\n\nstatic void *stbi__pic_load(stbi__context *s,int *px,int *py,int *comp,int req_comp, stbi__result_info *ri)\n{\n stbi_uc *result;\n int i, x,y;\n STBI_NOTUSED(ri);\n\n for (i=0; i<92; ++i)\n stbi__get8(s);\n\n x = stbi__get16be(s);\n y = stbi__get16be(s);\n if (stbi__at_eof(s)) return stbi__errpuc(\"bad file\",\"file too short (pic header)\");\n if (!stbi__mad3sizes_valid(x, y, 4, 0)) return stbi__errpuc(\"too large\", \"PIC image too large to decode\");\n\n stbi__get32be(s); //skip `ratio'\n stbi__get16be(s); //skip `fields'\n stbi__get16be(s); //skip `pad'\n\n // intermediate buffer is RGBA\n result = (stbi_uc *) stbi__malloc_mad3(x, y, 4, 0);\n memset(result, 0xff, x*y*4);\n\n if (!stbi__pic_load_core(s,x,y,comp, result)) {\n STBI_FREE(result);\n result=0;\n }\n *px = x;\n *py = y;\n if (req_comp == 0) req_comp = *comp;\n result=stbi__convert_format(result,4,req_comp,x,y);\n\n return result;\n}\n\nstatic int stbi__pic_test(stbi__context *s)\n{\n int r = stbi__pic_test_core(s);\n stbi__rewind(s);\n return r;\n}\n#endif\n\n// *************************************************************************************************\n// GIF loader -- public domain by Jean-Marc Lienher -- simplified/shrunk by stb\n\n#ifndef STBI_NO_GIF\ntypedef struct\n{\n stbi__int16 prefix;\n stbi_uc first;\n stbi_uc suffix;\n} stbi__gif_lzw;\n\ntypedef struct\n{\n int w,h;\n stbi_uc *out, *old_out; // output buffer (always 4 components)\n int flags, bgindex, ratio, transparent, eflags, delay;\n stbi_uc pal[256][4];\n stbi_uc lpal[256][4];\n stbi__gif_lzw codes[4096];\n stbi_uc *color_table;\n int parse, step;\n int lflags;\n int start_x, start_y;\n int max_x, max_y;\n int cur_x, cur_y;\n int line_size;\n} stbi__gif;\n\nstatic int stbi__gif_test_raw(stbi__context *s)\n{\n int sz;\n if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8') return 0;\n sz = stbi__get8(s);\n if (sz != '9' && sz != '7') return 0;\n if (stbi__get8(s) != 'a') return 0;\n return 1;\n}\n\nstatic int stbi__gif_test(stbi__context *s)\n{\n int r = stbi__gif_test_raw(s);\n stbi__rewind(s);\n return r;\n}\n\nstatic void stbi__gif_parse_colortable(stbi__context *s, stbi_uc pal[256][4], int num_entries, int transp)\n{\n int i;\n for (i=0; i < num_entries; ++i) {\n pal[i][2] = stbi__get8(s);\n pal[i][1] = stbi__get8(s);\n pal[i][0] = stbi__get8(s);\n pal[i][3] = transp == i ? 0 : 255;\n }\n}\n\nstatic int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, int is_info)\n{\n stbi_uc version;\n if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8')\n return stbi__err(\"not GIF\", \"Corrupt GIF\");\n\n version = stbi__get8(s);\n if (version != '7' && version != '9') return stbi__err(\"not GIF\", \"Corrupt GIF\");\n if (stbi__get8(s) != 'a') return stbi__err(\"not GIF\", \"Corrupt GIF\");\n\n stbi__g_failure_reason = \"\";\n g->w = stbi__get16le(s);\n g->h = stbi__get16le(s);\n g->flags = stbi__get8(s);\n g->bgindex = stbi__get8(s);\n g->ratio = stbi__get8(s);\n g->transparent = -1;\n\n if (comp != 0) *comp = 4; // can't actually tell whether it's 3 or 4 until we parse the comments\n\n if (is_info) return 1;\n\n if (g->flags & 0x80)\n stbi__gif_parse_colortable(s,g->pal, 2 << (g->flags & 7), -1);\n\n return 1;\n}\n\nstatic int stbi__gif_info_raw(stbi__context *s, int *x, int *y, int *comp)\n{\n stbi__gif* g = (stbi__gif*) stbi__malloc(sizeof(stbi__gif));\n if (!stbi__gif_header(s, g, comp, 1)) {\n STBI_FREE(g);\n stbi__rewind( s );\n return 0;\n }\n if (x) *x = g->w;\n if (y) *y = g->h;\n STBI_FREE(g);\n return 1;\n}\n\nstatic void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code)\n{\n stbi_uc *p, *c;\n\n // recurse to decode the prefixes, since the linked-list is backwards,\n // and working backwards through an interleaved image would be nasty\n if (g->codes[code].prefix >= 0)\n stbi__out_gif_code(g, g->codes[code].prefix);\n\n if (g->cur_y >= g->max_y) return;\n\n p = &g->out[g->cur_x + g->cur_y];\n c = &g->color_table[g->codes[code].suffix * 4];\n\n if (c[3] >= 128) {\n p[0] = c[2];\n p[1] = c[1];\n p[2] = c[0];\n p[3] = c[3];\n }\n g->cur_x += 4;\n\n if (g->cur_x >= g->max_x) {\n g->cur_x = g->start_x;\n g->cur_y += g->step;\n\n while (g->cur_y >= g->max_y && g->parse > 0) {\n g->step = (1 << g->parse) * g->line_size;\n g->cur_y = g->start_y + (g->step >> 1);\n --g->parse;\n }\n }\n}\n\nstatic stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g)\n{\n stbi_uc lzw_cs;\n stbi__int32 len, init_code;\n stbi__uint32 first;\n stbi__int32 codesize, codemask, avail, oldcode, bits, valid_bits, clear;\n stbi__gif_lzw *p;\n\n lzw_cs = stbi__get8(s);\n if (lzw_cs > 12) return NULL;\n clear = 1 << lzw_cs;\n first = 1;\n codesize = lzw_cs + 1;\n codemask = (1 << codesize) - 1;\n bits = 0;\n valid_bits = 0;\n for (init_code = 0; init_code < clear; init_code++) {\n g->codes[init_code].prefix = -1;\n g->codes[init_code].first = (stbi_uc) init_code;\n g->codes[init_code].suffix = (stbi_uc) init_code;\n }\n\n // support no starting clear code\n avail = clear+2;\n oldcode = -1;\n\n len = 0;\n for(;;) {\n if (valid_bits < codesize) {\n if (len == 0) {\n len = stbi__get8(s); // start new block\n if (len == 0)\n return g->out;\n }\n --len;\n bits |= (stbi__int32) stbi__get8(s) << valid_bits;\n valid_bits += 8;\n } else {\n stbi__int32 code = bits & codemask;\n bits >>= codesize;\n valid_bits -= codesize;\n // @OPTIMIZE: is there some way we can accelerate the non-clear path?\n if (code == clear) { // clear code\n codesize = lzw_cs + 1;\n codemask = (1 << codesize) - 1;\n avail = clear + 2;\n oldcode = -1;\n first = 0;\n } else if (code == clear + 1) { // end of stream code\n stbi__skip(s, len);\n while ((len = stbi__get8(s)) > 0)\n stbi__skip(s,len);\n return g->out;\n } else if (code <= avail) {\n if (first) return stbi__errpuc(\"no clear code\", \"Corrupt GIF\");\n\n if (oldcode >= 0) {\n p = &g->codes[avail++];\n if (avail > 4096) return stbi__errpuc(\"too many codes\", \"Corrupt GIF\");\n p->prefix = (stbi__int16) oldcode;\n p->first = g->codes[oldcode].first;\n p->suffix = (code == avail) ? p->first : g->codes[code].first;\n } else if (code == avail)\n return stbi__errpuc(\"illegal code in raster\", \"Corrupt GIF\");\n\n stbi__out_gif_code(g, (stbi__uint16) code);\n\n if ((avail & codemask) == 0 && avail <= 0x0FFF) {\n codesize++;\n codemask = (1 << codesize) - 1;\n }\n\n oldcode = code;\n } else {\n return stbi__errpuc(\"illegal code in raster\", \"Corrupt GIF\");\n }\n }\n }\n}\n\nstatic void stbi__fill_gif_background(stbi__gif *g, int x0, int y0, int x1, int y1)\n{\n int x, y;\n stbi_uc *c = g->pal[g->bgindex];\n for (y = y0; y < y1; y += 4 * g->w) {\n for (x = x0; x < x1; x += 4) {\n stbi_uc *p = &g->out[y + x];\n p[0] = c[2];\n p[1] = c[1];\n p[2] = c[0];\n p[3] = 0;\n }\n }\n}\n\n// this function is designed to support animated gifs, although stb_image doesn't support it\nstatic stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, int req_comp)\n{\n int i;\n stbi_uc *prev_out = 0;\n\n if (g->out == 0 && !stbi__gif_header(s, g, comp,0))\n return 0; // stbi__g_failure_reason set by stbi__gif_header\n\n if (!stbi__mad3sizes_valid(g->w, g->h, 4, 0))\n return stbi__errpuc(\"too large\", \"GIF too large\");\n\n prev_out = g->out;\n g->out = (stbi_uc *) stbi__malloc_mad3(4, g->w, g->h, 0);\n if (g->out == 0) return stbi__errpuc(\"outofmem\", \"Out of memory\");\n\n switch ((g->eflags & 0x1C) >> 2) {\n case 0: // unspecified (also always used on 1st frame)\n stbi__fill_gif_background(g, 0, 0, 4 * g->w, 4 * g->w * g->h);\n break;\n case 1: // do not dispose\n if (prev_out) memcpy(g->out, prev_out, 4 * g->w * g->h);\n g->old_out = prev_out;\n break;\n case 2: // dispose to background\n if (prev_out) memcpy(g->out, prev_out, 4 * g->w * g->h);\n stbi__fill_gif_background(g, g->start_x, g->start_y, g->max_x, g->max_y);\n break;\n case 3: // dispose to previous\n if (g->old_out) {\n for (i = g->start_y; i < g->max_y; i += 4 * g->w)\n memcpy(&g->out[i + g->start_x], &g->old_out[i + g->start_x], g->max_x - g->start_x);\n }\n break;\n }\n\n for (;;) {\n switch (stbi__get8(s)) {\n case 0x2C: /* Image Descriptor */\n {\n int prev_trans = -1;\n stbi__int32 x, y, w, h;\n stbi_uc *o;\n\n x = stbi__get16le(s);\n y = stbi__get16le(s);\n w = stbi__get16le(s);\n h = stbi__get16le(s);\n if (((x + w) > (g->w)) || ((y + h) > (g->h)))\n return stbi__errpuc(\"bad Image Descriptor\", \"Corrupt GIF\");\n\n g->line_size = g->w * 4;\n g->start_x = x * 4;\n g->start_y = y * g->line_size;\n g->max_x = g->start_x + w * 4;\n g->max_y = g->start_y + h * g->line_size;\n g->cur_x = g->start_x;\n g->cur_y = g->start_y;\n\n g->lflags = stbi__get8(s);\n\n if (g->lflags & 0x40) {\n g->step = 8 * g->line_size; // first interlaced spacing\n g->parse = 3;\n } else {\n g->step = g->line_size;\n g->parse = 0;\n }\n\n if (g->lflags & 0x80) {\n stbi__gif_parse_colortable(s,g->lpal, 2 << (g->lflags & 7), g->eflags & 0x01 ? g->transparent : -1);\n g->color_table = (stbi_uc *) g->lpal;\n } else if (g->flags & 0x80) {\n if (g->transparent >= 0 && (g->eflags & 0x01)) {\n prev_trans = g->pal[g->transparent][3];\n g->pal[g->transparent][3] = 0;\n }\n g->color_table = (stbi_uc *) g->pal;\n } else\n return stbi__errpuc(\"missing color table\", \"Corrupt GIF\");\n\n o = stbi__process_gif_raster(s, g);\n if (o == NULL) return NULL;\n\n if (prev_trans != -1)\n g->pal[g->transparent][3] = (stbi_uc) prev_trans;\n\n return o;\n }\n\n case 0x21: // Comment Extension.\n {\n int len;\n if (stbi__get8(s) == 0xF9) { // Graphic Control Extension.\n len = stbi__get8(s);\n if (len == 4) {\n g->eflags = stbi__get8(s);\n g->delay = stbi__get16le(s);\n g->transparent = stbi__get8(s);\n } else {\n stbi__skip(s, len);\n break;\n }\n }\n while ((len = stbi__get8(s)) != 0)\n stbi__skip(s, len);\n break;\n }\n\n case 0x3B: // gif stream termination code\n return (stbi_uc *) s; // using '1' causes warning on some compilers\n\n default:\n return stbi__errpuc(\"unknown code\", \"Corrupt GIF\");\n }\n }\n\n STBI_NOTUSED(req_comp);\n}\n\nstatic void *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)\n{\n stbi_uc *u = 0;\n stbi__gif* g = (stbi__gif*) stbi__malloc(sizeof(stbi__gif));\n memset(g, 0, sizeof(*g));\n STBI_NOTUSED(ri);\n\n u = stbi__gif_load_next(s, g, comp, req_comp);\n if (u == (stbi_uc *) s) u = 0; // end of animated gif marker\n if (u) {\n *x = g->w;\n *y = g->h;\n if (req_comp && req_comp != 4)\n u = stbi__convert_format(u, 4, req_comp, g->w, g->h);\n }\n else if (g->out)\n STBI_FREE(g->out);\n STBI_FREE(g);\n return u;\n}\n\nstatic int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp)\n{\n return stbi__gif_info_raw(s,x,y,comp);\n}\n#endif\n\n// *************************************************************************************************\n// Radiance RGBE HDR loader\n// originally by Nicolas Schulz\n#ifndef STBI_NO_HDR\nstatic int stbi__hdr_test_core(stbi__context *s, const char *signature)\n{\n int i;\n for (i=0; signature[i]; ++i)\n if (stbi__get8(s) != signature[i])\n return 0;\n stbi__rewind(s);\n return 1;\n}\n\nstatic int stbi__hdr_test(stbi__context* s)\n{\n int r = stbi__hdr_test_core(s, \"#?RADIANCE\\n\");\n stbi__rewind(s);\n if(!r) {\n r = stbi__hdr_test_core(s, \"#?RGBE\\n\");\n stbi__rewind(s);\n }\n return r;\n}\n\n#define STBI__HDR_BUFLEN 1024\nstatic char *stbi__hdr_gettoken(stbi__context *z, char *buffer)\n{\n int len=0;\n char c = '\\0';\n\n c = (char) stbi__get8(z);\n\n while (!stbi__at_eof(z) && c != '\\n') {\n buffer[len++] = c;\n if (len == STBI__HDR_BUFLEN-1) {\n // flush to end of line\n while (!stbi__at_eof(z) && stbi__get8(z) != '\\n')\n ;\n break;\n }\n c = (char) stbi__get8(z);\n }\n\n buffer[len] = 0;\n return buffer;\n}\n\nstatic void stbi__hdr_convert(float *output, stbi_uc *input, int req_comp)\n{\n if ( input[3] != 0 ) {\n float f1;\n // Exponent\n f1 = (float) ldexp(1.0f, input[3] - (int)(128 + 8));\n if (req_comp <= 2)\n output[0] = (input[0] + input[1] + input[2]) * f1 / 3;\n else {\n output[0] = input[0] * f1;\n output[1] = input[1] * f1;\n output[2] = input[2] * f1;\n }\n if (req_comp == 2) output[1] = 1;\n if (req_comp == 4) output[3] = 1;\n } else {\n switch (req_comp) {\n case 4: output[3] = 1; /* fallthrough */\n case 3: output[0] = output[1] = output[2] = 0;\n break;\n case 2: output[1] = 1; /* fallthrough */\n case 1: output[0] = 0;\n break;\n }\n }\n}\n\nstatic float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)\n{\n char buffer[STBI__HDR_BUFLEN];\n char *token;\n int valid = 0;\n int width, height;\n stbi_uc *scanline;\n float *hdr_data;\n int len;\n unsigned char count, value;\n int i, j, k, c1,c2, z;\n const char *headerToken;\n STBI_NOTUSED(ri);\n\n // Check identifier\n headerToken = stbi__hdr_gettoken(s,buffer);\n if (strcmp(headerToken, \"#?RADIANCE\") != 0 && strcmp(headerToken, \"#?RGBE\") != 0)\n return stbi__errpf(\"not HDR\", \"Corrupt HDR image\");\n\n // Parse header\n for(;;) {\n token = stbi__hdr_gettoken(s,buffer);\n if (token[0] == 0) break;\n if (strcmp(token, \"FORMAT=32-bit_rle_rgbe\") == 0) valid = 1;\n }\n\n if (!valid) return stbi__errpf(\"unsupported format\", \"Unsupported HDR format\");\n\n // Parse width and height\n // can't use sscanf() if we're not using stdio!\n token = stbi__hdr_gettoken(s,buffer);\n if (strncmp(token, \"-Y \", 3)) return stbi__errpf(\"unsupported data layout\", \"Unsupported HDR format\");\n token += 3;\n height = (int) strtol(token, &token, 10);\n while (*token == ' ') ++token;\n if (strncmp(token, \"+X \", 3)) return stbi__errpf(\"unsupported data layout\", \"Unsupported HDR format\");\n token += 3;\n width = (int) strtol(token, NULL, 10);\n\n *x = width;\n *y = height;\n\n if (comp) *comp = 3;\n if (req_comp == 0) req_comp = 3;\n\n if (!stbi__mad4sizes_valid(width, height, req_comp, sizeof(float), 0))\n return stbi__errpf(\"too large\", \"HDR image is too large\");\n\n // Read data\n hdr_data = (float *) stbi__malloc_mad4(width, height, req_comp, sizeof(float), 0);\n if (!hdr_data)\n return stbi__errpf(\"outofmem\", \"Out of memory\");\n\n // Load image data\n // image data is stored as some number of sca\n if ( width < 8 || width >= 32768) {\n // Read flat data\n for (j=0; j < height; ++j) {\n for (i=0; i < width; ++i) {\n stbi_uc rgbe[4];\n main_decode_loop:\n stbi__getn(s, rgbe, 4);\n stbi__hdr_convert(hdr_data + j * width * req_comp + i * req_comp, rgbe, req_comp);\n }\n }\n } else {\n // Read RLE-encoded data\n scanline = NULL;\n\n for (j = 0; j < height; ++j) {\n c1 = stbi__get8(s);\n c2 = stbi__get8(s);\n len = stbi__get8(s);\n if (c1 != 2 || c2 != 2 || (len & 0x80)) {\n // not run-length encoded, so we have to actually use THIS data as a decoded\n // pixel (note this can't be a valid pixel--one of RGB must be >= 128)\n stbi_uc rgbe[4];\n rgbe[0] = (stbi_uc) c1;\n rgbe[1] = (stbi_uc) c2;\n rgbe[2] = (stbi_uc) len;\n rgbe[3] = (stbi_uc) stbi__get8(s);\n stbi__hdr_convert(hdr_data, rgbe, req_comp);\n i = 1;\n j = 0;\n STBI_FREE(scanline);\n goto main_decode_loop; // yes, this makes no sense\n }\n len <<= 8;\n len |= stbi__get8(s);\n if (len != width) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf(\"invalid decoded scanline length\", \"corrupt HDR\"); }\n if (scanline == NULL) {\n scanline = (stbi_uc *) stbi__malloc_mad2(width, 4, 0);\n if (!scanline) {\n STBI_FREE(hdr_data);\n return stbi__errpf(\"outofmem\", \"Out of memory\");\n }\n }\n\n for (k = 0; k < 4; ++k) {\n int nleft;\n i = 0;\n while ((nleft = width - i) > 0) {\n count = stbi__get8(s);\n if (count > 128) {\n // Run\n value = stbi__get8(s);\n count -= 128;\n if (count > nleft) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf(\"corrupt\", \"bad RLE data in HDR\"); }\n for (z = 0; z < count; ++z)\n scanline[i++ * 4 + k] = value;\n } else {\n // Dump\n if (count > nleft) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf(\"corrupt\", \"bad RLE data in HDR\"); }\n for (z = 0; z < count; ++z)\n scanline[i++ * 4 + k] = stbi__get8(s);\n }\n }\n }\n for (i=0; i < width; ++i)\n stbi__hdr_convert(hdr_data+(j*width + i)*req_comp, scanline + i*4, req_comp);\n }\n if (scanline)\n STBI_FREE(scanline);\n }\n\n return hdr_data;\n}\n\nstatic int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp)\n{\n char buffer[STBI__HDR_BUFLEN];\n char *token;\n int valid = 0;\n\n if (stbi__hdr_test(s) == 0) {\n stbi__rewind( s );\n return 0;\n }\n\n for(;;) {\n token = stbi__hdr_gettoken(s,buffer);\n if (token[0] == 0) break;\n if (strcmp(token, \"FORMAT=32-bit_rle_rgbe\") == 0) valid = 1;\n }\n\n if (!valid) {\n stbi__rewind( s );\n return 0;\n }\n token = stbi__hdr_gettoken(s,buffer);\n if (strncmp(token, \"-Y \", 3)) {\n stbi__rewind( s );\n return 0;\n }\n token += 3;\n *y = (int) strtol(token, &token, 10);\n while (*token == ' ') ++token;\n if (strncmp(token, \"+X \", 3)) {\n stbi__rewind( s );\n return 0;\n }\n token += 3;\n *x = (int) strtol(token, NULL, 10);\n *comp = 3;\n return 1;\n}\n#endif // STBI_NO_HDR\n\n#ifndef STBI_NO_BMP\nstatic int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp)\n{\n void *p;\n stbi__bmp_data info;\n\n info.all_a = 255; \n p = stbi__bmp_parse_header(s, &info);\n stbi__rewind( s );\n if (p == NULL)\n return 0;\n *x = s->img_x;\n *y = s->img_y;\n *comp = info.ma ? 4 : 3;\n return 1;\n}\n#endif\n\n#ifndef STBI_NO_PSD\nstatic int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp)\n{\n int channelCount;\n if (stbi__get32be(s) != 0x38425053) {\n stbi__rewind( s );\n return 0;\n }\n if (stbi__get16be(s) != 1) {\n stbi__rewind( s );\n return 0;\n }\n stbi__skip(s, 6);\n channelCount = stbi__get16be(s);\n if (channelCount < 0 || channelCount > 16) {\n stbi__rewind( s );\n return 0;\n }\n *y = stbi__get32be(s);\n *x = stbi__get32be(s);\n if (stbi__get16be(s) != 8) {\n stbi__rewind( s );\n return 0;\n }\n if (stbi__get16be(s) != 3) {\n stbi__rewind( s );\n return 0;\n }\n *comp = 4;\n return 1;\n}\n#endif\n\n#ifndef STBI_NO_PIC\nstatic int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp)\n{\n int act_comp=0,num_packets=0,chained;\n stbi__pic_packet packets[10];\n\n if (!stbi__pic_is4(s,\"\\x53\\x80\\xF6\\x34\")) {\n stbi__rewind(s);\n return 0;\n }\n\n stbi__skip(s, 88);\n\n *x = stbi__get16be(s);\n *y = stbi__get16be(s);\n if (stbi__at_eof(s)) {\n stbi__rewind( s);\n return 0;\n }\n if ( (*x) != 0 && (1 << 28) / (*x) < (*y)) {\n stbi__rewind( s );\n return 0;\n }\n\n stbi__skip(s, 8);\n\n do {\n stbi__pic_packet *packet;\n\n if (num_packets==sizeof(packets)/sizeof(packets[0]))\n return 0;\n\n packet = &packets[num_packets++];\n chained = stbi__get8(s);\n packet->size = stbi__get8(s);\n packet->type = stbi__get8(s);\n packet->channel = stbi__get8(s);\n act_comp |= packet->channel;\n\n if (stbi__at_eof(s)) {\n stbi__rewind( s );\n return 0;\n }\n if (packet->size != 8) {\n stbi__rewind( s );\n return 0;\n }\n } while (chained);\n\n *comp = (act_comp & 0x10 ? 4 : 3);\n\n return 1;\n}\n#endif\n\n// *************************************************************************************************\n// Portable Gray Map and Portable Pixel Map loader\n// by Ken Miller\n//\n// PGM: http://netpbm.sourceforge.net/doc/pgm.html\n// PPM: http://netpbm.sourceforge.net/doc/ppm.html\n//\n// Known limitations:\n// Does not support comments in the header section\n// Does not support ASCII image data (formats P2 and P3)\n// Does not support 16-bit-per-channel\n\n#ifndef STBI_NO_PNM\n\nstatic int stbi__pnm_test(stbi__context *s)\n{\n char p, t;\n p = (char) stbi__get8(s);\n t = (char) stbi__get8(s);\n if (p != 'P' || (t != '5' && t != '6')) {\n stbi__rewind( s );\n return 0;\n }\n return 1;\n}\n\nstatic void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)\n{\n stbi_uc *out;\n STBI_NOTUSED(ri);\n\n if (!stbi__pnm_info(s, (int *)&s->img_x, (int *)&s->img_y, (int *)&s->img_n))\n return 0;\n\n *x = s->img_x;\n *y = s->img_y;\n *comp = s->img_n;\n\n if (!stbi__mad3sizes_valid(s->img_n, s->img_x, s->img_y, 0))\n return stbi__errpuc(\"too large\", \"PNM too large\");\n\n out = (stbi_uc *) stbi__malloc_mad3(s->img_n, s->img_x, s->img_y, 0);\n if (!out) return stbi__errpuc(\"outofmem\", \"Out of memory\");\n stbi__getn(s, out, s->img_n * s->img_x * s->img_y);\n\n if (req_comp && req_comp != s->img_n) {\n out = stbi__convert_format(out, s->img_n, req_comp, s->img_x, s->img_y);\n if (out == NULL) return out; // stbi__convert_format frees input on failure\n }\n return out;\n}\n\nstatic int stbi__pnm_isspace(char c)\n{\n return c == ' ' || c == '\\t' || c == '\\n' || c == '\\v' || c == '\\f' || c == '\\r';\n}\n\nstatic void stbi__pnm_skip_whitespace(stbi__context *s, char *c)\n{\n for (;;) {\n while (!stbi__at_eof(s) && stbi__pnm_isspace(*c))\n *c = (char) stbi__get8(s);\n\n if (stbi__at_eof(s) || *c != '#')\n break;\n\n while (!stbi__at_eof(s) && *c != '\\n' && *c != '\\r' )\n *c = (char) stbi__get8(s);\n }\n}\n\nstatic int stbi__pnm_isdigit(char c)\n{\n return c >= '0' && c <= '9';\n}\n\nstatic int stbi__pnm_getinteger(stbi__context *s, char *c)\n{\n int value = 0;\n\n while (!stbi__at_eof(s) && stbi__pnm_isdigit(*c)) {\n value = value*10 + (*c - '0');\n *c = (char) stbi__get8(s);\n }\n\n return value;\n}\n\nstatic int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp)\n{\n int maxv;\n char c, p, t;\n\n stbi__rewind( s );\n\n // Get identifier\n p = (char) stbi__get8(s);\n t = (char) stbi__get8(s);\n if (p != 'P' || (t != '5' && t != '6')) {\n stbi__rewind( s );\n return 0;\n }\n\n *comp = (t == '6') ? 3 : 1; // '5' is 1-component .pgm; '6' is 3-component .ppm\n\n c = (char) stbi__get8(s);\n stbi__pnm_skip_whitespace(s, &c);\n\n *x = stbi__pnm_getinteger(s, &c); // read width\n stbi__pnm_skip_whitespace(s, &c);\n\n *y = stbi__pnm_getinteger(s, &c); // read height\n stbi__pnm_skip_whitespace(s, &c);\n\n maxv = stbi__pnm_getinteger(s, &c); // read max value\n\n if (maxv > 255)\n return stbi__err(\"max value > 255\", \"PPM image not 8-bit\");\n else\n return 1;\n}\n#endif\n\nstatic int stbi__info_main(stbi__context *s, int *x, int *y, int *comp)\n{\n #ifndef STBI_NO_JPEG\n if (stbi__jpeg_info(s, x, y, comp)) return 1;\n #endif\n\n #ifndef STBI_NO_PNG\n if (stbi__png_info(s, x, y, comp)) return 1;\n #endif\n\n #ifndef STBI_NO_GIF\n if (stbi__gif_info(s, x, y, comp)) return 1;\n #endif\n\n #ifndef STBI_NO_BMP\n if (stbi__bmp_info(s, x, y, comp)) return 1;\n #endif\n\n #ifndef STBI_NO_PSD\n if (stbi__psd_info(s, x, y, comp)) return 1;\n #endif\n\n #ifndef STBI_NO_PIC\n if (stbi__pic_info(s, x, y, comp)) return 1;\n #endif\n\n #ifndef STBI_NO_PNM\n if (stbi__pnm_info(s, x, y, comp)) return 1;\n #endif\n\n #ifndef STBI_NO_HDR\n if (stbi__hdr_info(s, x, y, comp)) return 1;\n #endif\n\n // test tga last because it's a crappy test!\n #ifndef STBI_NO_TGA\n if (stbi__tga_info(s, x, y, comp))\n return 1;\n #endif\n return stbi__err(\"unknown image type\", \"Image not of any known type, or corrupt\");\n}\n\n#ifndef STBI_NO_STDIO\nSTBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp)\n{\n FILE *f = stbi__fopen(filename, \"rb\");\n int result;\n if (!f) return stbi__err(\"can't fopen\", \"Unable to open file\");\n result = stbi_info_from_file(f, x, y, comp);\n fclose(f);\n return result;\n}\n\nSTBIDEF int stbi_info_from_file(FILE *f, int *x, int *y, int *comp)\n{\n int r;\n stbi__context s;\n long pos = ftell(f);\n stbi__start_file(&s, f);\n r = stbi__info_main(&s,x,y,comp);\n fseek(f,pos,SEEK_SET);\n return r;\n}\n#endif // !STBI_NO_STDIO\n\nSTBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp)\n{\n stbi__context s;\n stbi__start_mem(&s,buffer,len);\n return stbi__info_main(&s,x,y,comp);\n}\n\nSTBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int *x, int *y, int *comp)\n{\n stbi__context s;\n stbi__start_callbacks(&s, (stbi_io_callbacks *) c, user);\n return stbi__info_main(&s,x,y,comp);\n}\n\n#endif // STB_IMAGE_IMPLEMENTATION\n\n/*\n revision history:\n 2.13 (2016-11-29) add 16-bit API, only supported for PNG right now\n 2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes\n 2.11 (2016-04-02) allocate large structures on the stack\n remove white matting for transparent PSD\n fix reported channel count for PNG & BMP\n re-enable SSE2 in non-gcc 64-bit\n support RGB-formatted JPEG\n read 16-bit PNGs (only as 8-bit)\n 2.10 (2016-01-22) avoid warning introduced in 2.09 by STBI_REALLOC_SIZED\n 2.09 (2016-01-16) allow comments in PNM files\n 16-bit-per-pixel TGA (not bit-per-component)\n info() for TGA could break due to .hdr handling\n info() for BMP to shares code instead of sloppy parse\n can use STBI_REALLOC_SIZED if allocator doesn't support realloc\n code cleanup\n 2.08 (2015-09-13) fix to 2.07 cleanup, reading RGB PSD as RGBA\n 2.07 (2015-09-13) fix compiler warnings\n partial animated GIF support\n limited 16-bpc PSD support\n #ifdef unused functions\n bug with < 92 byte PIC,PNM,HDR,TGA\n 2.06 (2015-04-19) fix bug where PSD returns wrong '*comp' value\n 2.05 (2015-04-19) fix bug in progressive JPEG handling, fix warning\n 2.04 (2015-04-15) try to re-enable SIMD on MinGW 64-bit\n 2.03 (2015-04-12) extra corruption checking (mmozeiko)\n stbi_set_flip_vertically_on_load (nguillemot)\n fix NEON support; fix mingw support\n 2.02 (2015-01-19) fix incorrect assert, fix warning\n 2.01 (2015-01-17) fix various warnings; suppress SIMD on gcc 32-bit without -msse2\n 2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG\n 2.00 (2014-12-25) optimize JPG, including x86 SSE2 & NEON SIMD (ryg)\n progressive JPEG (stb)\n PGM/PPM support (Ken Miller)\n STBI_MALLOC,STBI_REALLOC,STBI_FREE\n GIF bugfix -- seemingly never worked\n STBI_NO_*, STBI_ONLY_*\n 1.48 (2014-12-14) fix incorrectly-named assert()\n 1.47 (2014-12-14) 1/2/4-bit PNG support, both direct and paletted (Omar Cornut & stb)\n optimize PNG (ryg)\n fix bug in interlaced PNG with user-specified channel count (stb)\n 1.46 (2014-08-26)\n fix broken tRNS chunk (colorkey-style transparency) in non-paletted PNG\n 1.45 (2014-08-16)\n fix MSVC-ARM internal compiler error by wrapping malloc\n 1.44 (2014-08-07)\n various warning fixes from Ronny Chevalier\n 1.43 (2014-07-15)\n fix MSVC-only compiler problem in code changed in 1.42\n 1.42 (2014-07-09)\n don't define _CRT_SECURE_NO_WARNINGS (affects user code)\n fixes to stbi__cleanup_jpeg path\n added STBI_ASSERT to avoid requiring assert.h\n 1.41 (2014-06-25)\n fix search&replace from 1.36 that messed up comments/error messages\n 1.40 (2014-06-22)\n fix gcc struct-initialization warning\n 1.39 (2014-06-15)\n fix to TGA optimization when req_comp != number of components in TGA;\n fix to GIF loading because BMP wasn't rewinding (whoops, no GIFs in my test suite)\n add support for BMP version 5 (more ignored fields)\n 1.38 (2014-06-06)\n suppress MSVC warnings on integer casts truncating values\n fix accidental rename of 'skip' field of I/O\n 1.37 (2014-06-04)\n remove duplicate typedef\n 1.36 (2014-06-03)\n convert to header file single-file library\n if de-iphone isn't set, load iphone images color-swapped instead of returning NULL\n 1.35 (2014-05-27)\n various warnings\n fix broken STBI_SIMD path\n fix bug where stbi_load_from_file no longer left file pointer in correct place\n fix broken non-easy path for 32-bit BMP (possibly never used)\n TGA optimization by Arseny Kapoulkine\n 1.34 (unknown)\n use STBI_NOTUSED in stbi__resample_row_generic(), fix one more leak in tga failure case\n 1.33 (2011-07-14)\n make stbi_is_hdr work in STBI_NO_HDR (as specified), minor compiler-friendly improvements\n 1.32 (2011-07-13)\n support for \"info\" function for all supported filetypes (SpartanJ)\n 1.31 (2011-06-20)\n a few more leak fixes, bug in PNG handling (SpartanJ)\n 1.30 (2011-06-11)\n added ability to load files via callbacks to accomidate custom input streams (Ben Wenger)\n removed deprecated format-specific test/load functions\n removed support for installable file formats (stbi_loader) -- would have been broken for IO callbacks anyway\n error cases in bmp and tga give messages and don't leak (Raymond Barbiero, grisha)\n fix inefficiency in decoding 32-bit BMP (David Woo)\n 1.29 (2010-08-16)\n various warning fixes from Aurelien Pocheville\n 1.28 (2010-08-01)\n fix bug in GIF palette transparency (SpartanJ)\n 1.27 (2010-08-01)\n cast-to-stbi_uc to fix warnings\n 1.26 (2010-07-24)\n fix bug in file buffering for PNG reported by SpartanJ\n 1.25 (2010-07-17)\n refix trans_data warning (Won Chun)\n 1.24 (2010-07-12)\n perf improvements reading from files on platforms with lock-heavy fgetc()\n minor perf improvements for jpeg\n deprecated type-specific functions so we'll get feedback if they're needed\n attempt to fix trans_data warning (Won Chun)\n 1.23 fixed bug in iPhone support\n 1.22 (2010-07-10)\n removed image *writing* support\n stbi_info support from Jetro Lauha\n GIF support from Jean-Marc Lienher\n iPhone PNG-extensions from James Brown\n warning-fixes from Nicolas Schulz and Janez Zemva (i.stbi__err. Janez (U+017D)emva)\n 1.21 fix use of 'stbi_uc' in header (reported by jon blow)\n 1.20 added support for Softimage PIC, by Tom Seddon\n 1.19 bug in interlaced PNG corruption check (found by ryg)\n 1.18 (2008-08-02)\n fix a threading bug (local mutable static)\n 1.17 support interlaced PNG\n 1.16 major bugfix - stbi__convert_format converted one too many pixels\n 1.15 initialize some fields for thread safety\n 1.14 fix threadsafe conversion bug\n header-file-only version (#define STBI_HEADER_FILE_ONLY before including)\n 1.13 threadsafe\n 1.12 const qualifiers in the API\n 1.11 Support installable IDCT, colorspace conversion routines\n 1.10 Fixes for 64-bit (don't use \"unsigned long\")\n optimized upsampling by Fabian \"ryg\" Giesen\n 1.09 Fix format-conversion for PSD code (bad global variables!)\n 1.08 Thatcher Ulrich's PSD code integrated by Nicolas Schulz\n 1.07 attempt to fix C++ warning/errors again\n 1.06 attempt to fix C++ warning/errors again\n 1.05 fix TGA loading to return correct *comp and use good luminance calc\n 1.04 default float alpha is 1, not 255; use 'void *' for stbi_image_free\n 1.03 bugfixes to STBI_NO_STDIO, STBI_NO_HDR\n 1.02 support for (subset of) HDR files, float interface for preferred access to them\n 1.01 fix bug: possible bug in handling right-side up bmps... not sure\n fix bug: the stbi__bmp_load() and stbi__tga_load() functions didn't work at all\n 1.00 interface to zlib that skips zlib header\n 0.99 correct handling of alpha in palette\n 0.98 TGA loader by lonesock; dynamically add loaders (untested)\n 0.97 jpeg errors on too large a file; also catch another malloc failure\n 0.96 fix detection of invalid v value - particleman@mollyrocket forum\n 0.95 during header scan, seek to markers in case of padding\n 0.94 STBI_NO_STDIO to disable stdio usage; rename all #defines the same\n 0.93 handle jpegtran output; verbose errors\n 0.92 read 4,8,16,24,32-bit BMP files of several formats\n 0.91 output 24-bit Windows 3.0 BMP files\n 0.90 fix a few more warnings; bump version number to approach 1.0\n 0.61 bugfixes due to Marc LeBlanc, Christopher Lloyd\n 0.60 fix compiling as c++\n 0.59 fix warnings: merge Dave Moore's -Wall fixes\n 0.58 fix bug: zlib uncompressed mode len/nlen was wrong endian\n 0.57 fix bug: jpg last huffman symbol before marker was >9 bits but less than 16 available\n 0.56 fix bug: zlib uncompressed mode len vs. nlen\n 0.55 fix bug: restart_interval not initialized to 0\n 0.54 allow NULL for 'int *comp'\n 0.53 fix bug in png 3->4; speedup png decoding\n 0.52 png handles req_comp=3,4 directly; minor cleanup; jpeg comments\n 0.51 obey req_comp requests, 1-component jpegs return as 1-component,\n on 'test' only check type, not whether we support this variant\n 0.50 (2006-11-19)\n first released version\n*/\n","// glw_imgui\n// Copyright (C) 2016 Iakov Sumygin - BSD license\n\n#include \"platform_sdl.h\"\n\n#include \n#include \n#include \n#include \n\n#include \n#include \n\n#define STB_IMAGE_IMPLEMENTATION\n#include \"stb_image.h\"\n\nextern SDL_Window* gWindow;\nextern SDL_Renderer* gRenderer;\n\n//coderobe: deleteme\nextern void println(const char* format, ...);\n\nnamespace imgui {\nnamespace {\nconst SDL_SystemCursor mapCursor[CURSOR_COUNT] = {SDL_SYSTEM_CURSOR_ARROW, SDL_SYSTEM_CURSOR_SIZEWE,\n\t\t\t\t\t\t\t\t\t\t\t\t SDL_SYSTEM_CURSOR_SIZENS,\n\t\t\t\t\t\t\t\t\t\t\t\t SDL_SYSTEM_CURSOR_SIZENWSE};\n}\nPlatformSDL::PlatformSDL() {\n\tif (SDL_Init(SDL_INIT_VIDEO) < 0) {\n\t\tprintf(\"SDL could not initialize! SDL Error: %s\\n\", SDL_GetError());\n\t\tthrow;\n\t}\n\tfor (int i = 0; i < CURSOR_COUNT; ++i) _cursors[i] = SDL_CreateSystemCursor(mapCursor[i]);\n}\nPlatformSDL::~PlatformSDL() {\n\tfor (int i = 0; i < CURSOR_COUNT; ++i) SDL_FreeCursor(_cursors[i]);\n\tSDL_Quit();\n}\nvoid PlatformSDL::set_cursor(CURSOR cursor) {\n\tSDL_SetCursor(_cursors[cursor]);\n}\nvoid PlatformSDL::capture_mouse(bool set) {\n\tSDL_CaptureMouse(set ? SDL_TRUE : SDL_FALSE);\n}\n\nvoid* PlatformSDL::load_file(const char* path, size_t& buf_size) {\n\tusing namespace std;\n\n\tstreampos size;\n\tifstream file(path, ios::in | ios::binary | ios::ate);\n\tvoid* memblock = nullptr;\n\tif (file.is_open()) {\n\t\tsize = file.tellg();\n\t\tbuf_size = (size_t)size;\n\t\tmemblock = malloc(buf_size);\n\t\tfile.seekg(0, ios::beg);\n\t\tfile.read((char*)memblock, buf_size);\n\t}\n\treturn memblock;\n}\n// Graphics program\nGLuint gProgramID = 0;\nGLint gVertexPos3DLocation = -1;\nGLint gVertexClrLocation = -1;\nGLint gVertexTxtLocation = -1;\nGLint gScreenSizeLocation = -1;\nGLuint vao, vbo;\n\nvoid printShaderLog(GLuint shader);\nvoid printProgramLog(GLuint program);\n\nvoid checkError() {\n\tGLenum err = GL_NO_ERROR;\n\twhile ((err = glGetError()) != GL_NO_ERROR) {\n\t\tprintf(\"%s\", glewGetErrorString(err));\n\t}\n}\n\nunsigned int compile_shader(const GLchar** vertex_source, const GLchar** fragment_source);\n\nbool RenderSDL::create() {\n\tbool success = true;\n\n\tconst GLchar* vertexShaderSource[] = {\n\t\t\"uniform vec2 screen_size;\"\n\t\t\"attribute vec3 in_vertex;\"\n\t\t\"attribute vec2 in_texcoord;\"\n\t\t\"attribute vec4 in_color;\"\n\t\t\"varying vec4 var_color;\"\n\t\t\"varying vec2 Texcoord;\"\n\t\t\"void main() {\"\n\t\t\t\"Texcoord = in_texcoord;\"\n\t\t\t\"gl_Position = vec4(\"\n\t\t\t\t\"2.0*in_vertex.x/screen_size.x-1.0,\"\n\t\t\t\t\"2.0*in_vertex.y/screen_size.y-1.0,\"\n\t\t\t\t\"in_vertex.z,\"\n\t\t\t\t\"1);\"\n\t\t\t\"var_color = in_color;\"\n\t\t\"}\"};\n\n\tconst GLchar* fragmentShaderSource[] = {\n\t\t\"precision highp float;\"\n\t\t\"varying vec2 Texcoord;\"\n\t\t\"varying vec4 var_color;\"\n\t\t\"mediump vec4 FragColor;\"\n\t\t\"uniform sampler2D tex;\"\n\t\t\"void main() {\"\n\t\t\t\"FragColor = texture2D(tex, Texcoord)*var_color;\"\n\t\t\"}\"};\n\n\tgProgramID = compile_shader(vertexShaderSource, fragmentShaderSource);\n\n\t/* Allocate and assign a Vertex Array Object to our handle */\n\tglGenVertexArrays(1, &vao);\n\n\t/* Bind our Vertex Array Object as the current used object */\n\tglBindVertexArray(vao);\n\n\t/* Allocate and assign two Vertex Buffer Objects to our handle */\n\tglGenBuffers(1, &vbo);\n\n\t/* Bind our first VBO as being the active buffer and storing vertex attributes (coordinates) */\n\tglBindBuffer(GL_ARRAY_BUFFER, vbo);\n\n\t// Get vertex attribute location\n\tgVertexPos3DLocation = 0;\n\tgVertexClrLocation = 1;\n\tgVertexTxtLocation = 2;\n\n\tgScreenSizeLocation = glGetUniformLocation(gProgramID, \"screen_size\");\n\n\tcheckError();\n\treturn success;\n}\n\nunsigned int compile_shader(const GLchar** vertex_source, const GLchar** fragment_source) {\n\t// Generate program\n\tGLuint programID = glCreateProgram();\n\n\t// Create vertex shader\n\tGLuint vertexShader = glCreateShader(GL_VERTEX_SHADER);\n\n\t// Set vertex source\n\tglShaderSource(vertexShader, 1, vertex_source, NULL);\n\n\t// Compile vertex source\n\tglCompileShader(vertexShader);\n\n\t// Check vertex shader for errors\n\tGLint vShaderCompiled = GL_FALSE;\n\tglGetShaderiv(vertexShader, GL_COMPILE_STATUS, &vShaderCompiled);\n\tif (vShaderCompiled != GL_TRUE) {\n\t\tprintf(\"Unable to compile vertex shader %d!\\n\", vertexShader);\n\t\tprintShaderLog(vertexShader);\n\t\treturn 0;\n\t}\n\n\t// Attach vertex shader to program\n\tglAttachShader(programID, vertexShader);\n\n\t// Create fragment shader\n\tGLuint fragmentShader = glCreateShader(GL_FRAGMENT_SHADER);\n\n\t// Set fragment source\n\tglShaderSource(fragmentShader, 1, fragment_source, NULL);\n\n\t// Compile fragment source\n\tglCompileShader(fragmentShader);\n\n\t// Check fragment shader for errors\n\tGLint fShaderCompiled = GL_FALSE;\n\tglGetShaderiv(fragmentShader, GL_COMPILE_STATUS, &fShaderCompiled);\n\tif (fShaderCompiled != GL_TRUE) {\n\t\tprintf(\"Unable to compile fragment shader %d!\\n\", fragmentShader);\n\t\tprintShaderLog(fragmentShader);\n\t\treturn 0;\n\t}\n\n\t// Attach fragment shader to program\n\tglAttachShader(programID, fragmentShader);\n\n\t/* Bind attribute index 0 (coordinates) to in_Position and attribute index 1 (color) to in_Color\n\t*/\n\t/* Attribute locations must be setup before calling glLinkProgram. */\n\tglBindAttribLocation(programID, 0, \"in_vertex\");\n\tglBindAttribLocation(programID, 1, \"in_color\");\n\tglBindAttribLocation(programID, 2, \"in_texcoord\");\n\n\t// Link program\n\tglLinkProgram(programID);\n\n\t// Check for errors\n\tGLint programSuccess = GL_TRUE;\n\tglGetProgramiv(programID, GL_LINK_STATUS, &programSuccess);\n\tif (programSuccess != GL_TRUE) {\n\t\tprintf(\"Error linking program %d!\\n\", programID);\n\t\tprintProgramLog(programID);\n\t\treturn 0;\n\t}\n\treturn programID;\n}\n\nvoid getDisplayScaleFactor(float& x, float& y) {\n\tint w, h, low_dpi_w, low_dpi_h;\n\tSDL_GL_GetDrawableSize(gWindow, &w, &h);\n\tSDL_GetWindowSize(gWindow, &low_dpi_w, &low_dpi_h);\n\tx = (float)w / low_dpi_w;\n\ty = (float)h / low_dpi_h;\n}\n\nbool RenderSDL::begin(uint width, uint height) {\n\tint wnd_width, wnd_height;\n\tSDL_GL_GetDrawableSize(gWindow, &wnd_width, &wnd_height);\n\tglViewport(0, 0, wnd_width, wnd_height);\n\n\tinitialize_render(width, height);\n\treturn true;\n}\n\nvoid RenderSDL::initialize_render(uint width, uint height) {\n\tglClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);\n\tglEnable(GL_DEPTH_TEST);\n\tglDepthFunc(GL_LEQUAL);\n\tglDisable(GL_CULL_FACE);\n\tglColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);\n\tcheckError();\n\n\t// Bind program\n\tglUseProgram(gProgramID);\n\tglEnableVertexAttribArray(gVertexPos3DLocation);\n\tglEnableVertexAttribArray(gVertexClrLocation);\n\tglEnableVertexAttribArray(gVertexTxtLocation);\n\n\tglUniform2f(gScreenSizeLocation, (float)width, float(height));\n\tcheckError();\n}\nbool RenderSDL::render_mesh(const render_vertex_3d_t* tris, int count, bool b) {\n\t_mesh.insert(_mesh.end(), tris, tris + count);\n\trender((int)_mesh.size() - count, count);\n\treturn true;\n}\nvoid RenderSDL::render(int start, int count) {\n\t// The following commands will talk about our 'vertexbuffer' buffer\n\tglBindBuffer(GL_ARRAY_BUFFER, vbo);\n\n\t// Give our vertices to OpenGL.\n\t//coderobe: remove logging\n\t//println(\"glBufferData(): mesh size = %i, mesh addr = %p\", sizeof(render_vertex_3d_t)*_mesh.size(), &_mesh[0]);\t\n\tglBufferData(GL_ARRAY_BUFFER, sizeof(render_vertex_3d_t) * _mesh.size(), &_mesh[0],\n\t\t\t\t GL_DYNAMIC_DRAW);\n\tcheckError();\n\n\t// bind vertex attributes\n\t//coderobe: FIXME\n\tglVertexAttribPointer(gVertexPos3DLocation, 3, GL_FLOAT, GL_FALSE, sizeof(render_vertex_3d_t),\n\t\t\t\t\t\t 0);\n\tglVertexAttribPointer(gVertexClrLocation, 4, GL_UNSIGNED_BYTE, GL_TRUE,\n\t\t\t\t\t\t sizeof(render_vertex_3d_t), (void*)offsetof(render_vertex_3d_t, clr));\n\tglVertexAttribPointer(gVertexTxtLocation, 2, GL_FLOAT, GL_FALSE, sizeof(render_vertex_3d_t),\n\t\t\t\t\t\t (void*)offsetof(render_vertex_3d_t, u));\n\tcheckError();\n\n\tglDrawArrays(GL_TRIANGLES, start, count);\n\t\n}\nbool RenderSDL::end() {\n\tif (_mesh.empty())\n\t\treturn true; // nothing to draw\n\n\t_mesh.clear();\n\t// GLenum e = glGetError();\n\t// printf(\"%s\", glewGetErrorString(e));\n\n\tcheckError();\n\n\tglDisable(GL_SCISSOR_TEST);\n\n\t// Disable vertex position\n\tglDisableVertexAttribArray(gVertexPos3DLocation);\n\tglDisableVertexAttribArray(gVertexClrLocation);\n\tglDisableVertexAttribArray(gVertexTxtLocation);\n\tcheckError();\n\n\t// Unbind program\n\tglUseProgram(NULL);\n\n\t// /on_render_finished();\n\treturn true;\n}\n\nvoid RenderSDL::set_blend_mode(BlendMode mode) {\n\tswitch (mode) {\n\tcase BLEND_NONE:\n\t\tglDisable(GL_BLEND);\n\t\tbreak;\n\tcase BLEND_TEXT:\n\t\tglBlendFunc(GL_ONE, GL_ONE);\n\t\tglEnable(GL_BLEND);\n\t\tbreak;\n\tcase BLEND_RECT:\n\t\tglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);\n\t\tglEnable(GL_BLEND);\n\t\tbreak;\n\t}\n}\nunsigned char* RenderSDL::load_image(const char* filename, int* width, int* height, int* channels) {\n\treturn stbi_load(filename, width, height, channels, 0);\n}\n\nunsigned int RenderSDL::create_texture(unsigned int width, unsigned int height,\n\t\t\t\t\t\t\t\t\t unsigned int channels, void* bmp) {\n\t// can free ttf_buffer at this point\n\tcheckError();\n\n\tGLuint ftex;\n\tglGenTextures(1, &ftex);\n\tcheckError();\n\n\tglBindTexture(GL_TEXTURE_2D, ftex);\n\tcheckError();\n\n\t// convert luminance image manually\n\tif (channels == 1) {\n\t\tunsigned char* new_bmp = (unsigned char*)malloc(width * height * 3);\n\t\tunsigned char* old_bmp = (unsigned char*)bmp;\n\t\tint j = 0;\n\t\tfor (uint i = 0; i < height * width; ++i) {\n\t\t\tnew_bmp[j++] = old_bmp[i];\n\t\t\tnew_bmp[j++] = old_bmp[i];\n\t\t\tnew_bmp[j++] = old_bmp[i];\n\t\t}\n\t\tbmp = new_bmp;\n\t}\n\n\tGLenum bmpFormat;\n\tswitch (channels) {\n\tcase 1:\n\t\tbmpFormat = GL_RGB;\n\t\tbreak;\n\tcase 3:\n\t\tbmpFormat = GL_RGB;\n\t\tbreak;\n\tcase 4:\n\t\tbmpFormat = GL_RGBA;\n\t\tbreak;\n\t}\n\tif (channels == 1)\n\t\tglTexImage2D(GL_TEXTURE_2D, 0, bmpFormat, width, height, 0, bmpFormat, GL_UNSIGNED_BYTE, bmp);\n\telse\n\t\tglTexImage2D(GL_TEXTURE_2D, 0, bmpFormat, width, height, 0, bmpFormat, GL_UNSIGNED_BYTE, bmp);\n\tcheckError();\n\n\tif (channels == 1)\n\t\tfree(bmp);\n\n\t// can free temp_bitmap at this point\n\tglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);\n\tcheckError();\n\treturn ftex;\n}\nbool RenderSDL::copy_sub_texture(unsigned int target, unsigned int x, unsigned int y,\n\t\t\t\t\t\t\t\t unsigned int width, unsigned int height, void* bmp) {\n\tglBindTexture(GL_TEXTURE_2D, target);\n\tglTexSubImage2D(GL_TEXTURE_2D, 0, x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, bmp);\n\tcheckError();\n\treturn true;\n}\n\nbool RenderSDL::remove_texture(unsigned int texture) {\n\tglDeleteTextures(1, &texture);\n\treturn true;\n}\nbool RenderSDL::bind_texture(unsigned int texture) {\n\tglBindTexture(GL_TEXTURE_2D, texture);\n\t// glBlendFunc(GL_ONE, GL_ONE);\n\tcheckError();\n\treturn true;\n}\nvoid RenderSDL::set_scissor(int x, int y, int w, int h, bool set) {\n\tfloat scale_x, scale_y;\n\tgetDisplayScaleFactor(scale_x, scale_y);\n\n\tif (set)\n\t\tglEnable(GL_SCISSOR_TEST);\n\telse\n\t\tglDisable(GL_SCISSOR_TEST);\n\tglScissor((int)(scale_x*x), (int)(scale_y*y), (int)(scale_x*w), (int)(scale_y*h));\n}\nvoid printProgramLog(GLuint program) {\n\t// Make sure name is shader\n\tif (glIsProgram(program)) {\n\t\t// Program log length\n\t\tint infoLogLength = 0;\n\t\tint maxLength = infoLogLength;\n\n\t\t// Get info string length\n\t\tglGetProgramiv(program, GL_INFO_LOG_LENGTH, &maxLength);\n\n\t\t// Allocate string\n\t\tchar* infoLog = new char[maxLength];\n\n\t\t// Get info log\n\t\tglGetProgramInfoLog(program, maxLength, &infoLogLength, infoLog);\n\t\tif (infoLogLength > 0) {\n\t\t\t// Print Log\n\t\t\tprintf(\"%s\\n\", infoLog);\n\t\t}\n\n\t\t// Deallocate string\n\t\tdelete[] infoLog;\n\t}\n\telse {\n\t\tprintf(\"Name %d is not a program\\n\", program);\n\t}\n}\n\nvoid printShaderLog(GLuint shader) {\n\t// Make sure name is shader\n\tif (glIsShader(shader)) {\n\t\t// Shader log length\n\t\tint infoLogLength = 0;\n\t\tint maxLength = infoLogLength;\n\n\t\t// Get info string length\n\t\tglGetShaderiv(shader, GL_INFO_LOG_LENGTH, &maxLength);\n\n\t\t// Allocate string\n\t\tchar* infoLog = new char[maxLength];\n\n\t\t// Get info log\n\t\tglGetShaderInfoLog(shader, maxLength, &infoLogLength, infoLog);\n\t\tif (infoLogLength > 0) {\n\t\t\t// Print Log\n\t\t\tprintf(\"%s\\n\", infoLog);\n\t\t}\n\n\t\t// Deallocate string\n\t\tdelete[] infoLog;\n\t}\n\telse {\n\t\tprintf(\"Name %d is not a shader\\n\", shader);\n\t}\n}\n}\n","// glw_imgui\n// Copyright (C) 2016 Iakov Sumygin - BSD license\n\n#ifndef _PLATFORM_H_\n#define _PLATFORM_H_\n\n#include \"imgui_ui.h\"\n\nnamespace imgui {\n\nstruct render_vertex_3d_t {\n\tfloat x, y, z, u, v;\n\tunsigned int clr;\n};\n\nclass IPlatform {\npublic:\n\tvirtual void set_cursor(CURSOR cursor) = 0;\n\tvirtual void capture_mouse(bool set) = 0;\n\tvirtual void* load_file(const char* path, size_t& buf_size) = 0;\n};\n\nclass IRenderer {\npublic:\n\tvirtual bool create() = 0;\n\tvirtual bool begin(uint width, uint height) = 0;\n\tvirtual bool end() = 0;\n\tvirtual unsigned char* load_image(const char* filename, int* width, int* height,\n\t\t\t\t\t\t\t\t\t int* channels) = 0;\n\tvirtual unsigned int create_texture(unsigned int width, unsigned int height,\n\t\t\t\t\t\t\t\t\t\tunsigned int channels, void* bmp) = 0;\n\tvirtual bool copy_sub_texture(unsigned int target, unsigned int x, unsigned int y,\n\t\t\t\t\t\t\t\t unsigned int width, unsigned int height, void* bmp) = 0;\n\tvirtual bool remove_texture(unsigned int texture) = 0;\n\tvirtual bool bind_texture(unsigned int texture) = 0;\n\tvirtual bool render_mesh(const render_vertex_3d_t* tries, int count, bool b) = 0;\n\tvirtual void set_blend_mode(BlendMode mode) = 0;\n\tvirtual void set_scissor(int x, int y, int w, int h, bool set) = 0;\n};\n}\n#endif //_PLATFORM_H_\n","// -*- C++ -*-\n//===--------------------------- string -----------------------------------===//\n//\n// The LLVM Compiler Infrastructure\n//\n// This file is distributed under the University of Illinois Open Source\n// License. See LICENSE.TXT for details.\n//\n//===----------------------------------------------------------------------===//\n\n#ifndef _LIBCPP_STRING\n#define _LIBCPP_STRING\n\n/*\n string synopsis\n\nnamespace std\n{\n\ntemplate \nclass fpos\n{\nprivate:\n stateT st;\npublic:\n fpos(streamoff = streamoff());\n\n operator streamoff() const;\n\n stateT state() const;\n void state(stateT);\n\n fpos& operator+=(streamoff);\n fpos operator+ (streamoff) const;\n fpos& operator-=(streamoff);\n fpos operator- (streamoff) const;\n};\n\ntemplate streamoff operator-(const fpos& x, const fpos& y);\n\ntemplate bool operator==(const fpos& x, const fpos& y);\ntemplate bool operator!=(const fpos& x, const fpos& y);\n\ntemplate \nstruct char_traits\n{\n typedef charT char_type;\n typedef ... int_type;\n typedef streamoff off_type;\n typedef streampos pos_type;\n typedef mbstate_t state_type;\n\n static void assign(char_type& c1, const char_type& c2) noexcept;\n static constexpr bool eq(char_type c1, char_type c2) noexcept;\n static constexpr bool lt(char_type c1, char_type c2) noexcept;\n\n static int compare(const char_type* s1, const char_type* s2, size_t n);\n static size_t length(const char_type* s);\n static const char_type* find(const char_type* s, size_t n, const char_type& a);\n static char_type* move(char_type* s1, const char_type* s2, size_t n);\n static char_type* copy(char_type* s1, const char_type* s2, size_t n);\n static char_type* assign(char_type* s, size_t n, char_type a);\n\n static constexpr int_type not_eof(int_type c) noexcept;\n static constexpr char_type to_char_type(int_type c) noexcept;\n static constexpr int_type to_int_type(char_type c) noexcept;\n static constexpr bool eq_int_type(int_type c1, int_type c2) noexcept;\n static constexpr int_type eof() noexcept;\n};\n\ntemplate <> struct char_traits;\ntemplate <> struct char_traits;\n\ntemplate, class Allocator = allocator >\nclass basic_string\n{\npublic:\n// types:\n typedef traits traits_type;\n typedef typename traits_type::char_type value_type;\n typedef Allocator allocator_type;\n typedef typename allocator_type::size_type size_type;\n typedef typename allocator_type::difference_type difference_type;\n typedef typename allocator_type::reference reference;\n typedef typename allocator_type::const_reference const_reference;\n typedef typename allocator_type::pointer pointer;\n typedef typename allocator_type::const_pointer const_pointer;\n typedef implementation-defined iterator;\n typedef implementation-defined const_iterator;\n typedef std::reverse_iterator reverse_iterator;\n typedef std::reverse_iterator const_reverse_iterator;\n\n static const size_type npos = -1;\n\n basic_string()\n noexcept(is_nothrow_default_constructible::value);\n explicit basic_string(const allocator_type& a);\n basic_string(const basic_string& str);\n basic_string(basic_string&& str)\n noexcept(is_nothrow_move_constructible::value);\n basic_string(const basic_string& str, size_type pos,\n const allocator_type& a = allocator_type());\n basic_string(const basic_string& str, size_type pos, size_type n,\n const Allocator& a = Allocator());\n template\n basic_string(const T& t, size_type pos, size_type n, const Allocator& a = Allocator()); // C++17\n explicit basic_string(const basic_string_view sv, const Allocator& a = Allocator());\n basic_string(const value_type* s, const allocator_type& a = allocator_type());\n basic_string(const value_type* s, size_type n, const allocator_type& a = allocator_type());\n basic_string(size_type n, value_type c, const allocator_type& a = allocator_type());\n template\n basic_string(InputIterator begin, InputIterator end,\n const allocator_type& a = allocator_type());\n basic_string(initializer_list, const Allocator& = Allocator());\n basic_string(const basic_string&, const Allocator&);\n basic_string(basic_string&&, const Allocator&);\n\n ~basic_string();\n\n operator basic_string_view() const noexcept;\n\n basic_string& operator=(const basic_string& str);\n basic_string& operator=(basic_string_view sv);\n basic_string& operator=(basic_string&& str)\n noexcept(\n allocator_type::propagate_on_container_move_assignment::value ||\n allocator_type::is_always_equal::value ); // C++17\n basic_string& operator=(const value_type* s);\n basic_string& operator=(value_type c);\n basic_string& operator=(initializer_list);\n\n iterator begin() noexcept;\n const_iterator begin() const noexcept;\n iterator end() noexcept;\n const_iterator end() const noexcept;\n\n reverse_iterator rbegin() noexcept;\n const_reverse_iterator rbegin() const noexcept;\n reverse_iterator rend() noexcept;\n const_reverse_iterator rend() const noexcept;\n\n const_iterator cbegin() const noexcept;\n const_iterator cend() const noexcept;\n const_reverse_iterator crbegin() const noexcept;\n const_reverse_iterator crend() const noexcept;\n\n size_type size() const noexcept;\n size_type length() const noexcept;\n size_type max_size() const noexcept;\n size_type capacity() const noexcept;\n\n void resize(size_type n, value_type c);\n void resize(size_type n);\n\n void reserve(size_type res_arg = 0);\n void shrink_to_fit();\n void clear() noexcept;\n bool empty() const noexcept;\n\n const_reference operator[](size_type pos) const;\n reference operator[](size_type pos);\n\n const_reference at(size_type n) const;\n reference at(size_type n);\n\n basic_string& operator+=(const basic_string& str);\n basic_string& operator+=(basic_string_view sv);\n basic_string& operator+=(const value_type* s);\n basic_string& operator+=(value_type c);\n basic_string& operator+=(initializer_list);\n\n basic_string& append(const basic_string& str);\n basic_string& append(basic_string_view sv);\n basic_string& append(const basic_string& str, size_type pos, size_type n=npos); //C++14\n template \n basic_string& append(const T& t, size_type pos, size_type n=npos); // C++17\n basic_string& append(const value_type* s, size_type n);\n basic_string& append(const value_type* s);\n basic_string& append(size_type n, value_type c);\n template\n basic_string& append(InputIterator first, InputIterator last);\n basic_string& append(initializer_list);\n\n void push_back(value_type c);\n void pop_back();\n reference front();\n const_reference front() const;\n reference back();\n const_reference back() const;\n\n basic_string& assign(const basic_string& str);\n basic_string& assign(basic_string_view sv);\n basic_string& assign(basic_string&& str);\n basic_string& assign(const basic_string& str, size_type pos, size_type n=npos); // C++14\n template \n basic_string& assign(const T& t, size_type pos, size_type n=npos); // C++17\n basic_string& assign(const value_type* s, size_type n);\n basic_string& assign(const value_type* s);\n basic_string& assign(size_type n, value_type c);\n template\n basic_string& assign(InputIterator first, InputIterator last);\n basic_string& assign(initializer_list);\n\n basic_string& insert(size_type pos1, const basic_string& str);\n basic_string& insert(size_type pos1, basic_string_view sv);\n basic_string& insert(size_type pos1, const basic_string& str,\n size_type pos2, size_type n);\n template \n basic_string& insert(size_type pos1, const T& t, size_type pos2, size_type n); // C++17\n basic_string& insert(size_type pos, const value_type* s, size_type n=npos); //C++14\n basic_string& insert(size_type pos, const value_type* s);\n basic_string& insert(size_type pos, size_type n, value_type c);\n iterator insert(const_iterator p, value_type c);\n iterator insert(const_iterator p, size_type n, value_type c);\n template\n iterator insert(const_iterator p, InputIterator first, InputIterator last);\n iterator insert(const_iterator p, initializer_list);\n\n basic_string& erase(size_type pos = 0, size_type n = npos);\n iterator erase(const_iterator position);\n iterator erase(const_iterator first, const_iterator last);\n\n basic_string& replace(size_type pos1, size_type n1, const basic_string& str);\n basic_string& replace(size_type pos1, size_type n1, basic_string_view sv);\n basic_string& replace(size_type pos1, size_type n1, const basic_string& str,\n size_type pos2, size_type n2=npos); // C++14\n template \n basic_string& replace(size_type pos1, size_type n1, const T& t,\n size_type pos2, size_type n); // C++17\n basic_string& replace(size_type pos, size_type n1, const value_type* s, size_type n2);\n basic_string& replace(size_type pos, size_type n1, const value_type* s);\n basic_string& replace(size_type pos, size_type n1, size_type n2, value_type c);\n basic_string& replace(const_iterator i1, const_iterator i2, const basic_string& str);\n basic_string& replace(const_iterator i1, const_iterator i2, basic_string_view sv);\n basic_string& replace(const_iterator i1, const_iterator i2, const value_type* s, size_type n);\n basic_string& replace(const_iterator i1, const_iterator i2, const value_type* s);\n basic_string& replace(const_iterator i1, const_iterator i2, size_type n, value_type c);\n template\n basic_string& replace(const_iterator i1, const_iterator i2, InputIterator j1, InputIterator j2);\n basic_string& replace(const_iterator i1, const_iterator i2, initializer_list);\n\n size_type copy(value_type* s, size_type n, size_type pos = 0) const;\n basic_string substr(size_type pos = 0, size_type n = npos) const;\n\n void swap(basic_string& str)\n noexcept(allocator_traits::propagate_on_container_swap::value ||\n allocator_traits::is_always_equal::value); // C++17\n\n const value_type* c_str() const noexcept;\n const value_type* data() const noexcept;\n value_type* data() noexcept; // C++17\n\n allocator_type get_allocator() const noexcept;\n\n size_type find(const basic_string& str, size_type pos = 0) const noexcept;\n size_type find(basic_string_view sv, size_type pos = 0) const noexcept;\n size_type find(const value_type* s, size_type pos, size_type n) const noexcept;\n size_type find(const value_type* s, size_type pos = 0) const noexcept;\n size_type find(value_type c, size_type pos = 0) const noexcept;\n\n size_type rfind(const basic_string& str, size_type pos = npos) const noexcept;\n size_type ffind(basic_string_view sv, size_type pos = 0) const noexcept;\n size_type rfind(const value_type* s, size_type pos, size_type n) const noexcept;\n size_type rfind(const value_type* s, size_type pos = npos) const noexcept;\n size_type rfind(value_type c, size_type pos = npos) const noexcept;\n\n size_type find_first_of(const basic_string& str, size_type pos = 0) const noexcept;\n size_type find_first_of(basic_string_view sv, size_type pos = 0) const noexcept;\n size_type find_first_of(const value_type* s, size_type pos, size_type n) const noexcept;\n size_type find_first_of(const value_type* s, size_type pos = 0) const noexcept;\n size_type find_first_of(value_type c, size_type pos = 0) const noexcept;\n\n size_type find_last_of(const basic_string& str, size_type pos = npos) const noexcept;\n size_type find_last_of(basic_string_view sv, size_type pos = 0) const noexcept;\n size_type find_last_of(const value_type* s, size_type pos, size_type n) const noexcept;\n size_type find_last_of(const value_type* s, size_type pos = npos) const noexcept;\n size_type find_last_of(value_type c, size_type pos = npos) const noexcept;\n\n size_type find_first_not_of(const basic_string& str, size_type pos = 0) const noexcept;\n size_type find_first_not_of(basic_string_view sv, size_type pos = 0) const noexcept;\n size_type find_first_not_of(const value_type* s, size_type pos, size_type n) const noexcept;\n size_type find_first_not_of(const value_type* s, size_type pos = 0) const noexcept;\n size_type find_first_not_of(value_type c, size_type pos = 0) const noexcept;\n\n size_type find_last_not_of(const basic_string& str, size_type pos = npos) const noexcept;\n size_type find_last_not_of(basic_string_view sv, size_type pos = 0) const noexcept;\n size_type find_last_not_of(const value_type* s, size_type pos, size_type n) const noexcept;\n size_type find_last_not_of(const value_type* s, size_type pos = npos) const noexcept;\n size_type find_last_not_of(value_type c, size_type pos = npos) const noexcept;\n\n int compare(const basic_string& str) const noexcept;\n int compare(basic_string_view sv) const noexcept;\n int compare(size_type pos1, size_type n1, const basic_string& str) const;\n int compare(size_type pos1, size_type n1, basic_string_view sv) const;\n int compare(size_type pos1, size_type n1, const basic_string& str,\n size_type pos2, size_type n2=npos) const; // C++14\n template \n int compare(size_type pos1, size_type n1, const T& t,\n size_type pos2, size_type n2=npos) const; // C++17\n int compare(const value_type* s) const noexcept;\n int compare(size_type pos1, size_type n1, const value_type* s) const;\n int compare(size_type pos1, size_type n1, const value_type* s, size_type n2) const;\n\n bool __invariants() const;\n};\n\ntemplate\nbasic_string\noperator+(const basic_string& lhs,\n const basic_string& rhs);\n\ntemplate\nbasic_string\noperator+(const charT* lhs , const basic_string&rhs);\n\ntemplate\nbasic_string\noperator+(charT lhs, const basic_string& rhs);\n\ntemplate\nbasic_string\noperator+(const basic_string& lhs, const charT* rhs);\n\ntemplate\nbasic_string\noperator+(const basic_string& lhs, charT rhs);\n\ntemplate\nbool operator==(const basic_string& lhs,\n const basic_string& rhs) noexcept;\n\ntemplate\nbool operator==(const charT* lhs, const basic_string& rhs) noexcept;\n\ntemplate\nbool operator==(const basic_string& lhs, const charT* rhs) noexcept;\n\ntemplate\nbool operator!=(const basic_string& lhs,\n const basic_string& rhs) noexcept;\n\ntemplate\nbool operator!=(const charT* lhs, const basic_string& rhs) noexcept;\n\ntemplate\nbool operator!=(const basic_string& lhs, const charT* rhs) noexcept;\n\ntemplate\nbool operator< (const basic_string& lhs,\n const basic_string& rhs) noexcept;\n\ntemplate\nbool operator< (const basic_string& lhs, const charT* rhs) noexcept;\n\ntemplate\nbool operator< (const charT* lhs, const basic_string& rhs) noexcept;\n\ntemplate\nbool operator> (const basic_string& lhs,\n const basic_string& rhs) noexcept;\n\ntemplate\nbool operator> (const basic_string& lhs, const charT* rhs) noexcept;\n\ntemplate\nbool operator> (const charT* lhs, const basic_string& rhs) noexcept;\n\ntemplate\nbool operator<=(const basic_string& lhs,\n const basic_string& rhs) noexcept;\n\ntemplate\nbool operator<=(const basic_string& lhs, const charT* rhs) noexcept;\n\ntemplate\nbool operator<=(const charT* lhs, const basic_string& rhs) noexcept;\n\ntemplate\nbool operator>=(const basic_string& lhs,\n const basic_string& rhs) noexcept;\n\ntemplate\nbool operator>=(const basic_string& lhs, const charT* rhs) noexcept;\n\ntemplate\nbool operator>=(const charT* lhs, const basic_string& rhs) noexcept;\n\ntemplate\nvoid swap(basic_string& lhs,\n basic_string& rhs)\n noexcept(noexcept(lhs.swap(rhs)));\n\ntemplate\nbasic_istream&\noperator>>(basic_istream& is, basic_string& str);\n\ntemplate\nbasic_ostream&\noperator<<(basic_ostream& os, const basic_string& str);\n\ntemplate\nbasic_istream&\ngetline(basic_istream& is, basic_string& str,\n charT delim);\n\ntemplate\nbasic_istream&\ngetline(basic_istream& is, basic_string& str);\n\ntypedef basic_string string;\ntypedef basic_string wstring;\ntypedef basic_string u16string;\ntypedef basic_string u32string;\n\nint stoi (const string& str, size_t* idx = 0, int base = 10);\nlong stol (const string& str, size_t* idx = 0, int base = 10);\nunsigned long stoul (const string& str, size_t* idx = 0, int base = 10);\nlong long stoll (const string& str, size_t* idx = 0, int base = 10);\nunsigned long long stoull(const string& str, size_t* idx = 0, int base = 10);\n\nfloat stof (const string& str, size_t* idx = 0);\ndouble stod (const string& str, size_t* idx = 0);\nlong double stold(const string& str, size_t* idx = 0);\n\nstring to_string(int val);\nstring to_string(unsigned val);\nstring to_string(long val);\nstring to_string(unsigned long val);\nstring to_string(long long val);\nstring to_string(unsigned long long val);\nstring to_string(float val);\nstring to_string(double val);\nstring to_string(long double val);\n\nint stoi (const wstring& str, size_t* idx = 0, int base = 10);\nlong stol (const wstring& str, size_t* idx = 0, int base = 10);\nunsigned long stoul (const wstring& str, size_t* idx = 0, int base = 10);\nlong long stoll (const wstring& str, size_t* idx = 0, int base = 10);\nunsigned long long stoull(const wstring& str, size_t* idx = 0, int base = 10);\n\nfloat stof (const wstring& str, size_t* idx = 0);\ndouble stod (const wstring& str, size_t* idx = 0);\nlong double stold(const wstring& str, size_t* idx = 0);\n\nwstring to_wstring(int val);\nwstring to_wstring(unsigned val);\nwstring to_wstring(long val);\nwstring to_wstring(unsigned long val);\nwstring to_wstring(long long val);\nwstring to_wstring(unsigned long long val);\nwstring to_wstring(float val);\nwstring to_wstring(double val);\nwstring to_wstring(long double val);\n\ntemplate <> struct hash;\ntemplate <> struct hash;\ntemplate <> struct hash;\ntemplate <> struct hash;\n\nbasic_string operator \"\" s( const char *str, size_t len ); // C++14\nbasic_string operator \"\" s( const wchar_t *str, size_t len ); // C++14\nbasic_string operator \"\" s( const char16_t *str, size_t len ); // C++14\nbasic_string operator \"\" s( const char32_t *str, size_t len ); // C++14\n\n} // std\n\n*/\n\n#include <__config>\n#include \n#include \n#include \n#include // For EOF.\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include <__functional_base>\n#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS\n#include \n#endif\n\n#include <__undef_min_max>\n\n#include <__debug>\n\n#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)\n#pragma GCC system_header\n#endif\n\n_LIBCPP_BEGIN_NAMESPACE_STD\n\n// fpos\n\ntemplate \nclass _LIBCPP_TEMPLATE_VIS fpos\n{\nprivate:\n _StateT __st_;\n streamoff __off_;\npublic:\n _LIBCPP_INLINE_VISIBILITY fpos(streamoff __off = streamoff()) : __st_(), __off_(__off) {}\n\n _LIBCPP_INLINE_VISIBILITY operator streamoff() const {return __off_;}\n\n _LIBCPP_INLINE_VISIBILITY _StateT state() const {return __st_;}\n _LIBCPP_INLINE_VISIBILITY void state(_StateT __st) {__st_ = __st;}\n\n _LIBCPP_INLINE_VISIBILITY fpos& operator+=(streamoff __off) {__off_ += __off; return *this;}\n _LIBCPP_INLINE_VISIBILITY fpos operator+ (streamoff __off) const {fpos __t(*this); __t += __off; return __t;}\n _LIBCPP_INLINE_VISIBILITY fpos& operator-=(streamoff __off) {__off_ -= __off; return *this;}\n _LIBCPP_INLINE_VISIBILITY fpos operator- (streamoff __off) const {fpos __t(*this); __t -= __off; return __t;}\n};\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nstreamoff operator-(const fpos<_StateT>& __x, const fpos<_StateT>& __y)\n {return streamoff(__x) - streamoff(__y);}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool operator==(const fpos<_StateT>& __x, const fpos<_StateT>& __y)\n {return streamoff(__x) == streamoff(__y);}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool operator!=(const fpos<_StateT>& __x, const fpos<_StateT>& __y)\n {return streamoff(__x) != streamoff(__y);}\n\n// basic_string\n\ntemplate\nbasic_string<_CharT, _Traits, _Allocator>\noperator+(const basic_string<_CharT, _Traits, _Allocator>& __x,\n const basic_string<_CharT, _Traits, _Allocator>& __y);\n\ntemplate\nbasic_string<_CharT, _Traits, _Allocator>\noperator+(const _CharT* __x, const basic_string<_CharT,_Traits,_Allocator>& __y);\n\ntemplate\nbasic_string<_CharT, _Traits, _Allocator>\noperator+(_CharT __x, const basic_string<_CharT,_Traits,_Allocator>& __y);\n\ntemplate\nbasic_string<_CharT, _Traits, _Allocator>\noperator+(const basic_string<_CharT, _Traits, _Allocator>& __x, const _CharT* __y);\n\ntemplate\nbasic_string<_CharT, _Traits, _Allocator>\noperator+(const basic_string<_CharT, _Traits, _Allocator>& __x, _CharT __y);\n\ntemplate \nclass _LIBCPP_TEMPLATE_VIS __basic_string_common\n{\nprotected:\n _LIBCPP_NORETURN void __throw_length_error() const;\n _LIBCPP_NORETURN void __throw_out_of_range() const;\n};\n\ntemplate \nvoid\n__basic_string_common<__b>::__throw_length_error() const\n{\n _VSTD::__throw_length_error(\"basic_string\");\n}\n\ntemplate \nvoid\n__basic_string_common<__b>::__throw_out_of_range() const\n{\n _VSTD::__throw_out_of_range(\"basic_string\");\n}\n\n#ifdef _LIBCPP_MSVC\n#pragma warning( push )\n#pragma warning( disable: 4231 )\n#endif // _LIBCPP_MSVC\n_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __basic_string_common)\n#ifdef _LIBCPP_MSVC\n#pragma warning( pop )\n#endif // _LIBCPP_MSVC\n\n#ifdef _LIBCPP_NO_EXCEPTIONS\ntemplate \nstruct __libcpp_string_gets_noexcept_iterator_impl : public true_type {};\n#elif defined(_LIBCPP_HAS_NO_NOEXCEPT)\ntemplate \nstruct __libcpp_string_gets_noexcept_iterator_impl : public false_type {};\n#else\ntemplate ::value>\nstruct __libcpp_string_gets_noexcept_iterator_impl : public _LIBCPP_BOOL_CONSTANT((\n noexcept(++(declval<_Iter&>())) && \n is_nothrow_assignable<_Iter&, _Iter>::value && \n noexcept(declval<_Iter>() == declval<_Iter>()) && \n noexcept(*declval<_Iter>())\n)) {};\n\ntemplate \nstruct __libcpp_string_gets_noexcept_iterator_impl<_Iter, false> : public false_type {};\n#endif\n\n\ntemplate \nstruct __libcpp_string_gets_noexcept_iterator\n : public _LIBCPP_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value || __libcpp_string_gets_noexcept_iterator_impl<_Iter>::value) {};\n\ntemplate \nstruct __can_be_converted_to_string_view : public _LIBCPP_BOOL_CONSTANT(\n\t( is_convertible >::value &&\n !is_convertible::value)) {};\n\n#ifdef _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT\n\ntemplate \nstruct __padding\n{\n unsigned char __xx[sizeof(_CharT)-1];\n};\n\ntemplate \nstruct __padding<_CharT, 1>\n{\n};\n\n#endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT\n\ntemplate\nclass _LIBCPP_TEMPLATE_VIS basic_string\n : private __basic_string_common\n{\npublic:\n typedef basic_string __self;\n typedef basic_string_view<_CharT, _Traits> __self_view;\n typedef _Traits traits_type;\n typedef typename traits_type::char_type value_type;\n typedef _Allocator allocator_type;\n typedef allocator_traits __alloc_traits;\n typedef typename __alloc_traits::size_type size_type;\n typedef typename __alloc_traits::difference_type difference_type;\n typedef value_type& reference;\n typedef const value_type& const_reference;\n typedef typename __alloc_traits::pointer pointer;\n typedef typename __alloc_traits::const_pointer const_pointer;\n\n static_assert(is_pod::value, \"Character type of basic_string must be a POD\");\n static_assert((is_same<_CharT, value_type>::value),\n \"traits_type::char_type must be the same type as CharT\");\n static_assert((is_same::value),\n \"Allocator::value_type must be same type as value_type\");\n#if defined(_LIBCPP_RAW_ITERATORS)\n typedef pointer iterator;\n typedef const_pointer const_iterator;\n#else // defined(_LIBCPP_RAW_ITERATORS)\n typedef __wrap_iter iterator;\n typedef __wrap_iter const_iterator;\n#endif // defined(_LIBCPP_RAW_ITERATORS)\n typedef _VSTD::reverse_iterator reverse_iterator;\n typedef _VSTD::reverse_iterator const_reverse_iterator;\n\nprivate:\n\n#ifdef _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT\n\n struct __long\n {\n pointer __data_;\n size_type __size_;\n size_type __cap_;\n };\n\n#if _LIBCPP_BIG_ENDIAN\n enum {__short_mask = 0x01};\n enum {__long_mask = 0x1ul};\n#else // _LIBCPP_BIG_ENDIAN\n enum {__short_mask = 0x80};\n enum {__long_mask = ~(size_type(~0) >> 1)};\n#endif // _LIBCPP_BIG_ENDIAN\n\n enum {__min_cap = (sizeof(__long) - 1)/sizeof(value_type) > 2 ?\n (sizeof(__long) - 1)/sizeof(value_type) : 2};\n\n struct __short\n {\n value_type __data_[__min_cap];\n struct\n : __padding\n {\n unsigned char __size_;\n };\n };\n\n#else\n\n struct __long\n {\n size_type __cap_;\n size_type __size_;\n pointer __data_;\n };\n\n#if _LIBCPP_BIG_ENDIAN\n enum {__short_mask = 0x80};\n enum {__long_mask = ~(size_type(~0) >> 1)};\n#else // _LIBCPP_BIG_ENDIAN\n enum {__short_mask = 0x01};\n enum {__long_mask = 0x1ul};\n#endif // _LIBCPP_BIG_ENDIAN\n\n enum {__min_cap = (sizeof(__long) - 1)/sizeof(value_type) > 2 ?\n (sizeof(__long) - 1)/sizeof(value_type) : 2};\n\n struct __short\n {\n union\n {\n unsigned char __size_;\n value_type __lx;\n };\n value_type __data_[__min_cap];\n };\n\n#endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT\n\n union __ulx{__long __lx; __short __lxx;};\n\n enum {__n_words = sizeof(__ulx) / sizeof(size_type)};\n\n struct __raw\n {\n size_type __words[__n_words];\n };\n\n struct __rep\n {\n union\n {\n __long __l;\n __short __s;\n __raw __r;\n };\n };\n\n __compressed_pair<__rep, allocator_type> __r_;\n\npublic:\n static const size_type npos = -1;\n\n _LIBCPP_INLINE_VISIBILITY basic_string()\n _NOEXCEPT_(is_nothrow_default_constructible::value);\n\n _LIBCPP_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a)\n#if _LIBCPP_STD_VER <= 14\n _NOEXCEPT_(is_nothrow_copy_constructible::value);\n#else\n _NOEXCEPT;\n#endif\n\n basic_string(const basic_string& __str);\n basic_string(const basic_string& __str, const allocator_type& __a);\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY\n basic_string(basic_string&& __str)\n#if _LIBCPP_STD_VER <= 14\n _NOEXCEPT_(is_nothrow_move_constructible::value);\n#else\n _NOEXCEPT;\n#endif\n\n _LIBCPP_INLINE_VISIBILITY\n basic_string(basic_string&& __str, const allocator_type& __a);\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY basic_string(const value_type* __s);\n _LIBCPP_INLINE_VISIBILITY\n basic_string(const value_type* __s, const allocator_type& __a);\n _LIBCPP_INLINE_VISIBILITY\n basic_string(const value_type* __s, size_type __n);\n _LIBCPP_INLINE_VISIBILITY\n basic_string(const value_type* __s, size_type __n, const allocator_type& __a);\n _LIBCPP_INLINE_VISIBILITY\n basic_string(size_type __n, value_type __c);\n _LIBCPP_INLINE_VISIBILITY\n basic_string(size_type __n, value_type __c, const allocator_type& __a);\n basic_string(const basic_string& __str, size_type __pos, size_type __n,\n const allocator_type& __a = allocator_type());\n _LIBCPP_INLINE_VISIBILITY\n basic_string(const basic_string& __str, size_type __pos,\n const allocator_type& __a = allocator_type());\n template\n basic_string(const _Tp& __t, size_type __pos, size_type __n, \n const allocator_type& __a = allocator_type(),\n typename enable_if<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, void>::type* = 0);\n _LIBCPP_INLINE_VISIBILITY explicit\n basic_string(__self_view __sv);\n _LIBCPP_INLINE_VISIBILITY\n basic_string(__self_view __sv, const allocator_type& __a);\n template\n _LIBCPP_INLINE_VISIBILITY\n basic_string(_InputIterator __first, _InputIterator __last);\n template\n _LIBCPP_INLINE_VISIBILITY\n basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a);\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n _LIBCPP_INLINE_VISIBILITY\n basic_string(initializer_list __il);\n _LIBCPP_INLINE_VISIBILITY\n basic_string(initializer_list __il, const allocator_type& __a);\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\n inline ~basic_string();\n\n _LIBCPP_INLINE_VISIBILITY\n operator __self_view() const _NOEXCEPT { return __self_view(data(), size()); }\n\n basic_string& operator=(const basic_string& __str);\n\n#ifndef _LIBCPP_CXX03_LANG\n template \n#endif\n _LIBCPP_INLINE_VISIBILITY\n basic_string& operator=(__self_view __sv) {return assign(__sv);}\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY\n basic_string& operator=(basic_string&& __str)\n _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));\n#endif\n _LIBCPP_INLINE_VISIBILITY basic_string& operator=(const value_type* __s) {return assign(__s);}\n basic_string& operator=(value_type __c);\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n _LIBCPP_INLINE_VISIBILITY\n basic_string& operator=(initializer_list __il) {return assign(__il.begin(), __il.size());}\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_INLINE_VISIBILITY\n iterator begin() _NOEXCEPT\n {return iterator(this, __get_pointer());}\n _LIBCPP_INLINE_VISIBILITY\n const_iterator begin() const _NOEXCEPT\n {return const_iterator(this, __get_pointer());}\n _LIBCPP_INLINE_VISIBILITY\n iterator end() _NOEXCEPT\n {return iterator(this, __get_pointer() + size());}\n _LIBCPP_INLINE_VISIBILITY\n const_iterator end() const _NOEXCEPT\n {return const_iterator(this, __get_pointer() + size());}\n#else\n _LIBCPP_INLINE_VISIBILITY\n iterator begin() _NOEXCEPT\n {return iterator(__get_pointer());}\n _LIBCPP_INLINE_VISIBILITY\n const_iterator begin() const _NOEXCEPT\n {return const_iterator(__get_pointer());}\n _LIBCPP_INLINE_VISIBILITY\n iterator end() _NOEXCEPT\n {return iterator(__get_pointer() + size());}\n _LIBCPP_INLINE_VISIBILITY\n const_iterator end() const _NOEXCEPT\n {return const_iterator(__get_pointer() + size());}\n#endif // _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_INLINE_VISIBILITY\n reverse_iterator rbegin() _NOEXCEPT\n {return reverse_iterator(end());}\n _LIBCPP_INLINE_VISIBILITY\n const_reverse_iterator rbegin() const _NOEXCEPT\n {return const_reverse_iterator(end());}\n _LIBCPP_INLINE_VISIBILITY\n reverse_iterator rend() _NOEXCEPT\n {return reverse_iterator(begin());}\n _LIBCPP_INLINE_VISIBILITY\n const_reverse_iterator rend() const _NOEXCEPT\n {return const_reverse_iterator(begin());}\n\n _LIBCPP_INLINE_VISIBILITY\n const_iterator cbegin() const _NOEXCEPT\n {return begin();}\n _LIBCPP_INLINE_VISIBILITY\n const_iterator cend() const _NOEXCEPT\n {return end();}\n _LIBCPP_INLINE_VISIBILITY\n const_reverse_iterator crbegin() const _NOEXCEPT\n {return rbegin();}\n _LIBCPP_INLINE_VISIBILITY\n const_reverse_iterator crend() const _NOEXCEPT\n {return rend();}\n\n _LIBCPP_INLINE_VISIBILITY size_type size() const _NOEXCEPT\n {return __is_long() ? __get_long_size() : __get_short_size();}\n _LIBCPP_INLINE_VISIBILITY size_type length() const _NOEXCEPT {return size();}\n _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY size_type capacity() const _NOEXCEPT\n {return (__is_long() ? __get_long_cap()\n : static_cast(__min_cap)) - 1;}\n\n void resize(size_type __n, value_type __c);\n _LIBCPP_INLINE_VISIBILITY void resize(size_type __n) {resize(__n, value_type());}\n\n void reserve(size_type res_arg = 0);\n _LIBCPP_INLINE_VISIBILITY\n void shrink_to_fit() _NOEXCEPT {reserve();}\n _LIBCPP_INLINE_VISIBILITY\n void clear() _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY bool empty() const _NOEXCEPT {return size() == 0;}\n\n _LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __pos) const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY reference operator[](size_type __pos) _NOEXCEPT;\n\n const_reference at(size_type __n) const;\n reference at(size_type __n);\n\n _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(const basic_string& __str) {return append(__str);}\n _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(__self_view __sv) {return append(__sv);}\n _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(const value_type* __s) {return append(__s);}\n _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(value_type __c) {push_back(__c); return *this;}\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(initializer_list __il) {return append(__il);}\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\n _LIBCPP_INLINE_VISIBILITY\n basic_string& append(const basic_string& __str);\n _LIBCPP_INLINE_VISIBILITY\n basic_string& append(__self_view __sv) { return append(__sv.data(), __sv.size()); }\n basic_string& append(const basic_string& __str, size_type __pos, size_type __n=npos);\n template \n typename enable_if\n <\n __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,\n basic_string&\n >::type\n append(const _Tp& __t, size_type __pos, size_type __n=npos);\n basic_string& append(const value_type* __s, size_type __n);\n basic_string& append(const value_type* __s);\n basic_string& append(size_type __n, value_type __c);\n template \n inline basic_string& __append_forward_unsafe(_ForwardIterator, _ForwardIterator);\n template\n typename enable_if\n <\n __is_exactly_input_iterator<_InputIterator>::value\n || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,\n basic_string&\n >::type\n _LIBCPP_INLINE_VISIBILITY\n append(_InputIterator __first, _InputIterator __last) {\n const basic_string __temp (__first, __last, __alloc());\n append(__temp.data(), __temp.size());\n return *this;\n }\n template\n typename enable_if\n <\n __is_forward_iterator<_ForwardIterator>::value\n && __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,\n basic_string&\n >::type\n _LIBCPP_INLINE_VISIBILITY\n append(_ForwardIterator __first, _ForwardIterator __last) {\n return __append_forward_unsafe(__first, __last);\n }\n\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n _LIBCPP_INLINE_VISIBILITY\n basic_string& append(initializer_list __il) {return append(__il.begin(), __il.size());}\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\n void push_back(value_type __c);\n _LIBCPP_INLINE_VISIBILITY\n void pop_back();\n _LIBCPP_INLINE_VISIBILITY reference front();\n _LIBCPP_INLINE_VISIBILITY const_reference front() const;\n _LIBCPP_INLINE_VISIBILITY reference back();\n _LIBCPP_INLINE_VISIBILITY const_reference back() const;\n\n _LIBCPP_INLINE_VISIBILITY\n basic_string& assign(__self_view __sv) { return assign(__sv.data(), __sv.size()); }\n _LIBCPP_INLINE_VISIBILITY\n basic_string& assign(const basic_string& __str) { return *this = __str; }\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY\n basic_string& assign(basic_string&& str)\n _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value))\n {*this = _VSTD::move(str); return *this;}\n#endif\n basic_string& assign(const basic_string& __str, size_type __pos, size_type __n=npos);\n template \n typename enable_if\n <\n __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,\n basic_string&\n >::type\n assign(const _Tp & __t, size_type pos, size_type n=npos);\n basic_string& assign(const value_type* __s, size_type __n);\n basic_string& assign(const value_type* __s);\n basic_string& assign(size_type __n, value_type __c);\n template\n typename enable_if\n <\n __is_exactly_input_iterator<_InputIterator>::value\n || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,\n basic_string&\n >::type\n assign(_InputIterator __first, _InputIterator __last);\n template\n typename enable_if\n <\n __is_forward_iterator<_ForwardIterator>::value\n && __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,\n basic_string&\n >::type\n assign(_ForwardIterator __first, _ForwardIterator __last);\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n _LIBCPP_INLINE_VISIBILITY\n basic_string& assign(initializer_list __il) {return assign(__il.begin(), __il.size());}\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\n _LIBCPP_INLINE_VISIBILITY\n basic_string& insert(size_type __pos1, const basic_string& __str);\n _LIBCPP_INLINE_VISIBILITY\n basic_string& insert(size_type __pos1, __self_view __sv) { return insert(__pos1, __sv.data(), __sv.size()); }\n template \n typename enable_if\n <\n __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,\n basic_string&\n >::type\n insert(size_type __pos1, const _Tp& __t, size_type __pos2, size_type __n=npos);\n basic_string& insert(size_type __pos1, const basic_string& __str, size_type __pos2, size_type __n=npos);\n basic_string& insert(size_type __pos, const value_type* __s, size_type __n);\n basic_string& insert(size_type __pos, const value_type* __s);\n basic_string& insert(size_type __pos, size_type __n, value_type __c);\n iterator insert(const_iterator __pos, value_type __c);\n _LIBCPP_INLINE_VISIBILITY\n iterator insert(const_iterator __pos, size_type __n, value_type __c);\n template\n typename enable_if\n <\n __is_exactly_input_iterator<_InputIterator>::value\n || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,\n iterator\n >::type\n insert(const_iterator __pos, _InputIterator __first, _InputIterator __last);\n template\n typename enable_if\n <\n __is_forward_iterator<_ForwardIterator>::value\n && __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,\n iterator\n >::type\n insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last);\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n _LIBCPP_INLINE_VISIBILITY\n iterator insert(const_iterator __pos, initializer_list __il)\n {return insert(__pos, __il.begin(), __il.end());}\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\n basic_string& erase(size_type __pos = 0, size_type __n = npos);\n _LIBCPP_INLINE_VISIBILITY\n iterator erase(const_iterator __pos);\n _LIBCPP_INLINE_VISIBILITY\n iterator erase(const_iterator __first, const_iterator __last);\n\n _LIBCPP_INLINE_VISIBILITY\n basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str);\n _LIBCPP_INLINE_VISIBILITY\n basic_string& replace(size_type __pos1, size_type __n1, __self_view __sv) { return replace(__pos1, __n1, __sv.data(), __sv.size()); }\n basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2=npos);\n template \n typename enable_if\n <\n __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,\n basic_string&\n >::type\n replace(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2=npos);\n basic_string& replace(size_type __pos, size_type __n1, const value_type* __s, size_type __n2);\n basic_string& replace(size_type __pos, size_type __n1, const value_type* __s);\n basic_string& replace(size_type __pos, size_type __n1, size_type __n2, value_type __c);\n _LIBCPP_INLINE_VISIBILITY\n basic_string& replace(const_iterator __i1, const_iterator __i2, const basic_string& __str);\n _LIBCPP_INLINE_VISIBILITY\n basic_string& replace(const_iterator __i1, const_iterator __i2, __self_view __sv) { return replace(__i1 - begin(), __i2 - __i1, __sv); }\n _LIBCPP_INLINE_VISIBILITY\n basic_string& replace(const_iterator __i1, const_iterator __i2, const value_type* __s, size_type __n);\n _LIBCPP_INLINE_VISIBILITY\n basic_string& replace(const_iterator __i1, const_iterator __i2, const value_type* __s);\n _LIBCPP_INLINE_VISIBILITY\n basic_string& replace(const_iterator __i1, const_iterator __i2, size_type __n, value_type __c);\n template\n typename enable_if\n <\n __is_input_iterator<_InputIterator>::value,\n basic_string&\n >::type\n replace(const_iterator __i1, const_iterator __i2, _InputIterator __j1, _InputIterator __j2);\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n _LIBCPP_INLINE_VISIBILITY\n basic_string& replace(const_iterator __i1, const_iterator __i2, initializer_list __il)\n {return replace(__i1, __i2, __il.begin(), __il.end());}\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\n size_type copy(value_type* __s, size_type __n, size_type __pos = 0) const;\n _LIBCPP_INLINE_VISIBILITY\n basic_string substr(size_type __pos = 0, size_type __n = npos) const;\n\n _LIBCPP_INLINE_VISIBILITY\n void swap(basic_string& __str)\n#if _LIBCPP_STD_VER >= 14\n _NOEXCEPT_DEBUG;\n#else\n _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value ||\n __is_nothrow_swappable::value);\n#endif\n\n _LIBCPP_INLINE_VISIBILITY\n const value_type* c_str() const _NOEXCEPT {return data();}\n _LIBCPP_INLINE_VISIBILITY\n const value_type* data() const _NOEXCEPT {return _VSTD::__to_raw_pointer(__get_pointer());}\n#if _LIBCPP_STD_VER > 14\n _LIBCPP_INLINE_VISIBILITY\n value_type* data() _NOEXCEPT {return _VSTD::__to_raw_pointer(__get_pointer());}\n#endif\n\n _LIBCPP_INLINE_VISIBILITY\n allocator_type get_allocator() const _NOEXCEPT {return __alloc();}\n\n _LIBCPP_INLINE_VISIBILITY\n size_type find(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n size_type find(__self_view __sv, size_type __pos = 0) const _NOEXCEPT;\n size_type find(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n size_type find(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;\n size_type find(value_type __c, size_type __pos = 0) const _NOEXCEPT;\n\n _LIBCPP_INLINE_VISIBILITY\n size_type rfind(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n size_type rfind(__self_view __sv, size_type __pos = 0) const _NOEXCEPT;\n size_type rfind(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n size_type rfind(const value_type* __s, size_type __pos = npos) const _NOEXCEPT;\n size_type rfind(value_type __c, size_type __pos = npos) const _NOEXCEPT;\n\n _LIBCPP_INLINE_VISIBILITY\n size_type find_first_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n size_type find_first_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT;\n size_type find_first_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n size_type find_first_of(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n size_type find_first_of(value_type __c, size_type __pos = 0) const _NOEXCEPT;\n\n _LIBCPP_INLINE_VISIBILITY\n size_type find_last_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n size_type find_last_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT;\n size_type find_last_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n size_type find_last_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n size_type find_last_of(value_type __c, size_type __pos = npos) const _NOEXCEPT;\n\n _LIBCPP_INLINE_VISIBILITY\n size_type find_first_not_of(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n size_type find_first_not_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT;\n size_type find_first_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n size_type find_first_not_of(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n size_type find_first_not_of(value_type __c, size_type __pos = 0) const _NOEXCEPT;\n\n _LIBCPP_INLINE_VISIBILITY\n size_type find_last_not_of(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n size_type find_last_not_of(__self_view __sv, size_type __pos = 0) const _NOEXCEPT;\n size_type find_last_not_of(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n size_type find_last_not_of(const value_type* __s, size_type __pos = npos) const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n size_type find_last_not_of(value_type __c, size_type __pos = npos) const _NOEXCEPT;\n\n _LIBCPP_INLINE_VISIBILITY\n int compare(const basic_string& __str) const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n int compare(__self_view __sv) const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n int compare(size_type __pos1, size_type __n1, __self_view __sv) const;\n _LIBCPP_INLINE_VISIBILITY\n int compare(size_type __pos1, size_type __n1, const basic_string& __str) const;\n int compare(size_type __pos1, size_type __n1, const basic_string& __str, size_type __pos2, size_type __n2=npos) const;\n template \n inline _LIBCPP_INLINE_VISIBILITY\n typename enable_if\n <\n __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,\n int\n >::type\n compare(size_type __pos1, size_type __n1, const _Tp& __t, size_type __pos2, size_type __n2=npos) const;\n int compare(const value_type* __s) const _NOEXCEPT;\n int compare(size_type __pos1, size_type __n1, const value_type* __s) const;\n int compare(size_type __pos1, size_type __n1, const value_type* __s, size_type __n2) const;\n\n _LIBCPP_INLINE_VISIBILITY bool __invariants() const;\n\n _LIBCPP_INLINE_VISIBILITY\n bool __is_long() const _NOEXCEPT\n {return bool(__r_.first().__s.__size_ & __short_mask);}\n\n#if _LIBCPP_DEBUG_LEVEL >= 2\n\n bool __dereferenceable(const const_iterator* __i) const;\n bool __decrementable(const const_iterator* __i) const;\n bool __addable(const const_iterator* __i, ptrdiff_t __n) const;\n bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;\n\n#endif // _LIBCPP_DEBUG_LEVEL >= 2\n\nprivate:\n _LIBCPP_INLINE_VISIBILITY\n allocator_type& __alloc() _NOEXCEPT\n {return __r_.second();}\n _LIBCPP_INLINE_VISIBILITY\n const allocator_type& __alloc() const _NOEXCEPT\n {return __r_.second();}\n\n#ifdef _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT\n\n _LIBCPP_INLINE_VISIBILITY\n void __set_short_size(size_type __s) _NOEXCEPT\n# if _LIBCPP_BIG_ENDIAN\n {__r_.first().__s.__size_ = (unsigned char)(__s << 1);}\n# else\n {__r_.first().__s.__size_ = (unsigned char)(__s);}\n# endif\n\n _LIBCPP_INLINE_VISIBILITY\n size_type __get_short_size() const _NOEXCEPT\n# if _LIBCPP_BIG_ENDIAN\n {return __r_.first().__s.__size_ >> 1;}\n# else\n {return __r_.first().__s.__size_;}\n# endif\n\n#else // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT\n\n _LIBCPP_INLINE_VISIBILITY\n void __set_short_size(size_type __s) _NOEXCEPT\n# if _LIBCPP_BIG_ENDIAN\n {__r_.first().__s.__size_ = (unsigned char)(__s);}\n# else\n {__r_.first().__s.__size_ = (unsigned char)(__s << 1);}\n# endif\n\n _LIBCPP_INLINE_VISIBILITY\n size_type __get_short_size() const _NOEXCEPT\n# if _LIBCPP_BIG_ENDIAN\n {return __r_.first().__s.__size_;}\n# else\n {return __r_.first().__s.__size_ >> 1;}\n# endif\n\n#endif // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT\n\n _LIBCPP_INLINE_VISIBILITY\n void __set_long_size(size_type __s) _NOEXCEPT\n {__r_.first().__l.__size_ = __s;}\n _LIBCPP_INLINE_VISIBILITY\n size_type __get_long_size() const _NOEXCEPT\n {return __r_.first().__l.__size_;}\n _LIBCPP_INLINE_VISIBILITY\n void __set_size(size_type __s) _NOEXCEPT\n {if (__is_long()) __set_long_size(__s); else __set_short_size(__s);}\n\n _LIBCPP_INLINE_VISIBILITY\n void __set_long_cap(size_type __s) _NOEXCEPT\n {__r_.first().__l.__cap_ = __long_mask | __s;}\n _LIBCPP_INLINE_VISIBILITY\n size_type __get_long_cap() const _NOEXCEPT\n {return __r_.first().__l.__cap_ & size_type(~__long_mask);}\n\n _LIBCPP_INLINE_VISIBILITY\n void __set_long_pointer(pointer __p) _NOEXCEPT\n {__r_.first().__l.__data_ = __p;}\n _LIBCPP_INLINE_VISIBILITY\n pointer __get_long_pointer() _NOEXCEPT\n {return __r_.first().__l.__data_;}\n _LIBCPP_INLINE_VISIBILITY\n const_pointer __get_long_pointer() const _NOEXCEPT\n {return __r_.first().__l.__data_;}\n _LIBCPP_INLINE_VISIBILITY\n pointer __get_short_pointer() _NOEXCEPT\n {return pointer_traits::pointer_to(__r_.first().__s.__data_[0]);}\n _LIBCPP_INLINE_VISIBILITY\n const_pointer __get_short_pointer() const _NOEXCEPT\n {return pointer_traits::pointer_to(__r_.first().__s.__data_[0]);}\n _LIBCPP_INLINE_VISIBILITY\n pointer __get_pointer() _NOEXCEPT\n {return __is_long() ? __get_long_pointer() : __get_short_pointer();}\n _LIBCPP_INLINE_VISIBILITY\n const_pointer __get_pointer() const _NOEXCEPT\n {return __is_long() ? __get_long_pointer() : __get_short_pointer();}\n\n _LIBCPP_INLINE_VISIBILITY\n void __zero() _NOEXCEPT\n {\n size_type (&__a)[__n_words] = __r_.first().__r.__words;\n for (unsigned __i = 0; __i < __n_words; ++__i)\n __a[__i] = 0;\n }\n\n template static\n _LIBCPP_INLINE_VISIBILITY\n size_type __align_it(size_type __s) _NOEXCEPT\n {return (__s + (__a-1)) & ~(__a-1);}\n enum {__alignment = 16};\n static _LIBCPP_INLINE_VISIBILITY\n size_type __recommend(size_type __s) _NOEXCEPT\n {return (__s < __min_cap ? static_cast(__min_cap) :\n __align_it (__s+1)) - 1;}\n\n inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY\n void __init(const value_type* __s, size_type __sz, size_type __reserve);\n inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY\n void __init(const value_type* __s, size_type __sz);\n inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY\n void __init(size_type __n, value_type __c);\n\n template \n inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY\n typename enable_if\n <\n __is_exactly_input_iterator<_InputIterator>::value,\n void\n >::type\n __init(_InputIterator __first, _InputIterator __last);\n\n template \n inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY\n typename enable_if\n <\n __is_forward_iterator<_ForwardIterator>::value,\n void\n >::type\n __init(_ForwardIterator __first, _ForwardIterator __last);\n\n void __grow_by(size_type __old_cap, size_type __delta_cap, size_type __old_sz,\n size_type __n_copy, size_type __n_del, size_type __n_add = 0);\n void __grow_by_and_replace(size_type __old_cap, size_type __delta_cap, size_type __old_sz,\n size_type __n_copy, size_type __n_del,\n size_type __n_add, const value_type* __p_new_stuff);\n\n _LIBCPP_INLINE_VISIBILITY\n void __erase_to_end(size_type __pos);\n\n _LIBCPP_INLINE_VISIBILITY\n void __copy_assign_alloc(const basic_string& __str)\n {__copy_assign_alloc(__str, integral_constant());}\n\n _LIBCPP_INLINE_VISIBILITY\n void __copy_assign_alloc(const basic_string& __str, true_type)\n {\n if (__alloc() != __str.__alloc())\n {\n clear();\n shrink_to_fit();\n }\n __alloc() = __str.__alloc();\n }\n\n _LIBCPP_INLINE_VISIBILITY\n void __copy_assign_alloc(const basic_string&, false_type) _NOEXCEPT\n {}\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY\n void __move_assign(basic_string& __str, false_type)\n _NOEXCEPT_(__alloc_traits::is_always_equal::value);\n _LIBCPP_INLINE_VISIBILITY\n void __move_assign(basic_string& __str, true_type)\n#if _LIBCPP_STD_VER > 14\n _NOEXCEPT;\n#else\n _NOEXCEPT_(is_nothrow_move_assignable::value);\n#endif\n#endif\n\n _LIBCPP_INLINE_VISIBILITY\n void\n __move_assign_alloc(basic_string& __str)\n _NOEXCEPT_(\n !__alloc_traits::propagate_on_container_move_assignment::value ||\n is_nothrow_move_assignable::value)\n {__move_assign_alloc(__str, integral_constant());}\n\n _LIBCPP_INLINE_VISIBILITY\n void __move_assign_alloc(basic_string& __c, true_type)\n _NOEXCEPT_(is_nothrow_move_assignable::value)\n {\n __alloc() = _VSTD::move(__c.__alloc());\n }\n\n _LIBCPP_INLINE_VISIBILITY\n void __move_assign_alloc(basic_string&, false_type)\n _NOEXCEPT\n {}\n\n _LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();\n _LIBCPP_INLINE_VISIBILITY void __invalidate_iterators_past(size_type);\n\n friend basic_string operator+<>(const basic_string&, const basic_string&);\n friend basic_string operator+<>(const value_type*, const basic_string&);\n friend basic_string operator+<>(value_type, const basic_string&);\n friend basic_string operator+<>(const basic_string&, const value_type*);\n friend basic_string operator+<>(const basic_string&, value_type);\n};\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nbasic_string<_CharT, _Traits, _Allocator>::__invalidate_all_iterators()\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__invalidate_all(this);\n#endif // _LIBCPP_DEBUG_LEVEL >= 2\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nbasic_string<_CharT, _Traits, _Allocator>::__invalidate_iterators_past(size_type\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __pos\n#endif\n )\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __c_node* __c = __get_db()->__find_c_and_lock(this);\n if (__c)\n {\n const_pointer __new_last = __get_pointer() + __pos;\n for (__i_node** __p = __c->end_; __p != __c->beg_; )\n {\n --__p;\n const_iterator* __i = static_cast((*__p)->__i_);\n if (__i->base() > __new_last)\n {\n (*__p)->__c_ = nullptr;\n if (--__c->end_ != __p)\n memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));\n }\n }\n __get_db()->unlock();\n }\n#endif // _LIBCPP_DEBUG_LEVEL >= 2\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>::basic_string()\n _NOEXCEPT_(is_nothrow_default_constructible::value)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n __zero();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>::basic_string(const allocator_type& __a)\n#if _LIBCPP_STD_VER <= 14\n _NOEXCEPT_(is_nothrow_copy_constructible::value)\n#else\n _NOEXCEPT\n#endif\n: __r_(__a)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n __zero();\n}\n\ntemplate \nvoid basic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s,\n size_type __sz,\n size_type __reserve)\n{\n if (__reserve > max_size())\n this->__throw_length_error();\n pointer __p;\n if (__reserve < __min_cap)\n {\n __set_short_size(__sz);\n __p = __get_short_pointer();\n }\n else\n {\n size_type __cap = __recommend(__reserve);\n __p = __alloc_traits::allocate(__alloc(), __cap+1);\n __set_long_pointer(__p);\n __set_long_cap(__cap+1);\n __set_long_size(__sz);\n }\n traits_type::copy(_VSTD::__to_raw_pointer(__p), __s, __sz);\n traits_type::assign(__p[__sz], value_type());\n}\n\ntemplate \nvoid\nbasic_string<_CharT, _Traits, _Allocator>::__init(const value_type* __s, size_type __sz)\n{\n if (__sz > max_size())\n this->__throw_length_error();\n pointer __p;\n if (__sz < __min_cap)\n {\n __set_short_size(__sz);\n __p = __get_short_pointer();\n }\n else\n {\n size_type __cap = __recommend(__sz);\n __p = __alloc_traits::allocate(__alloc(), __cap+1);\n __set_long_pointer(__p);\n __set_long_cap(__cap+1);\n __set_long_size(__sz);\n }\n traits_type::copy(_VSTD::__to_raw_pointer(__p), __s, __sz);\n traits_type::assign(__p[__sz], value_type());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s)\n{\n _LIBCPP_ASSERT(__s != nullptr, \"basic_string(const char*) detected nullptr\");\n __init(__s, traits_type::length(__s));\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s, const allocator_type& __a)\n : __r_(__a)\n{\n _LIBCPP_ASSERT(__s != nullptr, \"basic_string(const char*, allocator) detected nullptr\");\n __init(__s, traits_type::length(__s));\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s, size_type __n)\n{\n _LIBCPP_ASSERT(__n == 0 || __s != nullptr, \"basic_string(const char*, n) detected nullptr\");\n __init(__s, __n);\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s, size_type __n, const allocator_type& __a)\n : __r_(__a)\n{\n _LIBCPP_ASSERT(__n == 0 || __s != nullptr, \"basic_string(const char*, n, allocator) detected nullptr\");\n __init(__s, __n);\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n}\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str)\n : __r_(__alloc_traits::select_on_container_copy_construction(__str.__alloc()))\n{\n if (!__str.__is_long())\n __r_.first().__r = __str.__r_.first().__r;\n else\n __init(_VSTD::__to_raw_pointer(__str.__get_long_pointer()), __str.__get_long_size());\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n}\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str, const allocator_type& __a)\n : __r_(__a)\n{\n if (!__str.__is_long())\n __r_.first().__r = __str.__r_.first().__r;\n else\n __init(_VSTD::__to_raw_pointer(__str.__get_long_pointer()), __str.__get_long_size());\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n}\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str)\n#if _LIBCPP_STD_VER <= 14\n _NOEXCEPT_(is_nothrow_move_constructible::value)\n#else\n _NOEXCEPT\n#endif\n : __r_(_VSTD::move(__str.__r_))\n{\n __str.__zero();\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n if (__is_long())\n __get_db()->swap(this, &__str);\n#endif\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str, const allocator_type& __a)\n : __r_(__a)\n{\n if (__str.__is_long() && __a != __str.__alloc()) // copy, not move\n __init(_VSTD::__to_raw_pointer(__str.__get_long_pointer()), __str.__get_long_size());\n else\n {\n __r_.first().__r = __str.__r_.first().__r;\n __str.__zero();\n }\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n if (__is_long())\n __get_db()->swap(this, &__str);\n#endif\n}\n\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \nvoid\nbasic_string<_CharT, _Traits, _Allocator>::__init(size_type __n, value_type __c)\n{\n if (__n > max_size())\n this->__throw_length_error();\n pointer __p;\n if (__n < __min_cap)\n {\n __set_short_size(__n);\n __p = __get_short_pointer();\n }\n else\n {\n size_type __cap = __recommend(__n);\n __p = __alloc_traits::allocate(__alloc(), __cap+1);\n __set_long_pointer(__p);\n __set_long_cap(__cap+1);\n __set_long_size(__n);\n }\n traits_type::assign(_VSTD::__to_raw_pointer(__p), __n, __c);\n traits_type::assign(__p[__n], value_type());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, value_type __c)\n{\n __init(__n, __c);\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, value_type __c, const allocator_type& __a)\n : __r_(__a)\n{\n __init(__n, __c);\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n}\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str, size_type __pos, size_type __n,\n const allocator_type& __a)\n : __r_(__a)\n{\n size_type __str_sz = __str.size();\n if (__pos > __str_sz)\n this->__throw_out_of_range();\n __init(__str.data() + __pos, _VSTD::min(__n, __str_sz - __pos));\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str, size_type __pos,\n const allocator_type& __a)\n : __r_(__a)\n{\n size_type __str_sz = __str.size();\n if (__pos > __str_sz)\n this->__throw_out_of_range();\n __init(__str.data() + __pos, __str_sz - __pos);\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n}\n\ntemplate \ntemplate \nbasic_string<_CharT, _Traits, _Allocator>::basic_string(\n const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a,\n\t\t\t typename enable_if<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, void>::type *)\n : __r_(__a)\n{\n\t__self_view __sv = __self_view(__t).substr(__pos, __n);\n __init(__sv.data(), __sv.size());\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\t\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>::basic_string(__self_view __sv)\n{\n __init(__sv.data(), __sv.size());\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>::basic_string(__self_view __sv, const allocator_type& __a)\n : __r_(__a)\n{\n __init(__sv.data(), __sv.size());\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n}\n\ntemplate \ntemplate \ntypename enable_if\n<\n __is_exactly_input_iterator<_InputIterator>::value,\n void\n>::type\nbasic_string<_CharT, _Traits, _Allocator>::__init(_InputIterator __first, _InputIterator __last)\n{\n __zero();\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n for (; __first != __last; ++__first)\n push_back(*__first);\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n if (__is_long())\n __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());\n throw;\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n}\n\ntemplate \ntemplate \ntypename enable_if\n<\n __is_forward_iterator<_ForwardIterator>::value,\n void\n>::type\nbasic_string<_CharT, _Traits, _Allocator>::__init(_ForwardIterator __first, _ForwardIterator __last)\n{\n size_type __sz = static_cast(_VSTD::distance(__first, __last));\n if (__sz > max_size())\n this->__throw_length_error();\n pointer __p;\n if (__sz < __min_cap)\n {\n __set_short_size(__sz);\n __p = __get_short_pointer();\n }\n else\n {\n size_type __cap = __recommend(__sz);\n __p = __alloc_traits::allocate(__alloc(), __cap+1);\n __set_long_pointer(__p);\n __set_long_cap(__cap+1);\n __set_long_size(__sz);\n }\n for (; __first != __last; ++__first, (void) ++__p)\n traits_type::assign(*__p, *__first);\n traits_type::assign(*__p, value_type());\n}\n\ntemplate \ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first, _InputIterator __last)\n{\n __init(__first, __last);\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n}\n\ntemplate \ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first, _InputIterator __last,\n const allocator_type& __a)\n : __r_(__a)\n{\n __init(__first, __last);\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n}\n\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>::basic_string(initializer_list __il)\n{\n __init(__il.begin(), __il.end());\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>::basic_string(initializer_list __il, const allocator_type& __a)\n : __r_(__a)\n{\n __init(__il.begin(), __il.end());\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n}\n\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>::~basic_string()\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__erase_c(this);\n#endif\n if (__is_long())\n __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());\n}\n\ntemplate \nvoid\nbasic_string<_CharT, _Traits, _Allocator>::__grow_by_and_replace\n (size_type __old_cap, size_type __delta_cap, size_type __old_sz,\n size_type __n_copy, size_type __n_del, size_type __n_add, const value_type* __p_new_stuff)\n{\n size_type __ms = max_size();\n if (__delta_cap > __ms - __old_cap - 1)\n this->__throw_length_error();\n pointer __old_p = __get_pointer();\n size_type __cap = __old_cap < __ms / 2 - __alignment ?\n __recommend(_VSTD::max(__old_cap + __delta_cap, 2 * __old_cap)) :\n __ms - 1;\n pointer __p = __alloc_traits::allocate(__alloc(), __cap+1);\n __invalidate_all_iterators();\n if (__n_copy != 0)\n traits_type::copy(_VSTD::__to_raw_pointer(__p),\n _VSTD::__to_raw_pointer(__old_p), __n_copy);\n if (__n_add != 0)\n traits_type::copy(_VSTD::__to_raw_pointer(__p) + __n_copy, __p_new_stuff, __n_add);\n size_type __sec_cp_sz = __old_sz - __n_del - __n_copy;\n if (__sec_cp_sz != 0)\n traits_type::copy(_VSTD::__to_raw_pointer(__p) + __n_copy + __n_add,\n _VSTD::__to_raw_pointer(__old_p) + __n_copy + __n_del, __sec_cp_sz);\n if (__old_cap+1 != __min_cap)\n __alloc_traits::deallocate(__alloc(), __old_p, __old_cap+1);\n __set_long_pointer(__p);\n __set_long_cap(__cap+1);\n __old_sz = __n_copy + __n_add + __sec_cp_sz;\n __set_long_size(__old_sz);\n traits_type::assign(__p[__old_sz], value_type());\n}\n\ntemplate \nvoid\nbasic_string<_CharT, _Traits, _Allocator>::__grow_by(size_type __old_cap, size_type __delta_cap, size_type __old_sz,\n size_type __n_copy, size_type __n_del, size_type __n_add)\n{\n size_type __ms = max_size();\n if (__delta_cap > __ms - __old_cap)\n this->__throw_length_error();\n pointer __old_p = __get_pointer();\n size_type __cap = __old_cap < __ms / 2 - __alignment ?\n __recommend(_VSTD::max(__old_cap + __delta_cap, 2 * __old_cap)) :\n __ms - 1;\n pointer __p = __alloc_traits::allocate(__alloc(), __cap+1);\n __invalidate_all_iterators();\n if (__n_copy != 0)\n traits_type::copy(_VSTD::__to_raw_pointer(__p),\n _VSTD::__to_raw_pointer(__old_p), __n_copy);\n size_type __sec_cp_sz = __old_sz - __n_del - __n_copy;\n if (__sec_cp_sz != 0)\n traits_type::copy(_VSTD::__to_raw_pointer(__p) + __n_copy + __n_add,\n _VSTD::__to_raw_pointer(__old_p) + __n_copy + __n_del,\n __sec_cp_sz);\n if (__old_cap+1 != __min_cap)\n __alloc_traits::deallocate(__alloc(), __old_p, __old_cap+1);\n __set_long_pointer(__p);\n __set_long_cap(__cap+1);\n}\n\n// assign\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::assign(const value_type* __s, size_type __n)\n{\n _LIBCPP_ASSERT(__n == 0 || __s != nullptr, \"string::assign received nullptr\");\n size_type __cap = capacity();\n if (__cap >= __n)\n {\n value_type* __p = _VSTD::__to_raw_pointer(__get_pointer());\n traits_type::move(__p, __s, __n);\n traits_type::assign(__p[__n], value_type());\n __set_size(__n);\n __invalidate_iterators_past(__n);\n }\n else\n {\n size_type __sz = size();\n __grow_by_and_replace(__cap, __n - __cap, __sz, 0, __sz, __n, __s);\n }\n return *this;\n}\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::assign(size_type __n, value_type __c)\n{\n size_type __cap = capacity();\n if (__cap < __n)\n {\n size_type __sz = size();\n __grow_by(__cap, __n - __cap, __sz, 0, __sz);\n }\n else\n __invalidate_iterators_past(__n);\n value_type* __p = _VSTD::__to_raw_pointer(__get_pointer());\n traits_type::assign(__p, __n, __c);\n traits_type::assign(__p[__n], value_type());\n __set_size(__n);\n return *this;\n}\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::operator=(value_type __c)\n{\n pointer __p;\n if (__is_long())\n {\n __p = __get_long_pointer();\n __set_long_size(1);\n }\n else\n {\n __p = __get_short_pointer();\n __set_short_size(1);\n }\n traits_type::assign(*__p, __c);\n traits_type::assign(*++__p, value_type());\n __invalidate_iterators_past(1);\n return *this;\n}\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::operator=(const basic_string& __str)\n{\n if (this != &__str)\n {\n __copy_assign_alloc(__str);\n assign(__str.data(), __str.size());\n }\n return *this;\n}\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nbasic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, false_type)\n _NOEXCEPT_(__alloc_traits::is_always_equal::value)\n{\n if (__alloc() != __str.__alloc())\n assign(__str);\n else\n __move_assign(__str, true_type());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nbasic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, true_type)\n#if _LIBCPP_STD_VER > 14\n _NOEXCEPT\n#else\n _NOEXCEPT_(is_nothrow_move_assignable::value)\n#endif\n{\n clear();\n shrink_to_fit();\n __r_.first() = __str.__r_.first();\n __move_assign_alloc(__str);\n __str.__zero();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::operator=(basic_string&& __str)\n _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value))\n{\n __move_assign(__str, integral_constant());\n return *this;\n}\n\n#endif\n\ntemplate \ntemplate\ntypename enable_if\n<\n __is_exactly_input_iterator <_InputIterator>::value\n || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,\n basic_string<_CharT, _Traits, _Allocator>&\n>::type\nbasic_string<_CharT, _Traits, _Allocator>::assign(_InputIterator __first, _InputIterator __last)\n{\n const basic_string __temp(__first, __last, __alloc());\n assign(__temp.data(), __temp.size());\n return *this;\n}\n\ntemplate \ntemplate\ntypename enable_if\n<\n __is_forward_iterator<_ForwardIterator>::value\n && __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,\n basic_string<_CharT, _Traits, _Allocator>&\n>::type\nbasic_string<_CharT, _Traits, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)\n{\n size_type __n = static_cast(_VSTD::distance(__first, __last));\n size_type __cap = capacity();\n if (__cap < __n)\n {\n size_type __sz = size();\n __grow_by(__cap, __n - __cap, __sz, 0, __sz);\n }\n else\n __invalidate_iterators_past(__n);\n pointer __p = __get_pointer();\n for (; __first != __last; ++__first, ++__p)\n traits_type::assign(*__p, *__first);\n traits_type::assign(*__p, value_type());\n __set_size(__n);\n return *this;\n}\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::assign(const basic_string& __str, size_type __pos, size_type __n)\n{\n size_type __sz = __str.size();\n if (__pos > __sz)\n this->__throw_out_of_range();\n return assign(__str.data() + __pos, _VSTD::min(__n, __sz - __pos));\n}\n\ntemplate \ntemplate \ntypename enable_if\n<\n __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,\n\tbasic_string<_CharT, _Traits, _Allocator>&\n>::type\nbasic_string<_CharT, _Traits, _Allocator>::assign(const _Tp & __t, size_type __pos, size_type __n)\n{\n __self_view __sv = __t;\n size_type __sz = __sv.size();\n if (__pos > __sz)\n this->__throw_out_of_range();\n return assign(__sv.data() + __pos, _VSTD::min(__n, __sz - __pos));\n}\n\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::assign(const value_type* __s)\n{\n _LIBCPP_ASSERT(__s != nullptr, \"string::assign received nullptr\");\n return assign(__s, traits_type::length(__s));\n}\n\n// append\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::append(const value_type* __s, size_type __n)\n{\n _LIBCPP_ASSERT(__n == 0 || __s != nullptr, \"string::append received nullptr\");\n size_type __cap = capacity();\n size_type __sz = size();\n if (__cap - __sz >= __n)\n {\n if (__n)\n {\n value_type* __p = _VSTD::__to_raw_pointer(__get_pointer());\n traits_type::copy(__p + __sz, __s, __n);\n __sz += __n;\n __set_size(__sz);\n traits_type::assign(__p[__sz], value_type());\n }\n }\n else\n __grow_by_and_replace(__cap, __sz + __n - __cap, __sz, __sz, 0, __n, __s);\n return *this;\n}\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::append(size_type __n, value_type __c)\n{\n if (__n)\n {\n size_type __cap = capacity();\n size_type __sz = size();\n if (__cap - __sz < __n)\n __grow_by(__cap, __sz + __n - __cap, __sz, __sz, 0);\n pointer __p = __get_pointer();\n traits_type::assign(_VSTD::__to_raw_pointer(__p) + __sz, __n, __c);\n __sz += __n;\n __set_size(__sz);\n traits_type::assign(__p[__sz], value_type());\n }\n return *this;\n}\n\ntemplate \nvoid\nbasic_string<_CharT, _Traits, _Allocator>::push_back(value_type __c)\n{\n bool __is_short = !__is_long();\n size_type __cap;\n size_type __sz;\n if (__is_short)\n {\n __cap = __min_cap - 1;\n __sz = __get_short_size();\n }\n else\n {\n __cap = __get_long_cap() - 1;\n __sz = __get_long_size();\n }\n if (__sz == __cap)\n {\n __grow_by(__cap, 1, __sz, __sz, 0);\n __is_short = !__is_long();\n }\n pointer __p;\n if (__is_short)\n {\n __p = __get_short_pointer() + __sz;\n __set_short_size(__sz+1);\n }\n else\n {\n __p = __get_long_pointer() + __sz;\n __set_long_size(__sz+1);\n }\n traits_type::assign(*__p, __c);\n traits_type::assign(*++__p, value_type());\n}\n\ntemplate \nbool __ptr_in_range (const _Tp* __p, const _Tp* __first, const _Tp* __last)\n{\n return __first <= __p && __p < __last;\n}\n\ntemplate \nbool __ptr_in_range (const _Tp1*, const _Tp2*, const _Tp2*)\n{\n return false;\n}\n\ntemplate \ntemplate\nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::__append_forward_unsafe(\n _ForwardIterator __first, _ForwardIterator __last)\n{\n static_assert(__is_forward_iterator<_ForwardIterator>::value,\n \"function requires a ForwardIterator\");\n size_type __sz = size();\n size_type __cap = capacity();\n size_type __n = static_cast(_VSTD::distance(__first, __last));\n if (__n)\n {\n typedef typename iterator_traits<_ForwardIterator>::reference _CharRef;\n _CharRef __tmp_ref = *__first;\n if (__ptr_in_range(_VSTD::addressof(__tmp_ref), data(), data() + size()))\n {\n const basic_string __temp (__first, __last, __alloc());\n append(__temp.data(), __temp.size());\n }\n else \n {\n if (__cap - __sz < __n)\n __grow_by(__cap, __sz + __n - __cap, __sz, __sz, 0);\n pointer __p = __get_pointer() + __sz;\n for (; __first != __last; ++__p, ++__first)\n traits_type::assign(*__p, *__first);\n traits_type::assign(*__p, value_type());\n __set_size(__sz + __n);\n }\n }\n return *this;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::append(const basic_string& __str)\n{\n return append(__str.data(), __str.size());\n}\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::append(const basic_string& __str, size_type __pos, size_type __n)\n{\n size_type __sz = __str.size();\n if (__pos > __sz)\n this->__throw_out_of_range();\n return append(__str.data() + __pos, _VSTD::min(__n, __sz - __pos));\n}\n\ntemplate \ntemplate \n typename enable_if\n <\n __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,\n basic_string<_CharT, _Traits, _Allocator>&\n >::type\nbasic_string<_CharT, _Traits, _Allocator>::append(const _Tp & __t, size_type __pos, size_type __n)\n{\n __self_view __sv = __t;\n size_type __sz = __sv.size();\n if (__pos > __sz)\n this->__throw_out_of_range();\n return append(__sv.data() + __pos, _VSTD::min(__n, __sz - __pos));\n}\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::append(const value_type* __s)\n{\n _LIBCPP_ASSERT(__s != nullptr, \"string::append received nullptr\");\n return append(__s, traits_type::length(__s));\n}\n\n// insert\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, const value_type* __s, size_type __n)\n{\n _LIBCPP_ASSERT(__n == 0 || __s != nullptr, \"string::insert received nullptr\");\n size_type __sz = size();\n if (__pos > __sz)\n this->__throw_out_of_range();\n size_type __cap = capacity();\n if (__cap - __sz >= __n)\n {\n if (__n)\n {\n value_type* __p = _VSTD::__to_raw_pointer(__get_pointer());\n size_type __n_move = __sz - __pos;\n if (__n_move != 0)\n {\n if (__p + __pos <= __s && __s < __p + __sz)\n __s += __n;\n traits_type::move(__p + __pos + __n, __p + __pos, __n_move);\n }\n traits_type::move(__p + __pos, __s, __n);\n __sz += __n;\n __set_size(__sz);\n traits_type::assign(__p[__sz], value_type());\n }\n }\n else\n __grow_by_and_replace(__cap, __sz + __n - __cap, __sz, __pos, 0, __n, __s);\n return *this;\n}\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, size_type __n, value_type __c)\n{\n size_type __sz = size();\n if (__pos > __sz)\n this->__throw_out_of_range();\n if (__n)\n {\n size_type __cap = capacity();\n value_type* __p;\n if (__cap - __sz >= __n)\n {\n __p = _VSTD::__to_raw_pointer(__get_pointer());\n size_type __n_move = __sz - __pos;\n if (__n_move != 0)\n traits_type::move(__p + __pos + __n, __p + __pos, __n_move);\n }\n else\n {\n __grow_by(__cap, __sz + __n - __cap, __sz, __pos, 0, __n);\n __p = _VSTD::__to_raw_pointer(__get_long_pointer());\n }\n traits_type::assign(__p + __pos, __n, __c);\n __sz += __n;\n __set_size(__sz);\n traits_type::assign(__p[__sz], value_type());\n }\n return *this;\n}\n\ntemplate \ntemplate\ntypename enable_if\n<\n __is_exactly_input_iterator<_InputIterator>::value\n || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,\n typename basic_string<_CharT, _Traits, _Allocator>::iterator\n>::type\nbasic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _InputIterator __first, _InputIterator __last)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,\n \"string::insert(iterator, range) called with an iterator not\"\n \" referring to this string\");\n#endif\n const basic_string __temp(__first, __last, __alloc());\n return insert(__pos, __temp.data(), __temp.data() + __temp.size());\n}\n\ntemplate \ntemplate\ntypename enable_if\n<\n __is_forward_iterator<_ForwardIterator>::value\n && __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,\n typename basic_string<_CharT, _Traits, _Allocator>::iterator\n>::type\nbasic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,\n \"string::insert(iterator, range) called with an iterator not\"\n \" referring to this string\");\n#endif\n size_type __ip = static_cast(__pos - begin());\n size_type __n = static_cast(_VSTD::distance(__first, __last));\n if (__n)\n {\n typedef typename iterator_traits<_ForwardIterator>::reference _CharRef;\n _CharRef __tmp_char = *__first;\n if (__ptr_in_range(_VSTD::addressof(__tmp_char), data(), data() + size()))\n {\n const basic_string __temp(__first, __last, __alloc());\n return insert(__pos, __temp.data(), __temp.data() + __temp.size());\n }\n\n size_type __sz = size();\n size_type __cap = capacity();\n value_type* __p;\n if (__cap - __sz >= __n)\n {\n __p = _VSTD::__to_raw_pointer(__get_pointer());\n size_type __n_move = __sz - __ip;\n if (__n_move != 0)\n traits_type::move(__p + __ip + __n, __p + __ip, __n_move);\n }\n else\n {\n __grow_by(__cap, __sz + __n - __cap, __sz, __ip, 0, __n);\n __p = _VSTD::__to_raw_pointer(__get_long_pointer());\n }\n __sz += __n;\n __set_size(__sz);\n traits_type::assign(__p[__sz], value_type());\n for (__p += __ip; __first != __last; ++__p, ++__first)\n traits_type::assign(*__p, *__first);\n }\n return begin() + __ip;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos1, const basic_string& __str)\n{\n return insert(__pos1, __str.data(), __str.size());\n}\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos1, const basic_string& __str,\n size_type __pos2, size_type __n)\n{\n size_type __str_sz = __str.size();\n if (__pos2 > __str_sz)\n this->__throw_out_of_range();\n return insert(__pos1, __str.data() + __pos2, _VSTD::min(__n, __str_sz - __pos2));\n}\n\ntemplate \ntemplate \ntypename enable_if\n<\n __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,\n\tbasic_string<_CharT, _Traits, _Allocator>&\n>::type\nbasic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos1, const _Tp& __t,\n size_type __pos2, size_type __n)\n{\n __self_view __sv = __t;\n size_type __str_sz = __sv.size();\n if (__pos2 > __str_sz)\n this->__throw_out_of_range();\n return insert(__pos1, __sv.data() + __pos2, _VSTD::min(__n, __str_sz - __pos2));\n}\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, const value_type* __s)\n{\n _LIBCPP_ASSERT(__s != nullptr, \"string::insert received nullptr\");\n return insert(__pos, __s, traits_type::length(__s));\n}\n\ntemplate \ntypename basic_string<_CharT, _Traits, _Allocator>::iterator\nbasic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, value_type __c)\n{\n size_type __ip = static_cast(__pos - begin());\n size_type __sz = size();\n size_type __cap = capacity();\n value_type* __p;\n if (__cap == __sz)\n {\n __grow_by(__cap, 1, __sz, __ip, 0, 1);\n __p = _VSTD::__to_raw_pointer(__get_long_pointer());\n }\n else\n {\n __p = _VSTD::__to_raw_pointer(__get_pointer());\n size_type __n_move = __sz - __ip;\n if (__n_move != 0)\n traits_type::move(__p + __ip + 1, __p + __ip, __n_move);\n }\n traits_type::assign(__p[__ip], __c);\n traits_type::assign(__p[++__sz], value_type());\n __set_size(__sz);\n return begin() + static_cast(__ip);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::iterator\nbasic_string<_CharT, _Traits, _Allocator>::insert(const_iterator __pos, size_type __n, value_type __c)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,\n \"string::insert(iterator, n, value) called with an iterator not\"\n \" referring to this string\");\n#endif\n difference_type __p = __pos - begin();\n insert(static_cast(__p), __n, __c);\n return begin() + __p;\n}\n\n// replace\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __n1, const value_type* __s, size_type __n2)\n{\n _LIBCPP_ASSERT(__n2 == 0 || __s != nullptr, \"string::replace received nullptr\");\n size_type __sz = size();\n if (__pos > __sz)\n this->__throw_out_of_range();\n __n1 = _VSTD::min(__n1, __sz - __pos);\n size_type __cap = capacity();\n if (__cap - __sz + __n1 >= __n2)\n {\n value_type* __p = _VSTD::__to_raw_pointer(__get_pointer());\n if (__n1 != __n2)\n {\n size_type __n_move = __sz - __pos - __n1;\n if (__n_move != 0)\n {\n if (__n1 > __n2)\n {\n traits_type::move(__p + __pos, __s, __n2);\n traits_type::move(__p + __pos + __n2, __p + __pos + __n1, __n_move);\n goto __finish;\n }\n if (__p + __pos < __s && __s < __p + __sz)\n {\n if (__p + __pos + __n1 <= __s)\n __s += __n2 - __n1;\n else // __p + __pos < __s < __p + __pos + __n1\n {\n traits_type::move(__p + __pos, __s, __n1);\n __pos += __n1;\n __s += __n2;\n __n2 -= __n1;\n __n1 = 0;\n }\n }\n traits_type::move(__p + __pos + __n2, __p + __pos + __n1, __n_move);\n }\n }\n traits_type::move(__p + __pos, __s, __n2);\n__finish:\n __sz += __n2 - __n1;\n __set_size(__sz);\n __invalidate_iterators_past(__sz);\n traits_type::assign(__p[__sz], value_type());\n }\n else\n __grow_by_and_replace(__cap, __sz - __n1 + __n2 - __cap, __sz, __pos, __n1, __n2, __s);\n return *this;\n}\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __n1, size_type __n2, value_type __c)\n{\n size_type __sz = size();\n if (__pos > __sz)\n this->__throw_out_of_range();\n __n1 = _VSTD::min(__n1, __sz - __pos);\n size_type __cap = capacity();\n value_type* __p;\n if (__cap - __sz + __n1 >= __n2)\n {\n __p = _VSTD::__to_raw_pointer(__get_pointer());\n if (__n1 != __n2)\n {\n size_type __n_move = __sz - __pos - __n1;\n if (__n_move != 0)\n traits_type::move(__p + __pos + __n2, __p + __pos + __n1, __n_move);\n }\n }\n else\n {\n __grow_by(__cap, __sz - __n1 + __n2 - __cap, __sz, __pos, __n1, __n2);\n __p = _VSTD::__to_raw_pointer(__get_long_pointer());\n }\n traits_type::assign(__p + __pos, __n2, __c);\n __sz += __n2 - __n1;\n __set_size(__sz);\n __invalidate_iterators_past(__sz);\n traits_type::assign(__p[__sz], value_type());\n return *this;\n}\n\ntemplate \ntemplate\ntypename enable_if\n<\n __is_input_iterator<_InputIterator>::value,\n basic_string<_CharT, _Traits, _Allocator>&\n>::type\nbasic_string<_CharT, _Traits, _Allocator>::replace(const_iterator __i1, const_iterator __i2,\n _InputIterator __j1, _InputIterator __j2)\n{\n const basic_string __temp(__j1, __j2, __alloc());\n return this->replace(__i1, __i2, __temp);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos1, size_type __n1, const basic_string& __str)\n{\n return replace(__pos1, __n1, __str.data(), __str.size());\n}\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos1, size_type __n1, const basic_string& __str,\n size_type __pos2, size_type __n2)\n{\n size_type __str_sz = __str.size();\n if (__pos2 > __str_sz)\n this->__throw_out_of_range();\n return replace(__pos1, __n1, __str.data() + __pos2, _VSTD::min(__n2, __str_sz - __pos2));\n}\n\ntemplate \ntemplate \ntypename enable_if\n<\n\t__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,\n\tbasic_string<_CharT, _Traits, _Allocator>&\n>::type\nbasic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos1, size_type __n1, const _Tp& __t,\n size_type __pos2, size_type __n2)\n{\n __self_view __sv = __t;\n size_type __str_sz = __sv.size();\n if (__pos2 > __str_sz)\n this->__throw_out_of_range();\n return replace(__pos1, __n1, __sv.data() + __pos2, _VSTD::min(__n2, __str_sz - __pos2));\n}\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __n1, const value_type* __s)\n{\n _LIBCPP_ASSERT(__s != nullptr, \"string::replace received nullptr\");\n return replace(__pos, __n1, __s, traits_type::length(__s));\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::replace(const_iterator __i1, const_iterator __i2, const basic_string& __str)\n{\n return replace(static_cast(__i1 - begin()), static_cast(__i2 - __i1),\n __str.data(), __str.size());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::replace(const_iterator __i1, const_iterator __i2, const value_type* __s, size_type __n)\n{\n return replace(static_cast(__i1 - begin()), static_cast(__i2 - __i1), __s, __n);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::replace(const_iterator __i1, const_iterator __i2, const value_type* __s)\n{\n return replace(static_cast(__i1 - begin()), static_cast(__i2 - __i1), __s);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::replace(const_iterator __i1, const_iterator __i2, size_type __n, value_type __c)\n{\n return replace(static_cast(__i1 - begin()), static_cast(__i2 - __i1), __n, __c);\n}\n\n// erase\n\ntemplate \nbasic_string<_CharT, _Traits, _Allocator>&\nbasic_string<_CharT, _Traits, _Allocator>::erase(size_type __pos, size_type __n)\n{\n size_type __sz = size();\n if (__pos > __sz)\n this->__throw_out_of_range();\n if (__n)\n {\n value_type* __p = _VSTD::__to_raw_pointer(__get_pointer());\n __n = _VSTD::min(__n, __sz - __pos);\n size_type __n_move = __sz - __pos - __n;\n if (__n_move != 0)\n traits_type::move(__p + __pos, __p + __pos + __n, __n_move);\n __sz -= __n;\n __set_size(__sz);\n __invalidate_iterators_past(__sz);\n traits_type::assign(__p[__sz], value_type());\n }\n return *this;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::iterator\nbasic_string<_CharT, _Traits, _Allocator>::erase(const_iterator __pos)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,\n \"string::erase(iterator) called with an iterator not\"\n \" referring to this string\");\n#endif\n _LIBCPP_ASSERT(__pos != end(),\n \"string::erase(iterator) called with a non-dereferenceable iterator\");\n iterator __b = begin();\n size_type __r = static_cast(__pos - __b);\n erase(__r, 1);\n return __b + static_cast(__r);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::iterator\nbasic_string<_CharT, _Traits, _Allocator>::erase(const_iterator __first, const_iterator __last)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__first) == this,\n \"string::erase(iterator, iterator) called with an iterator not\"\n \" referring to this string\");\n#endif\n _LIBCPP_ASSERT(__first <= __last, \"string::erase(first, last) called with invalid range\");\n iterator __b = begin();\n size_type __r = static_cast(__first - __b);\n erase(__r, static_cast(__last - __first));\n return __b + static_cast(__r);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nbasic_string<_CharT, _Traits, _Allocator>::pop_back()\n{\n _LIBCPP_ASSERT(!empty(), \"string::pop_back(): string is already empty\");\n size_type __sz;\n if (__is_long())\n {\n __sz = __get_long_size() - 1;\n __set_long_size(__sz);\n traits_type::assign(*(__get_long_pointer() + __sz), value_type());\n }\n else\n {\n __sz = __get_short_size() - 1;\n __set_short_size(__sz);\n traits_type::assign(*(__get_short_pointer() + __sz), value_type());\n }\n __invalidate_iterators_past(__sz);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nbasic_string<_CharT, _Traits, _Allocator>::clear() _NOEXCEPT\n{\n __invalidate_all_iterators();\n if (__is_long())\n {\n traits_type::assign(*__get_long_pointer(), value_type());\n __set_long_size(0);\n }\n else\n {\n traits_type::assign(*__get_short_pointer(), value_type());\n __set_short_size(0);\n }\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nbasic_string<_CharT, _Traits, _Allocator>::__erase_to_end(size_type __pos)\n{\n if (__is_long())\n {\n traits_type::assign(*(__get_long_pointer() + __pos), value_type());\n __set_long_size(__pos);\n }\n else\n {\n traits_type::assign(*(__get_short_pointer() + __pos), value_type());\n __set_short_size(__pos);\n }\n __invalidate_iterators_past(__pos);\n}\n\ntemplate \nvoid\nbasic_string<_CharT, _Traits, _Allocator>::resize(size_type __n, value_type __c)\n{\n size_type __sz = size();\n if (__n > __sz)\n append(__n - __sz, __c);\n else\n __erase_to_end(__n);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::max_size() const _NOEXCEPT\n{\n size_type __m = __alloc_traits::max_size(__alloc());\n#if _LIBCPP_BIG_ENDIAN\n return (__m <= ~__long_mask ? __m : __m/2) - __alignment;\n#else\n return __m - __alignment;\n#endif\n}\n\ntemplate \nvoid\nbasic_string<_CharT, _Traits, _Allocator>::reserve(size_type __res_arg)\n{\n if (__res_arg > max_size())\n this->__throw_length_error();\n size_type __cap = capacity();\n size_type __sz = size();\n __res_arg = _VSTD::max(__res_arg, __sz);\n __res_arg = __recommend(__res_arg);\n if (__res_arg != __cap)\n {\n pointer __new_data, __p;\n bool __was_long, __now_long;\n if (__res_arg == __min_cap - 1)\n {\n __was_long = true;\n __now_long = false;\n __new_data = __get_short_pointer();\n __p = __get_long_pointer();\n }\n else\n {\n if (__res_arg > __cap)\n __new_data = __alloc_traits::allocate(__alloc(), __res_arg+1);\n else\n {\n #ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n #endif // _LIBCPP_NO_EXCEPTIONS\n __new_data = __alloc_traits::allocate(__alloc(), __res_arg+1);\n #ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n return;\n }\n #else // _LIBCPP_NO_EXCEPTIONS\n if (__new_data == nullptr)\n return;\n #endif // _LIBCPP_NO_EXCEPTIONS\n }\n __now_long = true;\n __was_long = __is_long();\n __p = __get_pointer();\n }\n traits_type::copy(_VSTD::__to_raw_pointer(__new_data),\n _VSTD::__to_raw_pointer(__p), size()+1);\n if (__was_long)\n __alloc_traits::deallocate(__alloc(), __p, __cap+1);\n if (__now_long)\n {\n __set_long_cap(__res_arg+1);\n __set_long_size(__sz);\n __set_long_pointer(__new_data);\n }\n else\n __set_short_size(__sz);\n __invalidate_all_iterators();\n }\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::const_reference\nbasic_string<_CharT, _Traits, _Allocator>::operator[](size_type __pos) const _NOEXCEPT\n{\n _LIBCPP_ASSERT(__pos <= size(), \"string index out of bounds\");\n return *(data() + __pos);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::reference\nbasic_string<_CharT, _Traits, _Allocator>::operator[](size_type __pos) _NOEXCEPT\n{\n _LIBCPP_ASSERT(__pos <= size(), \"string index out of bounds\");\n return *(__get_pointer() + __pos);\n}\n\ntemplate \ntypename basic_string<_CharT, _Traits, _Allocator>::const_reference\nbasic_string<_CharT, _Traits, _Allocator>::at(size_type __n) const\n{\n if (__n >= size())\n this->__throw_out_of_range();\n return (*this)[__n];\n}\n\ntemplate \ntypename basic_string<_CharT, _Traits, _Allocator>::reference\nbasic_string<_CharT, _Traits, _Allocator>::at(size_type __n)\n{\n if (__n >= size())\n this->__throw_out_of_range();\n return (*this)[__n];\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::reference\nbasic_string<_CharT, _Traits, _Allocator>::front()\n{\n _LIBCPP_ASSERT(!empty(), \"string::front(): string is empty\");\n return *__get_pointer();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::const_reference\nbasic_string<_CharT, _Traits, _Allocator>::front() const\n{\n _LIBCPP_ASSERT(!empty(), \"string::front(): string is empty\");\n return *data();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::reference\nbasic_string<_CharT, _Traits, _Allocator>::back()\n{\n _LIBCPP_ASSERT(!empty(), \"string::back(): string is empty\");\n return *(__get_pointer() + size() - 1);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::const_reference\nbasic_string<_CharT, _Traits, _Allocator>::back() const\n{\n _LIBCPP_ASSERT(!empty(), \"string::back(): string is empty\");\n return *(data() + size() - 1);\n}\n\ntemplate \ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::copy(value_type* __s, size_type __n, size_type __pos) const\n{\n size_type __sz = size();\n if (__pos > __sz)\n this->__throw_out_of_range();\n size_type __rlen = _VSTD::min(__n, __sz - __pos);\n traits_type::copy(__s, data() + __pos, __rlen);\n return __rlen;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>\nbasic_string<_CharT, _Traits, _Allocator>::substr(size_type __pos, size_type __n) const\n{\n return basic_string(*this, __pos, __n, __alloc());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nbasic_string<_CharT, _Traits, _Allocator>::swap(basic_string& __str)\n#if _LIBCPP_STD_VER >= 14\n _NOEXCEPT_DEBUG\n#else\n _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value ||\n __is_nothrow_swappable::value)\n#endif\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n if (!__is_long())\n __get_db()->__invalidate_all(this);\n if (!__str.__is_long())\n __get_db()->__invalidate_all(&__str);\n __get_db()->swap(this, &__str);\n#endif\n _LIBCPP_ASSERT(\n __alloc_traits::propagate_on_container_swap::value ||\n __alloc_traits::is_always_equal::value ||\n __alloc() == __str.__alloc(), \"swapping non-equal allocators\");\n _VSTD::swap(__r_.first(), __str.__r_.first());\n __swap_allocator(__alloc(), __str.__alloc());\n}\n\n// find\n\ntemplate \nstruct _LIBCPP_HIDDEN __traits_eq\n{\n typedef typename _Traits::char_type char_type;\n _LIBCPP_INLINE_VISIBILITY\n bool operator()(const char_type& __x, const char_type& __y) _NOEXCEPT\n {return _Traits::eq(__x, __y);}\n};\n\ntemplate\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find(const value_type* __s,\n size_type __pos,\n size_type __n) const _NOEXCEPT\n{\n _LIBCPP_ASSERT(__n == 0 || __s != nullptr, \"string::find(): received nullptr\");\n return __str_find\n (data(), size(), __s, __pos, __n);\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find(const basic_string& __str,\n size_type __pos) const _NOEXCEPT\n{\n return __str_find\n (data(), size(), __str.data(), __pos, __str.size());\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find(__self_view __sv,\n size_type __pos) const _NOEXCEPT\n{\n return __str_find\n (data(), size(), __sv.data(), __pos, __sv.size());\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find(const value_type* __s,\n size_type __pos) const _NOEXCEPT\n{\n _LIBCPP_ASSERT(__s != nullptr, \"string::find(): received nullptr\");\n return __str_find\n (data(), size(), __s, __pos, traits_type::length(__s));\n}\n\ntemplate\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find(value_type __c,\n size_type __pos) const _NOEXCEPT\n{\n return __str_find\n (data(), size(), __c, __pos);\n}\n\n// rfind\n\ntemplate\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::rfind(const value_type* __s,\n size_type __pos,\n size_type __n) const _NOEXCEPT\n{\n _LIBCPP_ASSERT(__n == 0 || __s != nullptr, \"string::rfind(): received nullptr\");\n return __str_rfind\n (data(), size(), __s, __pos, __n);\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::rfind(const basic_string& __str,\n size_type __pos) const _NOEXCEPT\n{\n return __str_rfind\n (data(), size(), __str.data(), __pos, __str.size());\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::rfind(__self_view __sv,\n size_type __pos) const _NOEXCEPT\n{\n return __str_rfind\n (data(), size(), __sv.data(), __pos, __sv.size());\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::rfind(const value_type* __s,\n size_type __pos) const _NOEXCEPT\n{\n _LIBCPP_ASSERT(__s != nullptr, \"string::rfind(): received nullptr\");\n return __str_rfind\n (data(), size(), __s, __pos, traits_type::length(__s));\n}\n\ntemplate\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::rfind(value_type __c,\n size_type __pos) const _NOEXCEPT\n{\n return __str_rfind\n (data(), size(), __c, __pos);\n}\n\n// find_first_of\n\ntemplate\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find_first_of(const value_type* __s,\n size_type __pos,\n size_type __n) const _NOEXCEPT\n{\n _LIBCPP_ASSERT(__n == 0 || __s != nullptr, \"string::find_first_of(): received nullptr\");\n return __str_find_first_of\n (data(), size(), __s, __pos, __n);\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find_first_of(const basic_string& __str,\n size_type __pos) const _NOEXCEPT\n{\n return __str_find_first_of\n (data(), size(), __str.data(), __pos, __str.size());\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find_first_of(__self_view __sv,\n size_type __pos) const _NOEXCEPT\n{\n return __str_find_first_of\n (data(), size(), __sv.data(), __pos, __sv.size());\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find_first_of(const value_type* __s,\n size_type __pos) const _NOEXCEPT\n{\n _LIBCPP_ASSERT(__s != nullptr, \"string::find_first_of(): received nullptr\");\n return __str_find_first_of\n (data(), size(), __s, __pos, traits_type::length(__s));\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find_first_of(value_type __c,\n size_type __pos) const _NOEXCEPT\n{\n return find(__c, __pos);\n}\n\n// find_last_of\n\ntemplate\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find_last_of(const value_type* __s,\n size_type __pos,\n size_type __n) const _NOEXCEPT\n{\n _LIBCPP_ASSERT(__n == 0 || __s != nullptr, \"string::find_last_of(): received nullptr\");\n return __str_find_last_of\n (data(), size(), __s, __pos, __n);\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find_last_of(const basic_string& __str,\n size_type __pos) const _NOEXCEPT\n{\n return __str_find_last_of\n (data(), size(), __str.data(), __pos, __str.size());\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find_last_of(__self_view __sv,\n size_type __pos) const _NOEXCEPT\n{\n return __str_find_last_of\n (data(), size(), __sv.data(), __pos, __sv.size());\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find_last_of(const value_type* __s,\n size_type __pos) const _NOEXCEPT\n{\n _LIBCPP_ASSERT(__s != nullptr, \"string::find_last_of(): received nullptr\");\n return __str_find_last_of\n (data(), size(), __s, __pos, traits_type::length(__s));\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find_last_of(value_type __c,\n size_type __pos) const _NOEXCEPT\n{\n return rfind(__c, __pos);\n}\n\n// find_first_not_of\n\ntemplate\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const value_type* __s,\n size_type __pos,\n size_type __n) const _NOEXCEPT\n{\n _LIBCPP_ASSERT(__n == 0 || __s != nullptr, \"string::find_first_not_of(): received nullptr\");\n return __str_find_first_not_of\n (data(), size(), __s, __pos, __n);\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const basic_string& __str,\n size_type __pos) const _NOEXCEPT\n{\n return __str_find_first_not_of\n (data(), size(), __str.data(), __pos, __str.size());\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find_first_not_of(__self_view __sv,\n size_type __pos) const _NOEXCEPT\n{\n return __str_find_first_not_of\n (data(), size(), __sv.data(), __pos, __sv.size());\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const value_type* __s,\n size_type __pos) const _NOEXCEPT\n{\n _LIBCPP_ASSERT(__s != nullptr, \"string::find_first_not_of(): received nullptr\");\n return __str_find_first_not_of\n (data(), size(), __s, __pos, traits_type::length(__s));\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find_first_not_of(value_type __c,\n size_type __pos) const _NOEXCEPT\n{\n return __str_find_first_not_of\n (data(), size(), __c, __pos);\n}\n\n// find_last_not_of\n\ntemplate\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const value_type* __s,\n size_type __pos,\n size_type __n) const _NOEXCEPT\n{\n _LIBCPP_ASSERT(__n == 0 || __s != nullptr, \"string::find_last_not_of(): received nullptr\");\n return __str_find_last_not_of\n (data(), size(), __s, __pos, __n);\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const basic_string& __str,\n size_type __pos) const _NOEXCEPT\n{\n return __str_find_last_not_of\n (data(), size(), __str.data(), __pos, __str.size());\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find_last_not_of(__self_view __sv,\n size_type __pos) const _NOEXCEPT\n{\n return __str_find_last_not_of\n (data(), size(), __sv.data(), __pos, __sv.size());\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const value_type* __s,\n size_type __pos) const _NOEXCEPT\n{\n _LIBCPP_ASSERT(__s != nullptr, \"string::find_last_not_of(): received nullptr\");\n return __str_find_last_not_of\n (data(), size(), __s, __pos, traits_type::length(__s));\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename basic_string<_CharT, _Traits, _Allocator>::size_type\nbasic_string<_CharT, _Traits, _Allocator>::find_last_not_of(value_type __c,\n size_type __pos) const _NOEXCEPT\n{\n return __str_find_last_not_of\n (data(), size(), __c, __pos);\n}\n\n// compare\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nint\nbasic_string<_CharT, _Traits, _Allocator>::compare(__self_view __sv) const _NOEXCEPT\n{\n size_t __lhs_sz = size();\n size_t __rhs_sz = __sv.size();\n int __result = traits_type::compare(data(), __sv.data(),\n _VSTD::min(__lhs_sz, __rhs_sz));\n if (__result != 0)\n return __result;\n if (__lhs_sz < __rhs_sz)\n return -1;\n if (__lhs_sz > __rhs_sz)\n return 1;\n return 0;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nint\nbasic_string<_CharT, _Traits, _Allocator>::compare(const basic_string& __str) const _NOEXCEPT\n{\n return compare(__self_view(__str));\n}\n\ntemplate \nint\nbasic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,\n size_type __n1,\n const value_type* __s,\n size_type __n2) const\n{\n _LIBCPP_ASSERT(__n2 == 0 || __s != nullptr, \"string::compare(): received nullptr\");\n size_type __sz = size();\n if (__pos1 > __sz || __n2 == npos)\n this->__throw_out_of_range();\n size_type __rlen = _VSTD::min(__n1, __sz - __pos1);\n int __r = traits_type::compare(data() + __pos1, __s, _VSTD::min(__rlen, __n2));\n if (__r == 0)\n {\n if (__rlen < __n2)\n __r = -1;\n else if (__rlen > __n2)\n __r = 1;\n }\n return __r;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nint\nbasic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,\n size_type __n1,\n __self_view __sv) const\n{\n return compare(__pos1, __n1, __sv.data(), __sv.size());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nint\nbasic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,\n size_type __n1,\n const basic_string& __str) const\n{\n return compare(__pos1, __n1, __str.data(), __str.size());\n}\n\ntemplate \ntemplate \ntypename enable_if\n<\n\t__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,\n\tint\n>::type\nbasic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,\n size_type __n1,\n const _Tp& __t,\n size_type __pos2,\n size_type __n2) const\n{\n __self_view __sv = __t;\n return __self_view(*this).substr(__pos1, __n1).compare(__sv.substr(__pos2, __n2));\n}\n\ntemplate \nint\nbasic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,\n size_type __n1,\n const basic_string& __str,\n size_type __pos2,\n size_type __n2) const\n{\n return compare(__pos1, __n1, __self_view(__str), __pos2, __n2);\n}\n\ntemplate \nint\nbasic_string<_CharT, _Traits, _Allocator>::compare(const value_type* __s) const _NOEXCEPT\n{\n _LIBCPP_ASSERT(__s != nullptr, \"string::compare(): received nullptr\");\n return compare(0, npos, __s, traits_type::length(__s));\n}\n\ntemplate \nint\nbasic_string<_CharT, _Traits, _Allocator>::compare(size_type __pos1,\n size_type __n1,\n const value_type* __s) const\n{\n _LIBCPP_ASSERT(__s != nullptr, \"string::compare(): received nullptr\");\n return compare(__pos1, __n1, __s, traits_type::length(__s));\n}\n\n// __invariants\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\nbasic_string<_CharT, _Traits, _Allocator>::__invariants() const\n{\n if (size() > capacity())\n return false;\n if (capacity() < __min_cap - 1)\n return false;\n if (data() == 0)\n return false;\n if (data()[size()] != value_type(0))\n return false;\n return true;\n}\n\n// operator==\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator==(const basic_string<_CharT, _Traits, _Allocator>& __lhs,\n const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT\n{\n size_t __lhs_sz = __lhs.size();\n return __lhs_sz == __rhs.size() && _Traits::compare(__lhs.data(),\n __rhs.data(),\n __lhs_sz) == 0;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator==(const basic_string, _Allocator>& __lhs,\n const basic_string, _Allocator>& __rhs) _NOEXCEPT\n{\n size_t __lhs_sz = __lhs.size();\n if (__lhs_sz != __rhs.size())\n return false;\n const char* __lp = __lhs.data();\n const char* __rp = __rhs.data();\n if (__lhs.__is_long())\n return char_traits::compare(__lp, __rp, __lhs_sz) == 0;\n for (; __lhs_sz != 0; --__lhs_sz, ++__lp, ++__rp)\n if (*__lp != *__rp)\n return false;\n return true;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator==(const _CharT* __lhs,\n const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT\n{\n typedef basic_string<_CharT, _Traits, _Allocator> _String;\n _LIBCPP_ASSERT(__lhs != nullptr, \"operator==(char*, basic_string): received nullptr\");\n size_t __lhs_len = _Traits::length(__lhs);\n if (__lhs_len != __rhs.size()) return false;\n return __rhs.compare(0, _String::npos, __lhs, __lhs_len) == 0;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator==(const basic_string<_CharT,_Traits,_Allocator>& __lhs,\n const _CharT* __rhs) _NOEXCEPT\n{\n typedef basic_string<_CharT, _Traits, _Allocator> _String;\n _LIBCPP_ASSERT(__rhs != nullptr, \"operator==(basic_string, char*): received nullptr\");\n size_t __rhs_len = _Traits::length(__rhs);\n if (__rhs_len != __lhs.size()) return false;\n return __lhs.compare(0, _String::npos, __rhs, __rhs_len) == 0;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator!=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,\n const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT\n{\n return !(__lhs == __rhs);\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator!=(const _CharT* __lhs,\n const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT\n{\n return !(__lhs == __rhs);\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator!=(const basic_string<_CharT, _Traits, _Allocator>& __lhs,\n const _CharT* __rhs) _NOEXCEPT\n{\n return !(__lhs == __rhs);\n}\n\n// operator<\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator< (const basic_string<_CharT, _Traits, _Allocator>& __lhs,\n const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT\n{\n return __lhs.compare(__rhs) < 0;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator< (const basic_string<_CharT, _Traits, _Allocator>& __lhs,\n const _CharT* __rhs) _NOEXCEPT\n{\n return __lhs.compare(__rhs) < 0;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator< (const _CharT* __lhs,\n const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT\n{\n return __rhs.compare(__lhs) > 0;\n}\n\n// operator>\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator> (const basic_string<_CharT, _Traits, _Allocator>& __lhs,\n const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT\n{\n return __rhs < __lhs;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator> (const basic_string<_CharT, _Traits, _Allocator>& __lhs,\n const _CharT* __rhs) _NOEXCEPT\n{\n return __rhs < __lhs;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator> (const _CharT* __lhs,\n const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT\n{\n return __rhs < __lhs;\n}\n\n// operator<=\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator<=(const basic_string<_CharT, _Traits, _Allocator>& __lhs,\n const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT\n{\n return !(__rhs < __lhs);\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator<=(const basic_string<_CharT, _Traits, _Allocator>& __lhs,\n const _CharT* __rhs) _NOEXCEPT\n{\n return !(__rhs < __lhs);\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator<=(const _CharT* __lhs,\n const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT\n{\n return !(__rhs < __lhs);\n}\n\n// operator>=\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator>=(const basic_string<_CharT, _Traits, _Allocator>& __lhs,\n const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT\n{\n return !(__lhs < __rhs);\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator>=(const basic_string<_CharT, _Traits, _Allocator>& __lhs,\n const _CharT* __rhs) _NOEXCEPT\n{\n return !(__lhs < __rhs);\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator>=(const _CharT* __lhs,\n const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT\n{\n return !(__lhs < __rhs);\n}\n\n// operator +\n\ntemplate\nbasic_string<_CharT, _Traits, _Allocator>\noperator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs,\n const basic_string<_CharT, _Traits, _Allocator>& __rhs)\n{\n basic_string<_CharT, _Traits, _Allocator> __r(__lhs.get_allocator());\n typename basic_string<_CharT, _Traits, _Allocator>::size_type __lhs_sz = __lhs.size();\n typename basic_string<_CharT, _Traits, _Allocator>::size_type __rhs_sz = __rhs.size();\n __r.__init(__lhs.data(), __lhs_sz, __lhs_sz + __rhs_sz);\n __r.append(__rhs.data(), __rhs_sz);\n return __r;\n}\n\ntemplate\nbasic_string<_CharT, _Traits, _Allocator>\noperator+(const _CharT* __lhs , const basic_string<_CharT,_Traits,_Allocator>& __rhs)\n{\n basic_string<_CharT, _Traits, _Allocator> __r(__rhs.get_allocator());\n typename basic_string<_CharT, _Traits, _Allocator>::size_type __lhs_sz = _Traits::length(__lhs);\n typename basic_string<_CharT, _Traits, _Allocator>::size_type __rhs_sz = __rhs.size();\n __r.__init(__lhs, __lhs_sz, __lhs_sz + __rhs_sz);\n __r.append(__rhs.data(), __rhs_sz);\n return __r;\n}\n\ntemplate\nbasic_string<_CharT, _Traits, _Allocator>\noperator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Allocator>& __rhs)\n{\n basic_string<_CharT, _Traits, _Allocator> __r(__rhs.get_allocator());\n typename basic_string<_CharT, _Traits, _Allocator>::size_type __rhs_sz = __rhs.size();\n __r.__init(&__lhs, 1, 1 + __rhs_sz);\n __r.append(__rhs.data(), __rhs_sz);\n return __r;\n}\n\ntemplate\nbasic_string<_CharT, _Traits, _Allocator>\noperator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, const _CharT* __rhs)\n{\n basic_string<_CharT, _Traits, _Allocator> __r(__lhs.get_allocator());\n typename basic_string<_CharT, _Traits, _Allocator>::size_type __lhs_sz = __lhs.size();\n typename basic_string<_CharT, _Traits, _Allocator>::size_type __rhs_sz = _Traits::length(__rhs);\n __r.__init(__lhs.data(), __lhs_sz, __lhs_sz + __rhs_sz);\n __r.append(__rhs, __rhs_sz);\n return __r;\n}\n\ntemplate\nbasic_string<_CharT, _Traits, _Allocator>\noperator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, _CharT __rhs)\n{\n basic_string<_CharT, _Traits, _Allocator> __r(__lhs.get_allocator());\n typename basic_string<_CharT, _Traits, _Allocator>::size_type __lhs_sz = __lhs.size();\n __r.__init(__lhs.data(), __lhs_sz, __lhs_sz + 1);\n __r.push_back(__rhs);\n return __r;\n}\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>\noperator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, const basic_string<_CharT, _Traits, _Allocator>& __rhs)\n{\n return _VSTD::move(__lhs.append(__rhs));\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>\noperator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, basic_string<_CharT, _Traits, _Allocator>&& __rhs)\n{\n return _VSTD::move(__rhs.insert(0, __lhs));\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>\noperator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, basic_string<_CharT, _Traits, _Allocator>&& __rhs)\n{\n return _VSTD::move(__lhs.append(__rhs));\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>\noperator+(const _CharT* __lhs , basic_string<_CharT,_Traits,_Allocator>&& __rhs)\n{\n return _VSTD::move(__rhs.insert(0, __lhs));\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>\noperator+(_CharT __lhs, basic_string<_CharT,_Traits,_Allocator>&& __rhs)\n{\n __rhs.insert(__rhs.begin(), __lhs);\n return _VSTD::move(__rhs);\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>\noperator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, const _CharT* __rhs)\n{\n return _VSTD::move(__lhs.append(__rhs));\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbasic_string<_CharT, _Traits, _Allocator>\noperator+(basic_string<_CharT, _Traits, _Allocator>&& __lhs, _CharT __rhs)\n{\n __lhs.push_back(__rhs);\n return _VSTD::move(__lhs);\n}\n\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\n// swap\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nswap(basic_string<_CharT, _Traits, _Allocator>& __lhs,\n basic_string<_CharT, _Traits, _Allocator>& __rhs)\n _NOEXCEPT_(_NOEXCEPT_(__lhs.swap(__rhs)))\n{\n __lhs.swap(__rhs);\n}\n\n#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS\n\ntypedef basic_string u16string;\ntypedef basic_string u32string;\n\n#endif // _LIBCPP_HAS_NO_UNICODE_CHARS\n\n_LIBCPP_FUNC_VIS int stoi (const string& __str, size_t* __idx = 0, int __base = 10);\n_LIBCPP_FUNC_VIS long stol (const string& __str, size_t* __idx = 0, int __base = 10);\n_LIBCPP_FUNC_VIS unsigned long stoul (const string& __str, size_t* __idx = 0, int __base = 10);\n_LIBCPP_FUNC_VIS long long stoll (const string& __str, size_t* __idx = 0, int __base = 10);\n_LIBCPP_FUNC_VIS unsigned long long stoull(const string& __str, size_t* __idx = 0, int __base = 10);\n\n_LIBCPP_FUNC_VIS float stof (const string& __str, size_t* __idx = 0);\n_LIBCPP_FUNC_VIS double stod (const string& __str, size_t* __idx = 0);\n_LIBCPP_FUNC_VIS long double stold(const string& __str, size_t* __idx = 0);\n\n_LIBCPP_FUNC_VIS string to_string(int __val);\n_LIBCPP_FUNC_VIS string to_string(unsigned __val);\n_LIBCPP_FUNC_VIS string to_string(long __val);\n_LIBCPP_FUNC_VIS string to_string(unsigned long __val);\n_LIBCPP_FUNC_VIS string to_string(long long __val);\n_LIBCPP_FUNC_VIS string to_string(unsigned long long __val);\n_LIBCPP_FUNC_VIS string to_string(float __val);\n_LIBCPP_FUNC_VIS string to_string(double __val);\n_LIBCPP_FUNC_VIS string to_string(long double __val);\n\n_LIBCPP_FUNC_VIS int stoi (const wstring& __str, size_t* __idx = 0, int __base = 10);\n_LIBCPP_FUNC_VIS long stol (const wstring& __str, size_t* __idx = 0, int __base = 10);\n_LIBCPP_FUNC_VIS unsigned long stoul (const wstring& __str, size_t* __idx = 0, int __base = 10);\n_LIBCPP_FUNC_VIS long long stoll (const wstring& __str, size_t* __idx = 0, int __base = 10);\n_LIBCPP_FUNC_VIS unsigned long long stoull(const wstring& __str, size_t* __idx = 0, int __base = 10);\n\n_LIBCPP_FUNC_VIS float stof (const wstring& __str, size_t* __idx = 0);\n_LIBCPP_FUNC_VIS double stod (const wstring& __str, size_t* __idx = 0);\n_LIBCPP_FUNC_VIS long double stold(const wstring& __str, size_t* __idx = 0);\n\n_LIBCPP_FUNC_VIS wstring to_wstring(int __val);\n_LIBCPP_FUNC_VIS wstring to_wstring(unsigned __val);\n_LIBCPP_FUNC_VIS wstring to_wstring(long __val);\n_LIBCPP_FUNC_VIS wstring to_wstring(unsigned long __val);\n_LIBCPP_FUNC_VIS wstring to_wstring(long long __val);\n_LIBCPP_FUNC_VIS wstring to_wstring(unsigned long long __val);\n_LIBCPP_FUNC_VIS wstring to_wstring(float __val);\n_LIBCPP_FUNC_VIS wstring to_wstring(double __val);\n_LIBCPP_FUNC_VIS wstring to_wstring(long double __val);\n\ntemplate\n const typename basic_string<_CharT, _Traits, _Allocator>::size_type\n basic_string<_CharT, _Traits, _Allocator>::npos;\n\ntemplate\nstruct _LIBCPP_TEMPLATE_VIS hash >\n : public unary_function, size_t>\n{\n size_t\n operator()(const basic_string<_CharT, _Traits, _Allocator>& __val) const _NOEXCEPT;\n};\n\ntemplate\nsize_t\nhash >::operator()(\n const basic_string<_CharT, _Traits, _Allocator>& __val) const _NOEXCEPT\n{\n return __do_string_hash(__val.data(), __val.data() + __val.size());\n}\n\ntemplate\nbasic_ostream<_CharT, _Traits>&\noperator<<(basic_ostream<_CharT, _Traits>& __os,\n const basic_string<_CharT, _Traits, _Allocator>& __str);\n\ntemplate\nbasic_istream<_CharT, _Traits>&\noperator>>(basic_istream<_CharT, _Traits>& __is,\n basic_string<_CharT, _Traits, _Allocator>& __str);\n\ntemplate\nbasic_istream<_CharT, _Traits>&\ngetline(basic_istream<_CharT, _Traits>& __is,\n basic_string<_CharT, _Traits, _Allocator>& __str, _CharT __dlm);\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbasic_istream<_CharT, _Traits>&\ngetline(basic_istream<_CharT, _Traits>& __is,\n basic_string<_CharT, _Traits, _Allocator>& __str);\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbasic_istream<_CharT, _Traits>&\ngetline(basic_istream<_CharT, _Traits>&& __is,\n basic_string<_CharT, _Traits, _Allocator>& __str, _CharT __dlm);\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbasic_istream<_CharT, _Traits>&\ngetline(basic_istream<_CharT, _Traits>&& __is,\n basic_string<_CharT, _Traits, _Allocator>& __str);\n\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\n#if _LIBCPP_DEBUG_LEVEL >= 2\n\ntemplate\nbool\nbasic_string<_CharT, _Traits, _Allocator>::__dereferenceable(const const_iterator* __i) const\n{\n return this->data() <= _VSTD::__to_raw_pointer(__i->base()) &&\n _VSTD::__to_raw_pointer(__i->base()) < this->data() + this->size();\n}\n\ntemplate\nbool\nbasic_string<_CharT, _Traits, _Allocator>::__decrementable(const const_iterator* __i) const\n{\n return this->data() < _VSTD::__to_raw_pointer(__i->base()) &&\n _VSTD::__to_raw_pointer(__i->base()) <= this->data() + this->size();\n}\n\ntemplate\nbool\nbasic_string<_CharT, _Traits, _Allocator>::__addable(const const_iterator* __i, ptrdiff_t __n) const\n{\n const value_type* __p = _VSTD::__to_raw_pointer(__i->base()) + __n;\n return this->data() <= __p && __p <= this->data() + this->size();\n}\n\ntemplate\nbool\nbasic_string<_CharT, _Traits, _Allocator>::__subscriptable(const const_iterator* __i, ptrdiff_t __n) const\n{\n const value_type* __p = _VSTD::__to_raw_pointer(__i->base()) + __n;\n return this->data() <= __p && __p < this->data() + this->size();\n}\n\n#endif // _LIBCPP_DEBUG_LEVEL >= 2\n\n#if _LIBCPP_STD_VER > 11 \n// Literal suffixes for basic_string [basic.string.literals]\ninline namespace literals\n{\n inline namespace string_literals\n {\n inline _LIBCPP_INLINE_VISIBILITY\n basic_string operator \"\" s( const char *__str, size_t __len )\n {\n return basic_string (__str, __len);\n }\n\n inline _LIBCPP_INLINE_VISIBILITY\n basic_string operator \"\" s( const wchar_t *__str, size_t __len )\n {\n return basic_string (__str, __len);\n }\n\n inline _LIBCPP_INLINE_VISIBILITY\n basic_string operator \"\" s( const char16_t *__str, size_t __len )\n {\n return basic_string (__str, __len);\n }\n\n inline _LIBCPP_INLINE_VISIBILITY\n basic_string operator \"\" s( const char32_t *__str, size_t __len )\n {\n return basic_string (__str, __len);\n }\n }\n}\n#endif\n\n_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string)\n_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string)\n_LIBCPP_EXTERN_TEMPLATE(string operator+, allocator >(char const*, string const&))\n\n_LIBCPP_END_NAMESPACE_STD\n\n#endif // _LIBCPP_STRING\n","// -*- C++ -*-\n//===------------------------- fstream ------------------------------------===//\n//\n// The LLVM Compiler Infrastructure\n//\n// This file is dual licensed under the MIT and the University of Illinois Open\n// Source Licenses. See LICENSE.TXT for details.\n//\n//===----------------------------------------------------------------------===//\n\n#ifndef _LIBCPP_FSTREAM\n#define _LIBCPP_FSTREAM\n\n/*\n fstream synopsis\n\ntemplate >\nclass basic_filebuf\n : public basic_streambuf\n{\npublic:\n typedef charT char_type;\n typedef traits traits_type;\n typedef typename traits_type::int_type int_type;\n typedef typename traits_type::pos_type pos_type;\n typedef typename traits_type::off_type off_type;\n\n // 27.9.1.2 Constructors/destructor:\n basic_filebuf();\n basic_filebuf(basic_filebuf&& rhs);\n virtual ~basic_filebuf();\n\n // 27.9.1.3 Assign/swap:\n basic_filebuf& operator=(basic_filebuf&& rhs);\n void swap(basic_filebuf& rhs);\n\n // 27.9.1.4 Members:\n bool is_open() const;\n basic_filebuf* open(const char* s, ios_base::openmode mode);\n basic_filebuf* open(const string& s, ios_base::openmode mode);\n basic_filebuf* close();\n\nprotected:\n // 27.9.1.5 Overridden virtual functions:\n virtual streamsize showmanyc();\n virtual int_type underflow();\n virtual int_type uflow();\n virtual int_type pbackfail(int_type c = traits_type::eof());\n virtual int_type overflow (int_type c = traits_type::eof());\n virtual basic_streambuf* setbuf(char_type* s, streamsize n);\n virtual pos_type seekoff(off_type off, ios_base::seekdir way,\n ios_base::openmode which = ios_base::in | ios_base::out);\n virtual pos_type seekpos(pos_type sp,\n ios_base::openmode which = ios_base::in | ios_base::out);\n virtual int sync();\n virtual void imbue(const locale& loc);\n};\n\ntemplate \n void\n swap(basic_filebuf& x, basic_filebuf& y);\n\ntypedef basic_filebuf filebuf;\ntypedef basic_filebuf wfilebuf;\n\ntemplate >\nclass basic_ifstream\n : public basic_istream\n{\npublic:\n typedef charT char_type;\n typedef traits traits_type;\n typedef typename traits_type::int_type int_type;\n typedef typename traits_type::pos_type pos_type;\n typedef typename traits_type::off_type off_type;\n\n basic_ifstream();\n explicit basic_ifstream(const char* s, ios_base::openmode mode = ios_base::in);\n explicit basic_ifstream(const string& s, ios_base::openmode mode = ios_base::in);\n basic_ifstream(basic_ifstream&& rhs);\n\n basic_ifstream& operator=(basic_ifstream&& rhs);\n void swap(basic_ifstream& rhs);\n\n basic_filebuf* rdbuf() const;\n bool is_open() const;\n void open(const char* s, ios_base::openmode mode = ios_base::in);\n void open(const string& s, ios_base::openmode mode = ios_base::in);\n void close();\n};\n\ntemplate \n void\n swap(basic_ifstream& x, basic_ifstream& y);\n\ntypedef basic_ifstream ifstream;\ntypedef basic_ifstream wifstream;\n\ntemplate >\nclass basic_ofstream\n : public basic_ostream\n{\npublic:\n typedef charT char_type;\n typedef traits traits_type;\n typedef typename traits_type::int_type int_type;\n typedef typename traits_type::pos_type pos_type;\n typedef typename traits_type::off_type off_type;\n\n basic_ofstream();\n explicit basic_ofstream(const char* s, ios_base::openmode mode = ios_base::out);\n explicit basic_ofstream(const string& s, ios_base::openmode mode = ios_base::out);\n basic_ofstream(basic_ofstream&& rhs);\n\n basic_ofstream& operator=(basic_ofstream&& rhs);\n void swap(basic_ofstream& rhs);\n\n basic_filebuf* rdbuf() const;\n bool is_open() const;\n void open(const char* s, ios_base::openmode mode = ios_base::out);\n void open(const string& s, ios_base::openmode mode = ios_base::out);\n void close();\n};\n\ntemplate \n void\n swap(basic_ofstream& x, basic_ofstream& y);\n\ntypedef basic_ofstream ofstream;\ntypedef basic_ofstream wofstream;\n\ntemplate >\nclass basic_fstream\n : public basic_iostream\n{\npublic:\n typedef charT char_type;\n typedef traits traits_type;\n typedef typename traits_type::int_type int_type;\n typedef typename traits_type::pos_type pos_type;\n typedef typename traits_type::off_type off_type;\n\n basic_fstream();\n explicit basic_fstream(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out);\n explicit basic_fstream(const string& s, ios_base::openmode mode = ios_base::in|ios_base::out);\n basic_fstream(basic_fstream&& rhs);\n\n basic_fstream& operator=(basic_fstream&& rhs);\n void swap(basic_fstream& rhs);\n\n basic_filebuf* rdbuf() const;\n bool is_open() const;\n void open(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out);\n void open(const string& s, ios_base::openmode mode = ios_base::in|ios_base::out);\n void close();\n};\n\ntemplate \n void swap(basic_fstream& x, basic_fstream& y);\n\ntypedef basic_fstream fstream;\ntypedef basic_fstream wfstream;\n\n} // std\n\n*/\n\n#include <__config>\n#include \n#include \n#include <__locale>\n#include \n\n#include <__undef_min_max>\n\n#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)\n#pragma GCC system_header\n#endif\n\n_LIBCPP_BEGIN_NAMESPACE_STD\n\ntemplate \nclass _LIBCPP_TEMPLATE_VIS basic_filebuf\n : public basic_streambuf<_CharT, _Traits>\n{\npublic:\n typedef _CharT char_type;\n typedef _Traits traits_type;\n typedef typename traits_type::int_type int_type;\n typedef typename traits_type::pos_type pos_type;\n typedef typename traits_type::off_type off_type;\n typedef typename traits_type::state_type state_type;\n\n // 27.9.1.2 Constructors/destructor:\n basic_filebuf();\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n basic_filebuf(basic_filebuf&& __rhs);\n#endif\n virtual ~basic_filebuf();\n\n // 27.9.1.3 Assign/swap:\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY\n basic_filebuf& operator=(basic_filebuf&& __rhs);\n#endif\n void swap(basic_filebuf& __rhs);\n\n // 27.9.1.4 Members:\n _LIBCPP_INLINE_VISIBILITY\n bool is_open() const;\n#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE\n basic_filebuf* open(const char* __s, ios_base::openmode __mode);\n _LIBCPP_INLINE_VISIBILITY\n basic_filebuf* open(const string& __s, ios_base::openmode __mode);\n#endif\n basic_filebuf* close();\n\nprotected:\n // 27.9.1.5 Overridden virtual functions:\n virtual int_type underflow();\n virtual int_type pbackfail(int_type __c = traits_type::eof());\n virtual int_type overflow (int_type __c = traits_type::eof());\n virtual basic_streambuf* setbuf(char_type* __s, streamsize __n);\n virtual pos_type seekoff(off_type __off, ios_base::seekdir __way,\n ios_base::openmode __wch = ios_base::in | ios_base::out);\n virtual pos_type seekpos(pos_type __sp,\n ios_base::openmode __wch = ios_base::in | ios_base::out);\n virtual int sync();\n virtual void imbue(const locale& __loc);\n\nprivate:\n char* __extbuf_;\n const char* __extbufnext_;\n const char* __extbufend_;\n char __extbuf_min_[8];\n size_t __ebs_;\n char_type* __intbuf_;\n size_t __ibs_;\n FILE* __file_;\n const codecvt* __cv_;\n state_type __st_;\n state_type __st_last_;\n ios_base::openmode __om_;\n ios_base::openmode __cm_;\n bool __owns_eb_;\n bool __owns_ib_;\n bool __always_noconv_;\n\n bool __read_mode();\n void __write_mode();\n};\n\ntemplate \nbasic_filebuf<_CharT, _Traits>::basic_filebuf()\n : __extbuf_(0),\n __extbufnext_(0),\n __extbufend_(0),\n __ebs_(0),\n __intbuf_(0),\n __ibs_(0),\n __file_(0),\n __cv_(nullptr),\n __st_(),\n __st_last_(),\n __om_(0),\n __cm_(0),\n __owns_eb_(false),\n __owns_ib_(false),\n __always_noconv_(false)\n{\n if (has_facet >(this->getloc()))\n {\n __cv_ = &use_facet >(this->getloc());\n __always_noconv_ = __cv_->always_noconv();\n }\n setbuf(0, 4096);\n}\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \nbasic_filebuf<_CharT, _Traits>::basic_filebuf(basic_filebuf&& __rhs)\n : basic_streambuf<_CharT, _Traits>(__rhs)\n{\n if (__rhs.__extbuf_ == __rhs.__extbuf_min_)\n {\n __extbuf_ = __extbuf_min_;\n __extbufnext_ = __extbuf_ + (__rhs.__extbufnext_ - __rhs.__extbuf_);\n __extbufend_ = __extbuf_ + (__rhs.__extbufend_ - __rhs.__extbuf_);\n }\n else\n {\n __extbuf_ = __rhs.__extbuf_;\n __extbufnext_ = __rhs.__extbufnext_;\n __extbufend_ = __rhs.__extbufend_;\n }\n __ebs_ = __rhs.__ebs_;\n __intbuf_ = __rhs.__intbuf_;\n __ibs_ = __rhs.__ibs_;\n __file_ = __rhs.__file_;\n __cv_ = __rhs.__cv_;\n __st_ = __rhs.__st_;\n __st_last_ = __rhs.__st_last_;\n __om_ = __rhs.__om_;\n __cm_ = __rhs.__cm_;\n __owns_eb_ = __rhs.__owns_eb_;\n __owns_ib_ = __rhs.__owns_ib_;\n __always_noconv_ = __rhs.__always_noconv_;\n if (__rhs.pbase())\n {\n if (__rhs.pbase() == __rhs.__intbuf_)\n this->setp(__intbuf_, __intbuf_ + (__rhs. epptr() - __rhs.pbase()));\n else\n this->setp((char_type*)__extbuf_,\n (char_type*)__extbuf_ + (__rhs. epptr() - __rhs.pbase()));\n this->pbump(__rhs. pptr() - __rhs.pbase());\n }\n else if (__rhs.eback())\n {\n if (__rhs.eback() == __rhs.__intbuf_)\n this->setg(__intbuf_, __intbuf_ + (__rhs.gptr() - __rhs.eback()),\n __intbuf_ + (__rhs.egptr() - __rhs.eback()));\n else\n this->setg((char_type*)__extbuf_,\n (char_type*)__extbuf_ + (__rhs.gptr() - __rhs.eback()),\n (char_type*)__extbuf_ + (__rhs.egptr() - __rhs.eback()));\n }\n __rhs.__extbuf_ = 0;\n __rhs.__extbufnext_ = 0;\n __rhs.__extbufend_ = 0;\n __rhs.__ebs_ = 0;\n __rhs.__intbuf_ = 0;\n __rhs.__ibs_ = 0;\n __rhs.__file_ = 0;\n __rhs.__st_ = state_type();\n __rhs.__st_last_ = state_type();\n __rhs.__om_ = 0;\n __rhs.__cm_ = 0;\n __rhs.__owns_eb_ = false;\n __rhs.__owns_ib_ = false;\n __rhs.setg(0, 0, 0);\n __rhs.setp(0, 0);\n}\n\ntemplate \ninline\nbasic_filebuf<_CharT, _Traits>&\nbasic_filebuf<_CharT, _Traits>::operator=(basic_filebuf&& __rhs)\n{\n close();\n swap(__rhs);\n return *this;\n}\n\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \nbasic_filebuf<_CharT, _Traits>::~basic_filebuf()\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n close();\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n if (__owns_eb_)\n delete [] __extbuf_;\n if (__owns_ib_)\n delete [] __intbuf_;\n}\n\ntemplate \nvoid\nbasic_filebuf<_CharT, _Traits>::swap(basic_filebuf& __rhs)\n{\n basic_streambuf::swap(__rhs);\n if (__extbuf_ != __extbuf_min_ && __rhs.__extbuf_ != __rhs.__extbuf_min_)\n {\n _VSTD::swap(__extbuf_, __rhs.__extbuf_);\n _VSTD::swap(__extbufnext_, __rhs.__extbufnext_);\n _VSTD::swap(__extbufend_, __rhs.__extbufend_);\n }\n else\n {\n ptrdiff_t __ln = __extbufnext_ - __extbuf_;\n ptrdiff_t __le = __extbufend_ - __extbuf_;\n ptrdiff_t __rn = __rhs.__extbufnext_ - __rhs.__extbuf_;\n ptrdiff_t __re = __rhs.__extbufend_ - __rhs.__extbuf_;\n if (__extbuf_ == __extbuf_min_ && __rhs.__extbuf_ != __rhs.__extbuf_min_)\n {\n __extbuf_ = __rhs.__extbuf_;\n __rhs.__extbuf_ = __rhs.__extbuf_min_;\n }\n else if (__extbuf_ != __extbuf_min_ && __rhs.__extbuf_ == __rhs.__extbuf_min_)\n {\n __rhs.__extbuf_ = __extbuf_;\n __extbuf_ = __extbuf_min_;\n }\n __extbufnext_ = __extbuf_ + __rn;\n __extbufend_ = __extbuf_ + __re;\n __rhs.__extbufnext_ = __rhs.__extbuf_ + __ln;\n __rhs.__extbufend_ = __rhs.__extbuf_ + __le;\n }\n _VSTD::swap(__ebs_, __rhs.__ebs_);\n _VSTD::swap(__intbuf_, __rhs.__intbuf_);\n _VSTD::swap(__ibs_, __rhs.__ibs_);\n _VSTD::swap(__file_, __rhs.__file_);\n _VSTD::swap(__cv_, __rhs.__cv_);\n _VSTD::swap(__st_, __rhs.__st_);\n _VSTD::swap(__st_last_, __rhs.__st_last_);\n _VSTD::swap(__om_, __rhs.__om_);\n _VSTD::swap(__cm_, __rhs.__cm_);\n _VSTD::swap(__owns_eb_, __rhs.__owns_eb_);\n _VSTD::swap(__owns_ib_, __rhs.__owns_ib_);\n _VSTD::swap(__always_noconv_, __rhs.__always_noconv_);\n if (this->eback() == (char_type*)__rhs.__extbuf_min_)\n {\n ptrdiff_t __n = this->gptr() - this->eback();\n ptrdiff_t __e = this->egptr() - this->eback();\n this->setg((char_type*)__extbuf_min_,\n (char_type*)__extbuf_min_ + __n,\n (char_type*)__extbuf_min_ + __e);\n }\n else if (this->pbase() == (char_type*)__rhs.__extbuf_min_)\n {\n ptrdiff_t __n = this->pptr() - this->pbase();\n ptrdiff_t __e = this->epptr() - this->pbase();\n this->setp((char_type*)__extbuf_min_,\n (char_type*)__extbuf_min_ + __e);\n this->pbump(__n);\n }\n if (__rhs.eback() == (char_type*)__extbuf_min_)\n {\n ptrdiff_t __n = __rhs.gptr() - __rhs.eback();\n ptrdiff_t __e = __rhs.egptr() - __rhs.eback();\n __rhs.setg((char_type*)__rhs.__extbuf_min_,\n (char_type*)__rhs.__extbuf_min_ + __n,\n (char_type*)__rhs.__extbuf_min_ + __e);\n }\n else if (__rhs.pbase() == (char_type*)__extbuf_min_)\n {\n ptrdiff_t __n = __rhs.pptr() - __rhs.pbase();\n ptrdiff_t __e = __rhs.epptr() - __rhs.pbase();\n __rhs.setp((char_type*)__rhs.__extbuf_min_,\n (char_type*)__rhs.__extbuf_min_ + __e);\n __rhs.pbump(__n);\n }\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nswap(basic_filebuf<_CharT, _Traits>& __x, basic_filebuf<_CharT, _Traits>& __y)\n{\n __x.swap(__y);\n}\n\ntemplate \ninline\nbool\nbasic_filebuf<_CharT, _Traits>::is_open() const\n{\n return __file_ != 0;\n}\n\n#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE\ntemplate \nbasic_filebuf<_CharT, _Traits>*\nbasic_filebuf<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode)\n{\n basic_filebuf<_CharT, _Traits>* __rt = 0;\n if (__file_ == 0)\n {\n __rt = this;\n const char* __mdstr;\n switch (__mode & ~ios_base::ate)\n {\n case ios_base::out:\n case ios_base::out | ios_base::trunc:\n __mdstr = \"w\";\n break;\n case ios_base::out | ios_base::app:\n case ios_base::app:\n __mdstr = \"a\";\n break;\n case ios_base::in:\n __mdstr = \"r\";\n break;\n case ios_base::in | ios_base::out:\n __mdstr = \"r+\";\n break;\n case ios_base::in | ios_base::out | ios_base::trunc:\n __mdstr = \"w+\";\n break;\n case ios_base::in | ios_base::out | ios_base::app:\n case ios_base::in | ios_base::app:\n __mdstr = \"a+\";\n break;\n case ios_base::out | ios_base::binary:\n case ios_base::out | ios_base::trunc | ios_base::binary:\n __mdstr = \"wb\";\n break;\n case ios_base::out | ios_base::app | ios_base::binary:\n case ios_base::app | ios_base::binary:\n __mdstr = \"ab\";\n break;\n case ios_base::in | ios_base::binary:\n __mdstr = \"rb\";\n break;\n case ios_base::in | ios_base::out | ios_base::binary:\n __mdstr = \"r+b\";\n break;\n case ios_base::in | ios_base::out | ios_base::trunc | ios_base::binary:\n __mdstr = \"w+b\";\n break;\n case ios_base::in | ios_base::out | ios_base::app | ios_base::binary:\n case ios_base::in | ios_base::app | ios_base::binary:\n __mdstr = \"a+b\";\n break;\n default:\n __rt = 0;\n break;\n }\n if (__rt)\n {\n __file_ = fopen(__s, __mdstr);\n if (__file_)\n {\n __om_ = __mode;\n if (__mode & ios_base::ate)\n {\n if (fseek(__file_, 0, SEEK_END))\n {\n fclose(__file_);\n __file_ = 0;\n __rt = 0;\n }\n }\n }\n else\n __rt = 0;\n }\n }\n return __rt;\n}\n\ntemplate \ninline\nbasic_filebuf<_CharT, _Traits>*\nbasic_filebuf<_CharT, _Traits>::open(const string& __s, ios_base::openmode __mode)\n{\n return open(__s.c_str(), __mode);\n}\n#endif\n\ntemplate \nbasic_filebuf<_CharT, _Traits>*\nbasic_filebuf<_CharT, _Traits>::close()\n{\n basic_filebuf<_CharT, _Traits>* __rt = 0;\n if (__file_)\n {\n __rt = this;\n unique_ptr __h(__file_, fclose);\n if (sync())\n __rt = 0;\n if (fclose(__h.release()) == 0)\n __file_ = 0;\n else\n __rt = 0;\n }\n return __rt;\n}\n\ntemplate \ntypename basic_filebuf<_CharT, _Traits>::int_type\nbasic_filebuf<_CharT, _Traits>::underflow()\n{\n if (__file_ == 0)\n return traits_type::eof();\n bool __initial = __read_mode();\n char_type __1buf;\n if (this->gptr() == 0)\n this->setg(&__1buf, &__1buf+1, &__1buf+1);\n const size_t __unget_sz = __initial ? 0 : min((this->egptr() - this->eback()) / 2, 4);\n int_type __c = traits_type::eof();\n if (this->gptr() == this->egptr())\n {\n memmove(this->eback(), this->egptr() - __unget_sz, __unget_sz * sizeof(char_type));\n if (__always_noconv_)\n {\n size_t __nmemb = static_cast(this->egptr() - this->eback() - __unget_sz);\n __nmemb = fread(this->eback() + __unget_sz, 1, __nmemb, __file_);\n if (__nmemb != 0)\n {\n this->setg(this->eback(),\n this->eback() + __unget_sz,\n this->eback() + __unget_sz + __nmemb);\n __c = traits_type::to_int_type(*this->gptr());\n }\n }\n else\n {\n _LIBCPP_ASSERT ( !(__extbufnext_ == NULL && (__extbufend_ != __extbufnext_)), \"underflow moving from NULL\" );\n if (__extbufend_ != __extbufnext_)\n memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);\n __extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);\n __extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);\n size_t __nmemb = _VSTD::min(static_cast(__ibs_ - __unget_sz),\n static_cast(__extbufend_ - __extbufnext_));\n codecvt_base::result __r;\n __st_last_ = __st_;\n size_t __nr = fread((void*)__extbufnext_, 1, __nmemb, __file_);\n if (__nr != 0)\n {\n if (!__cv_)\n __throw_bad_cast();\n\n __extbufend_ = __extbufnext_ + __nr;\n char_type* __inext;\n __r = __cv_->in(__st_, __extbuf_, __extbufend_, __extbufnext_,\n this->eback() + __unget_sz,\n this->eback() + __ibs_, __inext);\n if (__r == codecvt_base::noconv)\n {\n this->setg((char_type*)__extbuf_, (char_type*)__extbuf_, (char_type*)__extbufend_);\n __c = traits_type::to_int_type(*this->gptr());\n }\n else if (__inext != this->eback() + __unget_sz)\n {\n this->setg(this->eback(), this->eback() + __unget_sz, __inext);\n __c = traits_type::to_int_type(*this->gptr());\n }\n }\n }\n }\n else\n __c = traits_type::to_int_type(*this->gptr());\n if (this->eback() == &__1buf)\n this->setg(0, 0, 0);\n return __c;\n}\n\ntemplate \ntypename basic_filebuf<_CharT, _Traits>::int_type\nbasic_filebuf<_CharT, _Traits>::pbackfail(int_type __c)\n{\n if (__file_ && this->eback() < this->gptr())\n {\n if (traits_type::eq_int_type(__c, traits_type::eof()))\n {\n this->gbump(-1);\n return traits_type::not_eof(__c);\n }\n if ((__om_ & ios_base::out) ||\n traits_type::eq(traits_type::to_char_type(__c), this->gptr()[-1]))\n {\n this->gbump(-1);\n *this->gptr() = traits_type::to_char_type(__c);\n return __c;\n }\n }\n return traits_type::eof();\n}\n\ntemplate \ntypename basic_filebuf<_CharT, _Traits>::int_type\nbasic_filebuf<_CharT, _Traits>::overflow(int_type __c)\n{\n if (__file_ == 0)\n return traits_type::eof();\n __write_mode();\n char_type __1buf;\n char_type* __pb_save = this->pbase();\n char_type* __epb_save = this->epptr();\n if (!traits_type::eq_int_type(__c, traits_type::eof()))\n {\n if (this->pptr() == 0)\n this->setp(&__1buf, &__1buf+1);\n *this->pptr() = traits_type::to_char_type(__c);\n this->pbump(1);\n }\n if (this->pptr() != this->pbase())\n {\n if (__always_noconv_)\n {\n size_t __nmemb = static_cast(this->pptr() - this->pbase());\n if (fwrite(this->pbase(), sizeof(char_type), __nmemb, __file_) != __nmemb)\n return traits_type::eof();\n }\n else\n {\n char* __extbe = __extbuf_;\n codecvt_base::result __r;\n do\n {\n if (!__cv_)\n __throw_bad_cast();\n\n const char_type* __e;\n __r = __cv_->out(__st_, this->pbase(), this->pptr(), __e,\n __extbuf_, __extbuf_ + __ebs_, __extbe);\n if (__e == this->pbase())\n return traits_type::eof();\n if (__r == codecvt_base::noconv)\n {\n size_t __nmemb = static_cast(this->pptr() - this->pbase());\n if (fwrite(this->pbase(), 1, __nmemb, __file_) != __nmemb)\n return traits_type::eof();\n }\n else if (__r == codecvt_base::ok || __r == codecvt_base::partial)\n {\n size_t __nmemb = static_cast(__extbe - __extbuf_);\n if (fwrite(__extbuf_, 1, __nmemb, __file_) != __nmemb)\n return traits_type::eof();\n if (__r == codecvt_base::partial)\n {\n this->setp((char_type*)__e, this->pptr());\n this->pbump(this->epptr() - this->pbase());\n }\n }\n else\n return traits_type::eof();\n } while (__r == codecvt_base::partial);\n }\n this->setp(__pb_save, __epb_save);\n }\n return traits_type::not_eof(__c);\n}\n\ntemplate \nbasic_streambuf<_CharT, _Traits>*\nbasic_filebuf<_CharT, _Traits>::setbuf(char_type* __s, streamsize __n)\n{\n this->setg(0, 0, 0);\n this->setp(0, 0);\n if (__owns_eb_)\n delete [] __extbuf_;\n if (__owns_ib_)\n delete [] __intbuf_;\n __ebs_ = __n;\n if (__ebs_ > sizeof(__extbuf_min_))\n {\n if (__always_noconv_ && __s)\n {\n __extbuf_ = (char*)__s;\n __owns_eb_ = false;\n }\n else\n {\n __extbuf_ = new char[__ebs_];\n __owns_eb_ = true;\n }\n }\n else\n {\n __extbuf_ = __extbuf_min_;\n __ebs_ = sizeof(__extbuf_min_);\n __owns_eb_ = false;\n }\n if (!__always_noconv_)\n {\n __ibs_ = max(__n, sizeof(__extbuf_min_));\n if (__s && __ibs_ >= sizeof(__extbuf_min_))\n {\n __intbuf_ = __s;\n __owns_ib_ = false;\n }\n else\n {\n __intbuf_ = new char_type[__ibs_];\n __owns_ib_ = true;\n }\n }\n else\n {\n __ibs_ = 0;\n __intbuf_ = 0;\n __owns_ib_ = false;\n }\n return this;\n}\n\ntemplate \ntypename basic_filebuf<_CharT, _Traits>::pos_type\nbasic_filebuf<_CharT, _Traits>::seekoff(off_type __off, ios_base::seekdir __way,\n ios_base::openmode)\n{\n if (!__cv_)\n __throw_bad_cast();\n\n int __width = __cv_->encoding();\n if (__file_ == 0 || (__width <= 0 && __off != 0) || sync())\n return pos_type(off_type(-1));\n // __width > 0 || __off == 0\n int __whence;\n switch (__way)\n {\n case ios_base::beg:\n __whence = SEEK_SET;\n break;\n case ios_base::cur:\n __whence = SEEK_CUR;\n break;\n case ios_base::end:\n __whence = SEEK_END;\n break;\n default:\n return pos_type(off_type(-1));\n }\n#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)\n if (fseek(__file_, __width > 0 ? __width * __off : 0, __whence))\n return pos_type(off_type(-1));\n pos_type __r = ftell(__file_);\n#else\n if (fseeko(__file_, __width > 0 ? __width * __off : 0, __whence))\n return pos_type(off_type(-1));\n pos_type __r = ftello(__file_);\n#endif\n __r.state(__st_);\n return __r;\n}\n\ntemplate \ntypename basic_filebuf<_CharT, _Traits>::pos_type\nbasic_filebuf<_CharT, _Traits>::seekpos(pos_type __sp, ios_base::openmode)\n{\n if (__file_ == 0 || sync())\n return pos_type(off_type(-1));\n#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)\n if (fseek(__file_, __sp, SEEK_SET))\n return pos_type(off_type(-1));\n#else\n if (fseeko(__file_, __sp, SEEK_SET))\n return pos_type(off_type(-1));\n#endif\n __st_ = __sp.state();\n return __sp;\n}\n\ntemplate \nint\nbasic_filebuf<_CharT, _Traits>::sync()\n{\n if (__file_ == 0)\n return 0;\n if (!__cv_)\n __throw_bad_cast();\n\n if (__cm_ & ios_base::out)\n {\n if (this->pptr() != this->pbase())\n if (overflow() == traits_type::eof())\n return -1;\n codecvt_base::result __r;\n do\n {\n char* __extbe;\n __r = __cv_->unshift(__st_, __extbuf_, __extbuf_ + __ebs_, __extbe);\n size_t __nmemb = static_cast(__extbe - __extbuf_);\n if (fwrite(__extbuf_, 1, __nmemb, __file_) != __nmemb)\n return -1;\n } while (__r == codecvt_base::partial);\n if (__r == codecvt_base::error)\n return -1;\n if (fflush(__file_))\n return -1;\n }\n else if (__cm_ & ios_base::in)\n {\n off_type __c;\n state_type __state = __st_last_;\n bool __update_st = false;\n if (__always_noconv_)\n __c = this->egptr() - this->gptr();\n else\n {\n int __width = __cv_->encoding();\n __c = __extbufend_ - __extbufnext_;\n if (__width > 0)\n __c += __width * (this->egptr() - this->gptr());\n else\n {\n if (this->gptr() != this->egptr())\n {\n const int __off = __cv_->length(__state, __extbuf_,\n __extbufnext_,\n this->gptr() - this->eback());\n __c += __extbufnext_ - __extbuf_ - __off;\n __update_st = true;\n }\n }\n }\n#if defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)\n if (fseek(__file_, -__c, SEEK_CUR))\n return -1;\n#else\n if (fseeko(__file_, -__c, SEEK_CUR))\n return -1;\n#endif\n if (__update_st)\n __st_ = __state;\n __extbufnext_ = __extbufend_ = __extbuf_;\n this->setg(0, 0, 0);\n __cm_ = 0;\n }\n return 0;\n}\n\ntemplate \nvoid\nbasic_filebuf<_CharT, _Traits>::imbue(const locale& __loc)\n{\n sync();\n __cv_ = &use_facet >(__loc);\n bool __old_anc = __always_noconv_;\n __always_noconv_ = __cv_->always_noconv();\n if (__old_anc != __always_noconv_)\n {\n this->setg(0, 0, 0);\n this->setp(0, 0);\n // invariant, char_type is char, else we couldn't get here\n if (__always_noconv_) // need to dump __intbuf_\n {\n if (__owns_eb_)\n delete [] __extbuf_;\n __owns_eb_ = __owns_ib_;\n __ebs_ = __ibs_;\n __extbuf_ = (char*)__intbuf_;\n __ibs_ = 0;\n __intbuf_ = 0;\n __owns_ib_ = false;\n }\n else // need to obtain an __intbuf_.\n { // If __extbuf_ is user-supplied, use it, else new __intbuf_\n if (!__owns_eb_ && __extbuf_ != __extbuf_min_)\n {\n __ibs_ = __ebs_;\n __intbuf_ = (char_type*)__extbuf_;\n __owns_ib_ = false;\n __extbuf_ = new char[__ebs_];\n __owns_eb_ = true;\n }\n else\n {\n __ibs_ = __ebs_;\n __intbuf_ = new char_type[__ibs_];\n __owns_ib_ = true;\n }\n }\n }\n}\n\ntemplate \nbool\nbasic_filebuf<_CharT, _Traits>::__read_mode()\n{\n if (!(__cm_ & ios_base::in))\n {\n this->setp(0, 0);\n if (__always_noconv_)\n this->setg((char_type*)__extbuf_,\n (char_type*)__extbuf_ + __ebs_,\n (char_type*)__extbuf_ + __ebs_);\n else\n this->setg(__intbuf_, __intbuf_ + __ibs_, __intbuf_ + __ibs_);\n __cm_ = ios_base::in;\n return true;\n }\n return false;\n}\n\ntemplate \nvoid\nbasic_filebuf<_CharT, _Traits>::__write_mode()\n{\n if (!(__cm_ & ios_base::out))\n {\n this->setg(0, 0, 0);\n if (__ebs_ > sizeof(__extbuf_min_))\n {\n if (__always_noconv_)\n this->setp((char_type*)__extbuf_,\n (char_type*)__extbuf_ + (__ebs_ - 1));\n else\n this->setp(__intbuf_, __intbuf_ + (__ibs_ - 1));\n }\n else\n this->setp(0, 0);\n __cm_ = ios_base::out;\n }\n}\n\n// basic_ifstream\n\ntemplate \nclass _LIBCPP_TEMPLATE_VIS basic_ifstream\n : public basic_istream<_CharT, _Traits>\n{\npublic:\n typedef _CharT char_type;\n typedef _Traits traits_type;\n typedef typename traits_type::int_type int_type;\n typedef typename traits_type::pos_type pos_type;\n typedef typename traits_type::off_type off_type;\n\n _LIBCPP_INLINE_VISIBILITY\n basic_ifstream();\n#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE\n _LIBCPP_INLINE_VISIBILITY\n explicit basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in);\n _LIBCPP_INLINE_VISIBILITY\n explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in);\n#endif\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY\n basic_ifstream(basic_ifstream&& __rhs);\n#endif\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY\n basic_ifstream& operator=(basic_ifstream&& __rhs);\n#endif\n _LIBCPP_INLINE_VISIBILITY\n void swap(basic_ifstream& __rhs);\n\n _LIBCPP_INLINE_VISIBILITY\n basic_filebuf* rdbuf() const;\n _LIBCPP_INLINE_VISIBILITY\n bool is_open() const;\n#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE\n void open(const char* __s, ios_base::openmode __mode = ios_base::in);\n void open(const string& __s, ios_base::openmode __mode = ios_base::in);\n#endif\n _LIBCPP_INLINE_VISIBILITY\n void close();\n\nprivate:\n basic_filebuf __sb_;\n};\n\ntemplate \ninline\nbasic_ifstream<_CharT, _Traits>::basic_ifstream()\n : basic_istream(&__sb_)\n{\n}\n\n#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE\ntemplate \ninline\nbasic_ifstream<_CharT, _Traits>::basic_ifstream(const char* __s, ios_base::openmode __mode)\n : basic_istream(&__sb_)\n{\n if (__sb_.open(__s, __mode | ios_base::in) == 0)\n this->setstate(ios_base::failbit);\n}\n\ntemplate \ninline\nbasic_ifstream<_CharT, _Traits>::basic_ifstream(const string& __s, ios_base::openmode __mode)\n : basic_istream(&__sb_)\n{\n if (__sb_.open(__s, __mode | ios_base::in) == 0)\n this->setstate(ios_base::failbit);\n}\n#endif\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \ninline\nbasic_ifstream<_CharT, _Traits>::basic_ifstream(basic_ifstream&& __rhs)\n : basic_istream(_VSTD::move(__rhs)),\n __sb_(_VSTD::move(__rhs.__sb_))\n{\n this->set_rdbuf(&__sb_);\n}\n\ntemplate \ninline\nbasic_ifstream<_CharT, _Traits>&\nbasic_ifstream<_CharT, _Traits>::operator=(basic_ifstream&& __rhs)\n{\n basic_istream::operator=(_VSTD::move(__rhs));\n __sb_ = _VSTD::move(__rhs.__sb_);\n return *this;\n}\n\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \ninline\nvoid\nbasic_ifstream<_CharT, _Traits>::swap(basic_ifstream& __rhs)\n{\n basic_istream::swap(__rhs);\n __sb_.swap(__rhs.__sb_);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nswap(basic_ifstream<_CharT, _Traits>& __x, basic_ifstream<_CharT, _Traits>& __y)\n{\n __x.swap(__y);\n}\n\ntemplate \ninline\nbasic_filebuf<_CharT, _Traits>*\nbasic_ifstream<_CharT, _Traits>::rdbuf() const\n{\n return const_cast*>(&__sb_);\n}\n\ntemplate \ninline\nbool\nbasic_ifstream<_CharT, _Traits>::is_open() const\n{\n return __sb_.is_open();\n}\n\n#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE\ntemplate \nvoid\nbasic_ifstream<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode)\n{\n if (__sb_.open(__s, __mode | ios_base::in))\n this->clear();\n else\n this->setstate(ios_base::failbit);\n}\n\ntemplate \nvoid\nbasic_ifstream<_CharT, _Traits>::open(const string& __s, ios_base::openmode __mode)\n{\n if (__sb_.open(__s, __mode | ios_base::in))\n this->clear();\n else\n this->setstate(ios_base::failbit);\n}\n#endif\n\ntemplate \ninline\nvoid\nbasic_ifstream<_CharT, _Traits>::close()\n{\n if (__sb_.close() == 0)\n this->setstate(ios_base::failbit);\n}\n\n// basic_ofstream\n\ntemplate \nclass _LIBCPP_TEMPLATE_VIS basic_ofstream\n : public basic_ostream<_CharT, _Traits>\n{\npublic:\n typedef _CharT char_type;\n typedef _Traits traits_type;\n typedef typename traits_type::int_type int_type;\n typedef typename traits_type::pos_type pos_type;\n typedef typename traits_type::off_type off_type;\n\n _LIBCPP_INLINE_VISIBILITY\n basic_ofstream();\n _LIBCPP_INLINE_VISIBILITY\n explicit basic_ofstream(const char* __s, ios_base::openmode __mode = ios_base::out);\n _LIBCPP_INLINE_VISIBILITY\n explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY\n basic_ofstream(basic_ofstream&& __rhs);\n#endif\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY\n basic_ofstream& operator=(basic_ofstream&& __rhs);\n#endif\n _LIBCPP_INLINE_VISIBILITY\n void swap(basic_ofstream& __rhs);\n\n _LIBCPP_INLINE_VISIBILITY\n basic_filebuf* rdbuf() const;\n _LIBCPP_INLINE_VISIBILITY\n bool is_open() const;\n#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE\n void open(const char* __s, ios_base::openmode __mode = ios_base::out);\n void open(const string& __s, ios_base::openmode __mode = ios_base::out);\n#endif\n _LIBCPP_INLINE_VISIBILITY\n void close();\n\nprivate:\n basic_filebuf __sb_;\n};\n\ntemplate \ninline\nbasic_ofstream<_CharT, _Traits>::basic_ofstream()\n : basic_ostream(&__sb_)\n{\n}\n\n#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE\ntemplate \ninline\nbasic_ofstream<_CharT, _Traits>::basic_ofstream(const char* __s, ios_base::openmode __mode)\n : basic_ostream(&__sb_)\n{\n if (__sb_.open(__s, __mode | ios_base::out) == 0)\n this->setstate(ios_base::failbit);\n}\n\ntemplate \ninline\nbasic_ofstream<_CharT, _Traits>::basic_ofstream(const string& __s, ios_base::openmode __mode)\n : basic_ostream(&__sb_)\n{\n if (__sb_.open(__s, __mode | ios_base::out) == 0)\n this->setstate(ios_base::failbit);\n}\n#endif\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \ninline\nbasic_ofstream<_CharT, _Traits>::basic_ofstream(basic_ofstream&& __rhs)\n : basic_ostream(_VSTD::move(__rhs)),\n __sb_(_VSTD::move(__rhs.__sb_))\n{\n this->set_rdbuf(&__sb_);\n}\n\ntemplate \ninline\nbasic_ofstream<_CharT, _Traits>&\nbasic_ofstream<_CharT, _Traits>::operator=(basic_ofstream&& __rhs)\n{\n basic_ostream::operator=(_VSTD::move(__rhs));\n __sb_ = _VSTD::move(__rhs.__sb_);\n return *this;\n}\n\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \ninline\nvoid\nbasic_ofstream<_CharT, _Traits>::swap(basic_ofstream& __rhs)\n{\n basic_ostream::swap(__rhs);\n __sb_.swap(__rhs.__sb_);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nswap(basic_ofstream<_CharT, _Traits>& __x, basic_ofstream<_CharT, _Traits>& __y)\n{\n __x.swap(__y);\n}\n\ntemplate \ninline\nbasic_filebuf<_CharT, _Traits>*\nbasic_ofstream<_CharT, _Traits>::rdbuf() const\n{\n return const_cast*>(&__sb_);\n}\n\ntemplate \ninline\nbool\nbasic_ofstream<_CharT, _Traits>::is_open() const\n{\n return __sb_.is_open();\n}\n\n#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE\ntemplate \nvoid\nbasic_ofstream<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode)\n{\n if (__sb_.open(__s, __mode | ios_base::out))\n this->clear();\n else\n this->setstate(ios_base::failbit);\n}\n\ntemplate \nvoid\nbasic_ofstream<_CharT, _Traits>::open(const string& __s, ios_base::openmode __mode)\n{\n if (__sb_.open(__s, __mode | ios_base::out))\n this->clear();\n else\n this->setstate(ios_base::failbit);\n}\n#endif\n\ntemplate \ninline\nvoid\nbasic_ofstream<_CharT, _Traits>::close()\n{\n if (__sb_.close() == 0)\n this->setstate(ios_base::failbit);\n}\n\n// basic_fstream\n\ntemplate \nclass _LIBCPP_TEMPLATE_VIS basic_fstream\n : public basic_iostream<_CharT, _Traits>\n{\npublic:\n typedef _CharT char_type;\n typedef _Traits traits_type;\n typedef typename traits_type::int_type int_type;\n typedef typename traits_type::pos_type pos_type;\n typedef typename traits_type::off_type off_type;\n\n _LIBCPP_INLINE_VISIBILITY\n basic_fstream();\n#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE\n _LIBCPP_INLINE_VISIBILITY\n explicit basic_fstream(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out);\n _LIBCPP_INLINE_VISIBILITY\n explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);\n#endif\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY\n basic_fstream(basic_fstream&& __rhs);\n#endif\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY\n basic_fstream& operator=(basic_fstream&& __rhs);\n#endif\n _LIBCPP_INLINE_VISIBILITY\n void swap(basic_fstream& __rhs);\n\n _LIBCPP_INLINE_VISIBILITY\n basic_filebuf* rdbuf() const;\n _LIBCPP_INLINE_VISIBILITY\n bool is_open() const;\n#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE\n void open(const char* __s, ios_base::openmode __mode = ios_base::in | ios_base::out);\n void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);\n#endif\n _LIBCPP_INLINE_VISIBILITY\n void close();\n\nprivate:\n basic_filebuf __sb_;\n};\n\ntemplate \ninline\nbasic_fstream<_CharT, _Traits>::basic_fstream()\n : basic_iostream(&__sb_)\n{\n}\n\n#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE\ntemplate \ninline\nbasic_fstream<_CharT, _Traits>::basic_fstream(const char* __s, ios_base::openmode __mode)\n : basic_iostream(&__sb_)\n{\n if (__sb_.open(__s, __mode) == 0)\n this->setstate(ios_base::failbit);\n}\n\ntemplate \ninline\nbasic_fstream<_CharT, _Traits>::basic_fstream(const string& __s, ios_base::openmode __mode)\n : basic_iostream(&__sb_)\n{\n if (__sb_.open(__s, __mode) == 0)\n this->setstate(ios_base::failbit);\n}\n#endif\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \ninline\nbasic_fstream<_CharT, _Traits>::basic_fstream(basic_fstream&& __rhs)\n : basic_iostream(_VSTD::move(__rhs)),\n __sb_(_VSTD::move(__rhs.__sb_))\n{\n this->set_rdbuf(&__sb_);\n}\n\ntemplate \ninline\nbasic_fstream<_CharT, _Traits>&\nbasic_fstream<_CharT, _Traits>::operator=(basic_fstream&& __rhs)\n{\n basic_iostream::operator=(_VSTD::move(__rhs));\n __sb_ = _VSTD::move(__rhs.__sb_);\n return *this;\n}\n\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \ninline\nvoid\nbasic_fstream<_CharT, _Traits>::swap(basic_fstream& __rhs)\n{\n basic_iostream::swap(__rhs);\n __sb_.swap(__rhs.__sb_);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nswap(basic_fstream<_CharT, _Traits>& __x, basic_fstream<_CharT, _Traits>& __y)\n{\n __x.swap(__y);\n}\n\ntemplate \ninline\nbasic_filebuf<_CharT, _Traits>*\nbasic_fstream<_CharT, _Traits>::rdbuf() const\n{\n return const_cast*>(&__sb_);\n}\n\ntemplate \ninline\nbool\nbasic_fstream<_CharT, _Traits>::is_open() const\n{\n return __sb_.is_open();\n}\n\n#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE\ntemplate \nvoid\nbasic_fstream<_CharT, _Traits>::open(const char* __s, ios_base::openmode __mode)\n{\n if (__sb_.open(__s, __mode))\n this->clear();\n else\n this->setstate(ios_base::failbit);\n}\n\ntemplate \nvoid\nbasic_fstream<_CharT, _Traits>::open(const string& __s, ios_base::openmode __mode)\n{\n if (__sb_.open(__s, __mode))\n this->clear();\n else\n this->setstate(ios_base::failbit);\n}\n#endif\n\ntemplate \ninline\nvoid\nbasic_fstream<_CharT, _Traits>::close()\n{\n if (__sb_.close() == 0)\n this->setstate(ios_base::failbit);\n}\n\n_LIBCPP_END_NAMESPACE_STD\n\n#endif // _LIBCPP_FSTREAM\n","// -*- C++ -*-\n//===---------------------------- ios -------------------------------------===//\n//\n// The LLVM Compiler Infrastructure\n//\n// This file is dual licensed under the MIT and the University of Illinois Open\n// Source Licenses. See LICENSE.TXT for details.\n//\n//===----------------------------------------------------------------------===//\n\n#ifndef _LIBCPP_IOS\n#define _LIBCPP_IOS\n\n/*\n ios synopsis\n\n#include \n\nnamespace std\n{\n\ntypedef OFF_T streamoff;\ntypedef SZ_T streamsize;\ntemplate class fpos;\n\nclass ios_base\n{\npublic:\n class failure;\n\n typedef T1 fmtflags;\n static constexpr fmtflags boolalpha;\n static constexpr fmtflags dec;\n static constexpr fmtflags fixed;\n static constexpr fmtflags hex;\n static constexpr fmtflags internal;\n static constexpr fmtflags left;\n static constexpr fmtflags oct;\n static constexpr fmtflags right;\n static constexpr fmtflags scientific;\n static constexpr fmtflags showbase;\n static constexpr fmtflags showpoint;\n static constexpr fmtflags showpos;\n static constexpr fmtflags skipws;\n static constexpr fmtflags unitbuf;\n static constexpr fmtflags uppercase;\n static constexpr fmtflags adjustfield;\n static constexpr fmtflags basefield;\n static constexpr fmtflags floatfield;\n\n typedef T2 iostate;\n static constexpr iostate badbit;\n static constexpr iostate eofbit;\n static constexpr iostate failbit;\n static constexpr iostate goodbit;\n\n typedef T3 openmode;\n static constexpr openmode app;\n static constexpr openmode ate;\n static constexpr openmode binary;\n static constexpr openmode in;\n static constexpr openmode out;\n static constexpr openmode trunc;\n\n typedef T4 seekdir;\n static constexpr seekdir beg;\n static constexpr seekdir cur;\n static constexpr seekdir end;\n\n class Init;\n\n // 27.5.2.2 fmtflags state:\n fmtflags flags() const;\n fmtflags flags(fmtflags fmtfl);\n fmtflags setf(fmtflags fmtfl);\n fmtflags setf(fmtflags fmtfl, fmtflags mask);\n void unsetf(fmtflags mask);\n\n streamsize precision() const;\n streamsize precision(streamsize prec);\n streamsize width() const;\n streamsize width(streamsize wide);\n\n // 27.5.2.3 locales:\n locale imbue(const locale& loc);\n locale getloc() const;\n\n // 27.5.2.5 storage:\n static int xalloc();\n long& iword(int index);\n void*& pword(int index);\n\n // destructor\n virtual ~ios_base();\n\n // 27.5.2.6 callbacks;\n enum event { erase_event, imbue_event, copyfmt_event };\n typedef void (*event_callback)(event, ios_base&, int index);\n void register_callback(event_callback fn, int index);\n\n ios_base(const ios_base&) = delete;\n ios_base& operator=(const ios_base&) = delete;\n\n static bool sync_with_stdio(bool sync = true);\n\nprotected:\n ios_base();\n};\n\ntemplate >\nclass basic_ios\n : public ios_base\n{\npublic:\n // types:\n typedef charT char_type;\n typedef typename traits::int_type int_type; // removed in C++17\n typedef typename traits::pos_type pos_type; // removed in C++17\n typedef typename traits::off_type off_type; // removed in C++17\n typedef traits traits_type;\n\n operator unspecified-bool-type() const;\n bool operator!() const;\n iostate rdstate() const;\n void clear(iostate state = goodbit);\n void setstate(iostate state);\n bool good() const;\n bool eof() const;\n bool fail() const;\n bool bad() const;\n\n iostate exceptions() const;\n void exceptions(iostate except);\n\n // 27.5.4.1 Constructor/destructor:\n explicit basic_ios(basic_streambuf* sb);\n virtual ~basic_ios();\n\n // 27.5.4.2 Members:\n basic_ostream* tie() const;\n basic_ostream* tie(basic_ostream* tiestr);\n\n basic_streambuf* rdbuf() const;\n basic_streambuf* rdbuf(basic_streambuf* sb);\n\n basic_ios& copyfmt(const basic_ios& rhs);\n\n char_type fill() const;\n char_type fill(char_type ch);\n\n locale imbue(const locale& loc);\n\n char narrow(char_type c, char dfault) const;\n char_type widen(char c) const;\n\n basic_ios(const basic_ios& ) = delete;\n basic_ios& operator=(const basic_ios&) = delete;\n\nprotected:\n basic_ios();\n void init(basic_streambuf* sb);\n void move(basic_ios& rhs);\n void swap(basic_ios& rhs) noexcept;\n void set_rdbuf(basic_streambuf* sb);\n};\n\n// 27.5.5, manipulators:\nios_base& boolalpha (ios_base& str);\nios_base& noboolalpha(ios_base& str);\nios_base& showbase (ios_base& str);\nios_base& noshowbase (ios_base& str);\nios_base& showpoint (ios_base& str);\nios_base& noshowpoint(ios_base& str);\nios_base& showpos (ios_base& str);\nios_base& noshowpos (ios_base& str);\nios_base& skipws (ios_base& str);\nios_base& noskipws (ios_base& str);\nios_base& uppercase (ios_base& str);\nios_base& nouppercase(ios_base& str);\nios_base& unitbuf (ios_base& str);\nios_base& nounitbuf (ios_base& str);\n\n// 27.5.5.2 adjustfield:\nios_base& internal (ios_base& str);\nios_base& left (ios_base& str);\nios_base& right (ios_base& str);\n\n// 27.5.5.3 basefield:\nios_base& dec (ios_base& str);\nios_base& hex (ios_base& str);\nios_base& oct (ios_base& str);\n\n// 27.5.5.4 floatfield:\nios_base& fixed (ios_base& str);\nios_base& scientific (ios_base& str);\nios_base& hexfloat (ios_base& str);\nios_base& defaultfloat(ios_base& str);\n\n// 27.5.5.5 error reporting:\nenum class io_errc\n{\n stream = 1\n};\n\nconcept_map ErrorCodeEnum { };\nerror_code make_error_code(io_errc e) noexcept; \nerror_condition make_error_condition(io_errc e) noexcept; \nstorage-class-specifier const error_category& iostream_category() noexcept;\n\n} // std\n\n*/\n\n#include <__config>\n#include \n#include <__locale>\n#include \n\n#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)\n#include // for __xindex_\n#endif\n\n#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)\n#pragma GCC system_header\n#endif\n\n_LIBCPP_BEGIN_NAMESPACE_STD\n\ntypedef ptrdiff_t streamsize;\n\nclass _LIBCPP_TYPE_VIS ios_base\n{\npublic:\n class _LIBCPP_EXCEPTION_ABI failure;\n\n typedef unsigned int fmtflags;\n static const fmtflags boolalpha = 0x0001;\n static const fmtflags dec = 0x0002;\n static const fmtflags fixed = 0x0004;\n static const fmtflags hex = 0x0008;\n static const fmtflags internal = 0x0010;\n static const fmtflags left = 0x0020;\n static const fmtflags oct = 0x0040;\n static const fmtflags right = 0x0080;\n static const fmtflags scientific = 0x0100;\n static const fmtflags showbase = 0x0200;\n static const fmtflags showpoint = 0x0400;\n static const fmtflags showpos = 0x0800;\n static const fmtflags skipws = 0x1000;\n static const fmtflags unitbuf = 0x2000;\n static const fmtflags uppercase = 0x4000;\n static const fmtflags adjustfield = left | right | internal;\n static const fmtflags basefield = dec | oct | hex;\n static const fmtflags floatfield = scientific | fixed;\n\n typedef unsigned int iostate;\n static const iostate badbit = 0x1;\n static const iostate eofbit = 0x2;\n static const iostate failbit = 0x4;\n static const iostate goodbit = 0x0;\n\n typedef unsigned int openmode;\n static const openmode app = 0x01;\n static const openmode ate = 0x02;\n static const openmode binary = 0x04;\n static const openmode in = 0x08;\n static const openmode out = 0x10;\n static const openmode trunc = 0x20;\n\n enum seekdir {beg, cur, end};\n\n#if _LIBCPP_STD_VER <= 14\n typedef iostate io_state;\n typedef openmode open_mode;\n typedef seekdir seek_dir;\n\n typedef _VSTD::streamoff streamoff;\n typedef _VSTD::streampos streampos;\n#endif\n\n class _LIBCPP_TYPE_VIS Init;\n\n // 27.5.2.2 fmtflags state:\n _LIBCPP_INLINE_VISIBILITY fmtflags flags() const;\n _LIBCPP_INLINE_VISIBILITY fmtflags flags(fmtflags __fmtfl);\n _LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl);\n _LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl, fmtflags __mask);\n _LIBCPP_INLINE_VISIBILITY void unsetf(fmtflags __mask);\n\n _LIBCPP_INLINE_VISIBILITY streamsize precision() const;\n _LIBCPP_INLINE_VISIBILITY streamsize precision(streamsize __prec);\n _LIBCPP_INLINE_VISIBILITY streamsize width() const;\n _LIBCPP_INLINE_VISIBILITY streamsize width(streamsize __wide);\n\n // 27.5.2.3 locales:\n locale imbue(const locale& __loc);\n locale getloc() const;\n\n // 27.5.2.5 storage:\n static int xalloc();\n long& iword(int __index);\n void*& pword(int __index);\n\n // destructor\n virtual ~ios_base();\n\n // 27.5.2.6 callbacks;\n enum event { erase_event, imbue_event, copyfmt_event };\n typedef void (*event_callback)(event, ios_base&, int __index);\n void register_callback(event_callback __fn, int __index);\n\nprivate:\n ios_base(const ios_base&); // = delete;\n ios_base& operator=(const ios_base&); // = delete;\n\npublic:\n static bool sync_with_stdio(bool __sync = true);\n\n _LIBCPP_INLINE_VISIBILITY iostate rdstate() const;\n void clear(iostate __state = goodbit);\n _LIBCPP_INLINE_VISIBILITY void setstate(iostate __state);\n\n _LIBCPP_INLINE_VISIBILITY bool good() const;\n _LIBCPP_INLINE_VISIBILITY bool eof() const;\n _LIBCPP_INLINE_VISIBILITY bool fail() const;\n _LIBCPP_INLINE_VISIBILITY bool bad() const;\n\n _LIBCPP_INLINE_VISIBILITY iostate exceptions() const;\n _LIBCPP_INLINE_VISIBILITY void exceptions(iostate __iostate);\n\n void __set_badbit_and_consider_rethrow();\n void __set_failbit_and_consider_rethrow();\n\nprotected:\n _LIBCPP_INLINE_VISIBILITY\n ios_base() {// purposefully does no initialization\n }\n\n void init(void* __sb);\n _LIBCPP_ALWAYS_INLINE void* rdbuf() const {return __rdbuf_;}\n\n _LIBCPP_ALWAYS_INLINE\n void rdbuf(void* __sb)\n {\n __rdbuf_ = __sb;\n clear();\n }\n\n void __call_callbacks(event);\n void copyfmt(const ios_base&);\n void move(ios_base&);\n void swap(ios_base&) _NOEXCEPT;\n\n _LIBCPP_ALWAYS_INLINE\n void set_rdbuf(void* __sb)\n {\n __rdbuf_ = __sb;\n }\n\nprivate:\n // All data members must be scalars\n fmtflags __fmtflags_;\n streamsize __precision_;\n streamsize __width_;\n iostate __rdstate_;\n iostate __exceptions_;\n void* __rdbuf_;\n void* __loc_;\n event_callback* __fn_;\n int* __index_;\n size_t __event_size_;\n size_t __event_cap_;\n// TODO(EricWF): Enable this for both Clang and GCC. Currently it is only\n// enabled with clang.\n#if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)\n static atomic __xindex_;\n#else\n static int __xindex_;\n#endif\n long* __iarray_;\n size_t __iarray_size_;\n size_t __iarray_cap_;\n void** __parray_;\n size_t __parray_size_;\n size_t __parray_cap_;\n};\n\n//enum class io_errc\n_LIBCPP_DECLARE_STRONG_ENUM(io_errc)\n{\n stream = 1\n};\n_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(io_errc)\n\ntemplate <>\nstruct _LIBCPP_TEMPLATE_VIS is_error_code_enum : public true_type { };\n\n#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS\ntemplate <>\nstruct _LIBCPP_TEMPLATE_VIS is_error_code_enum : public true_type { };\n#endif\n\n_LIBCPP_FUNC_VIS\nconst error_category& iostream_category() _NOEXCEPT;\n\ninline _LIBCPP_INLINE_VISIBILITY\nerror_code\nmake_error_code(io_errc __e) _NOEXCEPT\n{\n return error_code(static_cast(__e), iostream_category());\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nerror_condition\nmake_error_condition(io_errc __e) _NOEXCEPT\n{\n return error_condition(static_cast(__e), iostream_category());\n}\n\nclass _LIBCPP_EXCEPTION_ABI ios_base::failure\n : public system_error\n{\npublic:\n explicit failure(const string& __msg, const error_code& __ec = io_errc::stream);\n explicit failure(const char* __msg, const error_code& __ec = io_errc::stream);\n virtual ~failure() throw();\n};\n\nclass _LIBCPP_TYPE_VIS ios_base::Init\n{\npublic:\n Init();\n ~Init();\n};\n\n// fmtflags\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base::fmtflags\nios_base::flags() const\n{\n return __fmtflags_;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base::fmtflags\nios_base::flags(fmtflags __fmtfl)\n{\n fmtflags __r = __fmtflags_;\n __fmtflags_ = __fmtfl;\n return __r;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base::fmtflags\nios_base::setf(fmtflags __fmtfl)\n{\n fmtflags __r = __fmtflags_;\n __fmtflags_ |= __fmtfl;\n return __r;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nios_base::unsetf(fmtflags __mask)\n{\n __fmtflags_ &= ~__mask;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base::fmtflags\nios_base::setf(fmtflags __fmtfl, fmtflags __mask)\n{\n fmtflags __r = __fmtflags_;\n unsetf(__mask);\n __fmtflags_ |= __fmtfl & __mask;\n return __r;\n}\n\n// precision\n\ninline _LIBCPP_INLINE_VISIBILITY\nstreamsize\nios_base::precision() const\n{\n return __precision_;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nstreamsize\nios_base::precision(streamsize __prec)\n{\n streamsize __r = __precision_;\n __precision_ = __prec;\n return __r;\n}\n\n// width\n\ninline _LIBCPP_INLINE_VISIBILITY\nstreamsize\nios_base::width() const\n{\n return __width_;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nstreamsize\nios_base::width(streamsize __wide)\n{\n streamsize __r = __width_;\n __width_ = __wide;\n return __r;\n}\n\n// iostate\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base::iostate\nios_base::rdstate() const\n{\n return __rdstate_;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nios_base::setstate(iostate __state)\n{\n clear(__rdstate_ | __state);\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nbool\nios_base::good() const\n{\n return __rdstate_ == 0;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nbool\nios_base::eof() const\n{\n return (__rdstate_ & eofbit) != 0;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nbool\nios_base::fail() const\n{\n return (__rdstate_ & (failbit | badbit)) != 0;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nbool\nios_base::bad() const\n{\n return (__rdstate_ & badbit) != 0;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base::iostate\nios_base::exceptions() const\n{\n return __exceptions_;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nios_base::exceptions(iostate __iostate)\n{\n __exceptions_ = __iostate;\n clear(__rdstate_);\n}\n\n#if defined(_LIBCPP_CXX03_LANG)\nstruct _LIBCPP_TYPE_VIS __cxx03_bool {\n typedef void (__cxx03_bool::*__bool_type)();\n void __true_value() {}\n};\n#endif\n\ntemplate \nclass _LIBCPP_TEMPLATE_VIS basic_ios\n : public ios_base\n{\npublic:\n // types:\n typedef _CharT char_type;\n typedef _Traits traits_type;\n\n typedef typename traits_type::int_type int_type;\n typedef typename traits_type::pos_type pos_type;\n typedef typename traits_type::off_type off_type;\n\n#if defined(_LIBCPP_CXX03_LANG)\n _LIBCPP_ALWAYS_INLINE\n operator __cxx03_bool::__bool_type() const {\n return !fail() ? &__cxx03_bool::__true_value : nullptr;\n }\n#else\n _LIBCPP_ALWAYS_INLINE\n _LIBCPP_EXPLICIT operator bool() const {return !fail();}\n#endif\n\n _LIBCPP_ALWAYS_INLINE bool operator!() const {return fail();}\n _LIBCPP_ALWAYS_INLINE iostate rdstate() const {return ios_base::rdstate();}\n _LIBCPP_ALWAYS_INLINE void clear(iostate __state = goodbit) {ios_base::clear(__state);}\n _LIBCPP_ALWAYS_INLINE void setstate(iostate __state) {ios_base::setstate(__state);}\n _LIBCPP_ALWAYS_INLINE bool good() const {return ios_base::good();}\n _LIBCPP_ALWAYS_INLINE bool eof() const {return ios_base::eof();}\n _LIBCPP_ALWAYS_INLINE bool fail() const {return ios_base::fail();}\n _LIBCPP_ALWAYS_INLINE bool bad() const {return ios_base::bad();}\n\n _LIBCPP_ALWAYS_INLINE iostate exceptions() const {return ios_base::exceptions();}\n _LIBCPP_ALWAYS_INLINE void exceptions(iostate __iostate) {ios_base::exceptions(__iostate);}\n\n // 27.5.4.1 Constructor/destructor:\n _LIBCPP_INLINE_VISIBILITY\n explicit basic_ios(basic_streambuf* __sb);\n virtual ~basic_ios();\n\n // 27.5.4.2 Members:\n _LIBCPP_INLINE_VISIBILITY \n basic_ostream* tie() const;\n _LIBCPP_INLINE_VISIBILITY \n basic_ostream* tie(basic_ostream* __tiestr);\n\n _LIBCPP_INLINE_VISIBILITY \n basic_streambuf* rdbuf() const;\n _LIBCPP_INLINE_VISIBILITY \n basic_streambuf* rdbuf(basic_streambuf* __sb);\n\n basic_ios& copyfmt(const basic_ios& __rhs);\n\n _LIBCPP_INLINE_VISIBILITY \n char_type fill() const;\n _LIBCPP_INLINE_VISIBILITY \n char_type fill(char_type __ch);\n\n _LIBCPP_INLINE_VISIBILITY \n locale imbue(const locale& __loc);\n\n _LIBCPP_INLINE_VISIBILITY \n char narrow(char_type __c, char __dfault) const;\n _LIBCPP_INLINE_VISIBILITY \n char_type widen(char __c) const;\n\nprotected:\n _LIBCPP_ALWAYS_INLINE\n basic_ios() {// purposefully does no initialization\n }\n _LIBCPP_INLINE_VISIBILITY \n void init(basic_streambuf* __sb);\n\n _LIBCPP_INLINE_VISIBILITY \n void move(basic_ios& __rhs);\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_ALWAYS_INLINE\n void move(basic_ios&& __rhs) {move(__rhs);}\n#endif\n _LIBCPP_INLINE_VISIBILITY \n void swap(basic_ios& __rhs) _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY \n void set_rdbuf(basic_streambuf* __sb);\nprivate:\n basic_ostream* __tie_;\n mutable int_type __fill_;\n};\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_ios<_CharT, _Traits>::basic_ios(basic_streambuf* __sb)\n{\n init(__sb);\n}\n\ntemplate \nbasic_ios<_CharT, _Traits>::~basic_ios()\n{\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nbasic_ios<_CharT, _Traits>::init(basic_streambuf* __sb)\n{\n ios_base::init(__sb);\n __tie_ = 0;\n __fill_ = traits_type::eof();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_ostream<_CharT, _Traits>*\nbasic_ios<_CharT, _Traits>::tie() const\n{\n return __tie_;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_ostream<_CharT, _Traits>*\nbasic_ios<_CharT, _Traits>::tie(basic_ostream* __tiestr)\n{\n basic_ostream* __r = __tie_;\n __tie_ = __tiestr;\n return __r;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_streambuf<_CharT, _Traits>*\nbasic_ios<_CharT, _Traits>::rdbuf() const\n{\n return static_cast*>(ios_base::rdbuf());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_streambuf<_CharT, _Traits>*\nbasic_ios<_CharT, _Traits>::rdbuf(basic_streambuf* __sb)\n{\n basic_streambuf* __r = rdbuf();\n ios_base::rdbuf(__sb);\n return __r;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nlocale\nbasic_ios<_CharT, _Traits>::imbue(const locale& __loc)\n{\n locale __r = getloc();\n ios_base::imbue(__loc);\n if (rdbuf())\n rdbuf()->pubimbue(__loc);\n return __r;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nchar\nbasic_ios<_CharT, _Traits>::narrow(char_type __c, char __dfault) const\n{\n return use_facet >(getloc()).narrow(__c, __dfault);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_CharT\nbasic_ios<_CharT, _Traits>::widen(char __c) const\n{\n return use_facet >(getloc()).widen(__c);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_CharT\nbasic_ios<_CharT, _Traits>::fill() const\n{\n if (traits_type::eq_int_type(traits_type::eof(), __fill_))\n __fill_ = widen(' ');\n return __fill_;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_CharT\nbasic_ios<_CharT, _Traits>::fill(char_type __ch)\n{\n char_type __r = __fill_;\n __fill_ = __ch;\n return __r;\n}\n\ntemplate \nbasic_ios<_CharT, _Traits>&\nbasic_ios<_CharT, _Traits>::copyfmt(const basic_ios& __rhs)\n{\n if (this != &__rhs)\n {\n __call_callbacks(erase_event);\n ios_base::copyfmt(__rhs);\n __tie_ = __rhs.__tie_;\n __fill_ = __rhs.__fill_;\n __call_callbacks(copyfmt_event);\n exceptions(__rhs.exceptions());\n }\n return *this;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nbasic_ios<_CharT, _Traits>::move(basic_ios& __rhs)\n{\n ios_base::move(__rhs);\n __tie_ = __rhs.__tie_;\n __rhs.__tie_ = 0;\n __fill_ = __rhs.__fill_;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nbasic_ios<_CharT, _Traits>::swap(basic_ios& __rhs) _NOEXCEPT\n{\n ios_base::swap(__rhs);\n _VSTD::swap(__tie_, __rhs.__tie_);\n _VSTD::swap(__fill_, __rhs.__fill_);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nbasic_ios<_CharT, _Traits>::set_rdbuf(basic_streambuf* __sb)\n{\n ios_base::set_rdbuf(__sb);\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\nboolalpha(ios_base& __str)\n{\n __str.setf(ios_base::boolalpha);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\nnoboolalpha(ios_base& __str)\n{\n __str.unsetf(ios_base::boolalpha);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\nshowbase(ios_base& __str)\n{\n __str.setf(ios_base::showbase);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\nnoshowbase(ios_base& __str)\n{\n __str.unsetf(ios_base::showbase);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\nshowpoint(ios_base& __str)\n{\n __str.setf(ios_base::showpoint);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\nnoshowpoint(ios_base& __str)\n{\n __str.unsetf(ios_base::showpoint);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\nshowpos(ios_base& __str)\n{\n __str.setf(ios_base::showpos);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\nnoshowpos(ios_base& __str)\n{\n __str.unsetf(ios_base::showpos);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\nskipws(ios_base& __str)\n{\n __str.setf(ios_base::skipws);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\nnoskipws(ios_base& __str)\n{\n __str.unsetf(ios_base::skipws);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\nuppercase(ios_base& __str)\n{\n __str.setf(ios_base::uppercase);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\nnouppercase(ios_base& __str)\n{\n __str.unsetf(ios_base::uppercase);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\nunitbuf(ios_base& __str)\n{\n __str.setf(ios_base::unitbuf);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\nnounitbuf(ios_base& __str)\n{\n __str.unsetf(ios_base::unitbuf);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\ninternal(ios_base& __str)\n{\n __str.setf(ios_base::internal, ios_base::adjustfield);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\nleft(ios_base& __str)\n{\n __str.setf(ios_base::left, ios_base::adjustfield);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\nright(ios_base& __str)\n{\n __str.setf(ios_base::right, ios_base::adjustfield);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\ndec(ios_base& __str)\n{\n __str.setf(ios_base::dec, ios_base::basefield);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\nhex(ios_base& __str)\n{\n __str.setf(ios_base::hex, ios_base::basefield);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\noct(ios_base& __str)\n{\n __str.setf(ios_base::oct, ios_base::basefield);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\nfixed(ios_base& __str)\n{\n __str.setf(ios_base::fixed, ios_base::floatfield);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\nscientific(ios_base& __str)\n{\n __str.setf(ios_base::scientific, ios_base::floatfield);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\nhexfloat(ios_base& __str)\n{\n __str.setf(ios_base::fixed | ios_base::scientific, ios_base::floatfield);\n return __str;\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nios_base&\ndefaultfloat(ios_base& __str)\n{\n __str.unsetf(ios_base::floatfield);\n return __str;\n}\n\ntemplate \nclass __save_flags\n{\n typedef basic_ios<_CharT, _Traits> __stream_type;\n typedef typename __stream_type::fmtflags fmtflags;\n\n __stream_type& __stream_;\n fmtflags __fmtflags_;\n _CharT __fill_;\n\n __save_flags(const __save_flags&);\n __save_flags& operator=(const __save_flags&);\npublic:\n _LIBCPP_INLINE_VISIBILITY\n explicit __save_flags(__stream_type& __stream)\n : __stream_(__stream),\n __fmtflags_(__stream.flags()),\n __fill_(__stream.fill())\n {}\n _LIBCPP_INLINE_VISIBILITY\n ~__save_flags()\n {\n __stream_.flags(__fmtflags_);\n __stream_.fill(__fill_);\n }\n};\n\n_LIBCPP_END_NAMESPACE_STD\n\n#endif // _LIBCPP_IOS\n","// -*- C++ -*-\n//===--------------------------- istream ----------------------------------===//\n//\n// The LLVM Compiler Infrastructure\n//\n// This file is dual licensed under the MIT and the University of Illinois Open\n// Source Licenses. See LICENSE.TXT for details.\n//\n//===----------------------------------------------------------------------===//\n\n#ifndef _LIBCPP_ISTREAM\n#define _LIBCPP_ISTREAM\n\n/*\n istream synopsis\n\ntemplate >\nclass basic_istream\n : virtual public basic_ios\n{\npublic:\n // types (inherited from basic_ios (27.5.4)):\n typedef charT char_type;\n typedef traits traits_type;\n typedef typename traits_type::int_type int_type;\n typedef typename traits_type::pos_type pos_type;\n typedef typename traits_type::off_type off_type;\n\n // 27.7.1.1.1 Constructor/destructor:\n explicit basic_istream(basic_streambuf* sb);\n basic_istream(basic_istream&& rhs);\n virtual ~basic_istream();\n\n // 27.7.1.1.2 Assign/swap:\n basic_istream& operator=(basic_istream&& rhs);\n void swap(basic_istream& rhs);\n\n // 27.7.1.1.3 Prefix/suffix:\n class sentry;\n\n // 27.7.1.2 Formatted input:\n basic_istream& operator>>(basic_istream& (*pf)(basic_istream&));\n basic_istream& operator>>(basic_ios&\n (*pf)(basic_ios&));\n basic_istream& operator>>(ios_base& (*pf)(ios_base&));\n basic_istream& operator>>(basic_streambuf* sb);\n basic_istream& operator>>(bool& n);\n basic_istream& operator>>(short& n);\n basic_istream& operator>>(unsigned short& n);\n basic_istream& operator>>(int& n);\n basic_istream& operator>>(unsigned int& n);\n basic_istream& operator>>(long& n);\n basic_istream& operator>>(unsigned long& n);\n basic_istream& operator>>(long long& n);\n basic_istream& operator>>(unsigned long long& n);\n basic_istream& operator>>(float& f);\n basic_istream& operator>>(double& f);\n basic_istream& operator>>(long double& f);\n basic_istream& operator>>(void*& p);\n\n // 27.7.1.3 Unformatted input:\n streamsize gcount() const;\n int_type get();\n basic_istream& get(char_type& c);\n basic_istream& get(char_type* s, streamsize n);\n basic_istream& get(char_type* s, streamsize n, char_type delim);\n basic_istream& get(basic_streambuf& sb);\n basic_istream& get(basic_streambuf& sb, char_type delim);\n\n basic_istream& getline(char_type* s, streamsize n);\n basic_istream& getline(char_type* s, streamsize n, char_type delim);\n\n basic_istream& ignore(streamsize n = 1, int_type delim = traits_type::eof());\n int_type peek();\n basic_istream& read (char_type* s, streamsize n);\n streamsize readsome(char_type* s, streamsize n);\n\n basic_istream& putback(char_type c);\n basic_istream& unget();\n int sync();\n\n pos_type tellg();\n basic_istream& seekg(pos_type);\n basic_istream& seekg(off_type, ios_base::seekdir);\nprotected:\n basic_istream(const basic_istream& rhs) = delete;\n basic_istream(basic_istream&& rhs);\n // 27.7.2.1.2 Assign/swap:\n basic_istream& operator=(const basic_istream& rhs) = delete;\n basic_istream& operator=(basic_istream&& rhs);\n void swap(basic_istream& rhs);\n};\n\n// 27.7.1.2.3 character extraction templates:\ntemplate\n basic_istream& operator>>(basic_istream&, charT&);\n\ntemplate\n basic_istream& operator>>(basic_istream&, unsigned char&);\n\ntemplate\n basic_istream& operator>>(basic_istream&, signed char&);\n\ntemplate\n basic_istream& operator>>(basic_istream&, charT*);\n\ntemplate\n basic_istream& operator>>(basic_istream&, unsigned char*);\n\ntemplate\n basic_istream& operator>>(basic_istream&, signed char*);\n\ntemplate \n void\n swap(basic_istream& x, basic_istream& y);\n\ntypedef basic_istream istream;\ntypedef basic_istream wistream;\n\ntemplate >\nclass basic_iostream :\n public basic_istream,\n public basic_ostream\n{\npublic:\n // types:\n typedef charT char_type;\n typedef traits traits_type;\n typedef typename traits_type::int_type int_type;\n typedef typename traits_type::pos_type pos_type;\n typedef typename traits_type::off_type off_type;\n\n // constructor/destructor\n explicit basic_iostream(basic_streambuf* sb);\n basic_iostream(basic_iostream&& rhs);\n virtual ~basic_iostream();\n\n // assign/swap\n basic_iostream& operator=(basic_iostream&& rhs);\n void swap(basic_iostream& rhs);\n};\n\ntemplate \n void\n swap(basic_iostream& x, basic_iostream& y);\n\ntypedef basic_iostream iostream;\ntypedef basic_iostream wiostream;\n\ntemplate \n basic_istream&\n ws(basic_istream& is);\n\ntemplate \n basic_istream&\n operator>>(basic_istream&& is, T& x);\n\n} // std\n\n*/\n\n#include <__config>\n#include \n\n#include <__undef_min_max>\n\n#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)\n#pragma GCC system_header\n#endif\n\n_LIBCPP_BEGIN_NAMESPACE_STD\n\ntemplate \nclass _LIBCPP_TEMPLATE_VIS basic_istream\n : virtual public basic_ios<_CharT, _Traits>\n{\n streamsize __gc_;\npublic:\n // types (inherited from basic_ios (27.5.4)):\n typedef _CharT char_type;\n typedef _Traits traits_type;\n typedef typename traits_type::int_type int_type;\n typedef typename traits_type::pos_type pos_type;\n typedef typename traits_type::off_type off_type;\n\n // 27.7.1.1.1 Constructor/destructor:\n inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY\n explicit basic_istream(basic_streambuf* __sb) : __gc_(0)\n { this->init(__sb); }\n virtual ~basic_istream();\nprotected:\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n inline _LIBCPP_INLINE_VISIBILITY\n basic_istream(basic_istream&& __rhs);\n#endif\n // 27.7.1.1.2 Assign/swap:\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n inline _LIBCPP_INLINE_VISIBILITY\n basic_istream& operator=(basic_istream&& __rhs);\n#endif\n\n inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY\n void swap(basic_istream& __rhs) {\n _VSTD::swap(__gc_, __rhs.__gc_);\n basic_ios::swap(__rhs);\n }\n\n#ifndef _LIBCPP_CXX03_LANG\n basic_istream (const basic_istream& __rhs) = delete;\n basic_istream& operator=(const basic_istream& __rhs) = delete;\n#endif\npublic:\n\n // 27.7.1.1.3 Prefix/suffix:\n class _LIBCPP_TEMPLATE_VIS sentry;\n\n // 27.7.1.2 Formatted input:\n inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY\n basic_istream& operator>>(basic_istream& (*__pf)(basic_istream&))\n { return __pf(*this); }\n\n inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY\n basic_istream& operator>>(basic_ios&\n (*__pf)(basic_ios&))\n { __pf(*this); return *this; }\n\n inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY\n basic_istream& operator>>(ios_base& (*__pf)(ios_base&))\n { __pf(*this); return *this; }\n\n basic_istream& operator>>(basic_streambuf* __sb);\n basic_istream& operator>>(bool& __n);\n basic_istream& operator>>(short& __n);\n basic_istream& operator>>(unsigned short& __n);\n basic_istream& operator>>(int& __n);\n basic_istream& operator>>(unsigned int& __n);\n basic_istream& operator>>(long& __n);\n basic_istream& operator>>(unsigned long& __n);\n basic_istream& operator>>(long long& __n);\n basic_istream& operator>>(unsigned long long& __n);\n basic_istream& operator>>(float& __f);\n basic_istream& operator>>(double& __f);\n basic_istream& operator>>(long double& __f);\n basic_istream& operator>>(void*& __p);\n\n // 27.7.1.3 Unformatted input:\n _LIBCPP_INLINE_VISIBILITY\n streamsize gcount() const {return __gc_;}\n int_type get();\n\n inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY\n basic_istream& get(char_type& __c) {\n int_type __ch = get();\n if (__ch != traits_type::eof())\n __c = traits_type::to_char_type(__ch);\n return *this;\n }\n\n inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY\n basic_istream& get(char_type* __s, streamsize __n)\n { return get(__s, __n, this->widen('\\n')); }\n\n basic_istream& get(char_type* __s, streamsize __n, char_type __dlm);\n\n inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY\n basic_istream& get(basic_streambuf& __sb)\n { return get(__sb, this->widen('\\n')); }\n\n basic_istream& get(basic_streambuf& __sb, char_type __dlm);\n\n inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY\n basic_istream& getline(char_type* __s, streamsize __n)\n { return getline(__s, __n, this->widen('\\n')); }\n\n basic_istream& getline(char_type* __s, streamsize __n, char_type __dlm);\n\n basic_istream& ignore(streamsize __n = 1, int_type __dlm = traits_type::eof());\n int_type peek();\n basic_istream& read (char_type* __s, streamsize __n);\n streamsize readsome(char_type* __s, streamsize __n);\n\n basic_istream& putback(char_type __c);\n basic_istream& unget();\n int sync();\n\n pos_type tellg();\n basic_istream& seekg(pos_type __pos);\n basic_istream& seekg(off_type __off, ios_base::seekdir __dir);\n};\n\ntemplate \nclass _LIBCPP_TEMPLATE_VIS basic_istream<_CharT, _Traits>::sentry\n{\n bool __ok_;\n\n sentry(const sentry&); // = delete;\n sentry& operator=(const sentry&); // = delete;\n\npublic:\n explicit sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false);\n// ~sentry() = default;\n\n _LIBCPP_INLINE_VISIBILITY\n _LIBCPP_EXPLICIT\n operator bool() const {return __ok_;}\n};\n\ntemplate \nbasic_istream<_CharT, _Traits>::sentry::sentry(basic_istream<_CharT, _Traits>& __is,\n bool __noskipws)\n : __ok_(false)\n{\n if (__is.good())\n {\n if (__is.tie())\n __is.tie()->flush();\n if (!__noskipws && (__is.flags() & ios_base::skipws))\n {\n typedef istreambuf_iterator<_CharT, _Traits> _Ip;\n const ctype<_CharT>& __ct = use_facet >(__is.getloc());\n _Ip __i(__is);\n _Ip __eof;\n for (; __i != __eof; ++__i)\n if (!__ct.is(__ct.space, *__i))\n break;\n if (__i == __eof)\n __is.setstate(ios_base::failbit | ios_base::eofbit);\n }\n __ok_ = __is.good();\n }\n else\n __is.setstate(ios_base::failbit);\n}\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \nbasic_istream<_CharT, _Traits>::basic_istream(basic_istream&& __rhs)\n : __gc_(__rhs.__gc_)\n{\n __rhs.__gc_ = 0;\n this->move(__rhs);\n}\n\ntemplate \nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::operator=(basic_istream&& __rhs)\n{\n swap(__rhs);\n return *this;\n}\n\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \nbasic_istream<_CharT, _Traits>::~basic_istream()\n{\n}\n\ntemplate \nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::operator>>(unsigned short& __n)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __s(*this);\n if (__s)\n {\n typedef istreambuf_iterator _Ip;\n typedef num_get _Fp;\n ios_base::iostate __err = ios_base::goodbit;\n use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);\n this->setstate(__err);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate \nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::operator>>(unsigned int& __n)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __s(*this);\n if (__s)\n {\n typedef istreambuf_iterator _Ip;\n typedef num_get _Fp;\n ios_base::iostate __err = ios_base::goodbit;\n use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);\n this->setstate(__err);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate \nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::operator>>(long& __n)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __s(*this);\n if (__s)\n {\n typedef istreambuf_iterator _Ip;\n typedef num_get _Fp;\n ios_base::iostate __err = ios_base::goodbit;\n use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);\n this->setstate(__err);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate \nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::operator>>(unsigned long& __n)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __s(*this);\n if (__s)\n {\n typedef istreambuf_iterator _Ip;\n typedef num_get _Fp;\n ios_base::iostate __err = ios_base::goodbit;\n use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);\n this->setstate(__err);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate \nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::operator>>(long long& __n)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __s(*this);\n if (__s)\n {\n typedef istreambuf_iterator _Ip;\n typedef num_get _Fp;\n ios_base::iostate __err = ios_base::goodbit;\n use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);\n this->setstate(__err);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate \nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::operator>>(unsigned long long& __n)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __s(*this);\n if (__s)\n {\n typedef istreambuf_iterator _Ip;\n typedef num_get _Fp;\n ios_base::iostate __err = ios_base::goodbit;\n use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);\n this->setstate(__err);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate \nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::operator>>(float& __n)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __s(*this);\n if (__s)\n {\n typedef istreambuf_iterator _Ip;\n typedef num_get _Fp;\n ios_base::iostate __err = ios_base::goodbit;\n use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);\n this->setstate(__err);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate \nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::operator>>(double& __n)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __s(*this);\n if (__s)\n {\n typedef istreambuf_iterator _Ip;\n typedef num_get _Fp;\n ios_base::iostate __err = ios_base::goodbit;\n use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);\n this->setstate(__err);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate \nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::operator>>(long double& __n)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __s(*this);\n if (__s)\n {\n typedef istreambuf_iterator _Ip;\n typedef num_get _Fp;\n ios_base::iostate __err = ios_base::goodbit;\n use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);\n this->setstate(__err);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate \nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::operator>>(bool& __n)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __s(*this);\n if (__s)\n {\n typedef istreambuf_iterator _Ip;\n typedef num_get _Fp;\n ios_base::iostate __err = ios_base::goodbit;\n use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);\n this->setstate(__err);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate \nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::operator>>(void*& __n)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __s(*this);\n if (__s)\n {\n typedef istreambuf_iterator _Ip;\n typedef num_get _Fp;\n ios_base::iostate __err = ios_base::goodbit;\n use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __n);\n this->setstate(__err);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate \nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::operator>>(short& __n)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __s(*this);\n if (__s)\n {\n typedef istreambuf_iterator _Ip;\n typedef num_get _Fp;\n ios_base::iostate __err = ios_base::goodbit;\n long __temp;\n use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __temp);\n if (__temp < numeric_limits::min())\n {\n __err |= ios_base::failbit;\n __n = numeric_limits::min();\n }\n else if (__temp > numeric_limits::max())\n {\n __err |= ios_base::failbit;\n __n = numeric_limits::max();\n }\n else\n __n = static_cast(__temp);\n this->setstate(__err);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate \nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::operator>>(int& __n)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __s(*this);\n if (__s)\n {\n typedef istreambuf_iterator _Ip;\n typedef num_get _Fp;\n ios_base::iostate __err = ios_base::goodbit;\n long __temp;\n use_facet<_Fp>(this->getloc()).get(_Ip(*this), _Ip(), *this, __err, __temp);\n if (__temp < numeric_limits::min())\n {\n __err |= ios_base::failbit;\n __n = numeric_limits::min();\n }\n else if (__temp > numeric_limits::max())\n {\n __err |= ios_base::failbit;\n __n = numeric_limits::max();\n }\n else\n __n = static_cast(__temp);\n this->setstate(__err);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate\nbasic_istream<_CharT, _Traits>&\noperator>>(basic_istream<_CharT, _Traits>& __is, _CharT* __s)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n typename basic_istream<_CharT, _Traits>::sentry __sen(__is);\n if (__sen)\n {\n streamsize __n = __is.width();\n if (__n <= 0)\n __n = numeric_limits::max() / sizeof(_CharT) - 1;\n streamsize __c = 0;\n const ctype<_CharT>& __ct = use_facet >(__is.getloc());\n ios_base::iostate __err = ios_base::goodbit;\n while (__c < __n-1)\n {\n typename _Traits::int_type __i = __is.rdbuf()->sgetc();\n if (_Traits::eq_int_type(__i, _Traits::eof()))\n {\n __err |= ios_base::eofbit;\n break;\n }\n _CharT __ch = _Traits::to_char_type(__i);\n if (__ct.is(__ct.space, __ch))\n break;\n *__s++ = __ch;\n ++__c;\n __is.rdbuf()->sbumpc();\n }\n *__s = _CharT();\n __is.width(0);\n if (__c == 0)\n __err |= ios_base::failbit;\n __is.setstate(__err);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n __is.__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return __is;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbasic_istream&\noperator>>(basic_istream& __is, unsigned char* __s)\n{\n return __is >> (char*)__s;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbasic_istream&\noperator>>(basic_istream& __is, signed char* __s)\n{\n return __is >> (char*)__s;\n}\n\ntemplate\nbasic_istream<_CharT, _Traits>&\noperator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n typename basic_istream<_CharT, _Traits>::sentry __sen(__is);\n if (__sen)\n {\n typename _Traits::int_type __i = __is.rdbuf()->sbumpc();\n if (_Traits::eq_int_type(__i, _Traits::eof()))\n __is.setstate(ios_base::eofbit | ios_base::failbit);\n else\n __c = _Traits::to_char_type(__i);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n __is.__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return __is;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbasic_istream&\noperator>>(basic_istream& __is, unsigned char& __c)\n{\n return __is >> (char&)__c;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbasic_istream&\noperator>>(basic_istream& __is, signed char& __c)\n{\n return __is >> (char&)__c;\n}\n\ntemplate\nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::operator>>(basic_streambuf* __sb)\n{\n __gc_ = 0;\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __s(*this, true);\n if (__s)\n {\n if (__sb)\n {\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n ios_base::iostate __err = ios_base::goodbit;\n while (true)\n {\n typename traits_type::int_type __i = this->rdbuf()->sgetc();\n if (traits_type::eq_int_type(__i, _Traits::eof()))\n {\n __err |= ios_base::eofbit;\n break;\n }\n if (traits_type::eq_int_type(\n __sb->sputc(traits_type::to_char_type(__i)),\n traits_type::eof()))\n break;\n ++__gc_;\n this->rdbuf()->sbumpc();\n }\n if (__gc_ == 0)\n __err |= ios_base::failbit;\n this->setstate(__err);\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n if (__gc_ == 0)\n this->__set_failbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n }\n else\n this->setstate(ios_base::failbit);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate\ntypename basic_istream<_CharT, _Traits>::int_type\nbasic_istream<_CharT, _Traits>::get()\n{\n __gc_ = 0;\n int_type __r = traits_type::eof();\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __s(*this, true);\n if (__s)\n {\n __r = this->rdbuf()->sbumpc();\n if (traits_type::eq_int_type(__r, traits_type::eof()))\n this->setstate(ios_base::failbit | ios_base::eofbit);\n else\n __gc_ = 1;\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return __r;\n}\n\ntemplate\nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::get(char_type* __s, streamsize __n, char_type __dlm)\n{\n __gc_ = 0;\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __sen(*this, true);\n if (__sen)\n {\n if (__n > 0)\n {\n ios_base::iostate __err = ios_base::goodbit;\n while (__gc_ < __n-1)\n {\n int_type __i = this->rdbuf()->sgetc();\n if (traits_type::eq_int_type(__i, traits_type::eof()))\n {\n __err |= ios_base::eofbit;\n break;\n }\n char_type __ch = traits_type::to_char_type(__i);\n if (traits_type::eq(__ch, __dlm))\n break;\n *__s++ = __ch;\n ++__gc_;\n this->rdbuf()->sbumpc();\n }\n *__s = char_type();\n if (__gc_ == 0)\n __err |= ios_base::failbit;\n this->setstate(__err);\n }\n else\n this->setstate(ios_base::failbit);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate\nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::get(basic_streambuf& __sb,\n char_type __dlm)\n{\n __gc_ = 0;\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __sen(*this, true);\n if (__sen)\n {\n ios_base::iostate __err = ios_base::goodbit;\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n while (true)\n {\n typename traits_type::int_type __i = this->rdbuf()->sgetc();\n if (traits_type::eq_int_type(__i, traits_type::eof()))\n {\n __err |= ios_base::eofbit;\n break;\n }\n char_type __ch = traits_type::to_char_type(__i);\n if (traits_type::eq(__ch, __dlm))\n break;\n if (traits_type::eq_int_type(__sb.sputc(__ch), traits_type::eof()))\n break;\n ++__gc_;\n this->rdbuf()->sbumpc();\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n if (__gc_ == 0)\n __err |= ios_base::failbit;\n this->setstate(__err);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate\nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_type __dlm)\n{\n __gc_ = 0;\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __sen(*this, true);\n if (__sen)\n {\n ios_base::iostate __err = ios_base::goodbit;\n while (true)\n {\n typename traits_type::int_type __i = this->rdbuf()->sgetc();\n if (traits_type::eq_int_type(__i, traits_type::eof()))\n {\n __err |= ios_base::eofbit;\n break;\n }\n char_type __ch = traits_type::to_char_type(__i);\n if (traits_type::eq(__ch, __dlm))\n {\n this->rdbuf()->sbumpc();\n ++__gc_;\n break;\n }\n if (__gc_ >= __n-1)\n {\n __err |= ios_base::failbit;\n break;\n }\n *__s++ = __ch;\n this->rdbuf()->sbumpc();\n ++__gc_;\n }\n if (__n > 0)\n *__s = char_type();\n if (__gc_ == 0)\n __err |= ios_base::failbit;\n this->setstate(__err);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate\nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __dlm)\n{\n __gc_ = 0;\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __sen(*this, true);\n if (__sen)\n {\n ios_base::iostate __err = ios_base::goodbit;\n if (__n == numeric_limits::max())\n {\n while (true)\n {\n typename traits_type::int_type __i = this->rdbuf()->sbumpc();\n if (traits_type::eq_int_type(__i, traits_type::eof()))\n {\n __err |= ios_base::eofbit;\n break;\n }\n ++__gc_;\n if (traits_type::eq_int_type(__i, __dlm))\n break;\n }\n }\n else\n {\n while (__gc_ < __n)\n {\n typename traits_type::int_type __i = this->rdbuf()->sbumpc();\n if (traits_type::eq_int_type(__i, traits_type::eof()))\n {\n __err |= ios_base::eofbit;\n break;\n }\n ++__gc_;\n if (traits_type::eq_int_type(__i, __dlm))\n break;\n }\n }\n this->setstate(__err);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate\ntypename basic_istream<_CharT, _Traits>::int_type\nbasic_istream<_CharT, _Traits>::peek()\n{\n __gc_ = 0;\n int_type __r = traits_type::eof();\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __sen(*this, true);\n if (__sen)\n {\n __r = this->rdbuf()->sgetc();\n if (traits_type::eq_int_type(__r, traits_type::eof()))\n this->setstate(ios_base::eofbit);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return __r;\n}\n\ntemplate\nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::read(char_type* __s, streamsize __n)\n{\n __gc_ = 0;\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __sen(*this, true);\n if (__sen)\n {\n __gc_ = this->rdbuf()->sgetn(__s, __n);\n if (__gc_ != __n)\n this->setstate(ios_base::failbit | ios_base::eofbit);\n }\n else\n this->setstate(ios_base::failbit);\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate\nstreamsize\nbasic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n)\n{\n __gc_ = 0;\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __sen(*this, true);\n if (__sen)\n {\n streamsize __c = this->rdbuf()->in_avail();\n switch (__c)\n {\n case -1:\n this->setstate(ios_base::eofbit);\n break;\n case 0:\n break;\n default:\n read(__s, _VSTD::min(__c, __n));\n break;\n }\n }\n else\n this->setstate(ios_base::failbit);\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return __gc_;\n}\n\ntemplate\nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::putback(char_type __c)\n{\n __gc_ = 0;\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n this->clear(this->rdstate() & ~ios_base::eofbit);\n sentry __sen(*this, true);\n if (__sen)\n {\n if (this->rdbuf() == 0 || this->rdbuf()->sputbackc(__c) == traits_type::eof())\n this->setstate(ios_base::badbit);\n }\n else\n this->setstate(ios_base::failbit);\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate\nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::unget()\n{\n __gc_ = 0;\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n this->clear(this->rdstate() & ~ios_base::eofbit);\n sentry __sen(*this, true);\n if (__sen)\n {\n if (this->rdbuf() == 0 || this->rdbuf()->sungetc() == traits_type::eof())\n this->setstate(ios_base::badbit);\n }\n else\n this->setstate(ios_base::failbit);\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate\nint\nbasic_istream<_CharT, _Traits>::sync()\n{\n int __r = 0;\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __sen(*this, true);\n if (__sen)\n {\n if (this->rdbuf() == 0)\n return -1;\n if (this->rdbuf()->pubsync() == -1)\n {\n this->setstate(ios_base::badbit);\n return -1;\n }\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return __r;\n}\n\ntemplate\ntypename basic_istream<_CharT, _Traits>::pos_type\nbasic_istream<_CharT, _Traits>::tellg()\n{\n pos_type __r(-1);\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n sentry __sen(*this, true);\n if (__sen)\n __r = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in);\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return __r;\n}\n\ntemplate\nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::seekg(pos_type __pos)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n this->clear(this->rdstate() & ~ios_base::eofbit);\n sentry __sen(*this, true);\n if (__sen)\n {\n if (this->rdbuf()->pubseekpos(__pos, ios_base::in) == pos_type(-1))\n this->setstate(ios_base::failbit);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate\nbasic_istream<_CharT, _Traits>&\nbasic_istream<_CharT, _Traits>::seekg(off_type __off, ios_base::seekdir __dir)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n this->clear(this->rdstate() & ~ios_base::eofbit);\n sentry __sen(*this, true);\n if (__sen)\n {\n if (this->rdbuf()->pubseekoff(__off, __dir, ios_base::in) == pos_type(-1))\n this->setstate(ios_base::failbit);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n this->__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return *this;\n}\n\ntemplate \nbasic_istream<_CharT, _Traits>&\nws(basic_istream<_CharT, _Traits>& __is)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n typename basic_istream<_CharT, _Traits>::sentry __sen(__is, true);\n if (__sen)\n {\n const ctype<_CharT>& __ct = use_facet >(__is.getloc());\n while (true)\n {\n typename _Traits::int_type __i = __is.rdbuf()->sgetc();\n if (_Traits::eq_int_type(__i, _Traits::eof()))\n {\n __is.setstate(ios_base::eofbit);\n break;\n }\n if (!__ct.is(__ct.space, _Traits::to_char_type(__i)))\n break;\n __is.rdbuf()->sbumpc();\n }\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n __is.__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return __is;\n}\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbasic_istream<_CharT, _Traits>&\noperator>>(basic_istream<_CharT, _Traits>&& __is, _Tp&& __x)\n{\n __is >> _VSTD::forward<_Tp>(__x);\n return __is;\n}\n\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \nclass _LIBCPP_TEMPLATE_VIS basic_iostream\n : public basic_istream<_CharT, _Traits>,\n public basic_ostream<_CharT, _Traits>\n{\npublic:\n // types:\n typedef _CharT char_type;\n typedef _Traits traits_type;\n typedef typename traits_type::int_type int_type;\n typedef typename traits_type::pos_type pos_type;\n typedef typename traits_type::off_type off_type;\n\n // constructor/destructor\n inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY\n explicit basic_iostream(basic_streambuf* __sb)\n : basic_istream<_CharT, _Traits>(__sb)\n {}\n\n virtual ~basic_iostream();\nprotected:\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n inline _LIBCPP_INLINE_VISIBILITY\n basic_iostream(basic_iostream&& __rhs);\n#endif\n\n // assign/swap\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n inline _LIBCPP_INLINE_VISIBILITY\n basic_iostream& operator=(basic_iostream&& __rhs);\n#endif\n inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY\n void swap(basic_iostream& __rhs)\n { basic_istream::swap(__rhs); }\npublic:\n};\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \nbasic_iostream<_CharT, _Traits>::basic_iostream(basic_iostream&& __rhs)\n : basic_istream<_CharT, _Traits>(_VSTD::move(__rhs))\n{\n}\n\ntemplate \nbasic_iostream<_CharT, _Traits>&\nbasic_iostream<_CharT, _Traits>::operator=(basic_iostream&& __rhs)\n{\n swap(__rhs);\n return *this;\n}\n\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \nbasic_iostream<_CharT, _Traits>::~basic_iostream()\n{\n}\n\ntemplate\nbasic_istream<_CharT, _Traits>&\noperator>>(basic_istream<_CharT, _Traits>& __is,\n basic_string<_CharT, _Traits, _Allocator>& __str)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n typename basic_istream<_CharT, _Traits>::sentry __sen(__is);\n if (__sen)\n {\n __str.clear();\n streamsize __n = __is.width();\n if (__n <= 0)\n __n = __str.max_size();\n if (__n <= 0)\n __n = numeric_limits::max();\n streamsize __c = 0;\n const ctype<_CharT>& __ct = use_facet >(__is.getloc());\n ios_base::iostate __err = ios_base::goodbit;\n while (__c < __n)\n {\n typename _Traits::int_type __i = __is.rdbuf()->sgetc();\n if (_Traits::eq_int_type(__i, _Traits::eof()))\n {\n __err |= ios_base::eofbit;\n break;\n }\n _CharT __ch = _Traits::to_char_type(__i);\n if (__ct.is(__ct.space, __ch))\n break;\n __str.push_back(__ch);\n ++__c;\n __is.rdbuf()->sbumpc();\n }\n __is.width(0);\n if (__c == 0)\n __err |= ios_base::failbit;\n __is.setstate(__err);\n }\n else\n __is.setstate(ios_base::failbit);\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n __is.__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return __is;\n}\n\ntemplate\nbasic_istream<_CharT, _Traits>&\ngetline(basic_istream<_CharT, _Traits>& __is,\n basic_string<_CharT, _Traits, _Allocator>& __str, _CharT __dlm)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n typename basic_istream<_CharT, _Traits>::sentry __sen(__is, true);\n if (__sen)\n {\n __str.clear();\n ios_base::iostate __err = ios_base::goodbit;\n streamsize __extr = 0;\n while (true)\n {\n typename _Traits::int_type __i = __is.rdbuf()->sbumpc();\n if (_Traits::eq_int_type(__i, _Traits::eof()))\n {\n __err |= ios_base::eofbit;\n break;\n }\n ++__extr;\n _CharT __ch = _Traits::to_char_type(__i);\n if (_Traits::eq(__ch, __dlm))\n break;\n __str.push_back(__ch);\n if (__str.size() == __str.max_size())\n {\n __err |= ios_base::failbit;\n break;\n }\n }\n if (__extr == 0)\n __err |= ios_base::failbit;\n __is.setstate(__err);\n }\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n __is.__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return __is;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbasic_istream<_CharT, _Traits>&\ngetline(basic_istream<_CharT, _Traits>& __is,\n basic_string<_CharT, _Traits, _Allocator>& __str)\n{\n return getline(__is, __str, __is.widen('\\n'));\n}\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbasic_istream<_CharT, _Traits>&\ngetline(basic_istream<_CharT, _Traits>&& __is,\n basic_string<_CharT, _Traits, _Allocator>& __str, _CharT __dlm)\n{\n return getline(__is, __str, __dlm);\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbasic_istream<_CharT, _Traits>&\ngetline(basic_istream<_CharT, _Traits>&& __is,\n basic_string<_CharT, _Traits, _Allocator>& __str)\n{\n return getline(__is, __str, __is.widen('\\n'));\n}\n\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \nbasic_istream<_CharT, _Traits>&\noperator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n typename basic_istream<_CharT, _Traits>::sentry __sen(__is);\n if (__sen)\n {\n basic_string<_CharT, _Traits> __str;\n const ctype<_CharT>& __ct = use_facet >(__is.getloc());\n size_t __c = 0;\n ios_base::iostate __err = ios_base::goodbit;\n _CharT __zero = __ct.widen('0');\n _CharT __one = __ct.widen('1');\n while (__c < _Size)\n {\n typename _Traits::int_type __i = __is.rdbuf()->sgetc();\n if (_Traits::eq_int_type(__i, _Traits::eof()))\n {\n __err |= ios_base::eofbit;\n break;\n }\n _CharT __ch = _Traits::to_char_type(__i);\n if (!_Traits::eq(__ch, __zero) && !_Traits::eq(__ch, __one))\n break;\n __str.push_back(__ch);\n ++__c;\n __is.rdbuf()->sbumpc();\n }\n __x = bitset<_Size>(__str);\n if (__c == 0)\n __err |= ios_base::failbit;\n __is.setstate(__err);\n }\n else\n __is.setstate(ios_base::failbit);\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n __is.__set_badbit_and_consider_rethrow();\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n return __is;\n}\n\n_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream)\n_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream)\n_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream)\n\n_LIBCPP_END_NAMESPACE_STD\n\n#endif // _LIBCPP_ISTREAM\n","// -*- C++ -*-\n//===--------------------------- __nullptr --------------------------------===//\n//\n// The LLVM Compiler Infrastructure\n//\n// This file is dual licensed under the MIT and the University of Illinois Open\n// Source Licenses. See LICENSE.TXT for details.\n//\n//===----------------------------------------------------------------------===//\n\n#ifndef _LIBCPP_NULLPTR\n#define _LIBCPP_NULLPTR\n\n#include <__config>\n\n#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)\n#pragma GCC system_header\n#endif\n\n#ifdef _LIBCPP_HAS_NO_NULLPTR\n\n_LIBCPP_BEGIN_NAMESPACE_STD\n\nstruct _LIBCPP_TEMPLATE_VIS nullptr_t\n{\n void* __lx;\n\n struct __nat {int __for_bool_;};\n\n _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t() : __lx(0) {}\n _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t(int __nat::*) : __lx(0) {}\n\n _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR operator int __nat::*() const {return 0;}\n\n template \n _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR\n operator _Tp* () const {return 0;}\n\n template \n _LIBCPP_ALWAYS_INLINE\n operator _Tp _Up::* () const {return 0;}\n\n friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator==(nullptr_t, nullptr_t) {return true;}\n friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator!=(nullptr_t, nullptr_t) {return false;}\n};\n\ninline _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t __get_nullptr_t() {return nullptr_t(0);}\n\n#define nullptr _VSTD::__get_nullptr_t()\n\n_LIBCPP_END_NAMESPACE_STD\n\n#else // _LIBCPP_HAS_NO_NULLPTR\n\nnamespace std\n{\n typedef decltype(nullptr) nullptr_t;\n}\n\n#endif // _LIBCPP_HAS_NO_NULLPTR\n\n#endif // _LIBCPP_NULLPTR\n","// -*- C++ -*-\n//===--------------------------- iosfwd -----------------------------------===//\n//\n// The LLVM Compiler Infrastructure\n//\n// This file is dual licensed under the MIT and the University of Illinois Open\n// Source Licenses. See LICENSE.TXT for details.\n//\n//===----------------------------------------------------------------------===//\n\n#ifndef _LIBCPP_IOSFWD\n#define _LIBCPP_IOSFWD\n\n/*\n iosfwd synopsis\n\nnamespace std\n{\n\ntemplate struct char_traits;\ntemplate class allocator;\n\nclass ios_base;\ntemplate > class basic_ios;\n\ntemplate > class basic_streambuf;\ntemplate > class basic_istream;\ntemplate > class basic_ostream;\ntemplate > class basic_iostream;\n\ntemplate , class Allocator = allocator >\n class basic_stringbuf;\ntemplate , class Allocator = allocator >\n class basic_istringstream;\ntemplate , class Allocator = allocator >\n class basic_ostringstream;\ntemplate , class Allocator = allocator >\n class basic_stringstream;\n\ntemplate > class basic_filebuf;\ntemplate > class basic_ifstream;\ntemplate > class basic_ofstream;\ntemplate > class basic_fstream;\n\ntemplate > class istreambuf_iterator;\ntemplate > class ostreambuf_iterator;\n\ntypedef basic_ios ios;\ntypedef basic_ios wios;\n\ntypedef basic_streambuf streambuf;\ntypedef basic_istream istream;\ntypedef basic_ostream ostream;\ntypedef basic_iostream iostream;\n\ntypedef basic_stringbuf stringbuf;\ntypedef basic_istringstream istringstream;\ntypedef basic_ostringstream ostringstream;\ntypedef basic_stringstream stringstream;\n\ntypedef basic_filebuf filebuf;\ntypedef basic_ifstream ifstream;\ntypedef basic_ofstream ofstream;\ntypedef basic_fstream fstream;\n\ntypedef basic_streambuf wstreambuf;\ntypedef basic_istream wistream;\ntypedef basic_ostream wostream;\ntypedef basic_iostream wiostream;\n\ntypedef basic_stringbuf wstringbuf;\ntypedef basic_istringstream wistringstream;\ntypedef basic_ostringstream wostringstream;\ntypedef basic_stringstream wstringstream;\n\ntypedef basic_filebuf wfilebuf;\ntypedef basic_ifstream wifstream;\ntypedef basic_ofstream wofstream;\ntypedef basic_fstream wfstream;\n\ntemplate class fpos;\ntypedef fpos::state_type> streampos;\ntypedef fpos::state_type> wstreampos;\n\n} // std\n\n*/\n\n#include <__config>\n#include // for mbstate_t\n\n#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)\n#pragma GCC system_header\n#endif\n\n_LIBCPP_BEGIN_NAMESPACE_STD\n\nclass _LIBCPP_TYPE_VIS ios_base;\n\ntemplate struct _LIBCPP_TEMPLATE_VIS char_traits;\ntemplate class _LIBCPP_TEMPLATE_VIS allocator;\n\ntemplate >\n class _LIBCPP_TEMPLATE_VIS basic_ios;\n\ntemplate >\n class _LIBCPP_TEMPLATE_VIS basic_streambuf;\ntemplate >\n class _LIBCPP_TEMPLATE_VIS basic_istream;\ntemplate >\n class _LIBCPP_TEMPLATE_VIS basic_ostream;\ntemplate >\n class _LIBCPP_TEMPLATE_VIS basic_iostream;\n\ntemplate ,\n class _Allocator = allocator<_CharT> >\n class _LIBCPP_TEMPLATE_VIS basic_stringbuf;\ntemplate ,\n class _Allocator = allocator<_CharT> >\n class _LIBCPP_TEMPLATE_VIS basic_istringstream;\ntemplate ,\n class _Allocator = allocator<_CharT> >\n class _LIBCPP_TEMPLATE_VIS basic_ostringstream;\ntemplate ,\n class _Allocator = allocator<_CharT> >\n class _LIBCPP_TEMPLATE_VIS basic_stringstream;\n\ntemplate >\n class _LIBCPP_TEMPLATE_VIS basic_filebuf;\ntemplate >\n class _LIBCPP_TEMPLATE_VIS basic_ifstream;\ntemplate >\n class _LIBCPP_TEMPLATE_VIS basic_ofstream;\ntemplate >\n class _LIBCPP_TEMPLATE_VIS basic_fstream;\n\ntemplate >\n class _LIBCPP_TEMPLATE_VIS istreambuf_iterator;\ntemplate >\n class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator;\n\ntypedef basic_ios ios;\ntypedef basic_ios wios;\n\ntypedef basic_streambuf streambuf;\ntypedef basic_istream istream;\ntypedef basic_ostream ostream;\ntypedef basic_iostream iostream;\n\ntypedef basic_stringbuf stringbuf;\ntypedef basic_istringstream istringstream;\ntypedef basic_ostringstream ostringstream;\ntypedef basic_stringstream stringstream;\n\ntypedef basic_filebuf filebuf;\ntypedef basic_ifstream ifstream;\ntypedef basic_ofstream ofstream;\ntypedef basic_fstream fstream;\n\ntypedef basic_streambuf wstreambuf;\ntypedef basic_istream wistream;\ntypedef basic_ostream wostream;\ntypedef basic_iostream wiostream;\n\ntypedef basic_stringbuf wstringbuf;\ntypedef basic_istringstream wistringstream;\ntypedef basic_ostringstream wostringstream;\ntypedef basic_stringstream wstringstream;\n\ntypedef basic_filebuf wfilebuf;\ntypedef basic_ifstream wifstream;\ntypedef basic_ofstream wofstream;\ntypedef basic_fstream wfstream;\n\ntemplate class _LIBCPP_TEMPLATE_VIS fpos;\ntypedef fpos streampos;\ntypedef fpos wstreampos;\n#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS\ntypedef fpos u16streampos;\ntypedef fpos u32streampos;\n#endif // _LIBCPP_HAS_NO_UNICODE_CHARS\n\n#if defined(_NEWLIB_VERSION)\n// On newlib, off_t is 'long int'\ntypedef long int streamoff; // for char_traits in \n#else\ntypedef long long streamoff; // for char_traits in \n#endif\n\ntemplate \n class _Traits = char_traits<_CharT>,\n class _Allocator = allocator<_CharT> >\n class _LIBCPP_TEMPLATE_VIS basic_string;\ntypedef basic_string, allocator > string;\ntypedef basic_string, allocator > wstring;\n\n\n// Include other forward declarations here\ntemplate >\nclass _LIBCPP_TEMPLATE_VIS vector;\n\n_LIBCPP_END_NAMESPACE_STD\n\n#endif // _LIBCPP_IOSFWD\n","// -*- C++ -*-\n//===------------------------------ vector --------------------------------===//\n//\n// The LLVM Compiler Infrastructure\n//\n// This file is dual licensed under the MIT and the University of Illinois Open\n// Source Licenses. See LICENSE.TXT for details.\n//\n//===----------------------------------------------------------------------===//\n\n#ifndef _LIBCPP_VECTOR\n#define _LIBCPP_VECTOR\n\n/*\n vector synopsis\n\nnamespace std\n{\n\ntemplate >\nclass vector\n{\npublic:\n typedef T value_type;\n typedef Allocator allocator_type;\n typedef typename allocator_type::reference reference;\n typedef typename allocator_type::const_reference const_reference;\n typedef implementation-defined iterator;\n typedef implementation-defined const_iterator;\n typedef typename allocator_type::size_type size_type;\n typedef typename allocator_type::difference_type difference_type;\n typedef typename allocator_type::pointer pointer;\n typedef typename allocator_type::const_pointer const_pointer;\n typedef std::reverse_iterator reverse_iterator;\n typedef std::reverse_iterator const_reverse_iterator;\n\n vector()\n noexcept(is_nothrow_default_constructible::value);\n explicit vector(const allocator_type&);\n explicit vector(size_type n);\n explicit vector(size_type n, const allocator_type&); // C++14\n vector(size_type n, const value_type& value, const allocator_type& = allocator_type());\n template \n vector(InputIterator first, InputIterator last, const allocator_type& = allocator_type());\n vector(const vector& x);\n vector(vector&& x)\n noexcept(is_nothrow_move_constructible::value);\n vector(initializer_list il);\n vector(initializer_list il, const allocator_type& a);\n ~vector();\n vector& operator=(const vector& x);\n vector& operator=(vector&& x)\n noexcept(\n allocator_type::propagate_on_container_move_assignment::value ||\n allocator_type::is_always_equal::value); // C++17\n vector& operator=(initializer_list il);\n template \n void assign(InputIterator first, InputIterator last);\n void assign(size_type n, const value_type& u);\n void assign(initializer_list il);\n\n allocator_type get_allocator() const noexcept;\n\n iterator begin() noexcept;\n const_iterator begin() const noexcept;\n iterator end() noexcept;\n const_iterator end() const noexcept;\n\n reverse_iterator rbegin() noexcept;\n const_reverse_iterator rbegin() const noexcept;\n reverse_iterator rend() noexcept;\n const_reverse_iterator rend() const noexcept;\n\n const_iterator cbegin() const noexcept;\n const_iterator cend() const noexcept;\n const_reverse_iterator crbegin() const noexcept;\n const_reverse_iterator crend() const noexcept;\n\n size_type size() const noexcept;\n size_type max_size() const noexcept;\n size_type capacity() const noexcept;\n bool empty() const noexcept;\n void reserve(size_type n);\n void shrink_to_fit() noexcept;\n\n reference operator[](size_type n);\n const_reference operator[](size_type n) const;\n reference at(size_type n);\n const_reference at(size_type n) const;\n\n reference front();\n const_reference front() const;\n reference back();\n const_reference back() const;\n\n value_type* data() noexcept;\n const value_type* data() const noexcept;\n\n void push_back(const value_type& x);\n void push_back(value_type&& x);\n template \n reference emplace_back(Args&&... args); // reference in C++17\n void pop_back();\n\n template iterator emplace(const_iterator position, Args&&... args);\n iterator insert(const_iterator position, const value_type& x);\n iterator insert(const_iterator position, value_type&& x);\n iterator insert(const_iterator position, size_type n, const value_type& x);\n template \n iterator insert(const_iterator position, InputIterator first, InputIterator last);\n iterator insert(const_iterator position, initializer_list il);\n\n iterator erase(const_iterator position);\n iterator erase(const_iterator first, const_iterator last);\n\n void clear() noexcept;\n\n void resize(size_type sz);\n void resize(size_type sz, const value_type& c);\n\n void swap(vector&)\n noexcept(allocator_traits::propagate_on_container_swap::value ||\n allocator_traits::is_always_equal::value); // C++17\n\n bool __invariants() const;\n};\n\ntemplate >\nclass vector\n{\npublic:\n typedef bool value_type;\n typedef Allocator allocator_type;\n typedef implementation-defined iterator;\n typedef implementation-defined const_iterator;\n typedef typename allocator_type::size_type size_type;\n typedef typename allocator_type::difference_type difference_type;\n typedef iterator pointer;\n typedef const_iterator const_pointer;\n typedef std::reverse_iterator reverse_iterator;\n typedef std::reverse_iterator const_reverse_iterator;\n\n class reference\n {\n public:\n reference(const reference&) noexcept;\n operator bool() const noexcept;\n reference& operator=(const bool x) noexcept;\n reference& operator=(const reference& x) noexcept;\n iterator operator&() const noexcept;\n void flip() noexcept;\n };\n\n class const_reference\n {\n public:\n const_reference(const reference&) noexcept;\n operator bool() const noexcept;\n const_iterator operator&() const noexcept;\n };\n\n vector()\n noexcept(is_nothrow_default_constructible::value);\n explicit vector(const allocator_type&);\n explicit vector(size_type n, const allocator_type& a = allocator_type()); // C++14\n vector(size_type n, const value_type& value, const allocator_type& = allocator_type());\n template \n vector(InputIterator first, InputIterator last, const allocator_type& = allocator_type());\n vector(const vector& x);\n vector(vector&& x)\n noexcept(is_nothrow_move_constructible::value);\n vector(initializer_list il);\n vector(initializer_list il, const allocator_type& a);\n ~vector();\n vector& operator=(const vector& x);\n vector& operator=(vector&& x)\n noexcept(\n allocator_type::propagate_on_container_move_assignment::value ||\n allocator_type::is_always_equal::value); // C++17\n vector& operator=(initializer_list il);\n template \n void assign(InputIterator first, InputIterator last);\n void assign(size_type n, const value_type& u);\n void assign(initializer_list il);\n\n allocator_type get_allocator() const noexcept;\n\n iterator begin() noexcept;\n const_iterator begin() const noexcept;\n iterator end() noexcept;\n const_iterator end() const noexcept;\n\n reverse_iterator rbegin() noexcept;\n const_reverse_iterator rbegin() const noexcept;\n reverse_iterator rend() noexcept;\n const_reverse_iterator rend() const noexcept;\n\n const_iterator cbegin() const noexcept;\n const_iterator cend() const noexcept;\n const_reverse_iterator crbegin() const noexcept;\n const_reverse_iterator crend() const noexcept;\n\n size_type size() const noexcept;\n size_type max_size() const noexcept;\n size_type capacity() const noexcept;\n bool empty() const noexcept;\n void reserve(size_type n);\n void shrink_to_fit() noexcept;\n\n reference operator[](size_type n);\n const_reference operator[](size_type n) const;\n reference at(size_type n);\n const_reference at(size_type n) const;\n\n reference front();\n const_reference front() const;\n reference back();\n const_reference back() const;\n\n void push_back(const value_type& x);\n template reference emplace_back(Args&&... args); // C++14; reference in C++17\n void pop_back();\n\n template iterator emplace(const_iterator position, Args&&... args); // C++14\n iterator insert(const_iterator position, const value_type& x);\n iterator insert(const_iterator position, size_type n, const value_type& x);\n template \n iterator insert(const_iterator position, InputIterator first, InputIterator last);\n iterator insert(const_iterator position, initializer_list il);\n\n iterator erase(const_iterator position);\n iterator erase(const_iterator first, const_iterator last);\n\n void clear() noexcept;\n\n void resize(size_type sz);\n void resize(size_type sz, value_type x);\n\n void swap(vector&)\n noexcept(allocator_traits::propagate_on_container_swap::value ||\n allocator_traits::is_always_equal::value); // C++17\n void flip() noexcept;\n\n bool __invariants() const;\n};\n\ntemplate struct hash>;\n\ntemplate bool operator==(const vector& x, const vector& y);\ntemplate bool operator< (const vector& x, const vector& y);\ntemplate bool operator!=(const vector& x, const vector& y);\ntemplate bool operator> (const vector& x, const vector& y);\ntemplate bool operator>=(const vector& x, const vector& y);\ntemplate bool operator<=(const vector& x, const vector& y);\n\ntemplate \nvoid swap(vector& x, vector& y)\n noexcept(noexcept(x.swap(y)));\n\n} // std\n\n*/\n\n#include <__config>\n#include // for forward declaration of vector\n#include <__bit_reference>\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include <__split_buffer>\n#include <__functional_base>\n\n#include <__undef_min_max>\n\n#include <__debug>\n\n#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)\n#pragma GCC system_header\n#endif\n\n_LIBCPP_BEGIN_NAMESPACE_STD\n\ntemplate \nclass __vector_base_common\n{\nprotected:\n _LIBCPP_ALWAYS_INLINE __vector_base_common() {}\n _LIBCPP_NORETURN void __throw_length_error() const;\n _LIBCPP_NORETURN void __throw_out_of_range() const;\n};\n\ntemplate \nvoid\n__vector_base_common<__b>::__throw_length_error() const\n{\n _VSTD::__throw_length_error(\"vector\");\n}\n\ntemplate \nvoid\n__vector_base_common<__b>::__throw_out_of_range() const\n{\n _VSTD::__throw_out_of_range(\"vector\");\n}\n\n#ifdef _LIBCPP_MSVC\n#pragma warning( push )\n#pragma warning( disable: 4231 )\n#endif // _LIBCPP_MSVC\n_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __vector_base_common)\n#ifdef _LIBCPP_MSVC\n#pragma warning( pop )\n#endif // _LIBCPP_MSVC\n\ntemplate \nclass __vector_base\n : protected __vector_base_common\n{\nprotected:\n typedef _Tp value_type;\n typedef _Allocator allocator_type;\n typedef allocator_traits __alloc_traits;\n typedef value_type& reference;\n typedef const value_type& const_reference;\n typedef typename __alloc_traits::size_type size_type;\n typedef typename __alloc_traits::difference_type difference_type;\n typedef typename __alloc_traits::pointer pointer;\n typedef typename __alloc_traits::const_pointer const_pointer;\n typedef pointer iterator;\n typedef const_pointer const_iterator;\n\n pointer __begin_;\n pointer __end_;\n __compressed_pair __end_cap_;\n\n _LIBCPP_INLINE_VISIBILITY\n allocator_type& __alloc() _NOEXCEPT\n {return __end_cap_.second();}\n _LIBCPP_INLINE_VISIBILITY\n const allocator_type& __alloc() const _NOEXCEPT\n {return __end_cap_.second();}\n _LIBCPP_INLINE_VISIBILITY\n pointer& __end_cap() _NOEXCEPT\n {return __end_cap_.first();}\n _LIBCPP_INLINE_VISIBILITY\n const pointer& __end_cap() const _NOEXCEPT\n {return __end_cap_.first();}\n\n _LIBCPP_INLINE_VISIBILITY\n __vector_base()\n _NOEXCEPT_(is_nothrow_default_constructible::value);\n _LIBCPP_INLINE_VISIBILITY __vector_base(const allocator_type& __a);\n ~__vector_base();\n\n _LIBCPP_INLINE_VISIBILITY\n void clear() _NOEXCEPT {__destruct_at_end(__begin_);}\n _LIBCPP_INLINE_VISIBILITY\n size_type capacity() const _NOEXCEPT\n {return static_cast(__end_cap() - __begin_);}\n\n _LIBCPP_INLINE_VISIBILITY\n void __destruct_at_end(pointer __new_last) _NOEXCEPT;\n\n _LIBCPP_INLINE_VISIBILITY\n void __copy_assign_alloc(const __vector_base& __c)\n {__copy_assign_alloc(__c, integral_constant());}\n\n _LIBCPP_INLINE_VISIBILITY\n void __move_assign_alloc(__vector_base& __c)\n _NOEXCEPT_(\n !__alloc_traits::propagate_on_container_move_assignment::value ||\n is_nothrow_move_assignable::value)\n {__move_assign_alloc(__c, integral_constant());}\nprivate:\n _LIBCPP_INLINE_VISIBILITY\n void __copy_assign_alloc(const __vector_base& __c, true_type)\n {\n if (__alloc() != __c.__alloc())\n {\n clear();\n __alloc_traits::deallocate(__alloc(), __begin_, capacity());\n __begin_ = __end_ = __end_cap() = nullptr;\n }\n __alloc() = __c.__alloc();\n }\n\n _LIBCPP_INLINE_VISIBILITY\n void __copy_assign_alloc(const __vector_base&, false_type)\n {}\n\n _LIBCPP_INLINE_VISIBILITY\n void __move_assign_alloc(__vector_base& __c, true_type)\n _NOEXCEPT_(is_nothrow_move_assignable::value)\n {\n __alloc() = _VSTD::move(__c.__alloc());\n }\n\n _LIBCPP_INLINE_VISIBILITY\n void __move_assign_alloc(__vector_base&, false_type)\n _NOEXCEPT\n {}\n};\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\n__vector_base<_Tp, _Allocator>::__destruct_at_end(pointer __new_last) _NOEXCEPT\n{\n while (__new_last != __end_)\n __alloc_traits::destroy(__alloc(), _VSTD::__to_raw_pointer(--__end_));\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n__vector_base<_Tp, _Allocator>::__vector_base()\n _NOEXCEPT_(is_nothrow_default_constructible::value)\n : __begin_(nullptr),\n __end_(nullptr),\n __end_cap_(nullptr)\n{\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n__vector_base<_Tp, _Allocator>::__vector_base(const allocator_type& __a)\n : __begin_(nullptr),\n __end_(nullptr),\n __end_cap_(nullptr, __a)\n{\n}\n\ntemplate \n__vector_base<_Tp, _Allocator>::~__vector_base()\n{\n if (__begin_ != nullptr)\n {\n clear();\n __alloc_traits::deallocate(__alloc(), __begin_, capacity());\n }\n}\n\ntemplate */>\nclass _LIBCPP_TEMPLATE_VIS vector\n : private __vector_base<_Tp, _Allocator>\n{\nprivate:\n typedef __vector_base<_Tp, _Allocator> __base;\n typedef allocator<_Tp> __default_allocator_type;\npublic:\n typedef vector __self;\n typedef _Tp value_type;\n typedef _Allocator allocator_type;\n typedef typename __base::__alloc_traits __alloc_traits;\n typedef typename __base::reference reference;\n typedef typename __base::const_reference const_reference;\n typedef typename __base::size_type size_type;\n typedef typename __base::difference_type difference_type;\n typedef typename __base::pointer pointer;\n typedef typename __base::const_pointer const_pointer;\n typedef __wrap_iter iterator;\n typedef __wrap_iter const_iterator;\n typedef _VSTD::reverse_iterator reverse_iterator;\n typedef _VSTD::reverse_iterator const_reverse_iterator;\n\n static_assert((is_same::value),\n \"Allocator::value_type must be same type as value_type\");\n\n _LIBCPP_INLINE_VISIBILITY\n vector() _NOEXCEPT_(is_nothrow_default_constructible::value)\n {\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n }\n _LIBCPP_INLINE_VISIBILITY explicit vector(const allocator_type& __a)\n#if _LIBCPP_STD_VER <= 14\n _NOEXCEPT_(is_nothrow_copy_constructible::value)\n#else\n _NOEXCEPT\n#endif\n : __base(__a)\n {\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n }\n explicit vector(size_type __n);\n#if _LIBCPP_STD_VER > 11\n explicit vector(size_type __n, const allocator_type& __a);\n#endif\n vector(size_type __n, const_reference __x);\n vector(size_type __n, const_reference __x, const allocator_type& __a);\n template \n vector(_InputIterator __first,\n typename enable_if<__is_input_iterator <_InputIterator>::value &&\n !__is_forward_iterator<_InputIterator>::value &&\n is_constructible<\n value_type,\n typename iterator_traits<_InputIterator>::reference>::value,\n _InputIterator>::type __last);\n template \n vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a,\n typename enable_if<__is_input_iterator <_InputIterator>::value &&\n !__is_forward_iterator<_InputIterator>::value &&\n is_constructible<\n value_type,\n typename iterator_traits<_InputIterator>::reference>::value>::type* = 0);\n template \n vector(_ForwardIterator __first,\n typename enable_if<__is_forward_iterator<_ForwardIterator>::value &&\n is_constructible<\n value_type,\n typename iterator_traits<_ForwardIterator>::reference>::value,\n _ForwardIterator>::type __last);\n template \n vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a,\n typename enable_if<__is_forward_iterator<_ForwardIterator>::value &&\n is_constructible<\n value_type,\n typename iterator_traits<_ForwardIterator>::reference>::value>::type* = 0);\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n _LIBCPP_INLINE_VISIBILITY\n vector(initializer_list __il);\n _LIBCPP_INLINE_VISIBILITY\n vector(initializer_list __il, const allocator_type& __a);\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_INLINE_VISIBILITY\n ~vector()\n {\n __get_db()->__erase_c(this);\n }\n#endif\n\n vector(const vector& __x);\n vector(const vector& __x, const allocator_type& __a);\n _LIBCPP_INLINE_VISIBILITY\n vector& operator=(const vector& __x);\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY\n vector(vector&& __x)\n#if _LIBCPP_STD_VER > 14\n _NOEXCEPT;\n#else\n _NOEXCEPT_(is_nothrow_move_constructible::value);\n#endif\n _LIBCPP_INLINE_VISIBILITY\n vector(vector&& __x, const allocator_type& __a);\n _LIBCPP_INLINE_VISIBILITY\n vector& operator=(vector&& __x)\n _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n _LIBCPP_INLINE_VISIBILITY\n vector& operator=(initializer_list __il)\n {assign(__il.begin(), __il.end()); return *this;}\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\n template \n typename enable_if\n <\n __is_input_iterator <_InputIterator>::value &&\n !__is_forward_iterator<_InputIterator>::value &&\n is_constructible<\n value_type,\n typename iterator_traits<_InputIterator>::reference>::value,\n void\n >::type\n assign(_InputIterator __first, _InputIterator __last);\n template \n typename enable_if\n <\n __is_forward_iterator<_ForwardIterator>::value &&\n is_constructible<\n value_type,\n typename iterator_traits<_ForwardIterator>::reference>::value,\n void\n >::type\n assign(_ForwardIterator __first, _ForwardIterator __last);\n\n void assign(size_type __n, const_reference __u);\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n _LIBCPP_INLINE_VISIBILITY\n void assign(initializer_list __il)\n {assign(__il.begin(), __il.end());}\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\n _LIBCPP_INLINE_VISIBILITY\n allocator_type get_allocator() const _NOEXCEPT\n {return this->__alloc();}\n\n _LIBCPP_INLINE_VISIBILITY iterator begin() _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY const_iterator begin() const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY iterator end() _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY const_iterator end() const _NOEXCEPT;\n\n _LIBCPP_INLINE_VISIBILITY\n reverse_iterator rbegin() _NOEXCEPT\n {return reverse_iterator(end());}\n _LIBCPP_INLINE_VISIBILITY\n const_reverse_iterator rbegin() const _NOEXCEPT\n {return const_reverse_iterator(end());}\n _LIBCPP_INLINE_VISIBILITY\n reverse_iterator rend() _NOEXCEPT\n {return reverse_iterator(begin());}\n _LIBCPP_INLINE_VISIBILITY\n const_reverse_iterator rend() const _NOEXCEPT\n {return const_reverse_iterator(begin());}\n\n _LIBCPP_INLINE_VISIBILITY\n const_iterator cbegin() const _NOEXCEPT\n {return begin();}\n _LIBCPP_INLINE_VISIBILITY\n const_iterator cend() const _NOEXCEPT\n {return end();}\n _LIBCPP_INLINE_VISIBILITY\n const_reverse_iterator crbegin() const _NOEXCEPT\n {return rbegin();}\n _LIBCPP_INLINE_VISIBILITY\n const_reverse_iterator crend() const _NOEXCEPT\n {return rend();}\n\n _LIBCPP_INLINE_VISIBILITY\n size_type size() const _NOEXCEPT\n {return static_cast(this->__end_ - this->__begin_);}\n _LIBCPP_INLINE_VISIBILITY\n size_type capacity() const _NOEXCEPT\n {return __base::capacity();}\n _LIBCPP_INLINE_VISIBILITY\n bool empty() const _NOEXCEPT\n {return this->__begin_ == this->__end_;}\n size_type max_size() const _NOEXCEPT;\n void reserve(size_type __n);\n void shrink_to_fit() _NOEXCEPT;\n\n _LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n);\n _LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __n) const;\n reference at(size_type __n);\n const_reference at(size_type __n) const;\n\n _LIBCPP_INLINE_VISIBILITY reference front()\n {\n _LIBCPP_ASSERT(!empty(), \"front() called for empty vector\");\n return *this->__begin_;\n }\n _LIBCPP_INLINE_VISIBILITY const_reference front() const\n {\n _LIBCPP_ASSERT(!empty(), \"front() called for empty vector\");\n return *this->__begin_;\n }\n _LIBCPP_INLINE_VISIBILITY reference back()\n {\n _LIBCPP_ASSERT(!empty(), \"back() called for empty vector\");\n return *(this->__end_ - 1);\n }\n _LIBCPP_INLINE_VISIBILITY const_reference back() const\n {\n _LIBCPP_ASSERT(!empty(), \"back() called for empty vector\");\n return *(this->__end_ - 1);\n }\n\n _LIBCPP_INLINE_VISIBILITY\n value_type* data() _NOEXCEPT\n {return _VSTD::__to_raw_pointer(this->__begin_);}\n _LIBCPP_INLINE_VISIBILITY\n const value_type* data() const _NOEXCEPT\n {return _VSTD::__to_raw_pointer(this->__begin_);}\n\n _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY void push_back(value_type&& __x);\n#ifndef _LIBCPP_HAS_NO_VARIADICS\n template \n _LIBCPP_INLINE_VISIBILITY\n#if _LIBCPP_STD_VER > 14\n reference emplace_back(_Args&&... __args);\n#else\n void emplace_back(_Args&&... __args);\n#endif\n#endif // _LIBCPP_HAS_NO_VARIADICS\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY\n void pop_back();\n\n iterator insert(const_iterator __position, const_reference __x);\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n iterator insert(const_iterator __position, value_type&& __x);\n#ifndef _LIBCPP_HAS_NO_VARIADICS\n template \n iterator emplace(const_iterator __position, _Args&&... __args);\n#endif // _LIBCPP_HAS_NO_VARIADICS\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n iterator insert(const_iterator __position, size_type __n, const_reference __x);\n template \n typename enable_if\n <\n __is_input_iterator <_InputIterator>::value &&\n !__is_forward_iterator<_InputIterator>::value &&\n is_constructible<\n value_type,\n typename iterator_traits<_InputIterator>::reference>::value,\n iterator\n >::type\n insert(const_iterator __position, _InputIterator __first, _InputIterator __last);\n template \n typename enable_if\n <\n __is_forward_iterator<_ForwardIterator>::value &&\n is_constructible<\n value_type,\n typename iterator_traits<_ForwardIterator>::reference>::value,\n iterator\n >::type\n insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last);\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n _LIBCPP_INLINE_VISIBILITY\n iterator insert(const_iterator __position, initializer_list __il)\n {return insert(__position, __il.begin(), __il.end());}\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\n _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __position);\n iterator erase(const_iterator __first, const_iterator __last);\n\n _LIBCPP_INLINE_VISIBILITY\n void clear() _NOEXCEPT\n {\n size_type __old_size = size();\n __base::clear();\n __annotate_shrink(__old_size);\n __invalidate_all_iterators();\n }\n\n void resize(size_type __sz);\n void resize(size_type __sz, const_reference __x);\n\n void swap(vector&)\n#if _LIBCPP_STD_VER >= 14\n _NOEXCEPT_DEBUG;\n#else\n _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value ||\n __is_nothrow_swappable::value);\n#endif\n\n bool __invariants() const;\n\n#if _LIBCPP_DEBUG_LEVEL >= 2\n\n bool __dereferenceable(const const_iterator* __i) const;\n bool __decrementable(const const_iterator* __i) const;\n bool __addable(const const_iterator* __i, ptrdiff_t __n) const;\n bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;\n\n#endif // _LIBCPP_DEBUG_LEVEL >= 2\n\nprivate:\n _LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();\n _LIBCPP_INLINE_VISIBILITY void __invalidate_iterators_past(pointer __new_last);\n void allocate(size_type __n);\n void deallocate() _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __new_size) const;\n void __construct_at_end(size_type __n);\n _LIBCPP_INLINE_VISIBILITY\n void __construct_at_end(size_type __n, const_reference __x);\n template \n typename enable_if\n <\n __is_forward_iterator<_ForwardIterator>::value,\n void\n >::type\n __construct_at_end(_ForwardIterator __first, _ForwardIterator __last, size_type __n);\n void __append(size_type __n);\n void __append(size_type __n, const_reference __x);\n _LIBCPP_INLINE_VISIBILITY\n iterator __make_iter(pointer __p) _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n const_iterator __make_iter(const_pointer __p) const _NOEXCEPT;\n void __swap_out_circular_buffer(__split_buffer& __v);\n pointer __swap_out_circular_buffer(__split_buffer& __v, pointer __p);\n void __move_range(pointer __from_s, pointer __from_e, pointer __to);\n void __move_assign(vector& __c, true_type)\n _NOEXCEPT_(is_nothrow_move_assignable::value);\n void __move_assign(vector& __c, false_type)\n _NOEXCEPT_(__alloc_traits::is_always_equal::value);\n _LIBCPP_INLINE_VISIBILITY\n void __destruct_at_end(pointer __new_last) _NOEXCEPT\n {\n __invalidate_iterators_past(__new_last);\n size_type __old_size = size();\n __base::__destruct_at_end(__new_last);\n __annotate_shrink(__old_size);\n }\n template \n void\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n __push_back_slow_path(_Up&& __x);\n#else\n __push_back_slow_path(_Up& __x);\n#endif\n#if !defined(_LIBCPP_HAS_NO_VARIADICS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)\n template \n void\n __emplace_back_slow_path(_Args&&... __args);\n#endif\n // The following functions are no-ops outside of AddressSanitizer mode.\n // We call annotatations only for the default Allocator because other allocators\n // may not meet the AddressSanitizer alignment constraints.\n // See the documentation for __sanitizer_annotate_contiguous_container for more details.\n#ifndef _LIBCPP_HAS_NO_ASAN\n void __annotate_contiguous_container(const void *__beg, const void *__end,\n const void *__old_mid,\n const void *__new_mid) const\n {\n\n if (__beg && is_same::value)\n __sanitizer_annotate_contiguous_container(__beg, __end, __old_mid, __new_mid);\n }\n#else\n _LIBCPP_INLINE_VISIBILITY\n void __annotate_contiguous_container(const void*, const void*, const void*,\n const void*) const {}\n#endif\n _LIBCPP_INLINE_VISIBILITY\n void __annotate_new(size_type __current_size) const {\n __annotate_contiguous_container(data(), data() + capacity(),\n data() + capacity(), data() + __current_size);\n }\n\n _LIBCPP_INLINE_VISIBILITY\n void __annotate_delete() const {\n __annotate_contiguous_container(data(), data() + capacity(),\n data() + size(), data() + capacity());\n }\n\n _LIBCPP_INLINE_VISIBILITY\n void __annotate_increase(size_type __n) const\n {\n __annotate_contiguous_container(data(), data() + capacity(),\n data() + size(), data() + size() + __n);\n }\n\n _LIBCPP_INLINE_VISIBILITY\n void __annotate_shrink(size_type __old_size) const\n {\n __annotate_contiguous_container(data(), data() + capacity(),\n data() + __old_size, data() + size());\n }\n#ifndef _LIBCPP_HAS_NO_ASAN\n // The annotation for size increase should happen before the actual increase,\n // but if an exception is thrown after that the annotation has to be undone.\n struct __RAII_IncreaseAnnotator {\n __RAII_IncreaseAnnotator(const vector &__v, size_type __n = 1)\n : __commit(false), __v(__v), __old_size(__v.size() + __n) {\n __v.__annotate_increase(__n);\n }\n void __done() { __commit = true; }\n ~__RAII_IncreaseAnnotator() {\n if (__commit) return;\n __v.__annotate_shrink(__old_size);\n }\n bool __commit;\n const vector &__v;\n size_type __old_size;\n };\n#else\n struct __RAII_IncreaseAnnotator {\n _LIBCPP_INLINE_VISIBILITY\n __RAII_IncreaseAnnotator(const vector &, size_type = 1) {}\n _LIBCPP_INLINE_VISIBILITY void __done() {}\n };\n#endif\n\n};\n\ntemplate \nvoid\nvector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer& __v)\n{\n __annotate_delete();\n __alloc_traits::__construct_backward(this->__alloc(), this->__begin_, this->__end_, __v.__begin_);\n _VSTD::swap(this->__begin_, __v.__begin_);\n _VSTD::swap(this->__end_, __v.__end_);\n _VSTD::swap(this->__end_cap(), __v.__end_cap());\n __v.__first_ = __v.__begin_;\n __annotate_new(size());\n __invalidate_all_iterators();\n}\n\ntemplate \ntypename vector<_Tp, _Allocator>::pointer\nvector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer& __v, pointer __p)\n{\n __annotate_delete();\n pointer __r = __v.__begin_;\n __alloc_traits::__construct_backward(this->__alloc(), this->__begin_, __p, __v.__begin_);\n __alloc_traits::__construct_forward(this->__alloc(), __p, this->__end_, __v.__end_);\n _VSTD::swap(this->__begin_, __v.__begin_);\n _VSTD::swap(this->__end_, __v.__end_);\n _VSTD::swap(this->__end_cap(), __v.__end_cap());\n __v.__first_ = __v.__begin_;\n __annotate_new(size());\n __invalidate_all_iterators();\n return __r;\n}\n\n// Allocate space for __n objects\n// throws length_error if __n > max_size()\n// throws (probably bad_alloc) if memory run out\n// Precondition: __begin_ == __end_ == __end_cap() == 0\n// Precondition: __n > 0\n// Postcondition: capacity() == __n\n// Postcondition: size() == 0\ntemplate \nvoid\nvector<_Tp, _Allocator>::allocate(size_type __n)\n{\n if (__n > max_size())\n this->__throw_length_error();\n this->__begin_ = this->__end_ = __alloc_traits::allocate(this->__alloc(), __n);\n this->__end_cap() = this->__begin_ + __n;\n __annotate_new(0);\n}\n\ntemplate \nvoid\nvector<_Tp, _Allocator>::deallocate() _NOEXCEPT\n{\n if (this->__begin_ != nullptr)\n {\n clear();\n __alloc_traits::deallocate(this->__alloc(), this->__begin_, capacity());\n this->__begin_ = this->__end_ = this->__end_cap() = nullptr;\n }\n}\n\ntemplate \ntypename vector<_Tp, _Allocator>::size_type\nvector<_Tp, _Allocator>::max_size() const _NOEXCEPT\n{\n return _VSTD::min(__alloc_traits::max_size(this->__alloc()),\n numeric_limits::max());\n}\n\n// Precondition: __new_size > capacity()\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename vector<_Tp, _Allocator>::size_type\nvector<_Tp, _Allocator>::__recommend(size_type __new_size) const\n{\n const size_type __ms = max_size();\n if (__new_size > __ms)\n this->__throw_length_error();\n const size_type __cap = capacity();\n if (__cap >= __ms / 2)\n return __ms;\n return _VSTD::max(2*__cap, __new_size);\n}\n\n// Default constructs __n objects starting at __end_\n// throws if construction throws\n// Precondition: __n > 0\n// Precondition: size() + __n <= capacity()\n// Postcondition: size() == size() + __n\ntemplate \nvoid\nvector<_Tp, _Allocator>::__construct_at_end(size_type __n)\n{\n allocator_type& __a = this->__alloc();\n do\n {\n __RAII_IncreaseAnnotator __annotator(*this);\n __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_));\n ++this->__end_;\n --__n;\n __annotator.__done();\n } while (__n > 0);\n}\n\n// Copy constructs __n objects starting at __end_ from __x\n// throws if construction throws\n// Precondition: __n > 0\n// Precondition: size() + __n <= capacity()\n// Postcondition: size() == old size() + __n\n// Postcondition: [i] == __x for all i in [size() - __n, __n)\ntemplate \ninline\nvoid\nvector<_Tp, _Allocator>::__construct_at_end(size_type __n, const_reference __x)\n{\n allocator_type& __a = this->__alloc();\n do\n {\n __RAII_IncreaseAnnotator __annotator(*this);\n __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_), __x);\n ++this->__end_;\n --__n;\n __annotator.__done();\n } while (__n > 0);\n}\n\ntemplate \ntemplate \ntypename enable_if\n<\n __is_forward_iterator<_ForwardIterator>::value,\n void\n>::type\nvector<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last, size_type __n)\n{\n allocator_type& __a = this->__alloc();\n __RAII_IncreaseAnnotator __annotator(*this, __n);\n __alloc_traits::__construct_range_forward(__a, __first, __last, this->__end_);\n __annotator.__done();\n}\n\n// Default constructs __n objects starting at __end_\n// throws if construction throws\n// Postcondition: size() == size() + __n\n// Exception safety: strong.\ntemplate \nvoid\nvector<_Tp, _Allocator>::__append(size_type __n)\n{\n if (static_cast(this->__end_cap() - this->__end_) >= __n)\n this->__construct_at_end(__n);\n else\n {\n allocator_type& __a = this->__alloc();\n __split_buffer __v(__recommend(size() + __n), size(), __a);\n __v.__construct_at_end(__n);\n __swap_out_circular_buffer(__v);\n }\n}\n\n// Default constructs __n objects starting at __end_\n// throws if construction throws\n// Postcondition: size() == size() + __n\n// Exception safety: strong.\ntemplate \nvoid\nvector<_Tp, _Allocator>::__append(size_type __n, const_reference __x)\n{\n if (static_cast(this->__end_cap() - this->__end_) >= __n)\n this->__construct_at_end(__n, __x);\n else\n {\n allocator_type& __a = this->__alloc();\n __split_buffer __v(__recommend(size() + __n), size(), __a);\n __v.__construct_at_end(__n, __x);\n __swap_out_circular_buffer(__v);\n }\n}\n\ntemplate \nvector<_Tp, _Allocator>::vector(size_type __n)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n if (__n > 0)\n {\n allocate(__n);\n __construct_at_end(__n);\n }\n}\n\n#if _LIBCPP_STD_VER > 11\ntemplate \nvector<_Tp, _Allocator>::vector(size_type __n, const allocator_type& __a)\n : __base(__a)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n if (__n > 0)\n {\n allocate(__n);\n __construct_at_end(__n);\n }\n}\n#endif\n\ntemplate \nvector<_Tp, _Allocator>::vector(size_type __n, const_reference __x)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n if (__n > 0)\n {\n allocate(__n);\n __construct_at_end(__n, __x);\n }\n}\n\ntemplate \nvector<_Tp, _Allocator>::vector(size_type __n, const_reference __x, const allocator_type& __a)\n : __base(__a)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n if (__n > 0)\n {\n allocate(__n);\n __construct_at_end(__n, __x);\n }\n}\n\ntemplate \ntemplate \nvector<_Tp, _Allocator>::vector(_InputIterator __first,\n typename enable_if<__is_input_iterator <_InputIterator>::value &&\n !__is_forward_iterator<_InputIterator>::value &&\n is_constructible<\n value_type,\n typename iterator_traits<_InputIterator>::reference>::value,\n _InputIterator>::type __last)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n for (; __first != __last; ++__first)\n push_back(*__first);\n}\n\ntemplate \ntemplate \nvector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a,\n typename enable_if<__is_input_iterator <_InputIterator>::value &&\n !__is_forward_iterator<_InputIterator>::value &&\n is_constructible<\n value_type,\n typename iterator_traits<_InputIterator>::reference>::value>::type*)\n : __base(__a)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n for (; __first != __last; ++__first)\n push_back(*__first);\n}\n\ntemplate \ntemplate \nvector<_Tp, _Allocator>::vector(_ForwardIterator __first,\n typename enable_if<__is_forward_iterator<_ForwardIterator>::value &&\n is_constructible<\n value_type,\n typename iterator_traits<_ForwardIterator>::reference>::value,\n _ForwardIterator>::type __last)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n size_type __n = static_cast(_VSTD::distance(__first, __last));\n if (__n > 0)\n {\n allocate(__n);\n __construct_at_end(__first, __last, __n);\n }\n}\n\ntemplate \ntemplate \nvector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a,\n typename enable_if<__is_forward_iterator<_ForwardIterator>::value &&\n is_constructible<\n value_type,\n typename iterator_traits<_ForwardIterator>::reference>::value>::type*)\n : __base(__a)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n size_type __n = static_cast(_VSTD::distance(__first, __last));\n if (__n > 0)\n {\n allocate(__n);\n __construct_at_end(__first, __last, __n);\n }\n}\n\ntemplate \nvector<_Tp, _Allocator>::vector(const vector& __x)\n : __base(__alloc_traits::select_on_container_copy_construction(__x.__alloc()))\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n size_type __n = __x.size();\n if (__n > 0)\n {\n allocate(__n);\n __construct_at_end(__x.__begin_, __x.__end_, __n);\n }\n}\n\ntemplate \nvector<_Tp, _Allocator>::vector(const vector& __x, const allocator_type& __a)\n : __base(__a)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n size_type __n = __x.size();\n if (__n > 0)\n {\n allocate(__n);\n __construct_at_end(__x.__begin_, __x.__end_, __n);\n }\n}\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvector<_Tp, _Allocator>::vector(vector&& __x)\n#if _LIBCPP_STD_VER > 14\n _NOEXCEPT\n#else\n _NOEXCEPT_(is_nothrow_move_constructible::value)\n#endif\n : __base(_VSTD::move(__x.__alloc()))\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n __get_db()->swap(this, &__x);\n#endif\n this->__begin_ = __x.__begin_;\n this->__end_ = __x.__end_;\n this->__end_cap() = __x.__end_cap();\n __x.__begin_ = __x.__end_ = __x.__end_cap() = nullptr;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvector<_Tp, _Allocator>::vector(vector&& __x, const allocator_type& __a)\n : __base(__a)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n if (__a == __x.__alloc())\n {\n this->__begin_ = __x.__begin_;\n this->__end_ = __x.__end_;\n this->__end_cap() = __x.__end_cap();\n __x.__begin_ = __x.__end_ = __x.__end_cap() = nullptr;\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->swap(this, &__x);\n#endif\n }\n else\n {\n typedef move_iterator _Ip;\n assign(_Ip(__x.begin()), _Ip(__x.end()));\n }\n}\n\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvector<_Tp, _Allocator>::vector(initializer_list __il)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n if (__il.size() > 0)\n {\n allocate(__il.size());\n __construct_at_end(__il.begin(), __il.end(), __il.size());\n }\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvector<_Tp, _Allocator>::vector(initializer_list __il, const allocator_type& __a)\n : __base(__a)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_c(this);\n#endif\n if (__il.size() > 0)\n {\n allocate(__il.size());\n __construct_at_end(__il.begin(), __il.end(), __il.size());\n }\n}\n\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvector<_Tp, _Allocator>&\nvector<_Tp, _Allocator>::operator=(vector&& __x)\n _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value))\n{\n __move_assign(__x, integral_constant());\n return *this;\n}\n\ntemplate \nvoid\nvector<_Tp, _Allocator>::__move_assign(vector& __c, false_type)\n _NOEXCEPT_(__alloc_traits::is_always_equal::value)\n{\n if (__base::__alloc() != __c.__alloc())\n {\n typedef move_iterator _Ip;\n assign(_Ip(__c.begin()), _Ip(__c.end()));\n }\n else\n __move_assign(__c, true_type());\n}\n\ntemplate \nvoid\nvector<_Tp, _Allocator>::__move_assign(vector& __c, true_type)\n _NOEXCEPT_(is_nothrow_move_assignable::value)\n{\n deallocate();\n __base::__move_assign_alloc(__c); // this can throw\n this->__begin_ = __c.__begin_;\n this->__end_ = __c.__end_;\n this->__end_cap() = __c.__end_cap();\n __c.__begin_ = __c.__end_ = __c.__end_cap() = nullptr;\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->swap(this, &__c);\n#endif\n}\n\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvector<_Tp, _Allocator>&\nvector<_Tp, _Allocator>::operator=(const vector& __x)\n{\n if (this != &__x)\n {\n __base::__copy_assign_alloc(__x);\n assign(__x.__begin_, __x.__end_);\n }\n return *this;\n}\n\ntemplate \ntemplate \ntypename enable_if\n<\n __is_input_iterator <_InputIterator>::value &&\n !__is_forward_iterator<_InputIterator>::value &&\n is_constructible<\n _Tp,\n typename iterator_traits<_InputIterator>::reference>::value,\n void\n>::type\nvector<_Tp, _Allocator>::assign(_InputIterator __first, _InputIterator __last)\n{\n clear();\n for (; __first != __last; ++__first)\n push_back(*__first);\n}\n\ntemplate \ntemplate \ntypename enable_if\n<\n __is_forward_iterator<_ForwardIterator>::value &&\n is_constructible<\n _Tp,\n typename iterator_traits<_ForwardIterator>::reference>::value,\n void\n>::type\nvector<_Tp, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)\n{\n size_type __new_size = static_cast(_VSTD::distance(__first, __last));\n if (__new_size <= capacity())\n {\n _ForwardIterator __mid = __last;\n bool __growing = false;\n if (__new_size > size())\n {\n __growing = true;\n __mid = __first;\n _VSTD::advance(__mid, size());\n }\n pointer __m = _VSTD::copy(__first, __mid, this->__begin_);\n if (__growing)\n __construct_at_end(__mid, __last, __new_size - size());\n else\n this->__destruct_at_end(__m);\n }\n else\n {\n deallocate();\n allocate(__recommend(__new_size));\n __construct_at_end(__first, __last, __new_size);\n }\n __invalidate_all_iterators();\n}\n\ntemplate \nvoid\nvector<_Tp, _Allocator>::assign(size_type __n, const_reference __u)\n{\n if (__n <= capacity())\n {\n size_type __s = size();\n _VSTD::fill_n(this->__begin_, _VSTD::min(__n, __s), __u);\n if (__n > __s)\n __construct_at_end(__n - __s, __u);\n else\n this->__destruct_at_end(this->__begin_ + __n);\n }\n else\n {\n deallocate();\n allocate(__recommend(static_cast(__n)));\n __construct_at_end(__n, __u);\n }\n __invalidate_all_iterators();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename vector<_Tp, _Allocator>::iterator\nvector<_Tp, _Allocator>::__make_iter(pointer __p) _NOEXCEPT\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n return iterator(this, __p);\n#else\n return iterator(__p);\n#endif\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename vector<_Tp, _Allocator>::const_iterator\nvector<_Tp, _Allocator>::__make_iter(const_pointer __p) const _NOEXCEPT\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n return const_iterator(this, __p);\n#else\n return const_iterator(__p);\n#endif\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename vector<_Tp, _Allocator>::iterator\nvector<_Tp, _Allocator>::begin() _NOEXCEPT\n{\n return __make_iter(this->__begin_);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename vector<_Tp, _Allocator>::const_iterator\nvector<_Tp, _Allocator>::begin() const _NOEXCEPT\n{\n return __make_iter(this->__begin_);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename vector<_Tp, _Allocator>::iterator\nvector<_Tp, _Allocator>::end() _NOEXCEPT\n{\n return __make_iter(this->__end_);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename vector<_Tp, _Allocator>::const_iterator\nvector<_Tp, _Allocator>::end() const _NOEXCEPT\n{\n return __make_iter(this->__end_);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename vector<_Tp, _Allocator>::reference\nvector<_Tp, _Allocator>::operator[](size_type __n)\n{\n _LIBCPP_ASSERT(__n < size(), \"vector[] index out of bounds\");\n return this->__begin_[__n];\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename vector<_Tp, _Allocator>::const_reference\nvector<_Tp, _Allocator>::operator[](size_type __n) const\n{\n _LIBCPP_ASSERT(__n < size(), \"vector[] index out of bounds\");\n return this->__begin_[__n];\n}\n\ntemplate \ntypename vector<_Tp, _Allocator>::reference\nvector<_Tp, _Allocator>::at(size_type __n)\n{\n if (__n >= size())\n this->__throw_out_of_range();\n return this->__begin_[__n];\n}\n\ntemplate \ntypename vector<_Tp, _Allocator>::const_reference\nvector<_Tp, _Allocator>::at(size_type __n) const\n{\n if (__n >= size())\n this->__throw_out_of_range();\n return this->__begin_[__n];\n}\n\ntemplate \nvoid\nvector<_Tp, _Allocator>::reserve(size_type __n)\n{\n if (__n > capacity())\n {\n allocator_type& __a = this->__alloc();\n __split_buffer __v(__n, size(), __a);\n __swap_out_circular_buffer(__v);\n }\n}\n\ntemplate \nvoid\nvector<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT\n{\n if (capacity() > size())\n {\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n allocator_type& __a = this->__alloc();\n __split_buffer __v(size(), size(), __a);\n __swap_out_circular_buffer(__v);\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n }\n}\n\ntemplate \ntemplate \nvoid\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\nvector<_Tp, _Allocator>::__push_back_slow_path(_Up&& __x)\n#else\nvector<_Tp, _Allocator>::__push_back_slow_path(_Up& __x)\n#endif\n{\n allocator_type& __a = this->__alloc();\n __split_buffer __v(__recommend(size() + 1), size(), __a);\n // __v.push_back(_VSTD::forward<_Up>(__x));\n __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(__v.__end_), _VSTD::forward<_Up>(__x));\n __v.__end_++;\n __swap_out_circular_buffer(__v);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nvector<_Tp, _Allocator>::push_back(const_reference __x)\n{\n if (this->__end_ != this->__end_cap())\n {\n __RAII_IncreaseAnnotator __annotator(*this);\n __alloc_traits::construct(this->__alloc(),\n _VSTD::__to_raw_pointer(this->__end_), __x);\n __annotator.__done();\n ++this->__end_;\n }\n else\n __push_back_slow_path(__x);\n}\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nvector<_Tp, _Allocator>::push_back(value_type&& __x)\n{\n if (this->__end_ < this->__end_cap())\n {\n __RAII_IncreaseAnnotator __annotator(*this);\n __alloc_traits::construct(this->__alloc(),\n _VSTD::__to_raw_pointer(this->__end_),\n _VSTD::move(__x));\n __annotator.__done();\n ++this->__end_;\n }\n else\n __push_back_slow_path(_VSTD::move(__x));\n}\n\n#ifndef _LIBCPP_HAS_NO_VARIADICS\n\ntemplate \ntemplate \nvoid\nvector<_Tp, _Allocator>::__emplace_back_slow_path(_Args&&... __args)\n{\n allocator_type& __a = this->__alloc();\n __split_buffer __v(__recommend(size() + 1), size(), __a);\n// __v.emplace_back(_VSTD::forward<_Args>(__args)...);\n __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(__v.__end_), _VSTD::forward<_Args>(__args)...);\n __v.__end_++;\n __swap_out_circular_buffer(__v);\n}\n\ntemplate \ntemplate \ninline\n#if _LIBCPP_STD_VER > 14\ntypename vector<_Tp, _Allocator>::reference\n#else\nvoid\n#endif\nvector<_Tp, _Allocator>::emplace_back(_Args&&... __args)\n{\n if (this->__end_ < this->__end_cap())\n {\n __RAII_IncreaseAnnotator __annotator(*this);\n __alloc_traits::construct(this->__alloc(),\n _VSTD::__to_raw_pointer(this->__end_),\n _VSTD::forward<_Args>(__args)...);\n __annotator.__done();\n ++this->__end_;\n }\n else\n __emplace_back_slow_path(_VSTD::forward<_Args>(__args)...);\n#if _LIBCPP_STD_VER > 14\n return this->back();\n#endif\n}\n\n#endif // _LIBCPP_HAS_NO_VARIADICS\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \ninline\nvoid\nvector<_Tp, _Allocator>::pop_back()\n{\n _LIBCPP_ASSERT(!empty(), \"vector::pop_back called for empty vector\");\n this->__destruct_at_end(this->__end_ - 1);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename vector<_Tp, _Allocator>::iterator\nvector<_Tp, _Allocator>::erase(const_iterator __position)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,\n \"vector::erase(iterator) called with an iterator not\"\n \" referring to this vector\");\n#endif\n _LIBCPP_ASSERT(__position != end(),\n \"vector::erase(iterator) called with a non-dereferenceable iterator\");\n difference_type __ps = __position - cbegin();\n pointer __p = this->__begin_ + __ps;\n this->__destruct_at_end(_VSTD::move(__p + 1, this->__end_, __p));\n this->__invalidate_iterators_past(__p-1);\n iterator __r = __make_iter(__p);\n return __r;\n}\n\ntemplate \ntypename vector<_Tp, _Allocator>::iterator\nvector<_Tp, _Allocator>::erase(const_iterator __first, const_iterator __last)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__first) == this,\n \"vector::erase(iterator, iterator) called with an iterator not\"\n \" referring to this vector\");\n _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__last) == this,\n \"vector::erase(iterator, iterator) called with an iterator not\"\n \" referring to this vector\");\n#endif\n _LIBCPP_ASSERT(__first <= __last, \"vector::erase(first, last) called with invalid range\");\n pointer __p = this->__begin_ + (__first - begin());\n if (__first != __last) {\n this->__destruct_at_end(_VSTD::move(__p + (__last - __first), this->__end_, __p));\n this->__invalidate_iterators_past(__p - 1);\n }\n iterator __r = __make_iter(__p);\n return __r;\n}\n\ntemplate \nvoid\nvector<_Tp, _Allocator>::__move_range(pointer __from_s, pointer __from_e, pointer __to)\n{\n pointer __old_last = this->__end_;\n difference_type __n = __old_last - __to;\n for (pointer __i = __from_s + __n; __i < __from_e; ++__i, ++this->__end_)\n __alloc_traits::construct(this->__alloc(),\n _VSTD::__to_raw_pointer(this->__end_),\n _VSTD::move(*__i));\n _VSTD::move_backward(__from_s, __from_s + __n, __old_last);\n}\n\ntemplate \ntypename vector<_Tp, _Allocator>::iterator\nvector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,\n \"vector::insert(iterator, x) called with an iterator not\"\n \" referring to this vector\");\n#endif\n pointer __p = this->__begin_ + (__position - begin());\n if (this->__end_ < this->__end_cap())\n {\n __RAII_IncreaseAnnotator __annotator(*this);\n if (__p == this->__end_)\n {\n __alloc_traits::construct(this->__alloc(),\n _VSTD::__to_raw_pointer(this->__end_), __x);\n ++this->__end_;\n }\n else\n {\n __move_range(__p, this->__end_, __p + 1);\n const_pointer __xr = pointer_traits::pointer_to(__x);\n if (__p <= __xr && __xr < this->__end_)\n ++__xr;\n *__p = *__xr;\n }\n __annotator.__done();\n }\n else\n {\n allocator_type& __a = this->__alloc();\n __split_buffer __v(__recommend(size() + 1), __p - this->__begin_, __a);\n __v.push_back(__x);\n __p = __swap_out_circular_buffer(__v, __p);\n }\n return __make_iter(__p);\n}\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \ntypename vector<_Tp, _Allocator>::iterator\nvector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,\n \"vector::insert(iterator, x) called with an iterator not\"\n \" referring to this vector\");\n#endif\n pointer __p = this->__begin_ + (__position - begin());\n if (this->__end_ < this->__end_cap())\n {\n __RAII_IncreaseAnnotator __annotator(*this);\n if (__p == this->__end_)\n {\n __alloc_traits::construct(this->__alloc(),\n _VSTD::__to_raw_pointer(this->__end_),\n _VSTD::move(__x));\n ++this->__end_;\n }\n else\n {\n __move_range(__p, this->__end_, __p + 1);\n *__p = _VSTD::move(__x);\n }\n __annotator.__done();\n }\n else\n {\n allocator_type& __a = this->__alloc();\n __split_buffer __v(__recommend(size() + 1), __p - this->__begin_, __a);\n __v.push_back(_VSTD::move(__x));\n __p = __swap_out_circular_buffer(__v, __p);\n }\n return __make_iter(__p);\n}\n\n#ifndef _LIBCPP_HAS_NO_VARIADICS\n\ntemplate \ntemplate \ntypename vector<_Tp, _Allocator>::iterator\nvector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,\n \"vector::emplace(iterator, x) called with an iterator not\"\n \" referring to this vector\");\n#endif\n pointer __p = this->__begin_ + (__position - begin());\n if (this->__end_ < this->__end_cap())\n {\n __RAII_IncreaseAnnotator __annotator(*this);\n if (__p == this->__end_)\n {\n __alloc_traits::construct(this->__alloc(),\n _VSTD::__to_raw_pointer(this->__end_),\n _VSTD::forward<_Args>(__args)...);\n ++this->__end_;\n }\n else\n {\n __temp_value __tmp(this->__alloc(), _VSTD::forward<_Args>(__args)...);\n __move_range(__p, this->__end_, __p + 1);\n *__p = _VSTD::move(__tmp.get());\n }\n __annotator.__done();\n }\n else\n {\n allocator_type& __a = this->__alloc();\n __split_buffer __v(__recommend(size() + 1), __p - this->__begin_, __a);\n __v.emplace_back(_VSTD::forward<_Args>(__args)...);\n __p = __swap_out_circular_buffer(__v, __p);\n }\n return __make_iter(__p);\n}\n\n#endif // _LIBCPP_HAS_NO_VARIADICS\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \ntypename vector<_Tp, _Allocator>::iterator\nvector<_Tp, _Allocator>::insert(const_iterator __position, size_type __n, const_reference __x)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,\n \"vector::insert(iterator, n, x) called with an iterator not\"\n \" referring to this vector\");\n#endif\n pointer __p = this->__begin_ + (__position - begin());\n if (__n > 0)\n {\n if (__n <= static_cast(this->__end_cap() - this->__end_))\n {\n size_type __old_n = __n;\n pointer __old_last = this->__end_;\n if (__n > static_cast(this->__end_ - __p))\n {\n size_type __cx = __n - (this->__end_ - __p);\n __construct_at_end(__cx, __x);\n __n -= __cx;\n }\n if (__n > 0)\n {\n __RAII_IncreaseAnnotator __annotator(*this, __n);\n __move_range(__p, __old_last, __p + __old_n);\n __annotator.__done();\n const_pointer __xr = pointer_traits::pointer_to(__x);\n if (__p <= __xr && __xr < this->__end_)\n __xr += __old_n;\n _VSTD::fill_n(__p, __n, *__xr);\n }\n }\n else\n {\n allocator_type& __a = this->__alloc();\n __split_buffer __v(__recommend(size() + __n), __p - this->__begin_, __a);\n __v.__construct_at_end(__n, __x);\n __p = __swap_out_circular_buffer(__v, __p);\n }\n }\n return __make_iter(__p);\n}\n\ntemplate \ntemplate \ntypename enable_if\n<\n __is_input_iterator <_InputIterator>::value &&\n !__is_forward_iterator<_InputIterator>::value &&\n is_constructible<\n _Tp,\n typename iterator_traits<_InputIterator>::reference>::value,\n typename vector<_Tp, _Allocator>::iterator\n>::type\nvector<_Tp, _Allocator>::insert(const_iterator __position, _InputIterator __first, _InputIterator __last)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,\n \"vector::insert(iterator, range) called with an iterator not\"\n \" referring to this vector\");\n#endif\n difference_type __off = __position - begin();\n pointer __p = this->__begin_ + __off;\n allocator_type& __a = this->__alloc();\n pointer __old_last = this->__end_;\n for (; this->__end_ != this->__end_cap() && __first != __last; ++__first)\n {\n __RAII_IncreaseAnnotator __annotator(*this);\n __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_),\n *__first);\n ++this->__end_;\n __annotator.__done();\n }\n __split_buffer __v(__a);\n if (__first != __last)\n {\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n __v.__construct_at_end(__first, __last);\n difference_type __old_size = __old_last - this->__begin_;\n difference_type __old_p = __p - this->__begin_;\n reserve(__recommend(size() + __v.size()));\n __p = this->__begin_ + __old_p;\n __old_last = this->__begin_ + __old_size;\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n erase(__make_iter(__old_last), end());\n throw;\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n }\n __p = _VSTD::rotate(__p, __old_last, this->__end_);\n insert(__make_iter(__p), make_move_iterator(__v.begin()),\n make_move_iterator(__v.end()));\n return begin() + __off;\n}\n\ntemplate \ntemplate \ntypename enable_if\n<\n __is_forward_iterator<_ForwardIterator>::value &&\n is_constructible<\n _Tp,\n typename iterator_traits<_ForwardIterator>::reference>::value,\n typename vector<_Tp, _Allocator>::iterator\n>::type\nvector<_Tp, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last)\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,\n \"vector::insert(iterator, range) called with an iterator not\"\n \" referring to this vector\");\n#endif\n pointer __p = this->__begin_ + (__position - begin());\n difference_type __n = _VSTD::distance(__first, __last);\n if (__n > 0)\n {\n if (__n <= this->__end_cap() - this->__end_)\n {\n size_type __old_n = __n;\n pointer __old_last = this->__end_;\n _ForwardIterator __m = __last;\n difference_type __dx = this->__end_ - __p;\n if (__n > __dx)\n {\n __m = __first;\n difference_type __diff = this->__end_ - __p;\n _VSTD::advance(__m, __diff);\n __construct_at_end(__m, __last, __n - __diff);\n __n = __dx;\n }\n if (__n > 0)\n {\n __RAII_IncreaseAnnotator __annotator(*this, __n);\n __move_range(__p, __old_last, __p + __old_n);\n __annotator.__done();\n _VSTD::copy(__first, __m, __p);\n }\n }\n else\n {\n allocator_type& __a = this->__alloc();\n __split_buffer __v(__recommend(size() + __n), __p - this->__begin_, __a);\n __v.__construct_at_end(__first, __last);\n __p = __swap_out_circular_buffer(__v, __p);\n }\n }\n return __make_iter(__p);\n}\n\ntemplate \nvoid\nvector<_Tp, _Allocator>::resize(size_type __sz)\n{\n size_type __cs = size();\n if (__cs < __sz)\n this->__append(__sz - __cs);\n else if (__cs > __sz)\n this->__destruct_at_end(this->__begin_ + __sz);\n}\n\ntemplate \nvoid\nvector<_Tp, _Allocator>::resize(size_type __sz, const_reference __x)\n{\n size_type __cs = size();\n if (__cs < __sz)\n this->__append(__sz - __cs, __x);\n else if (__cs > __sz)\n this->__destruct_at_end(this->__begin_ + __sz);\n}\n\ntemplate \nvoid\nvector<_Tp, _Allocator>::swap(vector& __x)\n#if _LIBCPP_STD_VER >= 14\n _NOEXCEPT_DEBUG\n#else\n _NOEXCEPT_DEBUG_(!__alloc_traits::propagate_on_container_swap::value ||\n __is_nothrow_swappable::value)\n#endif\n{\n _LIBCPP_ASSERT(__alloc_traits::propagate_on_container_swap::value ||\n this->__alloc() == __x.__alloc(),\n \"vector::swap: Either propagate_on_container_swap must be true\"\n \" or the allocators must compare equal\");\n _VSTD::swap(this->__begin_, __x.__begin_);\n _VSTD::swap(this->__end_, __x.__end_);\n _VSTD::swap(this->__end_cap(), __x.__end_cap());\n __swap_allocator(this->__alloc(), __x.__alloc(), \n integral_constant());\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->swap(this, &__x);\n#endif // _LIBCPP_DEBUG_LEVEL >= 2\n}\n\ntemplate \nbool\nvector<_Tp, _Allocator>::__invariants() const\n{\n if (this->__begin_ == nullptr)\n {\n if (this->__end_ != nullptr || this->__end_cap() != nullptr)\n return false;\n }\n else\n {\n if (this->__begin_ > this->__end_)\n return false;\n if (this->__begin_ == this->__end_cap())\n return false;\n if (this->__end_ > this->__end_cap())\n return false;\n }\n return true;\n}\n\n#if _LIBCPP_DEBUG_LEVEL >= 2\n\ntemplate \nbool\nvector<_Tp, _Allocator>::__dereferenceable(const const_iterator* __i) const\n{\n return this->__begin_ <= __i->base() && __i->base() < this->__end_;\n}\n\ntemplate \nbool\nvector<_Tp, _Allocator>::__decrementable(const const_iterator* __i) const\n{\n return this->__begin_ < __i->base() && __i->base() <= this->__end_;\n}\n\ntemplate \nbool\nvector<_Tp, _Allocator>::__addable(const const_iterator* __i, ptrdiff_t __n) const\n{\n const_pointer __p = __i->base() + __n;\n return this->__begin_ <= __p && __p <= this->__end_;\n}\n\ntemplate \nbool\nvector<_Tp, _Allocator>::__subscriptable(const const_iterator* __i, ptrdiff_t __n) const\n{\n const_pointer __p = __i->base() + __n;\n return this->__begin_ <= __p && __p < this->__end_;\n}\n\n#endif // _LIBCPP_DEBUG_LEVEL >= 2\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nvector<_Tp, _Allocator>::__invalidate_all_iterators()\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__invalidate_all(this);\n#endif // _LIBCPP_DEBUG_LEVEL >= 2\n}\n\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nvector<_Tp, _Allocator>::__invalidate_iterators_past(pointer __new_last) {\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __c_node* __c = __get_db()->__find_c_and_lock(this);\n for (__i_node** __p = __c->end_; __p != __c->beg_; ) {\n --__p;\n const_iterator* __i = static_cast((*__p)->__i_);\n if (__i->base() > __new_last) {\n (*__p)->__c_ = nullptr;\n if (--__c->end_ != __p)\n memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));\n }\n }\n __get_db()->unlock();\n#else\n ((void)__new_last);\n#endif\n}\n\n// vector\n\ntemplate class vector;\n\ntemplate struct hash >;\n\ntemplate \nstruct __has_storage_type >\n{\n static const bool value = true;\n};\n\ntemplate \nclass _LIBCPP_TEMPLATE_VIS vector\n : private __vector_base_common\n{\npublic:\n typedef vector __self;\n typedef bool value_type;\n typedef _Allocator allocator_type;\n typedef allocator_traits __alloc_traits;\n typedef typename __alloc_traits::size_type size_type;\n typedef typename __alloc_traits::difference_type difference_type;\n typedef size_type __storage_type;\n typedef __bit_iterator pointer;\n typedef __bit_iterator const_pointer;\n typedef pointer iterator;\n typedef const_pointer const_iterator;\n typedef _VSTD::reverse_iterator reverse_iterator;\n typedef _VSTD::reverse_iterator const_reverse_iterator;\n\nprivate:\n typedef typename __rebind_alloc_helper<__alloc_traits, __storage_type>::type __storage_allocator;\n typedef allocator_traits<__storage_allocator> __storage_traits;\n typedef typename __storage_traits::pointer __storage_pointer;\n typedef typename __storage_traits::const_pointer __const_storage_pointer;\n\n __storage_pointer __begin_;\n size_type __size_;\n __compressed_pair __cap_alloc_;\npublic:\n typedef __bit_reference reference;\n typedef __bit_const_reference const_reference;\nprivate:\n _LIBCPP_INLINE_VISIBILITY\n size_type& __cap() _NOEXCEPT\n {return __cap_alloc_.first();}\n _LIBCPP_INLINE_VISIBILITY\n const size_type& __cap() const _NOEXCEPT\n {return __cap_alloc_.first();}\n _LIBCPP_INLINE_VISIBILITY\n __storage_allocator& __alloc() _NOEXCEPT\n {return __cap_alloc_.second();}\n _LIBCPP_INLINE_VISIBILITY\n const __storage_allocator& __alloc() const _NOEXCEPT\n {return __cap_alloc_.second();}\n\n static const unsigned __bits_per_word = static_cast(sizeof(__storage_type) * CHAR_BIT);\n\n _LIBCPP_INLINE_VISIBILITY\n static size_type __internal_cap_to_external(size_type __n) _NOEXCEPT\n {return __n * __bits_per_word;}\n _LIBCPP_INLINE_VISIBILITY\n static size_type __external_cap_to_internal(size_type __n) _NOEXCEPT\n {return (__n - 1) / __bits_per_word + 1;}\n\npublic:\n _LIBCPP_INLINE_VISIBILITY\n vector() _NOEXCEPT_(is_nothrow_default_constructible::value);\n\n _LIBCPP_INLINE_VISIBILITY explicit vector(const allocator_type& __a)\n#if _LIBCPP_STD_VER <= 14\n _NOEXCEPT_(is_nothrow_copy_constructible::value);\n#else\n _NOEXCEPT;\n#endif\n ~vector();\n explicit vector(size_type __n);\n#if _LIBCPP_STD_VER > 11\n explicit vector(size_type __n, const allocator_type& __a);\n#endif\n vector(size_type __n, const value_type& __v);\n vector(size_type __n, const value_type& __v, const allocator_type& __a);\n template \n vector(_InputIterator __first, _InputIterator __last,\n typename enable_if<__is_input_iterator <_InputIterator>::value &&\n !__is_forward_iterator<_InputIterator>::value>::type* = 0);\n template \n vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a,\n typename enable_if<__is_input_iterator <_InputIterator>::value &&\n !__is_forward_iterator<_InputIterator>::value>::type* = 0);\n template \n vector(_ForwardIterator __first, _ForwardIterator __last,\n typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type* = 0);\n template \n vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a,\n typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type* = 0);\n\n vector(const vector& __v);\n vector(const vector& __v, const allocator_type& __a);\n vector& operator=(const vector& __v);\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n vector(initializer_list __il);\n vector(initializer_list __il, const allocator_type& __a);\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY\n vector(vector&& __v)\n#if _LIBCPP_STD_VER > 14\n _NOEXCEPT;\n#else\n _NOEXCEPT_(is_nothrow_move_constructible::value);\n#endif\n vector(vector&& __v, const allocator_type& __a);\n _LIBCPP_INLINE_VISIBILITY\n vector& operator=(vector&& __v)\n _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n _LIBCPP_INLINE_VISIBILITY\n vector& operator=(initializer_list __il)\n {assign(__il.begin(), __il.end()); return *this;}\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\n template \n typename enable_if\n <\n __is_input_iterator<_InputIterator>::value &&\n !__is_forward_iterator<_InputIterator>::value,\n void\n >::type\n assign(_InputIterator __first, _InputIterator __last);\n template \n typename enable_if\n <\n __is_forward_iterator<_ForwardIterator>::value,\n void\n >::type\n assign(_ForwardIterator __first, _ForwardIterator __last);\n\n void assign(size_type __n, const value_type& __x);\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n _LIBCPP_INLINE_VISIBILITY\n void assign(initializer_list __il)\n {assign(__il.begin(), __il.end());}\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\n _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const _NOEXCEPT\n {return allocator_type(this->__alloc());}\n\n size_type max_size() const _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n size_type capacity() const _NOEXCEPT\n {return __internal_cap_to_external(__cap());}\n _LIBCPP_INLINE_VISIBILITY\n size_type size() const _NOEXCEPT\n {return __size_;}\n _LIBCPP_INLINE_VISIBILITY\n bool empty() const _NOEXCEPT\n {return __size_ == 0;}\n void reserve(size_type __n);\n void shrink_to_fit() _NOEXCEPT;\n\n _LIBCPP_INLINE_VISIBILITY\n iterator begin() _NOEXCEPT\n {return __make_iter(0);}\n _LIBCPP_INLINE_VISIBILITY\n const_iterator begin() const _NOEXCEPT\n {return __make_iter(0);}\n _LIBCPP_INLINE_VISIBILITY\n iterator end() _NOEXCEPT\n {return __make_iter(__size_);}\n _LIBCPP_INLINE_VISIBILITY\n const_iterator end() const _NOEXCEPT\n {return __make_iter(__size_);}\n\n _LIBCPP_INLINE_VISIBILITY\n reverse_iterator rbegin() _NOEXCEPT\n {return reverse_iterator(end());}\n _LIBCPP_INLINE_VISIBILITY\n const_reverse_iterator rbegin() const _NOEXCEPT\n {return const_reverse_iterator(end());}\n _LIBCPP_INLINE_VISIBILITY\n reverse_iterator rend() _NOEXCEPT\n {return reverse_iterator(begin());}\n _LIBCPP_INLINE_VISIBILITY\n const_reverse_iterator rend() const _NOEXCEPT\n {return const_reverse_iterator(begin());}\n\n _LIBCPP_INLINE_VISIBILITY\n const_iterator cbegin() const _NOEXCEPT\n {return __make_iter(0);}\n _LIBCPP_INLINE_VISIBILITY\n const_iterator cend() const _NOEXCEPT\n {return __make_iter(__size_);}\n _LIBCPP_INLINE_VISIBILITY\n const_reverse_iterator crbegin() const _NOEXCEPT\n {return rbegin();}\n _LIBCPP_INLINE_VISIBILITY\n const_reverse_iterator crend() const _NOEXCEPT\n {return rend();}\n\n _LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n) {return __make_ref(__n);}\n _LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __n) const {return __make_ref(__n);}\n reference at(size_type __n);\n const_reference at(size_type __n) const;\n\n _LIBCPP_INLINE_VISIBILITY reference front() {return __make_ref(0);}\n _LIBCPP_INLINE_VISIBILITY const_reference front() const {return __make_ref(0);}\n _LIBCPP_INLINE_VISIBILITY reference back() {return __make_ref(__size_ - 1);}\n _LIBCPP_INLINE_VISIBILITY const_reference back() const {return __make_ref(__size_ - 1);}\n\n void push_back(const value_type& __x);\n#if _LIBCPP_STD_VER > 11\n template \n#if _LIBCPP_STD_VER > 14\n _LIBCPP_INLINE_VISIBILITY reference emplace_back(_Args&&... __args)\n#else\n _LIBCPP_INLINE_VISIBILITY void emplace_back(_Args&&... __args)\n#endif\n {\n push_back ( value_type ( _VSTD::forward<_Args>(__args)... ));\n#if _LIBCPP_STD_VER > 14\n return this->back();\n#endif\n }\n#endif\n\n _LIBCPP_INLINE_VISIBILITY void pop_back() {--__size_;}\n\n#if _LIBCPP_STD_VER > 11\n template \n _LIBCPP_INLINE_VISIBILITY iterator emplace(const_iterator position, _Args&&... __args)\n { return insert ( position, value_type ( _VSTD::forward<_Args>(__args)... )); }\n#endif\n\n iterator insert(const_iterator __position, const value_type& __x);\n iterator insert(const_iterator __position, size_type __n, const value_type& __x);\n iterator insert(const_iterator __position, size_type __n, const_reference __x);\n template \n typename enable_if\n <\n __is_input_iterator <_InputIterator>::value &&\n !__is_forward_iterator<_InputIterator>::value,\n iterator\n >::type\n insert(const_iterator __position, _InputIterator __first, _InputIterator __last);\n template \n typename enable_if\n <\n __is_forward_iterator<_ForwardIterator>::value,\n iterator\n >::type\n insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last);\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n _LIBCPP_INLINE_VISIBILITY\n iterator insert(const_iterator __position, initializer_list __il)\n {return insert(__position, __il.begin(), __il.end());}\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\n _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __position);\n iterator erase(const_iterator __first, const_iterator __last);\n\n _LIBCPP_INLINE_VISIBILITY\n void clear() _NOEXCEPT {__size_ = 0;}\n\n void swap(vector&)\n#if _LIBCPP_STD_VER >= 14\n _NOEXCEPT;\n#else\n _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||\n __is_nothrow_swappable::value);\n#endif\n static void swap(reference __x, reference __y) _NOEXCEPT { _VSTD::swap(__x, __y); }\n\n void resize(size_type __sz, value_type __x = false);\n void flip() _NOEXCEPT;\n\n bool __invariants() const;\n\nprivate:\n _LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();\n void allocate(size_type __n);\n void deallocate() _NOEXCEPT;\n _LIBCPP_INLINE_VISIBILITY\n static size_type __align_it(size_type __new_size) _NOEXCEPT\n {return __new_size + (__bits_per_word-1) & ~((size_type)__bits_per_word-1);};\n _LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __new_size) const;\n _LIBCPP_INLINE_VISIBILITY void __construct_at_end(size_type __n, bool __x);\n template \n typename enable_if\n <\n __is_forward_iterator<_ForwardIterator>::value,\n void\n >::type\n __construct_at_end(_ForwardIterator __first, _ForwardIterator __last);\n void __append(size_type __n, const_reference __x);\n _LIBCPP_INLINE_VISIBILITY\n reference __make_ref(size_type __pos) _NOEXCEPT\n {return reference(__begin_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);}\n _LIBCPP_INLINE_VISIBILITY\n const_reference __make_ref(size_type __pos) const _NOEXCEPT\n {return const_reference(__begin_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);}\n _LIBCPP_INLINE_VISIBILITY\n iterator __make_iter(size_type __pos) _NOEXCEPT\n {return iterator(__begin_ + __pos / __bits_per_word, static_cast(__pos % __bits_per_word));}\n _LIBCPP_INLINE_VISIBILITY\n const_iterator __make_iter(size_type __pos) const _NOEXCEPT\n {return const_iterator(__begin_ + __pos / __bits_per_word, static_cast(__pos % __bits_per_word));}\n _LIBCPP_INLINE_VISIBILITY\n iterator __const_iterator_cast(const_iterator __p) _NOEXCEPT\n {return begin() + (__p - cbegin());}\n\n _LIBCPP_INLINE_VISIBILITY\n void __copy_assign_alloc(const vector& __v)\n {__copy_assign_alloc(__v, integral_constant());}\n _LIBCPP_INLINE_VISIBILITY\n void __copy_assign_alloc(const vector& __c, true_type)\n {\n if (__alloc() != __c.__alloc())\n deallocate();\n __alloc() = __c.__alloc();\n }\n\n _LIBCPP_INLINE_VISIBILITY\n void __copy_assign_alloc(const vector&, false_type)\n {}\n\n void __move_assign(vector& __c, false_type);\n void __move_assign(vector& __c, true_type)\n _NOEXCEPT_(is_nothrow_move_assignable::value);\n _LIBCPP_INLINE_VISIBILITY\n void __move_assign_alloc(vector& __c)\n _NOEXCEPT_(\n !__storage_traits::propagate_on_container_move_assignment::value ||\n is_nothrow_move_assignable::value)\n {__move_assign_alloc(__c, integral_constant());}\n _LIBCPP_INLINE_VISIBILITY\n void __move_assign_alloc(vector& __c, true_type)\n _NOEXCEPT_(is_nothrow_move_assignable::value)\n {\n __alloc() = _VSTD::move(__c.__alloc());\n }\n\n _LIBCPP_INLINE_VISIBILITY\n void __move_assign_alloc(vector&, false_type)\n _NOEXCEPT\n {}\n\n size_t __hash_code() const _NOEXCEPT;\n\n friend class __bit_reference;\n friend class __bit_const_reference;\n friend class __bit_iterator;\n friend class __bit_iterator;\n friend struct __bit_array;\n friend struct _LIBCPP_TEMPLATE_VIS hash;\n};\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nvector::__invalidate_all_iterators()\n{\n}\n\n// Allocate space for __n objects\n// throws length_error if __n > max_size()\n// throws (probably bad_alloc) if memory run out\n// Precondition: __begin_ == __end_ == __cap() == 0\n// Precondition: __n > 0\n// Postcondition: capacity() == __n\n// Postcondition: size() == 0\ntemplate \nvoid\nvector::allocate(size_type __n)\n{\n if (__n > max_size())\n this->__throw_length_error();\n __n = __external_cap_to_internal(__n);\n this->__begin_ = __storage_traits::allocate(this->__alloc(), __n);\n this->__size_ = 0;\n this->__cap() = __n;\n}\n\ntemplate \nvoid\nvector::deallocate() _NOEXCEPT\n{\n if (this->__begin_ != nullptr)\n {\n __storage_traits::deallocate(this->__alloc(), this->__begin_, __cap());\n __invalidate_all_iterators();\n this->__begin_ = nullptr;\n this->__size_ = this->__cap() = 0;\n }\n}\n\ntemplate \ntypename vector::size_type\nvector::max_size() const _NOEXCEPT\n{\n size_type __amax = __storage_traits::max_size(__alloc());\n size_type __nmax = numeric_limits::max() / 2; // end() >= begin(), always\n if (__nmax / __bits_per_word <= __amax)\n return __nmax;\n return __internal_cap_to_external(__amax);\n}\n\n// Precondition: __new_size > capacity()\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename vector::size_type\nvector::__recommend(size_type __new_size) const\n{\n const size_type __ms = max_size();\n if (__new_size > __ms)\n this->__throw_length_error();\n const size_type __cap = capacity();\n if (__cap >= __ms / 2)\n return __ms;\n return _VSTD::max(2*__cap, __align_it(__new_size));\n}\n\n// Default constructs __n objects starting at __end_\n// Precondition: __n > 0\n// Precondition: size() + __n <= capacity()\n// Postcondition: size() == size() + __n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nvector::__construct_at_end(size_type __n, bool __x)\n{\n size_type __old_size = this->__size_;\n this->__size_ += __n;\n _VSTD::fill_n(__make_iter(__old_size), __n, __x);\n}\n\ntemplate \ntemplate \ntypename enable_if\n<\n __is_forward_iterator<_ForwardIterator>::value,\n void\n>::type\nvector::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last)\n{\n size_type __old_size = this->__size_;\n this->__size_ += _VSTD::distance(__first, __last);\n _VSTD::copy(__first, __last, __make_iter(__old_size));\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvector::vector()\n _NOEXCEPT_(is_nothrow_default_constructible::value)\n : __begin_(nullptr),\n __size_(0),\n __cap_alloc_(0)\n{\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvector::vector(const allocator_type& __a)\n#if _LIBCPP_STD_VER <= 14\n _NOEXCEPT_(is_nothrow_copy_constructible::value)\n#else\n _NOEXCEPT\n#endif\n : __begin_(nullptr),\n __size_(0),\n __cap_alloc_(0, static_cast<__storage_allocator>(__a))\n{\n}\n\ntemplate \nvector::vector(size_type __n)\n : __begin_(nullptr),\n __size_(0),\n __cap_alloc_(0)\n{\n if (__n > 0)\n {\n allocate(__n);\n __construct_at_end(__n, false);\n }\n}\n\n#if _LIBCPP_STD_VER > 11\ntemplate \nvector::vector(size_type __n, const allocator_type& __a)\n : __begin_(nullptr),\n __size_(0),\n __cap_alloc_(0, static_cast<__storage_allocator>(__a))\n{\n if (__n > 0)\n {\n allocate(__n);\n __construct_at_end(__n, false);\n }\n}\n#endif\n\ntemplate \nvector::vector(size_type __n, const value_type& __x)\n : __begin_(nullptr),\n __size_(0),\n __cap_alloc_(0)\n{\n if (__n > 0)\n {\n allocate(__n);\n __construct_at_end(__n, __x);\n }\n}\n\ntemplate \nvector::vector(size_type __n, const value_type& __x, const allocator_type& __a)\n : __begin_(nullptr),\n __size_(0),\n __cap_alloc_(0, static_cast<__storage_allocator>(__a))\n{\n if (__n > 0)\n {\n allocate(__n);\n __construct_at_end(__n, __x);\n }\n}\n\ntemplate \ntemplate \nvector::vector(_InputIterator __first, _InputIterator __last,\n typename enable_if<__is_input_iterator <_InputIterator>::value &&\n !__is_forward_iterator<_InputIterator>::value>::type*)\n : __begin_(nullptr),\n __size_(0),\n __cap_alloc_(0)\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n for (; __first != __last; ++__first)\n push_back(*__first);\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n if (__begin_ != nullptr)\n __storage_traits::deallocate(__alloc(), __begin_, __cap());\n __invalidate_all_iterators();\n throw;\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n}\n\ntemplate \ntemplate \nvector::vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a,\n typename enable_if<__is_input_iterator <_InputIterator>::value &&\n !__is_forward_iterator<_InputIterator>::value>::type*)\n : __begin_(nullptr),\n __size_(0),\n __cap_alloc_(0, static_cast<__storage_allocator>(__a))\n{\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n for (; __first != __last; ++__first)\n push_back(*__first);\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n if (__begin_ != nullptr)\n __storage_traits::deallocate(__alloc(), __begin_, __cap());\n __invalidate_all_iterators();\n throw;\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n}\n\ntemplate \ntemplate \nvector::vector(_ForwardIterator __first, _ForwardIterator __last,\n typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type*)\n : __begin_(nullptr),\n __size_(0),\n __cap_alloc_(0)\n{\n size_type __n = static_cast(_VSTD::distance(__first, __last));\n if (__n > 0)\n {\n allocate(__n);\n __construct_at_end(__first, __last);\n }\n}\n\ntemplate \ntemplate \nvector::vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a,\n typename enable_if<__is_forward_iterator<_ForwardIterator>::value>::type*)\n : __begin_(nullptr),\n __size_(0),\n __cap_alloc_(0, static_cast<__storage_allocator>(__a))\n{\n size_type __n = static_cast(_VSTD::distance(__first, __last));\n if (__n > 0)\n {\n allocate(__n);\n __construct_at_end(__first, __last);\n }\n}\n\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\ntemplate \nvector::vector(initializer_list __il)\n : __begin_(nullptr),\n __size_(0),\n __cap_alloc_(0)\n{\n size_type __n = static_cast(__il.size());\n if (__n > 0)\n {\n allocate(__n);\n __construct_at_end(__il.begin(), __il.end());\n }\n}\n\ntemplate \nvector::vector(initializer_list __il, const allocator_type& __a)\n : __begin_(nullptr),\n __size_(0),\n __cap_alloc_(0, static_cast<__storage_allocator>(__a))\n{\n size_type __n = static_cast(__il.size());\n if (__n > 0)\n {\n allocate(__n);\n __construct_at_end(__il.begin(), __il.end());\n }\n}\n\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\ntemplate \nvector::~vector()\n{\n if (__begin_ != nullptr)\n __storage_traits::deallocate(__alloc(), __begin_, __cap());\n __invalidate_all_iterators();\n}\n\ntemplate \nvector::vector(const vector& __v)\n : __begin_(nullptr),\n __size_(0),\n __cap_alloc_(0, __storage_traits::select_on_container_copy_construction(__v.__alloc()))\n{\n if (__v.size() > 0)\n {\n allocate(__v.size());\n __construct_at_end(__v.begin(), __v.end());\n }\n}\n\ntemplate \nvector::vector(const vector& __v, const allocator_type& __a)\n : __begin_(nullptr),\n __size_(0),\n __cap_alloc_(0, __a)\n{\n if (__v.size() > 0)\n {\n allocate(__v.size());\n __construct_at_end(__v.begin(), __v.end());\n }\n}\n\ntemplate \nvector&\nvector::operator=(const vector& __v)\n{\n if (this != &__v)\n {\n __copy_assign_alloc(__v);\n if (__v.__size_)\n {\n if (__v.__size_ > capacity())\n {\n deallocate();\n allocate(__v.__size_);\n }\n _VSTD::copy(__v.__begin_, __v.__begin_ + __external_cap_to_internal(__v.__size_), __begin_);\n }\n __size_ = __v.__size_;\n }\n return *this;\n}\n\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvector::vector(vector&& __v)\n#if _LIBCPP_STD_VER > 14\n _NOEXCEPT\n#else\n _NOEXCEPT_(is_nothrow_move_constructible::value)\n#endif\n : __begin_(__v.__begin_),\n __size_(__v.__size_),\n __cap_alloc_(__v.__cap_alloc_)\n{\n __v.__begin_ = nullptr;\n __v.__size_ = 0;\n __v.__cap() = 0;\n}\n\ntemplate \nvector::vector(vector&& __v, const allocator_type& __a)\n : __begin_(nullptr),\n __size_(0),\n __cap_alloc_(0, __a)\n{\n if (__a == allocator_type(__v.__alloc()))\n {\n this->__begin_ = __v.__begin_;\n this->__size_ = __v.__size_;\n this->__cap() = __v.__cap();\n __v.__begin_ = nullptr;\n __v.__cap() = __v.__size_ = 0;\n }\n else if (__v.size() > 0)\n {\n allocate(__v.size());\n __construct_at_end(__v.begin(), __v.end());\n }\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvector&\nvector::operator=(vector&& __v)\n _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value))\n{\n __move_assign(__v, integral_constant());\n return *this;\n}\n\ntemplate \nvoid\nvector::__move_assign(vector& __c, false_type)\n{\n if (__alloc() != __c.__alloc())\n assign(__c.begin(), __c.end());\n else\n __move_assign(__c, true_type());\n}\n\ntemplate \nvoid\nvector::__move_assign(vector& __c, true_type)\n _NOEXCEPT_(is_nothrow_move_assignable::value)\n{\n deallocate();\n __move_assign_alloc(__c);\n this->__begin_ = __c.__begin_;\n this->__size_ = __c.__size_;\n this->__cap() = __c.__cap();\n __c.__begin_ = nullptr;\n __c.__cap() = __c.__size_ = 0;\n}\n\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n\ntemplate \nvoid\nvector::assign(size_type __n, const value_type& __x)\n{\n __size_ = 0;\n if (__n > 0)\n {\n size_type __c = capacity();\n if (__n <= __c)\n __size_ = __n;\n else\n {\n vector __v(__alloc());\n __v.reserve(__recommend(__n));\n __v.__size_ = __n;\n swap(__v);\n }\n _VSTD::fill_n(begin(), __n, __x);\n }\n __invalidate_all_iterators();\n}\n\ntemplate \ntemplate \ntypename enable_if\n<\n __is_input_iterator<_InputIterator>::value &&\n !__is_forward_iterator<_InputIterator>::value,\n void\n>::type\nvector::assign(_InputIterator __first, _InputIterator __last)\n{\n clear();\n for (; __first != __last; ++__first)\n push_back(*__first);\n}\n\ntemplate \ntemplate \ntypename enable_if\n<\n __is_forward_iterator<_ForwardIterator>::value,\n void\n>::type\nvector::assign(_ForwardIterator __first, _ForwardIterator __last)\n{\n clear();\n difference_type __ns = _VSTD::distance(__first, __last);\n _LIBCPP_ASSERT(__ns >= 0, \"invalid range specified\");\n const size_t __n = static_cast(__ns);\n if (__n)\n {\n if (__n > capacity())\n {\n deallocate();\n allocate(__n);\n }\n __construct_at_end(__first, __last);\n }\n}\n\ntemplate \nvoid\nvector::reserve(size_type __n)\n{\n if (__n > capacity())\n {\n vector __v(this->__alloc());\n __v.allocate(__n);\n __v.__construct_at_end(this->begin(), this->end());\n swap(__v);\n __invalidate_all_iterators();\n }\n}\n\ntemplate \nvoid\nvector::shrink_to_fit() _NOEXCEPT\n{\n if (__external_cap_to_internal(size()) > __cap())\n {\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n vector(*this, allocator_type(__alloc())).swap(*this);\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n }\n}\n\ntemplate \ntypename vector::reference\nvector::at(size_type __n)\n{\n if (__n >= size())\n this->__throw_out_of_range();\n return (*this)[__n];\n}\n\ntemplate \ntypename vector::const_reference\nvector::at(size_type __n) const\n{\n if (__n >= size())\n this->__throw_out_of_range();\n return (*this)[__n];\n}\n\ntemplate \nvoid\nvector::push_back(const value_type& __x)\n{\n if (this->__size_ == this->capacity())\n reserve(__recommend(this->__size_ + 1));\n ++this->__size_;\n back() = __x;\n}\n\ntemplate \ntypename vector::iterator\nvector::insert(const_iterator __position, const value_type& __x)\n{\n iterator __r;\n if (size() < capacity())\n {\n const_iterator __old_end = end();\n ++__size_;\n _VSTD::copy_backward(__position, __old_end, end());\n __r = __const_iterator_cast(__position);\n }\n else\n {\n vector __v(__alloc());\n __v.reserve(__recommend(__size_ + 1));\n __v.__size_ = __size_ + 1;\n __r = _VSTD::copy(cbegin(), __position, __v.begin());\n _VSTD::copy_backward(__position, cend(), __v.end());\n swap(__v);\n }\n *__r = __x;\n return __r;\n}\n\ntemplate \ntypename vector::iterator\nvector::insert(const_iterator __position, size_type __n, const value_type& __x)\n{\n iterator __r;\n size_type __c = capacity();\n if (__n <= __c && size() <= __c - __n)\n {\n const_iterator __old_end = end();\n __size_ += __n;\n _VSTD::copy_backward(__position, __old_end, end());\n __r = __const_iterator_cast(__position);\n }\n else\n {\n vector __v(__alloc());\n __v.reserve(__recommend(__size_ + __n));\n __v.__size_ = __size_ + __n;\n __r = _VSTD::copy(cbegin(), __position, __v.begin());\n _VSTD::copy_backward(__position, cend(), __v.end());\n swap(__v);\n }\n _VSTD::fill_n(__r, __n, __x);\n return __r;\n}\n\ntemplate \ntemplate \ntypename enable_if\n<\n __is_input_iterator <_InputIterator>::value &&\n !__is_forward_iterator<_InputIterator>::value,\n typename vector::iterator\n>::type\nvector::insert(const_iterator __position, _InputIterator __first, _InputIterator __last)\n{\n difference_type __off = __position - begin();\n iterator __p = __const_iterator_cast(__position);\n iterator __old_end = end();\n for (; size() != capacity() && __first != __last; ++__first)\n {\n ++this->__size_;\n back() = *__first;\n }\n vector __v(__alloc());\n if (__first != __last)\n {\n#ifndef _LIBCPP_NO_EXCEPTIONS\n try\n {\n#endif // _LIBCPP_NO_EXCEPTIONS\n __v.assign(__first, __last);\n difference_type __old_size = static_cast(__old_end - begin());\n difference_type __old_p = __p - begin();\n reserve(__recommend(size() + __v.size()));\n __p = begin() + __old_p;\n __old_end = begin() + __old_size;\n#ifndef _LIBCPP_NO_EXCEPTIONS\n }\n catch (...)\n {\n erase(__old_end, end());\n throw;\n }\n#endif // _LIBCPP_NO_EXCEPTIONS\n }\n __p = _VSTD::rotate(__p, __old_end, end());\n insert(__p, __v.begin(), __v.end());\n return begin() + __off;\n}\n\ntemplate \ntemplate \ntypename enable_if\n<\n __is_forward_iterator<_ForwardIterator>::value,\n typename vector::iterator\n>::type\nvector::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last)\n{\n const difference_type __n_signed = _VSTD::distance(__first, __last);\n _LIBCPP_ASSERT(__n_signed >= 0, \"invalid range specified\");\n const size_type __n = static_cast(__n_signed);\n iterator __r;\n size_type __c = capacity();\n if (__n <= __c && size() <= __c - __n)\n {\n const_iterator __old_end = end();\n __size_ += __n;\n _VSTD::copy_backward(__position, __old_end, end());\n __r = __const_iterator_cast(__position);\n }\n else\n {\n vector __v(__alloc());\n __v.reserve(__recommend(__size_ + __n));\n __v.__size_ = __size_ + __n;\n __r = _VSTD::copy(cbegin(), __position, __v.begin());\n _VSTD::copy_backward(__position, cend(), __v.end());\n swap(__v);\n }\n _VSTD::copy(__first, __last, __r);\n return __r;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename vector::iterator\nvector::erase(const_iterator __position)\n{\n iterator __r = __const_iterator_cast(__position);\n _VSTD::copy(__position + 1, this->cend(), __r);\n --__size_;\n return __r;\n}\n\ntemplate \ntypename vector::iterator\nvector::erase(const_iterator __first, const_iterator __last)\n{\n iterator __r = __const_iterator_cast(__first);\n difference_type __d = __last - __first;\n _VSTD::copy(__last, this->cend(), __r);\n __size_ -= __d;\n return __r;\n}\n\ntemplate \nvoid\nvector::swap(vector& __x)\n#if _LIBCPP_STD_VER >= 14\n _NOEXCEPT\n#else\n _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||\n __is_nothrow_swappable::value)\n#endif\n{\n _VSTD::swap(this->__begin_, __x.__begin_);\n _VSTD::swap(this->__size_, __x.__size_);\n _VSTD::swap(this->__cap(), __x.__cap());\n __swap_allocator(this->__alloc(), __x.__alloc(), \n integral_constant());\n}\n\ntemplate \nvoid\nvector::resize(size_type __sz, value_type __x)\n{\n size_type __cs = size();\n if (__cs < __sz)\n {\n iterator __r;\n size_type __c = capacity();\n size_type __n = __sz - __cs;\n if (__n <= __c && __cs <= __c - __n)\n {\n __r = end();\n __size_ += __n;\n }\n else\n {\n vector __v(__alloc());\n __v.reserve(__recommend(__size_ + __n));\n __v.__size_ = __size_ + __n;\n __r = _VSTD::copy(cbegin(), cend(), __v.begin());\n swap(__v);\n }\n _VSTD::fill_n(__r, __n, __x);\n }\n else\n __size_ = __sz;\n}\n\ntemplate \nvoid\nvector::flip() _NOEXCEPT\n{\n // do middle whole words\n size_type __n = __size_;\n __storage_pointer __p = __begin_;\n for (; __n >= __bits_per_word; ++__p, __n -= __bits_per_word)\n *__p = ~*__p;\n // do last partial word\n if (__n > 0)\n {\n __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);\n __storage_type __b = *__p & __m;\n *__p &= ~__m;\n *__p |= ~__b & __m;\n }\n}\n\ntemplate \nbool\nvector::__invariants() const\n{\n if (this->__begin_ == nullptr)\n {\n if (this->__size_ != 0 || this->__cap() != 0)\n return false;\n }\n else\n {\n if (this->__cap() == 0)\n return false;\n if (this->__size_ > this->capacity())\n return false;\n }\n return true;\n}\n\ntemplate \nsize_t\nvector::__hash_code() const _NOEXCEPT\n{\n size_t __h = 0;\n // do middle whole words\n size_type __n = __size_;\n __storage_pointer __p = __begin_;\n for (; __n >= __bits_per_word; ++__p, __n -= __bits_per_word)\n __h ^= *__p;\n // do last partial word\n if (__n > 0)\n {\n const __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);\n __h ^= *__p & __m;\n }\n return __h;\n}\n\ntemplate \nstruct _LIBCPP_TEMPLATE_VIS hash >\n : public unary_function, size_t>\n{\n _LIBCPP_INLINE_VISIBILITY\n size_t operator()(const vector& __vec) const _NOEXCEPT\n {return __vec.__hash_code();}\n};\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator==(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y)\n{\n const typename vector<_Tp, _Allocator>::size_type __sz = __x.size();\n return __sz == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator!=(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y)\n{\n return !(__x == __y);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator< (const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y)\n{\n return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator> (const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y)\n{\n return __y < __x;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator>=(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y)\n{\n return !(__x < __y);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator<=(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y)\n{\n return !(__y < __x);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nswap(vector<_Tp, _Allocator>& __x, vector<_Tp, _Allocator>& __y)\n _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))\n{\n __x.swap(__y);\n}\n\n_LIBCPP_END_NAMESPACE_STD\n\n#endif // _LIBCPP_VECTOR\n","// -*- C++ -*-\n//===-------------------------- iterator ----------------------------------===//\n//\n// The LLVM Compiler Infrastructure\n//\n// This file is dual licensed under the MIT and the University of Illinois Open\n// Source Licenses. See LICENSE.TXT for details.\n//\n//===----------------------------------------------------------------------===//\n\n#ifndef _LIBCPP_ITERATOR\n#define _LIBCPP_ITERATOR\n\n/*\n iterator synopsis\n\nnamespace std\n{\n\ntemplate\nstruct iterator_traits\n{\n typedef typename Iterator::difference_type difference_type;\n typedef typename Iterator::value_type value_type;\n typedef typename Iterator::pointer pointer;\n typedef typename Iterator::reference reference;\n typedef typename Iterator::iterator_category iterator_category;\n};\n\ntemplate\nstruct iterator_traits\n{\n typedef ptrdiff_t difference_type;\n typedef T value_type;\n typedef T* pointer;\n typedef T& reference;\n typedef random_access_iterator_tag iterator_category;\n};\n\ntemplate\nstruct iterator_traits\n{\n typedef ptrdiff_t difference_type;\n typedef T value_type;\n typedef const T* pointer;\n typedef const T& reference;\n typedef random_access_iterator_tag iterator_category;\n};\n\ntemplate\nstruct iterator\n{\n typedef T value_type;\n typedef Distance difference_type;\n typedef Pointer pointer;\n typedef Reference reference;\n typedef Category iterator_category;\n};\n\nstruct input_iterator_tag {};\nstruct output_iterator_tag {};\nstruct forward_iterator_tag : public input_iterator_tag {};\nstruct bidirectional_iterator_tag : public forward_iterator_tag {};\nstruct random_access_iterator_tag : public bidirectional_iterator_tag {};\n\n// extension: second argument not conforming to C++03\ntemplate \nvoid advance(InputIterator& i,\n typename iterator_traits::difference_type n);\n\ntemplate \ntypename iterator_traits::difference_type\ndistance(InputIterator first, InputIterator last);\n\ntemplate \nclass reverse_iterator\n : public iterator::iterator_category,\n typename iterator_traits::value_type,\n typename iterator_traits::difference_type,\n typename iterator_traits::pointer,\n typename iterator_traits::reference>\n{\nprotected:\n Iterator current;\npublic:\n typedef Iterator iterator_type;\n typedef typename iterator_traits::difference_type difference_type;\n typedef typename iterator_traits::reference reference;\n typedef typename iterator_traits::pointer pointer;\n\n constexpr reverse_iterator();\n constexpr explicit reverse_iterator(Iterator x);\n template constexpr reverse_iterator(const reverse_iterator& u);\n template constexpr reverse_iterator& operator=(const reverse_iterator& u);\n constexpr Iterator base() const;\n constexpr reference operator*() const;\n constexpr pointer operator->() const;\n constexpr reverse_iterator& operator++();\n constexpr reverse_iterator operator++(int);\n constexpr reverse_iterator& operator--();\n constexpr reverse_iterator operator--(int);\n constexpr reverse_iterator operator+ (difference_type n) const;\n constexpr reverse_iterator& operator+=(difference_type n);\n constexpr reverse_iterator operator- (difference_type n) const;\n constexpr reverse_iterator& operator-=(difference_type n);\n constexpr reference operator[](difference_type n) const;\n};\n\ntemplate \nconstexpr bool // constexpr in C++17\noperator==(const reverse_iterator& x, const reverse_iterator& y);\n\ntemplate \nconstexpr bool // constexpr in C++17\noperator<(const reverse_iterator& x, const reverse_iterator& y);\n\ntemplate \nconstexpr bool // constexpr in C++17\noperator!=(const reverse_iterator& x, const reverse_iterator& y);\n\ntemplate \nconstexpr bool // constexpr in C++17\noperator>(const reverse_iterator& x, const reverse_iterator& y);\n\ntemplate \nconstexpr bool // constexpr in C++17\noperator>=(const reverse_iterator& x, const reverse_iterator& y);\n\ntemplate \nconstexpr bool // constexpr in C++17\noperator<=(const reverse_iterator& x, const reverse_iterator& y);\n\ntemplate \nconstexpr auto\noperator-(const reverse_iterator& x, const reverse_iterator& y)\n-> decltype(__y.base() - __x.base()); // constexpr in C++17\n\ntemplate \nconstexpr reverse_iterator\noperator+(typename reverse_iterator::difference_type n, \n const reverse_iterator& x); // constexpr in C++17\n\ntemplate \nconstexpr reverse_iterator make_reverse_iterator(Iterator i); // C++14, constexpr in C++17\n\ntemplate \nclass back_insert_iterator\n{\nprotected:\n Container* container;\npublic:\n typedef Container container_type;\n typedef void value_type;\n typedef void difference_type;\n typedef void reference;\n typedef void pointer;\n\n explicit back_insert_iterator(Container& x);\n back_insert_iterator& operator=(const typename Container::value_type& value);\n back_insert_iterator& operator*();\n back_insert_iterator& operator++();\n back_insert_iterator operator++(int);\n};\n\ntemplate back_insert_iterator back_inserter(Container& x);\n\ntemplate \nclass front_insert_iterator\n{\nprotected:\n Container* container;\npublic:\n typedef Container container_type;\n typedef void value_type;\n typedef void difference_type;\n typedef void reference;\n typedef void pointer;\n\n explicit front_insert_iterator(Container& x);\n front_insert_iterator& operator=(const typename Container::value_type& value);\n front_insert_iterator& operator*();\n front_insert_iterator& operator++();\n front_insert_iterator operator++(int);\n};\n\ntemplate front_insert_iterator front_inserter(Container& x);\n\ntemplate \nclass insert_iterator\n{\nprotected:\n Container* container;\n typename Container::iterator iter;\npublic:\n typedef Container container_type;\n typedef void value_type;\n typedef void difference_type;\n typedef void reference;\n typedef void pointer;\n\n insert_iterator(Container& x, typename Container::iterator i);\n insert_iterator& operator=(const typename Container::value_type& value);\n insert_iterator& operator*();\n insert_iterator& operator++();\n insert_iterator& operator++(int);\n};\n\ntemplate \ninsert_iterator inserter(Container& x, Iterator i);\n\ntemplate \nclass move_iterator {\npublic:\n typedef Iterator iterator_type;\n typedef typename iterator_traits::difference_type difference_type;\n typedef Iterator pointer;\n typedef typename iterator_traits::value_type value_type;\n typedef typename iterator_traits::iterator_category iterator_category;\n typedef value_type&& reference;\n \n constexpr move_iterator(); // all the constexprs are in C++17\n constexpr explicit move_iterator(Iterator i);\n template \n constexpr move_iterator(const move_iterator& u);\n template \n constexpr move_iterator& operator=(const move_iterator& u);\n constexpr iterator_type base() const;\n constexpr reference operator*() const;\n constexpr pointer operator->() const;\n constexpr move_iterator& operator++();\n constexpr move_iterator operator++(int);\n constexpr move_iterator& operator--();\n constexpr move_iterator operator--(int);\n constexpr move_iterator operator+(difference_type n) const; \n constexpr move_iterator& operator+=(difference_type n); \n constexpr move_iterator operator-(difference_type n) const; \n constexpr move_iterator& operator-=(difference_type n); \n constexpr unspecified operator[](difference_type n) const;\nprivate:\n Iterator current; // exposition only\n};\n\ntemplate \nconstexpr bool // constexpr in C++17\noperator==(const move_iterator& x, const move_iterator& y);\n\ntemplate \nconstexpr bool // constexpr in C++17\noperator!=(const move_iterator& x, const move_iterator& y);\n\ntemplate \nconstexpr bool // constexpr in C++17\noperator<(const move_iterator& x, const move_iterator& y);\n\ntemplate \nconstexpr bool // constexpr in C++17\noperator<=(const move_iterator& x, const move_iterator& y);\n\ntemplate \nconstexpr bool // constexpr in C++17\noperator>(const move_iterator& x, const move_iterator& y);\n\ntemplate \nconstexpr bool // constexpr in C++17\noperator>=(const move_iterator& x, const move_iterator& y);\n\ntemplate \nconstexpr auto // constexpr in C++17\noperator-(const move_iterator& x,\n const move_iterator& y) -> decltype(x.base() - y.base());\n\ntemplate \nconstexpr move_iterator operator+( // constexpr in C++17\n typename move_iterator::difference_type n, \n const move_iterator& x);\n\ntemplate // constexpr in C++17\nconstexpr move_iterator make_move_iterator(const Iterator& i);\n\n\ntemplate , class Distance = ptrdiff_t>\nclass istream_iterator\n : public iterator\n{\npublic:\n typedef charT char_type;\n typedef traits traits_type;\n typedef basic_istream istream_type;\n\n constexpr istream_iterator();\n istream_iterator(istream_type& s);\n istream_iterator(const istream_iterator& x);\n ~istream_iterator();\n\n const T& operator*() const;\n const T* operator->() const;\n istream_iterator& operator++();\n istream_iterator operator++(int);\n};\n\ntemplate \nbool operator==(const istream_iterator& x,\n const istream_iterator& y);\ntemplate \nbool operator!=(const istream_iterator& x,\n const istream_iterator& y);\n\ntemplate >\nclass ostream_iterator\n : public iterator\n{\npublic:\n typedef charT char_type;\n typedef traits traits_type;\n typedef basic_ostream ostream_type;\n\n ostream_iterator(ostream_type& s);\n ostream_iterator(ostream_type& s, const charT* delimiter);\n ostream_iterator(const ostream_iterator& x);\n ~ostream_iterator();\n ostream_iterator& operator=(const T& value);\n\n ostream_iterator& operator*();\n ostream_iterator& operator++();\n ostream_iterator& operator++(int);\n};\n\ntemplate >\nclass istreambuf_iterator\n : public iterator\n{\npublic:\n typedef charT char_type;\n typedef traits traits_type;\n typedef typename traits::int_type int_type;\n typedef basic_streambuf streambuf_type;\n typedef basic_istream istream_type;\n\n istreambuf_iterator() noexcept;\n istreambuf_iterator(istream_type& s) noexcept;\n istreambuf_iterator(streambuf_type* s) noexcept;\n istreambuf_iterator(a-private-type) noexcept;\n\n charT operator*() const;\n pointer operator->() const;\n istreambuf_iterator& operator++();\n a-private-type operator++(int);\n\n bool equal(const istreambuf_iterator& b) const;\n};\n\ntemplate \nbool operator==(const istreambuf_iterator& a,\n const istreambuf_iterator& b);\ntemplate \nbool operator!=(const istreambuf_iterator& a,\n const istreambuf_iterator& b);\n\ntemplate >\nclass ostreambuf_iterator\n : public iterator\n{\npublic:\n typedef charT char_type;\n typedef traits traits_type;\n typedef basic_streambuf streambuf_type;\n typedef basic_ostream ostream_type;\n\n ostreambuf_iterator(ostream_type& s) noexcept;\n ostreambuf_iterator(streambuf_type* s) noexcept;\n ostreambuf_iterator& operator=(charT c);\n ostreambuf_iterator& operator*();\n ostreambuf_iterator& operator++();\n ostreambuf_iterator& operator++(int);\n bool failed() const noexcept;\n};\n\ntemplate constexpr auto begin(C& c) -> decltype(c.begin());\ntemplate constexpr auto begin(const C& c) -> decltype(c.begin());\ntemplate constexpr auto end(C& c) -> decltype(c.end());\ntemplate constexpr auto end(const C& c) -> decltype(c.end());\ntemplate constexpr T* begin(T (&array)[N]);\ntemplate constexpr T* end(T (&array)[N]);\n\ntemplate auto constexpr cbegin(const C& c) -> decltype(std::begin(c)); // C++14\ntemplate auto constexpr cend(const C& c) -> decltype(std::end(c)); // C++14\ntemplate auto constexpr rbegin(C& c) -> decltype(c.rbegin()); // C++14\ntemplate auto constexpr rbegin(const C& c) -> decltype(c.rbegin()); // C++14\ntemplate auto constexpr rend(C& c) -> decltype(c.rend()); // C++14\ntemplate constexpr auto rend(const C& c) -> decltype(c.rend()); // C++14\ntemplate reverse_iterator constexpr rbegin(initializer_list il); // C++14\ntemplate reverse_iterator constexpr rend(initializer_list il); // C++14\ntemplate reverse_iterator constexpr rbegin(T (&array)[N]); // C++14\ntemplate reverse_iterator constexpr rend(T (&array)[N]); // C++14\ntemplate constexpr auto crbegin(const C& c) -> decltype(std::rbegin(c)); // C++14\ntemplate constexpr auto crend(const C& c) -> decltype(std::rend(c)); // C++14\n\n// 24.8, container access:\ntemplate constexpr auto size(const C& c) -> decltype(c.size()); // C++17\ntemplate constexpr size_t size(const T (&array)[N]) noexcept; // C++17\ntemplate constexpr auto empty(const C& c) -> decltype(c.empty()); // C++17\ntemplate constexpr bool empty(const T (&array)[N]) noexcept; // C++17\ntemplate constexpr bool empty(initializer_list il) noexcept; // C++17\ntemplate constexpr auto data(C& c) -> decltype(c.data()); // C++17\ntemplate constexpr auto data(const C& c) -> decltype(c.data()); // C++17\ntemplate constexpr T* data(T (&array)[N]) noexcept; // C++17\ntemplate constexpr const E* data(initializer_list il) noexcept; // C++17\n\n} // std\n\n*/\n\n#include <__config>\n#include // for forward declarations of vector and string.\n#include <__functional_base>\n#include \n#include \n#include \n#ifdef __APPLE__\n#include \n#endif\n\n#include <__debug>\n\n#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)\n#pragma GCC system_header\n#endif\n\n_LIBCPP_BEGIN_NAMESPACE_STD\n\nstruct _LIBCPP_TEMPLATE_VIS input_iterator_tag {};\nstruct _LIBCPP_TEMPLATE_VIS output_iterator_tag {};\nstruct _LIBCPP_TEMPLATE_VIS forward_iterator_tag : public input_iterator_tag {};\nstruct _LIBCPP_TEMPLATE_VIS bidirectional_iterator_tag : public forward_iterator_tag {};\nstruct _LIBCPP_TEMPLATE_VIS random_access_iterator_tag : public bidirectional_iterator_tag {};\n\ntemplate \nstruct __has_iterator_category\n{\nprivate:\n struct __two {char __lx; char __lxx;};\n template static __two __test(...);\n template static char __test(typename _Up::iterator_category* = 0);\npublic:\n static const bool value = sizeof(__test<_Tp>(0)) == 1;\n};\n\ntemplate struct __iterator_traits_impl {};\n\ntemplate \nstruct __iterator_traits_impl<_Iter, true>\n{\n typedef typename _Iter::difference_type difference_type;\n typedef typename _Iter::value_type value_type;\n typedef typename _Iter::pointer pointer;\n typedef typename _Iter::reference reference;\n typedef typename _Iter::iterator_category iterator_category;\n};\n\ntemplate struct __iterator_traits {};\n\ntemplate \nstruct __iterator_traits<_Iter, true>\n : __iterator_traits_impl\n <\n _Iter,\n is_convertible::value ||\n is_convertible::value\n >\n{};\n\n// iterator_traits will only have the nested types if Iterator::iterator_category\n// exists. Else iterator_traits will be an empty class. This is a\n// conforming extension which allows some programs to compile and behave as\n// the client expects instead of failing at compile time.\n\ntemplate \nstruct _LIBCPP_TEMPLATE_VIS iterator_traits\n : __iterator_traits<_Iter, __has_iterator_category<_Iter>::value> {};\n\ntemplate\nstruct _LIBCPP_TEMPLATE_VIS iterator_traits<_Tp*>\n{\n typedef ptrdiff_t difference_type;\n typedef typename remove_const<_Tp>::type value_type;\n typedef _Tp* pointer;\n typedef _Tp& reference;\n typedef random_access_iterator_tag iterator_category;\n};\n\ntemplate >::value>\nstruct __has_iterator_category_convertible_to\n : public integral_constant::iterator_category, _Up>::value>\n{};\n\ntemplate \nstruct __has_iterator_category_convertible_to<_Tp, _Up, false> : public false_type {};\n\ntemplate \nstruct __is_input_iterator : public __has_iterator_category_convertible_to<_Tp, input_iterator_tag> {};\n\ntemplate \nstruct __is_forward_iterator : public __has_iterator_category_convertible_to<_Tp, forward_iterator_tag> {};\n\ntemplate \nstruct __is_bidirectional_iterator : public __has_iterator_category_convertible_to<_Tp, bidirectional_iterator_tag> {};\n\ntemplate \nstruct __is_random_access_iterator : public __has_iterator_category_convertible_to<_Tp, random_access_iterator_tag> {};\n\ntemplate \nstruct __is_exactly_input_iterator\n : public integral_constant::value && \n !__has_iterator_category_convertible_to<_Tp, forward_iterator_tag>::value> {};\n\ntemplate\nstruct _LIBCPP_TEMPLATE_VIS iterator\n{\n typedef _Tp value_type;\n typedef _Distance difference_type;\n typedef _Pointer pointer;\n typedef _Reference reference;\n typedef _Category iterator_category;\n};\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid __advance(_InputIter& __i,\n typename iterator_traits<_InputIter>::difference_type __n, input_iterator_tag)\n{\n for (; __n > 0; --__n)\n ++__i;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid __advance(_BiDirIter& __i,\n typename iterator_traits<_BiDirIter>::difference_type __n, bidirectional_iterator_tag)\n{\n if (__n >= 0)\n for (; __n > 0; --__n)\n ++__i;\n else\n for (; __n < 0; ++__n)\n --__i;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid __advance(_RandIter& __i,\n typename iterator_traits<_RandIter>::difference_type __n, random_access_iterator_tag)\n{\n __i += __n;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid advance(_InputIter& __i,\n typename iterator_traits<_InputIter>::difference_type __n)\n{\n __advance(__i, __n, typename iterator_traits<_InputIter>::iterator_category());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename iterator_traits<_InputIter>::difference_type\n__distance(_InputIter __first, _InputIter __last, input_iterator_tag)\n{\n typename iterator_traits<_InputIter>::difference_type __r(0);\n for (; __first != __last; ++__first)\n ++__r;\n return __r;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename iterator_traits<_RandIter>::difference_type\n__distance(_RandIter __first, _RandIter __last, random_access_iterator_tag)\n{\n return __last - __first;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename iterator_traits<_InputIter>::difference_type\ndistance(_InputIter __first, _InputIter __last)\n{\n return __distance(__first, __last, typename iterator_traits<_InputIter>::iterator_category());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_InputIter\nnext(_InputIter __x,\n typename iterator_traits<_InputIter>::difference_type __n = 1,\n typename enable_if<__is_input_iterator<_InputIter>::value>::type* = 0)\n{\n _VSTD::advance(__x, __n);\n return __x;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_BidiretionalIter\nprev(_BidiretionalIter __x,\n typename iterator_traits<_BidiretionalIter>::difference_type __n = 1,\n typename enable_if<__is_bidirectional_iterator<_BidiretionalIter>::value>::type* = 0)\n{\n _VSTD::advance(__x, -__n);\n return __x;\n}\n\ntemplate \nclass _LIBCPP_TEMPLATE_VIS reverse_iterator\n : public iterator::iterator_category,\n typename iterator_traits<_Iter>::value_type,\n typename iterator_traits<_Iter>::difference_type,\n typename iterator_traits<_Iter>::pointer,\n typename iterator_traits<_Iter>::reference>\n{\nprivate:\n /*mutable*/ _Iter __t; // no longer used as of LWG #2360, not removed due to ABI break\nprotected:\n _Iter current;\npublic:\n typedef _Iter iterator_type;\n typedef typename iterator_traits<_Iter>::difference_type difference_type;\n typedef typename iterator_traits<_Iter>::reference reference;\n typedef typename iterator_traits<_Iter>::pointer pointer;\n\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n reverse_iterator() : __t(), current() {}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n explicit reverse_iterator(_Iter __x) : __t(__x), current(__x) {}\n template \n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n reverse_iterator(const reverse_iterator<_Up>& __u) : __t(__u.base()), current(__u.base()) {}\n template \n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n reverse_iterator& operator=(const reverse_iterator<_Up>& __u)\n { __t = current = __u.base(); return *this; }\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n _Iter base() const {return current;}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n reference operator*() const {_Iter __tmp = current; return *--__tmp;}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n pointer operator->() const {return _VSTD::addressof(operator*());}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n reverse_iterator& operator++() {--current; return *this;}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n reverse_iterator operator++(int) {reverse_iterator __tmp(*this); --current; return __tmp;}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n reverse_iterator& operator--() {++current; return *this;}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n reverse_iterator operator--(int) {reverse_iterator __tmp(*this); ++current; return __tmp;}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n reverse_iterator operator+ (difference_type __n) const {return reverse_iterator(current - __n);}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n reverse_iterator& operator+=(difference_type __n) {current -= __n; return *this;}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n reverse_iterator operator- (difference_type __n) const {return reverse_iterator(current + __n);}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n reverse_iterator& operator-=(difference_type __n) {current += __n; return *this;}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n reference operator[](difference_type __n) const {return *(*this + __n);}\n};\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nbool\noperator==(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)\n{\n return __x.base() == __y.base();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nbool\noperator<(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)\n{\n return __x.base() > __y.base();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nbool\noperator!=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)\n{\n return __x.base() != __y.base();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nbool\noperator>(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)\n{\n return __x.base() < __y.base();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nbool\noperator>=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)\n{\n return __x.base() <= __y.base();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nbool\noperator<=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)\n{\n return __x.base() >= __y.base();\n}\n\n#ifndef _LIBCPP_CXX03_LANG\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nauto\noperator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)\n-> decltype(__y.base() - __x.base())\n{\n return __y.base() - __x.base();\n}\n#else\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename reverse_iterator<_Iter1>::difference_type\noperator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)\n{\n return __y.base() - __x.base();\n}\n#endif\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nreverse_iterator<_Iter>\noperator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_iterator<_Iter>& __x)\n{\n return reverse_iterator<_Iter>(__x.base() - __n);\n}\n\n#if _LIBCPP_STD_VER > 11\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nreverse_iterator<_Iter> make_reverse_iterator(_Iter __i)\n{\n return reverse_iterator<_Iter>(__i);\n}\n#endif\n\ntemplate \nclass _LIBCPP_TEMPLATE_VIS back_insert_iterator\n : public iterator\n{\nprotected:\n _Container* container;\npublic:\n typedef _Container container_type;\n\n _LIBCPP_INLINE_VISIBILITY explicit back_insert_iterator(_Container& __x) : container(_VSTD::addressof(__x)) {}\n _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator=(const typename _Container::value_type& __value_)\n {container->push_back(__value_); return *this;}\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator=(typename _Container::value_type&& __value_)\n {container->push_back(_VSTD::move(__value_)); return *this;}\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator*() {return *this;}\n _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator++() {return *this;}\n _LIBCPP_INLINE_VISIBILITY back_insert_iterator operator++(int) {return *this;}\n};\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nback_insert_iterator<_Container>\nback_inserter(_Container& __x)\n{\n return back_insert_iterator<_Container>(__x);\n}\n\ntemplate \nclass _LIBCPP_TEMPLATE_VIS front_insert_iterator\n : public iterator\n{\nprotected:\n _Container* container;\npublic:\n typedef _Container container_type;\n\n _LIBCPP_INLINE_VISIBILITY explicit front_insert_iterator(_Container& __x) : container(_VSTD::addressof(__x)) {}\n _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator=(const typename _Container::value_type& __value_)\n {container->push_front(__value_); return *this;}\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator=(typename _Container::value_type&& __value_)\n {container->push_front(_VSTD::move(__value_)); return *this;}\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator*() {return *this;}\n _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator++() {return *this;}\n _LIBCPP_INLINE_VISIBILITY front_insert_iterator operator++(int) {return *this;}\n};\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nfront_insert_iterator<_Container>\nfront_inserter(_Container& __x)\n{\n return front_insert_iterator<_Container>(__x);\n}\n\ntemplate \nclass _LIBCPP_TEMPLATE_VIS insert_iterator\n : public iterator\n{\nprotected:\n _Container* container;\n typename _Container::iterator iter;\npublic:\n typedef _Container container_type;\n\n _LIBCPP_INLINE_VISIBILITY insert_iterator(_Container& __x, typename _Container::iterator __i)\n : container(_VSTD::addressof(__x)), iter(__i) {}\n _LIBCPP_INLINE_VISIBILITY insert_iterator& operator=(const typename _Container::value_type& __value_)\n {iter = container->insert(iter, __value_); ++iter; return *this;}\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY insert_iterator& operator=(typename _Container::value_type&& __value_)\n {iter = container->insert(iter, _VSTD::move(__value_)); ++iter; return *this;}\n#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _LIBCPP_INLINE_VISIBILITY insert_iterator& operator*() {return *this;}\n _LIBCPP_INLINE_VISIBILITY insert_iterator& operator++() {return *this;}\n _LIBCPP_INLINE_VISIBILITY insert_iterator& operator++(int) {return *this;}\n};\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ninsert_iterator<_Container>\ninserter(_Container& __x, typename _Container::iterator __i)\n{\n return insert_iterator<_Container>(__x, __i);\n}\n\ntemplate , class _Distance = ptrdiff_t>\nclass _LIBCPP_TEMPLATE_VIS istream_iterator\n : public iterator\n{\npublic:\n typedef _CharT char_type;\n typedef _Traits traits_type;\n typedef basic_istream<_CharT,_Traits> istream_type;\nprivate:\n istream_type* __in_stream_;\n _Tp __value_;\npublic:\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istream_iterator() : __in_stream_(0), __value_() {}\n _LIBCPP_INLINE_VISIBILITY istream_iterator(istream_type& __s) : __in_stream_(_VSTD::addressof(__s))\n {\n if (!(*__in_stream_ >> __value_))\n __in_stream_ = 0;\n }\n\n _LIBCPP_INLINE_VISIBILITY const _Tp& operator*() const {return __value_;}\n _LIBCPP_INLINE_VISIBILITY const _Tp* operator->() const {return _VSTD::addressof((operator*()));}\n _LIBCPP_INLINE_VISIBILITY istream_iterator& operator++()\n {\n if (!(*__in_stream_ >> __value_))\n __in_stream_ = 0;\n return *this;\n }\n _LIBCPP_INLINE_VISIBILITY istream_iterator operator++(int)\n {istream_iterator __t(*this); ++(*this); return __t;}\n\n friend _LIBCPP_INLINE_VISIBILITY\n bool operator==(const istream_iterator& __x, const istream_iterator& __y)\n {return __x.__in_stream_ == __y.__in_stream_;}\n\n friend _LIBCPP_INLINE_VISIBILITY\n bool operator!=(const istream_iterator& __x, const istream_iterator& __y)\n {return !(__x == __y);}\n};\n\ntemplate >\nclass _LIBCPP_TEMPLATE_VIS ostream_iterator\n : public iterator\n{\npublic:\n typedef _CharT char_type;\n typedef _Traits traits_type;\n typedef basic_ostream<_CharT,_Traits> ostream_type;\nprivate:\n ostream_type* __out_stream_;\n const char_type* __delim_;\npublic:\n _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s) _NOEXCEPT\n : __out_stream_(_VSTD::addressof(__s)), __delim_(0) {}\n _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s, const _CharT* __delimiter) _NOEXCEPT\n : __out_stream_(_VSTD::addressof(__s)), __delim_(__delimiter) {}\n _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator=(const _Tp& __value_)\n {\n *__out_stream_ << __value_;\n if (__delim_)\n *__out_stream_ << __delim_;\n return *this;\n }\n\n _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator*() {return *this;}\n _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator++() {return *this;}\n _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator++(int) {return *this;}\n};\n\ntemplate\nclass _LIBCPP_TEMPLATE_VIS istreambuf_iterator\n : public iterator\n{\npublic:\n typedef _CharT char_type;\n typedef _Traits traits_type;\n typedef typename _Traits::int_type int_type;\n typedef basic_streambuf<_CharT,_Traits> streambuf_type;\n typedef basic_istream<_CharT,_Traits> istream_type;\nprivate:\n mutable streambuf_type* __sbuf_;\n\n class __proxy\n {\n char_type __keep_;\n streambuf_type* __sbuf_;\n _LIBCPP_INLINE_VISIBILITY __proxy(char_type __c, streambuf_type* __s)\n : __keep_(__c), __sbuf_(__s) {}\n friend class istreambuf_iterator;\n public:\n _LIBCPP_INLINE_VISIBILITY char_type operator*() const {return __keep_;}\n };\n\n _LIBCPP_INLINE_VISIBILITY\n bool __test_for_eof() const\n {\n if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sgetc(), traits_type::eof()))\n __sbuf_ = 0;\n return __sbuf_ == 0;\n }\npublic:\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istreambuf_iterator() _NOEXCEPT : __sbuf_(0) {}\n _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) _NOEXCEPT\n : __sbuf_(__s.rdbuf()) {}\n _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) _NOEXCEPT\n : __sbuf_(__s) {}\n _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(const __proxy& __p) _NOEXCEPT\n : __sbuf_(__p.__sbuf_) {}\n\n _LIBCPP_INLINE_VISIBILITY char_type operator*() const\n {return static_cast(__sbuf_->sgetc());}\n _LIBCPP_INLINE_VISIBILITY char_type* operator->() const {return nullptr;}\n _LIBCPP_INLINE_VISIBILITY istreambuf_iterator& operator++()\n {\n __sbuf_->sbumpc();\n return *this;\n }\n _LIBCPP_INLINE_VISIBILITY __proxy operator++(int)\n {\n return __proxy(__sbuf_->sbumpc(), __sbuf_);\n }\n\n _LIBCPP_INLINE_VISIBILITY bool equal(const istreambuf_iterator& __b) const\n {return __test_for_eof() == __b.__test_for_eof();}\n};\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool operator==(const istreambuf_iterator<_CharT,_Traits>& __a,\n const istreambuf_iterator<_CharT,_Traits>& __b)\n {return __a.equal(__b);}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool operator!=(const istreambuf_iterator<_CharT,_Traits>& __a,\n const istreambuf_iterator<_CharT,_Traits>& __b)\n {return !__a.equal(__b);}\n\ntemplate \nclass _LIBCPP_TEMPLATE_VIS ostreambuf_iterator\n : public iterator\n{\npublic:\n typedef _CharT char_type;\n typedef _Traits traits_type;\n typedef basic_streambuf<_CharT,_Traits> streambuf_type;\n typedef basic_ostream<_CharT,_Traits> ostream_type;\nprivate:\n streambuf_type* __sbuf_;\npublic:\n _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator(ostream_type& __s) _NOEXCEPT\n : __sbuf_(__s.rdbuf()) {}\n _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator(streambuf_type* __s) _NOEXCEPT\n : __sbuf_(__s) {}\n _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator=(_CharT __c)\n {\n if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sputc(__c), traits_type::eof()))\n __sbuf_ = 0;\n return *this;\n }\n _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator*() {return *this;}\n _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++() {return *this;}\n _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++(int) {return *this;}\n _LIBCPP_INLINE_VISIBILITY bool failed() const _NOEXCEPT {return __sbuf_ == 0;}\n\n#if !defined(__APPLE__) || \\\n (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED > __MAC_10_8) || \\\n (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_6_0)\n\n template \n friend\n _LIBCPP_HIDDEN\n ostreambuf_iterator<_Ch, _Tr>\n __pad_and_output(ostreambuf_iterator<_Ch, _Tr> __s,\n const _Ch* __ob, const _Ch* __op, const _Ch* __oe,\n ios_base& __iob, _Ch __fl);\n#endif\n};\n\ntemplate \nclass _LIBCPP_TEMPLATE_VIS move_iterator\n{\nprivate:\n _Iter __i;\npublic:\n typedef _Iter iterator_type;\n typedef typename iterator_traits::iterator_category iterator_category;\n typedef typename iterator_traits::value_type value_type;\n typedef typename iterator_traits::difference_type difference_type;\n typedef iterator_type pointer;\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n typedef typename iterator_traits::reference __reference;\n typedef typename conditional<\n is_reference<__reference>::value,\n typename remove_reference<__reference>::type&&,\n __reference\n >::type reference;\n#else\n typedef typename iterator_traits::reference reference;\n#endif\n\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n move_iterator() : __i() {}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n explicit move_iterator(_Iter __x) : __i(__x) {}\n template \n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n move_iterator(const move_iterator<_Up>& __u) : __i(__u.base()) {}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 _Iter base() const {return __i;}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 \n reference operator*() const { return static_cast(*__i); }\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n pointer operator->() const { return __i;}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n move_iterator& operator++() {++__i; return *this;}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n move_iterator operator++(int) {move_iterator __tmp(*this); ++__i; return __tmp;}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n move_iterator& operator--() {--__i; return *this;}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n move_iterator operator--(int) {move_iterator __tmp(*this); --__i; return __tmp;}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n move_iterator operator+ (difference_type __n) const {return move_iterator(__i + __n);}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n move_iterator& operator+=(difference_type __n) {__i += __n; return *this;}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n move_iterator operator- (difference_type __n) const {return move_iterator(__i - __n);}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n move_iterator& operator-=(difference_type __n) {__i -= __n; return *this;}\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\n reference operator[](difference_type __n) const { return static_cast(__i[__n]); }\n};\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nbool\noperator==(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)\n{\n return __x.base() == __y.base();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nbool\noperator<(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)\n{\n return __x.base() < __y.base();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nbool\noperator!=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)\n{\n return __x.base() != __y.base();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nbool\noperator>(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)\n{\n return __x.base() > __y.base();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nbool\noperator>=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)\n{\n return __x.base() >= __y.base();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nbool\noperator<=(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)\n{\n return __x.base() <= __y.base();\n}\n\n#ifndef _LIBCPP_CXX03_LANG\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nauto\noperator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)\n-> decltype(__x.base() - __y.base())\n{\n return __x.base() - __y.base();\n}\n#else\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename move_iterator<_Iter1>::difference_type\noperator-(const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y)\n{\n return __x.base() - __y.base();\n}\n#endif\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nmove_iterator<_Iter>\noperator+(typename move_iterator<_Iter>::difference_type __n, const move_iterator<_Iter>& __x)\n{\n return move_iterator<_Iter>(__x.base() + __n);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nmove_iterator<_Iter>\nmake_move_iterator(_Iter __i)\n{\n return move_iterator<_Iter>(__i);\n}\n\n// __wrap_iter\n\ntemplate class __wrap_iter;\n\ntemplate \n_LIBCPP_INLINE_VISIBILITY\nbool\noperator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;\n\ntemplate \n_LIBCPP_INLINE_VISIBILITY\nbool\noperator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;\n\ntemplate \n_LIBCPP_INLINE_VISIBILITY\nbool\noperator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;\n\ntemplate \n_LIBCPP_INLINE_VISIBILITY\nbool\noperator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;\n\ntemplate \n_LIBCPP_INLINE_VISIBILITY\nbool\noperator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;\n\ntemplate \n_LIBCPP_INLINE_VISIBILITY\nbool\noperator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;\n\n#ifndef _LIBCPP_CXX03_LANG\ntemplate \n_LIBCPP_INLINE_VISIBILITY\nauto\noperator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG\n-> decltype(__x.base() - __y.base());\n#else\ntemplate \n_LIBCPP_INLINE_VISIBILITY\ntypename __wrap_iter<_Iter1>::difference_type\noperator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;\n#endif\n\ntemplate \n_LIBCPP_INLINE_VISIBILITY\n__wrap_iter<_Iter>\noperator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOEXCEPT_DEBUG;\n\ntemplate _Op _LIBCPP_INLINE_VISIBILITY copy(_Ip, _Ip, _Op);\ntemplate _B2 _LIBCPP_INLINE_VISIBILITY copy_backward(_B1, _B1, _B2);\ntemplate _Op _LIBCPP_INLINE_VISIBILITY move(_Ip, _Ip, _Op);\ntemplate _B2 _LIBCPP_INLINE_VISIBILITY move_backward(_B1, _B1, _B2);\n\n#if _LIBCPP_DEBUG_LEVEL < 2\n\ntemplate \n_LIBCPP_INLINE_VISIBILITY\ntypename enable_if\n<\n is_trivially_copy_assignable<_Tp>::value,\n _Tp*\n>::type\n__unwrap_iter(__wrap_iter<_Tp*>);\n\n#else\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename enable_if\n<\n is_trivially_copy_assignable<_Tp>::value,\n __wrap_iter<_Tp*>\n>::type\n__unwrap_iter(__wrap_iter<_Tp*> __i);\n\n#endif\n\ntemplate \nclass __wrap_iter\n{\npublic:\n typedef _Iter iterator_type;\n typedef typename iterator_traits::iterator_category iterator_category;\n typedef typename iterator_traits::value_type value_type;\n typedef typename iterator_traits::difference_type difference_type;\n typedef typename iterator_traits::pointer pointer;\n typedef typename iterator_traits::reference reference;\nprivate:\n iterator_type __i;\npublic:\n _LIBCPP_INLINE_VISIBILITY __wrap_iter() _NOEXCEPT_DEBUG\n#if _LIBCPP_STD_VER > 11\n : __i{}\n#endif\n {\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__insert_i(this);\n#endif\n }\n template _LIBCPP_INLINE_VISIBILITY __wrap_iter(const __wrap_iter<_Up>& __u,\n typename enable_if::value>::type* = 0) _NOEXCEPT_DEBUG\n : __i(__u.base())\n {\n#if _LIBCPP_DEBUG_LEVEL >= 2\n __get_db()->__iterator_copy(this, &__u);\n#endif\n }\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_INLINE_VISIBILITY\n __wrap_iter(const __wrap_iter& __x)\n : __i(__x.base())\n {\n __get_db()->__iterator_copy(this, &__x);\n }\n _LIBCPP_INLINE_VISIBILITY\n __wrap_iter& operator=(const __wrap_iter& __x)\n {\n if (this != &__x)\n {\n __get_db()->__iterator_copy(this, &__x);\n __i = __x.__i;\n }\n return *this;\n }\n _LIBCPP_INLINE_VISIBILITY\n ~__wrap_iter()\n {\n __get_db()->__erase_i(this);\n }\n#endif\n _LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT_DEBUG\n {\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),\n \"Attempted to dereference a non-dereferenceable iterator\");\n#endif\n return *__i;\n }\n _LIBCPP_INLINE_VISIBILITY pointer operator->() const _NOEXCEPT_DEBUG\n {\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),\n \"Attempted to dereference a non-dereferenceable iterator\");\n#endif\n return (pointer)_VSTD::addressof(*__i);\n }\n _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator++() _NOEXCEPT_DEBUG\n {\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),\n \"Attempted to increment non-incrementable iterator\");\n#endif\n ++__i;\n return *this;\n }\n _LIBCPP_INLINE_VISIBILITY __wrap_iter operator++(int) _NOEXCEPT_DEBUG\n {__wrap_iter __tmp(*this); ++(*this); return __tmp;}\n _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator--() _NOEXCEPT_DEBUG\n {\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__decrementable(this),\n \"Attempted to decrement non-decrementable iterator\");\n#endif\n --__i;\n return *this;\n }\n _LIBCPP_INLINE_VISIBILITY __wrap_iter operator--(int) _NOEXCEPT_DEBUG\n {__wrap_iter __tmp(*this); --(*this); return __tmp;}\n _LIBCPP_INLINE_VISIBILITY __wrap_iter operator+ (difference_type __n) const _NOEXCEPT_DEBUG\n {__wrap_iter __w(*this); __w += __n; return __w;}\n _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator+=(difference_type __n) _NOEXCEPT_DEBUG\n {\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__addable(this, __n),\n \"Attempted to add/subtract iterator outside of valid range\");\n#endif\n __i += __n;\n return *this;\n }\n _LIBCPP_INLINE_VISIBILITY __wrap_iter operator- (difference_type __n) const _NOEXCEPT_DEBUG\n {return *this + (-__n);}\n _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator-=(difference_type __n) _NOEXCEPT_DEBUG\n {*this += -__n; return *this;}\n _LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const _NOEXCEPT_DEBUG\n {\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__subscriptable(this, __n),\n \"Attempted to subscript iterator outside of valid range\");\n#endif\n return __i[__n];\n }\n\n _LIBCPP_INLINE_VISIBILITY iterator_type base() const _NOEXCEPT_DEBUG {return __i;}\n\nprivate:\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_INLINE_VISIBILITY __wrap_iter(const void* __p, iterator_type __x) : __i(__x)\n {\n __get_db()->__insert_ic(this, __p);\n }\n#else\n _LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) _NOEXCEPT_DEBUG : __i(__x) {}\n#endif\n\n template friend class __wrap_iter;\n template friend class basic_string;\n template friend class _LIBCPP_TEMPLATE_VIS vector;\n\n template \n friend\n bool\n operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;\n\n template \n friend\n bool\n operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;\n\n template \n friend\n bool\n operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;\n\n template \n friend\n bool\n operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;\n\n template \n friend\n bool\n operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;\n\n template \n friend\n bool\n operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;\n\n#ifndef _LIBCPP_CXX03_LANG\n template \n friend\n auto\n operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG\n -> decltype(__x.base() - __y.base());\n#else\n template \n friend\n typename __wrap_iter<_Iter1>::difference_type\n operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT_DEBUG;\n#endif\n\n template \n friend\n __wrap_iter<_Iter1>\n operator+(typename __wrap_iter<_Iter1>::difference_type, __wrap_iter<_Iter1>) _NOEXCEPT_DEBUG;\n\n template friend _Op copy(_Ip, _Ip, _Op);\n template friend _B2 copy_backward(_B1, _B1, _B2);\n template friend _Op move(_Ip, _Ip, _Op);\n template friend _B2 move_backward(_B1, _B1, _B2);\n\n#if _LIBCPP_DEBUG_LEVEL < 2\n template \n friend\n typename enable_if\n <\n is_trivially_copy_assignable<_Tp>::value,\n _Tp*\n >::type\n __unwrap_iter(__wrap_iter<_Tp*>);\n#else\n template \n inline _LIBCPP_INLINE_VISIBILITY\n typename enable_if\n <\n is_trivially_copy_assignable<_Tp>::value,\n __wrap_iter<_Tp*>\n >::type\n __unwrap_iter(__wrap_iter<_Tp*> __i);\n#endif\n};\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG\n{\n return __x.base() == __y.base();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),\n \"Attempted to compare incomparable iterators\");\n#endif\n return __x.base() < __y.base();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG\n{\n return !(__x == __y);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG\n{\n return __y < __x;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG\n{\n return !(__x < __y);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG\n{\n return !(__y < __x);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG\n{\n return !(__x == __y);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG\n{\n return __y < __x;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG\n{\n return !(__x < __y);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\noperator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT_DEBUG\n{\n return !(__y < __x);\n}\n\n#ifndef _LIBCPP_CXX03_LANG\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nauto\noperator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG\n-> decltype(__x.base() - __y.base())\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),\n \"Attempted to subtract incompatible iterators\");\n#endif\n return __x.base() - __y.base();\n}\n#else\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename __wrap_iter<_Iter1>::difference_type\noperator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT_DEBUG\n{\n#if _LIBCPP_DEBUG_LEVEL >= 2\n _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),\n \"Attempted to subtract incompatible iterators\");\n#endif\n return __x.base() - __y.base();\n}\n#endif\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n__wrap_iter<_Iter>\noperator+(typename __wrap_iter<_Iter>::difference_type __n,\n __wrap_iter<_Iter> __x) _NOEXCEPT_DEBUG\n{\n __x += __n;\n return __x;\n}\n\ntemplate \nstruct __libcpp_is_trivial_iterator\n : public _LIBCPP_BOOL_CONSTANT(is_pointer<_Iter>::value) {};\n \ntemplate \nstruct __libcpp_is_trivial_iterator >\n : public _LIBCPP_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value) {};\n\ntemplate \nstruct __libcpp_is_trivial_iterator >\n : public _LIBCPP_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value) {};\n\ntemplate \nstruct __libcpp_is_trivial_iterator<__wrap_iter<_Iter> >\n : public _LIBCPP_BOOL_CONSTANT(__libcpp_is_trivial_iterator<_Iter>::value) {};\n\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\n_Tp*\nbegin(_Tp (&__array)[_Np])\n{\n return __array;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\n_Tp*\nend(_Tp (&__array)[_Np])\n{\n return __array + _Np;\n}\n\n#if !defined(_LIBCPP_CXX03_LANG)\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nauto\nbegin(_Cp& __c) -> decltype(__c.begin())\n{\n return __c.begin();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nauto\nbegin(const _Cp& __c) -> decltype(__c.begin())\n{\n return __c.begin();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nauto\nend(_Cp& __c) -> decltype(__c.end())\n{\n return __c.end();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nauto\nend(const _Cp& __c) -> decltype(__c.end())\n{\n return __c.end();\n}\n\n#if _LIBCPP_STD_VER > 11\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nreverse_iterator<_Tp*> rbegin(_Tp (&__array)[_Np])\n{\n return reverse_iterator<_Tp*>(__array + _Np);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nreverse_iterator<_Tp*> rend(_Tp (&__array)[_Np])\n{\n return reverse_iterator<_Tp*>(__array);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nreverse_iterator rbegin(initializer_list<_Ep> __il)\n{\n return reverse_iterator(__il.end());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nreverse_iterator rend(initializer_list<_Ep> __il)\n{\n return reverse_iterator(__il.begin());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\nauto cbegin(const _Cp& __c) -> decltype(_VSTD::begin(__c))\n{\n return _VSTD::begin(__c);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\nauto cend(const _Cp& __c) -> decltype(_VSTD::end(__c))\n{\n return _VSTD::end(__c);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nauto rbegin(_Cp& __c) -> decltype(__c.rbegin())\n{\n return __c.rbegin();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nauto rbegin(const _Cp& __c) -> decltype(__c.rbegin())\n{\n return __c.rbegin();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nauto rend(_Cp& __c) -> decltype(__c.rend())\n{\n return __c.rend();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nauto rend(const _Cp& __c) -> decltype(__c.rend())\n{\n return __c.rend();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nauto crbegin(const _Cp& __c) -> decltype(_VSTD::rbegin(__c))\n{\n return _VSTD::rbegin(__c);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14\nauto crend(const _Cp& __c) -> decltype(_VSTD::rend(__c))\n{\n return _VSTD::rend(__c);\n}\n\n#endif\n\n\n#else // defined(_LIBCPP_CXX03_LANG)\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename _Cp::iterator\nbegin(_Cp& __c)\n{\n return __c.begin();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename _Cp::const_iterator\nbegin(const _Cp& __c)\n{\n return __c.begin();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename _Cp::iterator\nend(_Cp& __c)\n{\n return __c.end();\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename _Cp::const_iterator\nend(const _Cp& __c)\n{\n return __c.end();\n}\n\n#endif // !defined(_LIBCPP_CXX03_LANG)\n\n#if _LIBCPP_STD_VER > 14\ntemplate \nconstexpr auto size(const _Cont& __c) -> decltype(__c.size()) { return __c.size(); }\n\ntemplate \nconstexpr size_t size(const _Tp (&)[_Sz]) noexcept { return _Sz; }\n\ntemplate \nconstexpr auto empty(const _Cont& __c) -> decltype(__c.empty()) { return __c.empty(); }\n\ntemplate \nconstexpr bool empty(const _Tp (&)[_Sz]) noexcept { return false; }\n\ntemplate \nconstexpr bool empty(initializer_list<_Ep> __il) noexcept { return __il.size() == 0; }\n\ntemplate constexpr\nauto data(_Cont& __c) -> decltype(__c.data()) { return __c.data(); }\n\ntemplate constexpr\nauto data(const _Cont& __c) -> decltype(__c.data()) { return __c.data(); }\n\ntemplate \nconstexpr _Tp* data(_Tp (&__array)[_Sz]) noexcept { return __array; }\n\ntemplate \nconstexpr const _Ep* data(initializer_list<_Ep> __il) noexcept { return __il.begin(); }\n#endif\n\n\n_LIBCPP_END_NAMESPACE_STD\n\n#endif // _LIBCPP_ITERATOR\n","// -*- C++ -*-\n//===-------------------------- algorithm ---------------------------------===//\n//\n// The LLVM Compiler Infrastructure\n//\n// This file is dual licensed under the MIT and the University of Illinois Open\n// Source Licenses. See LICENSE.TXT for details.\n//\n//===----------------------------------------------------------------------===//\n\n#ifndef _LIBCPP_ALGORITHM\n#define _LIBCPP_ALGORITHM\n\n/*\n algorithm synopsis\n\n#include \n\nnamespace std\n{\n\ntemplate \n bool\n all_of(InputIterator first, InputIterator last, Predicate pred);\n\ntemplate \n bool\n any_of(InputIterator first, InputIterator last, Predicate pred);\n\ntemplate \n bool\n none_of(InputIterator first, InputIterator last, Predicate pred);\n\ntemplate \n Function\n for_each(InputIterator first, InputIterator last, Function f);\n\ntemplate \n InputIterator\n find(InputIterator first, InputIterator last, const T& value);\n\ntemplate \n InputIterator\n find_if(InputIterator first, InputIterator last, Predicate pred);\n\ntemplate\n InputIterator\n find_if_not(InputIterator first, InputIterator last, Predicate pred);\n\ntemplate \n ForwardIterator1\n find_end(ForwardIterator1 first1, ForwardIterator1 last1,\n ForwardIterator2 first2, ForwardIterator2 last2);\n\ntemplate \n ForwardIterator1\n find_end(ForwardIterator1 first1, ForwardIterator1 last1,\n ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred);\n\ntemplate \n ForwardIterator1\n find_first_of(ForwardIterator1 first1, ForwardIterator1 last1,\n ForwardIterator2 first2, ForwardIterator2 last2);\n\ntemplate \n ForwardIterator1\n find_first_of(ForwardIterator1 first1, ForwardIterator1 last1,\n ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred);\n\ntemplate \n ForwardIterator\n adjacent_find(ForwardIterator first, ForwardIterator last);\n\ntemplate \n ForwardIterator\n adjacent_find(ForwardIterator first, ForwardIterator last, BinaryPredicate pred);\n\ntemplate \n typename iterator_traits::difference_type\n count(InputIterator first, InputIterator last, const T& value);\n\ntemplate \n typename iterator_traits::difference_type\n count_if(InputIterator first, InputIterator last, Predicate pred);\n\ntemplate \n pair\n mismatch(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2);\n\ntemplate \n pair\n mismatch(InputIterator1 first1, InputIterator1 last1,\n InputIterator2 first2, InputIterator2 last2); // **C++14**\n\ntemplate \n pair\n mismatch(InputIterator1 first1, InputIterator1 last1,\n InputIterator2 first2, BinaryPredicate pred);\n\ntemplate \n pair\n mismatch(InputIterator1 first1, InputIterator1 last1,\n InputIterator2 first2, InputIterator2 last2,\n BinaryPredicate pred); // **C++14**\n\ntemplate \n bool\n equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2);\n\ntemplate \n bool\n equal(InputIterator1 first1, InputIterator1 last1,\n InputIterator2 first2, InputIterator2 last2); // **C++14**\n\ntemplate \n bool\n equal(InputIterator1 first1, InputIterator1 last1,\n InputIterator2 first2, BinaryPredicate pred);\n\ntemplate \n bool\n equal(InputIterator1 first1, InputIterator1 last1,\n InputIterator2 first2, InputIterator2 last2,\n BinaryPredicate pred); // **C++14**\n\ntemplate\n bool\n is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,\n ForwardIterator2 first2);\n\ntemplate\n bool\n is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,\n ForwardIterator2 first2, ForwardIterator2 last2); // **C++14**\n\ntemplate\n bool\n is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,\n ForwardIterator2 first2, BinaryPredicate pred);\n\ntemplate\n bool\n is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,\n ForwardIterator2 first2, ForwardIterator2 last2,\n BinaryPredicate pred); // **C++14**\n\ntemplate \n ForwardIterator1\n search(ForwardIterator1 first1, ForwardIterator1 last1,\n ForwardIterator2 first2, ForwardIterator2 last2);\n\ntemplate \n ForwardIterator1\n search(ForwardIterator1 first1, ForwardIterator1 last1,\n ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred);\n\ntemplate \n ForwardIterator\n search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value);\n\ntemplate \n ForwardIterator\n search_n(ForwardIterator first, ForwardIterator last,\n Size count, const T& value, BinaryPredicate pred);\n\ntemplate \n OutputIterator\n copy(InputIterator first, InputIterator last, OutputIterator result);\n\ntemplate\n OutputIterator\n copy_if(InputIterator first, InputIterator last,\n OutputIterator result, Predicate pred);\n\ntemplate\n OutputIterator\n copy_n(InputIterator first, Size n, OutputIterator result);\n\ntemplate \n BidirectionalIterator2\n copy_backward(BidirectionalIterator1 first, BidirectionalIterator1 last,\n BidirectionalIterator2 result);\n\ntemplate \n ForwardIterator2\n swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2);\n\ntemplate \n void\n iter_swap(ForwardIterator1 a, ForwardIterator2 b);\n\ntemplate \n OutputIterator\n transform(InputIterator first, InputIterator last, OutputIterator result, UnaryOperation op);\n\ntemplate \n OutputIterator\n transform(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2,\n OutputIterator result, BinaryOperation binary_op);\n\ntemplate \n void\n replace(ForwardIterator first, ForwardIterator last, const T& old_value, const T& new_value);\n\ntemplate \n void\n replace_if(ForwardIterator first, ForwardIterator last, Predicate pred, const T& new_value);\n\ntemplate \n OutputIterator\n replace_copy(InputIterator first, InputIterator last, OutputIterator result,\n const T& old_value, const T& new_value);\n\ntemplate \n OutputIterator\n replace_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred, const T& new_value);\n\ntemplate \n void\n fill(ForwardIterator first, ForwardIterator last, const T& value);\n\ntemplate \n OutputIterator\n fill_n(OutputIterator first, Size n, const T& value);\n\ntemplate \n void\n generate(ForwardIterator first, ForwardIterator last, Generator gen);\n\ntemplate \n OutputIterator\n generate_n(OutputIterator first, Size n, Generator gen);\n\ntemplate \n ForwardIterator\n remove(ForwardIterator first, ForwardIterator last, const T& value);\n\ntemplate \n ForwardIterator\n remove_if(ForwardIterator first, ForwardIterator last, Predicate pred);\n\ntemplate \n OutputIterator\n remove_copy(InputIterator first, InputIterator last, OutputIterator result, const T& value);\n\ntemplate \n OutputIterator\n remove_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred);\n\ntemplate \n ForwardIterator\n unique(ForwardIterator first, ForwardIterator last);\n\ntemplate \n ForwardIterator\n unique(ForwardIterator first, ForwardIterator last, BinaryPredicate pred);\n\ntemplate \n OutputIterator\n unique_copy(InputIterator first, InputIterator last, OutputIterator result);\n\ntemplate \n OutputIterator\n unique_copy(InputIterator first, InputIterator last, OutputIterator result, BinaryPredicate pred);\n\ntemplate \n void\n reverse(BidirectionalIterator first, BidirectionalIterator last);\n\ntemplate \n OutputIterator\n reverse_copy(BidirectionalIterator first, BidirectionalIterator last, OutputIterator result);\n\ntemplate \n ForwardIterator\n rotate(ForwardIterator first, ForwardIterator middle, ForwardIterator last);\n\ntemplate \n OutputIterator\n rotate_copy(ForwardIterator first, ForwardIterator middle, ForwardIterator last, OutputIterator result);\n\ntemplate \n void\n random_shuffle(RandomAccessIterator first, RandomAccessIterator last); // deprecated in C++14\n\ntemplate \n void\n random_shuffle(RandomAccessIterator first, RandomAccessIterator last,\n RandomNumberGenerator& rand); // deprecated in C++14\n\ntemplate\n SampleIterator sample(PopulationIterator first, PopulationIterator last,\n SampleIterator out, Distance n,\n UniformRandomBitGenerator&& g); // C++17\n\ntemplate\n void shuffle(RandomAccessIterator first, RandomAccessIterator last,\n UniformRandomNumberGenerator&& g);\n\ntemplate \n bool\n is_partitioned(InputIterator first, InputIterator last, Predicate pred);\n\ntemplate \n ForwardIterator\n partition(ForwardIterator first, ForwardIterator last, Predicate pred);\n\ntemplate \n pair\n partition_copy(InputIterator first, InputIterator last,\n OutputIterator1 out_true, OutputIterator2 out_false,\n Predicate pred);\n\ntemplate \n ForwardIterator\n stable_partition(ForwardIterator first, ForwardIterator last, Predicate pred);\n\ntemplate\n ForwardIterator\n partition_point(ForwardIterator first, ForwardIterator last, Predicate pred);\n\ntemplate \n bool\n is_sorted(ForwardIterator first, ForwardIterator last);\n\ntemplate \n bool\n is_sorted(ForwardIterator first, ForwardIterator last, Compare comp);\n\ntemplate\n ForwardIterator\n is_sorted_until(ForwardIterator first, ForwardIterator last);\n\ntemplate \n ForwardIterator\n is_sorted_until(ForwardIterator first, ForwardIterator last, Compare comp);\n\ntemplate \n void\n sort(RandomAccessIterator first, RandomAccessIterator last);\n\ntemplate \n void\n sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp);\n\ntemplate \n void\n stable_sort(RandomAccessIterator first, RandomAccessIterator last);\n\ntemplate \n void\n stable_sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp);\n\ntemplate \n void\n partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last);\n\ntemplate \n void\n partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last, Compare comp);\n\ntemplate \n RandomAccessIterator\n partial_sort_copy(InputIterator first, InputIterator last,\n RandomAccessIterator result_first, RandomAccessIterator result_last);\n\ntemplate \n RandomAccessIterator\n partial_sort_copy(InputIterator first, InputIterator last,\n RandomAccessIterator result_first, RandomAccessIterator result_last, Compare comp);\n\ntemplate \n void\n nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last);\n\ntemplate \n void\n nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last, Compare comp);\n\ntemplate \n ForwardIterator\n lower_bound(ForwardIterator first, ForwardIterator last, const T& value);\n\ntemplate \n ForwardIterator\n lower_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp);\n\ntemplate \n ForwardIterator\n upper_bound(ForwardIterator first, ForwardIterator last, const T& value);\n\ntemplate \n ForwardIterator\n upper_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp);\n\ntemplate \n pair\n equal_range(ForwardIterator first, ForwardIterator last, const T& value);\n\ntemplate \n pair\n equal_range(ForwardIterator first, ForwardIterator last, const T& value, Compare comp);\n\ntemplate \n bool\n binary_search(ForwardIterator first, ForwardIterator last, const T& value);\n\ntemplate \n bool\n binary_search(ForwardIterator first, ForwardIterator last, const T& value, Compare comp);\n\ntemplate \n OutputIterator\n merge(InputIterator1 first1, InputIterator1 last1,\n InputIterator2 first2, InputIterator2 last2, OutputIterator result);\n\ntemplate \n OutputIterator\n merge(InputIterator1 first1, InputIterator1 last1,\n InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);\n\ntemplate \n void\n inplace_merge(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last);\n\ntemplate \n void\n inplace_merge(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last, Compare comp);\n\ntemplate \n bool\n includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2);\n\ntemplate \n bool\n includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp);\n\ntemplate \n OutputIterator\n set_union(InputIterator1 first1, InputIterator1 last1,\n InputIterator2 first2, InputIterator2 last2, OutputIterator result);\n\ntemplate \n OutputIterator\n set_union(InputIterator1 first1, InputIterator1 last1,\n InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);\n\ntemplate \n OutputIterator\n set_intersection(InputIterator1 first1, InputIterator1 last1,\n InputIterator2 first2, InputIterator2 last2, OutputIterator result);\n\ntemplate \n OutputIterator\n set_intersection(InputIterator1 first1, InputIterator1 last1,\n InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);\n\ntemplate \n OutputIterator\n set_difference(InputIterator1 first1, InputIterator1 last1,\n InputIterator2 first2, InputIterator2 last2, OutputIterator result);\n\ntemplate \n OutputIterator\n set_difference(InputIterator1 first1, InputIterator1 last1,\n InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);\n\ntemplate \n OutputIterator\n set_symmetric_difference(InputIterator1 first1, InputIterator1 last1,\n InputIterator2 first2, InputIterator2 last2, OutputIterator result);\n\ntemplate \n OutputIterator\n set_symmetric_difference(InputIterator1 first1, InputIterator1 last1,\n InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp);\n\ntemplate \n void\n push_heap(RandomAccessIterator first, RandomAccessIterator last);\n\ntemplate \n void\n push_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp);\n\ntemplate \n void\n pop_heap(RandomAccessIterator first, RandomAccessIterator last);\n\ntemplate \n void\n pop_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp);\n\ntemplate \n void\n make_heap(RandomAccessIterator first, RandomAccessIterator last);\n\ntemplate \n void\n make_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp);\n\ntemplate \n void\n sort_heap(RandomAccessIterator first, RandomAccessIterator last);\n\ntemplate \n void\n sort_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp);\n\ntemplate \n bool\n is_heap(RandomAccessIterator first, RandomAccessiterator last);\n\ntemplate \n bool\n is_heap(RandomAccessIterator first, RandomAccessiterator last, Compare comp);\n\ntemplate \n RandomAccessIterator\n is_heap_until(RandomAccessIterator first, RandomAccessiterator last);\n\ntemplate \n RandomAccessIterator\n is_heap_until(RandomAccessIterator first, RandomAccessiterator last, Compare comp);\n\ntemplate \n ForwardIterator\n min_element(ForwardIterator first, ForwardIterator last); // constexpr in C++14\n\ntemplate \n ForwardIterator\n min_element(ForwardIterator first, ForwardIterator last, Compare comp); // constexpr in C++14\n\ntemplate \n const T&\n min(const T& a, const T& b); // constexpr in C++14\n\ntemplate \n const T&\n min(const T& a, const T& b, Compare comp); // constexpr in C++14\n\ntemplate\n T\n min(initializer_list t); // constexpr in C++14\n\ntemplate\n T\n min(initializer_list t, Compare comp); // constexpr in C++14\n\ntemplate\n constexpr const T& clamp( const T& v, const T& lo, const T& hi ); // C++17\n\ntemplate\n constexpr const T& clamp( const T& v, const T& lo, const T& hi, Compare comp ); // C++17\n\ntemplate \n ForwardIterator\n max_element(ForwardIterator first, ForwardIterator last); // constexpr in C++14\n\ntemplate \n ForwardIterator\n max_element(ForwardIterator first, ForwardIterator last, Compare comp); // constexpr in C++14\n\ntemplate \n const T&\n max(const T& a, const T& b); // constexpr in C++14\n\ntemplate \n const T&\n max(const T& a, const T& b, Compare comp); // constexpr in C++14\n\ntemplate\n T\n max(initializer_list t); // constexpr in C++14\n\ntemplate\n T\n max(initializer_list t, Compare comp); // constexpr in C++14\n\ntemplate\n pair\n minmax_element(ForwardIterator first, ForwardIterator last); // constexpr in C++14\n\ntemplate\n pair\n minmax_element(ForwardIterator first, ForwardIterator last, Compare comp); // constexpr in C++14\n\ntemplate\n pair\n minmax(const T& a, const T& b); // constexpr in C++14\n\ntemplate\n pair\n minmax(const T& a, const T& b, Compare comp); // constexpr in C++14\n\ntemplate\n pair\n minmax(initializer_list t); // constexpr in C++14\n\ntemplate\n pair\n minmax(initializer_list t, Compare comp); // constexpr in C++14\n\ntemplate \n bool\n lexicographical_compare(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2);\n\ntemplate \n bool\n lexicographical_compare(InputIterator1 first1, InputIterator1 last1,\n InputIterator2 first2, InputIterator2 last2, Compare comp);\n\ntemplate \n bool\n next_permutation(BidirectionalIterator first, BidirectionalIterator last);\n\ntemplate \n bool\n next_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp);\n\ntemplate \n bool\n prev_permutation(BidirectionalIterator first, BidirectionalIterator last);\n\ntemplate \n bool\n prev_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp);\n\n} // std\n\n*/\n\n#include <__config>\n#include \n#include \n#include \n#include // needed to provide swap_ranges.\n#include \n#include \n#include \n\n#if defined(__IBMCPP__)\n#include \"support/ibm/support.h\"\n#endif\n#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)\n#include \"support/win32/support.h\"\n#endif\n\n#include <__undef_min_max>\n\n#include <__debug>\n\n#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)\n#pragma GCC system_header\n#endif\n\n_LIBCPP_BEGIN_NAMESPACE_STD\n\n// I'd like to replace these with _VSTD::equal_to, but can't because:\n// * That only works with C++14 and later, and\n// * We haven't included here.\ntemplate \nstruct __equal_to\n{\n _LIBCPP_INLINE_VISIBILITY bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}\n _LIBCPP_INLINE_VISIBILITY bool operator()(const _T1& __x, const _T2& __y) const {return __x == __y;}\n _LIBCPP_INLINE_VISIBILITY bool operator()(const _T2& __x, const _T1& __y) const {return __x == __y;}\n _LIBCPP_INLINE_VISIBILITY bool operator()(const _T2& __x, const _T2& __y) const {return __x == __y;}\n};\n\ntemplate \nstruct __equal_to<_T1, _T1>\n{\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\n bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}\n};\n\ntemplate \nstruct __equal_to\n{\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\n bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}\n};\n\ntemplate \nstruct __equal_to<_T1, const _T1>\n{\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\n bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}\n};\n\ntemplate \nstruct __less\n{\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\n bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}\n\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\n bool operator()(const _T1& __x, const _T2& __y) const {return __x < __y;}\n\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\n bool operator()(const _T2& __x, const _T1& __y) const {return __x < __y;}\n\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\n bool operator()(const _T2& __x, const _T2& __y) const {return __x < __y;}\n};\n\ntemplate \nstruct __less<_T1, _T1>\n{\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\n bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}\n};\n\ntemplate \nstruct __less\n{\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\n bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}\n};\n\ntemplate \nstruct __less<_T1, const _T1>\n{\n _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\n bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}\n};\n\ntemplate \nclass __negate\n{\nprivate:\n _Predicate __p_;\npublic:\n _LIBCPP_INLINE_VISIBILITY __negate() {}\n\n _LIBCPP_INLINE_VISIBILITY\n explicit __negate(_Predicate __p) : __p_(__p) {}\n\n template \n _LIBCPP_INLINE_VISIBILITY\n bool operator()(const _T1& __x) {return !__p_(__x);}\n\n template \n _LIBCPP_INLINE_VISIBILITY\n bool operator()(const _T1& __x, const _T2& __y) {return !__p_(__x, __y);}\n};\n\n#ifdef _LIBCPP_DEBUG\n\ntemplate \nstruct __debug_less\n{\n _Compare __comp_;\n __debug_less(_Compare& __c) : __comp_(__c) {}\n\n template \n bool operator()(const _Tp& __x, const _Up& __y)\n {\n bool __r = __comp_(__x, __y);\n if (__r)\n __do_compare_assert(0, __y, __x);\n return __r;\n }\n\n template \n inline _LIBCPP_INLINE_VISIBILITY\n decltype((void)_VSTD::declval<_Compare&>()(\n _VSTD::declval<_LHS const&>(), _VSTD::declval<_RHS const&>()))\n __do_compare_assert(int, _LHS const& __l, _RHS const& __r) {\n _LIBCPP_ASSERT(!__comp_(__l, __r),\n \"Comparator does not induce a strict weak ordering\");\n }\n\n template \n inline _LIBCPP_INLINE_VISIBILITY\n void __do_compare_assert(long, _LHS const&, _RHS const&) {}\n};\n\n#endif // _LIBCPP_DEBUG\n\n// Precondition: __x != 0\ninline _LIBCPP_INLINE_VISIBILITY\nunsigned\n__ctz(unsigned __x)\n{\n return static_cast(__builtin_ctz(__x));\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nunsigned long\n__ctz(unsigned long __x)\n{\n return static_cast(__builtin_ctzl(__x));\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nunsigned long long\n__ctz(unsigned long long __x)\n{\n return static_cast(__builtin_ctzll(__x));\n}\n\n// Precondition: __x != 0\ninline _LIBCPP_INLINE_VISIBILITY\nunsigned\n__clz(unsigned __x)\n{\n return static_cast(__builtin_clz(__x));\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nunsigned long\n__clz(unsigned long __x)\n{\n return static_cast(__builtin_clzl (__x));\n}\n\ninline _LIBCPP_INLINE_VISIBILITY\nunsigned long long\n__clz(unsigned long long __x)\n{\n return static_cast(__builtin_clzll(__x));\n}\n\ninline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned __x) {return __builtin_popcount (__x);}\ninline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned long __x) {return __builtin_popcountl (__x);}\ninline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned long long __x) {return __builtin_popcountll(__x);}\n\n// all_of\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\nall_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)\n{\n for (; __first != __last; ++__first)\n if (!__pred(*__first))\n return false;\n return true;\n}\n\n// any_of\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\nany_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)\n{\n for (; __first != __last; ++__first)\n if (__pred(*__first))\n return true;\n return false;\n}\n\n// none_of\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\nnone_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)\n{\n for (; __first != __last; ++__first)\n if (__pred(*__first))\n return false;\n return true;\n}\n\n// for_each\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_Function\nfor_each(_InputIterator __first, _InputIterator __last, _Function __f)\n{\n for (; __first != __last; ++__first)\n __f(*__first);\n return __f;\n}\n\n// find\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_InputIterator\nfind(_InputIterator __first, _InputIterator __last, const _Tp& __value_)\n{\n for (; __first != __last; ++__first)\n if (*__first == __value_)\n break;\n return __first;\n}\n\n// find_if\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_InputIterator\nfind_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)\n{\n for (; __first != __last; ++__first)\n if (__pred(*__first))\n break;\n return __first;\n}\n\n// find_if_not\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\n_InputIterator\nfind_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred)\n{\n for (; __first != __last; ++__first)\n if (!__pred(*__first))\n break;\n return __first;\n}\n\n// find_end\n\ntemplate \n_ForwardIterator1\n__find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,\n _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred,\n forward_iterator_tag, forward_iterator_tag)\n{\n // modeled after search algorithm\n _ForwardIterator1 __r = __last1; // __last1 is the \"default\" answer\n if (__first2 == __last2)\n return __r;\n while (true)\n {\n while (true)\n {\n if (__first1 == __last1) // if source exhausted return last correct answer\n return __r; // (or __last1 if never found)\n if (__pred(*__first1, *__first2))\n break;\n ++__first1;\n }\n // *__first1 matches *__first2, now match elements after here\n _ForwardIterator1 __m1 = __first1;\n _ForwardIterator2 __m2 = __first2;\n while (true)\n {\n if (++__m2 == __last2)\n { // Pattern exhaused, record answer and search for another one\n __r = __first1;\n ++__first1;\n break;\n }\n if (++__m1 == __last1) // Source exhausted, return last answer\n return __r;\n if (!__pred(*__m1, *__m2)) // mismatch, restart with a new __first\n {\n ++__first1;\n break;\n } // else there is a match, check next elements\n }\n }\n}\n\ntemplate \n_BidirectionalIterator1\n__find_end(_BidirectionalIterator1 __first1, _BidirectionalIterator1 __last1,\n _BidirectionalIterator2 __first2, _BidirectionalIterator2 __last2, _BinaryPredicate __pred,\n bidirectional_iterator_tag, bidirectional_iterator_tag)\n{\n // modeled after search algorithm (in reverse)\n if (__first2 == __last2)\n return __last1; // Everything matches an empty sequence\n _BidirectionalIterator1 __l1 = __last1;\n _BidirectionalIterator2 __l2 = __last2;\n --__l2;\n while (true)\n {\n // Find last element in sequence 1 that matchs *(__last2-1), with a mininum of loop checks\n while (true)\n {\n if (__first1 == __l1) // return __last1 if no element matches *__first2\n return __last1;\n if (__pred(*--__l1, *__l2))\n break;\n }\n // *__l1 matches *__l2, now match elements before here\n _BidirectionalIterator1 __m1 = __l1;\n _BidirectionalIterator2 __m2 = __l2;\n while (true)\n {\n if (__m2 == __first2) // If pattern exhausted, __m1 is the answer (works for 1 element pattern)\n return __m1;\n if (__m1 == __first1) // Otherwise if source exhaused, pattern not found\n return __last1;\n if (!__pred(*--__m1, *--__m2)) // if there is a mismatch, restart with a new __l1\n {\n break;\n } // else there is a match, check next elements\n }\n }\n}\n\ntemplate \n_LIBCPP_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator1\n__find_end(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,\n _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred,\n random_access_iterator_tag, random_access_iterator_tag)\n{\n // Take advantage of knowing source and pattern lengths. Stop short when source is smaller than pattern\n typename iterator_traits<_RandomAccessIterator2>::difference_type __len2 = __last2 - __first2;\n if (__len2 == 0)\n return __last1;\n typename iterator_traits<_RandomAccessIterator1>::difference_type __len1 = __last1 - __first1;\n if (__len1 < __len2)\n return __last1;\n const _RandomAccessIterator1 __s = __first1 + (__len2 - 1); // End of pattern match can't go before here\n _RandomAccessIterator1 __l1 = __last1;\n _RandomAccessIterator2 __l2 = __last2;\n --__l2;\n while (true)\n {\n while (true)\n {\n if (__s == __l1)\n return __last1;\n if (__pred(*--__l1, *__l2))\n break;\n }\n _RandomAccessIterator1 __m1 = __l1;\n _RandomAccessIterator2 __m2 = __l2;\n while (true)\n {\n if (__m2 == __first2)\n return __m1;\n // no need to check range on __m1 because __s guarantees we have enough source\n if (!__pred(*--__m1, *--__m2))\n {\n break;\n }\n }\n }\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_ForwardIterator1\nfind_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,\n _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)\n{\n return _VSTD::__find_end::type>\n (__first1, __last1, __first2, __last2, __pred,\n typename iterator_traits<_ForwardIterator1>::iterator_category(),\n typename iterator_traits<_ForwardIterator2>::iterator_category());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_ForwardIterator1\nfind_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,\n _ForwardIterator2 __first2, _ForwardIterator2 __last2)\n{\n typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;\n typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;\n return _VSTD::find_end(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());\n}\n\n// find_first_of\n\ntemplate \n_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator1\n__find_first_of_ce(_ForwardIterator1 __first1, _ForwardIterator1 __last1,\n _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)\n{\n for (; __first1 != __last1; ++__first1)\n for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j)\n if (__pred(*__first1, *__j))\n return __first1;\n return __last1;\n}\n\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_ForwardIterator1\nfind_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1,\n _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)\n{\n return _VSTD::__find_first_of_ce(__first1, __last1, __first2, __last2, __pred);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_ForwardIterator1\nfind_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1,\n _ForwardIterator2 __first2, _ForwardIterator2 __last2)\n{\n typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;\n typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;\n return _VSTD::__find_first_of_ce(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());\n}\n\n// adjacent_find\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_ForwardIterator\nadjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred)\n{\n if (__first != __last)\n {\n _ForwardIterator __i = __first;\n while (++__i != __last)\n {\n if (__pred(*__first, *__i))\n return __first;\n __first = __i;\n }\n }\n return __last;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_ForwardIterator\nadjacent_find(_ForwardIterator __first, _ForwardIterator __last)\n{\n typedef typename iterator_traits<_ForwardIterator>::value_type __v;\n return _VSTD::adjacent_find(__first, __last, __equal_to<__v>());\n}\n\n// count\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename iterator_traits<_InputIterator>::difference_type\ncount(_InputIterator __first, _InputIterator __last, const _Tp& __value_)\n{\n typename iterator_traits<_InputIterator>::difference_type __r(0);\n for (; __first != __last; ++__first)\n if (*__first == __value_)\n ++__r;\n return __r;\n}\n\n// count_if\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename iterator_traits<_InputIterator>::difference_type\ncount_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)\n{\n typename iterator_traits<_InputIterator>::difference_type __r(0);\n for (; __first != __last; ++__first)\n if (__pred(*__first))\n ++__r;\n return __r;\n}\n\n// mismatch\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\npair<_InputIterator1, _InputIterator2>\nmismatch(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _BinaryPredicate __pred)\n{\n for (; __first1 != __last1; ++__first1, (void) ++__first2)\n if (!__pred(*__first1, *__first2))\n break;\n return pair<_InputIterator1, _InputIterator2>(__first1, __first2);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\npair<_InputIterator1, _InputIterator2>\nmismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2)\n{\n typedef typename iterator_traits<_InputIterator1>::value_type __v1;\n typedef typename iterator_traits<_InputIterator2>::value_type __v2;\n return _VSTD::mismatch(__first1, __last1, __first2, __equal_to<__v1, __v2>());\n}\n\n#if _LIBCPP_STD_VER > 11\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\npair<_InputIterator1, _InputIterator2>\nmismatch(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2,\n _BinaryPredicate __pred)\n{\n for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2)\n if (!__pred(*__first1, *__first2))\n break;\n return pair<_InputIterator1, _InputIterator2>(__first1, __first2);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\npair<_InputIterator1, _InputIterator2>\nmismatch(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2)\n{\n typedef typename iterator_traits<_InputIterator1>::value_type __v1;\n typedef typename iterator_traits<_InputIterator2>::value_type __v2;\n return _VSTD::mismatch(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());\n}\n#endif\n\n// equal\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\nequal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred)\n{\n for (; __first1 != __last1; ++__first1, (void) ++__first2)\n if (!__pred(*__first1, *__first2))\n return false;\n return true;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\nequal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2)\n{\n typedef typename iterator_traits<_InputIterator1>::value_type __v1;\n typedef typename iterator_traits<_InputIterator2>::value_type __v2;\n return _VSTD::equal(__first1, __last1, __first2, __equal_to<__v1, __v2>());\n}\n\n#if _LIBCPP_STD_VER > 11\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\n__equal(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred,\n input_iterator_tag, input_iterator_tag )\n{\n for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2)\n if (!__pred(*__first1, *__first2))\n return false;\n return __first1 == __last1 && __first2 == __last2;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\n__equal(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,\n _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred,\n random_access_iterator_tag, random_access_iterator_tag )\n{\n if ( _VSTD::distance(__first1, __last1) != _VSTD::distance(__first2, __last2))\n return false;\n return _VSTD::equal<_RandomAccessIterator1, _RandomAccessIterator2,\n typename add_lvalue_reference<_BinaryPredicate>::type>\n (__first1, __last1, __first2, __pred );\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\nequal(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred )\n{\n return _VSTD::__equal::type>\n (__first1, __last1, __first2, __last2, __pred,\n typename iterator_traits<_InputIterator1>::iterator_category(),\n typename iterator_traits<_InputIterator2>::iterator_category());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\nequal(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2)\n{\n typedef typename iterator_traits<_InputIterator1>::value_type __v1;\n typedef typename iterator_traits<_InputIterator2>::value_type __v2;\n return _VSTD::__equal(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>(),\n typename iterator_traits<_InputIterator1>::iterator_category(),\n typename iterator_traits<_InputIterator2>::iterator_category());\n}\n#endif\n\n// is_permutation\n\ntemplate\nbool\nis_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,\n _ForwardIterator2 __first2, _BinaryPredicate __pred)\n{\n // shorten sequences as much as possible by lopping of any equal parts\n for (; __first1 != __last1; ++__first1, (void) ++__first2)\n if (!__pred(*__first1, *__first2))\n goto __not_done;\n return true;\n__not_done:\n // __first1 != __last1 && *__first1 != *__first2\n typedef typename iterator_traits<_ForwardIterator1>::difference_type _D1;\n _D1 __l1 = _VSTD::distance(__first1, __last1);\n if (__l1 == _D1(1))\n return false;\n _ForwardIterator2 __last2 = _VSTD::next(__first2, __l1);\n // For each element in [f1, l1) see if there are the same number of\n // equal elements in [f2, l2)\n for (_ForwardIterator1 __i = __first1; __i != __last1; ++__i)\n {\n // Have we already counted the number of *__i in [f1, l1)?\n for (_ForwardIterator1 __j = __first1; __j != __i; ++__j)\n if (__pred(*__j, *__i))\n goto __next_iter;\n {\n // Count number of *__i in [f2, l2)\n _D1 __c2 = 0;\n for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j)\n if (__pred(*__i, *__j))\n ++__c2;\n if (__c2 == 0)\n return false;\n // Count number of *__i in [__i, l1) (we can start with 1)\n _D1 __c1 = 1;\n for (_ForwardIterator1 __j = _VSTD::next(__i); __j != __last1; ++__j)\n if (__pred(*__i, *__j))\n ++__c1;\n if (__c1 != __c2)\n return false;\n }\n__next_iter:;\n }\n return true;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\nis_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,\n _ForwardIterator2 __first2)\n{\n typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;\n typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;\n return _VSTD::is_permutation(__first1, __last1, __first2, __equal_to<__v1, __v2>());\n}\n\n#if _LIBCPP_STD_VER > 11\ntemplate\nbool\n__is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,\n _ForwardIterator2 __first2, _ForwardIterator2 __last2,\n _BinaryPredicate __pred,\n forward_iterator_tag, forward_iterator_tag )\n{\n // shorten sequences as much as possible by lopping of any equal parts\n for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2)\n if (!__pred(*__first1, *__first2))\n goto __not_done;\n return __first1 == __last1 && __first2 == __last2;\n__not_done:\n // __first1 != __last1 && __first2 != __last2 && *__first1 != *__first2\n typedef typename iterator_traits<_ForwardIterator1>::difference_type _D1;\n _D1 __l1 = _VSTD::distance(__first1, __last1);\n\n typedef typename iterator_traits<_ForwardIterator2>::difference_type _D2;\n _D2 __l2 = _VSTD::distance(__first2, __last2);\n if (__l1 != __l2)\n return false;\n\n // For each element in [f1, l1) see if there are the same number of\n // equal elements in [f2, l2)\n for (_ForwardIterator1 __i = __first1; __i != __last1; ++__i)\n {\n // Have we already counted the number of *__i in [f1, l1)?\n for (_ForwardIterator1 __j = __first1; __j != __i; ++__j)\n if (__pred(*__j, *__i))\n goto __next_iter;\n {\n // Count number of *__i in [f2, l2)\n _D1 __c2 = 0;\n for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j)\n if (__pred(*__i, *__j))\n ++__c2;\n if (__c2 == 0)\n return false;\n // Count number of *__i in [__i, l1) (we can start with 1)\n _D1 __c1 = 1;\n for (_ForwardIterator1 __j = _VSTD::next(__i); __j != __last1; ++__j)\n if (__pred(*__i, *__j))\n ++__c1;\n if (__c1 != __c2)\n return false;\n }\n__next_iter:;\n }\n return true;\n}\n\ntemplate\nbool\n__is_permutation(_RandomAccessIterator1 __first1, _RandomAccessIterator2 __last1,\n _RandomAccessIterator1 __first2, _RandomAccessIterator2 __last2,\n _BinaryPredicate __pred,\n random_access_iterator_tag, random_access_iterator_tag )\n{\n if ( _VSTD::distance(__first1, __last1) != _VSTD::distance(__first2, __last2))\n return false;\n return _VSTD::is_permutation<_RandomAccessIterator1, _RandomAccessIterator2,\n typename add_lvalue_reference<_BinaryPredicate>::type>\n (__first1, __last1, __first2, __pred );\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\nis_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,\n _ForwardIterator2 __first2, _ForwardIterator2 __last2,\n _BinaryPredicate __pred )\n{\n return _VSTD::__is_permutation::type>\n (__first1, __last1, __first2, __last2, __pred,\n typename iterator_traits<_ForwardIterator1>::iterator_category(),\n typename iterator_traits<_ForwardIterator2>::iterator_category());\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\nis_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,\n _ForwardIterator2 __first2, _ForwardIterator2 __last2)\n{\n typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;\n typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;\n return _VSTD::__is_permutation(__first1, __last1, __first2, __last2,\n __equal_to<__v1, __v2>(),\n typename iterator_traits<_ForwardIterator1>::iterator_category(),\n typename iterator_traits<_ForwardIterator2>::iterator_category());\n}\n#endif\n\n// search\n\ntemplate \npair<_ForwardIterator1, _ForwardIterator1>\n__search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,\n _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred,\n forward_iterator_tag, forward_iterator_tag)\n{\n if (__first2 == __last2)\n return make_pair(__first1, __first1); // Everything matches an empty sequence\n while (true)\n {\n // Find first element in sequence 1 that matchs *__first2, with a mininum of loop checks\n while (true)\n {\n if (__first1 == __last1) // return __last1 if no element matches *__first2\n return make_pair(__last1, __last1);\n if (__pred(*__first1, *__first2))\n break;\n ++__first1;\n }\n // *__first1 matches *__first2, now match elements after here\n _ForwardIterator1 __m1 = __first1;\n _ForwardIterator2 __m2 = __first2;\n while (true)\n {\n if (++__m2 == __last2) // If pattern exhausted, __first1 is the answer (works for 1 element pattern)\n return make_pair(__first1, __m1);\n if (++__m1 == __last1) // Otherwise if source exhaused, pattern not found\n return make_pair(__last1, __last1);\n if (!__pred(*__m1, *__m2)) // if there is a mismatch, restart with a new __first1\n {\n ++__first1;\n break;\n } // else there is a match, check next elements\n }\n }\n}\n\ntemplate \n_LIBCPP_CONSTEXPR_AFTER_CXX11\npair<_RandomAccessIterator1, _RandomAccessIterator1>\n__search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,\n _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred,\n random_access_iterator_tag, random_access_iterator_tag)\n{\n typedef typename iterator_traits<_RandomAccessIterator1>::difference_type _D1;\n typedef typename iterator_traits<_RandomAccessIterator2>::difference_type _D2;\n // Take advantage of knowing source and pattern lengths. Stop short when source is smaller than pattern\n const _D2 __len2 = __last2 - __first2;\n if (__len2 == 0)\n return make_pair(__first1, __first1);\n const _D1 __len1 = __last1 - __first1;\n if (__len1 < __len2)\n return make_pair(__last1, __last1);\n const _RandomAccessIterator1 __s = __last1 - (__len2 - 1); // Start of pattern match can't go beyond here\n\n while (true)\n {\n while (true)\n {\n if (__first1 == __s)\n return make_pair(__last1, __last1);\n if (__pred(*__first1, *__first2))\n break;\n ++__first1;\n }\n\n _RandomAccessIterator1 __m1 = __first1;\n _RandomAccessIterator2 __m2 = __first2;\n while (true)\n {\n if (++__m2 == __last2)\n return make_pair(__first1, __first1 + __len2);\n ++__m1; // no need to check range on __m1 because __s guarantees we have enough source\n if (!__pred(*__m1, *__m2))\n {\n ++__first1;\n break;\n }\n }\n }\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_ForwardIterator1\nsearch(_ForwardIterator1 __first1, _ForwardIterator1 __last1,\n _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)\n{\n return _VSTD::__search::type>\n (__first1, __last1, __first2, __last2, __pred,\n typename iterator_traits<_ForwardIterator1>::iterator_category(),\n typename iterator_traits<_ForwardIterator2>::iterator_category())\n .first;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_ForwardIterator1\nsearch(_ForwardIterator1 __first1, _ForwardIterator1 __last1,\n _ForwardIterator2 __first2, _ForwardIterator2 __last2)\n{\n typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;\n typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;\n return _VSTD::search(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());\n}\n\n// search_n\n\ntemplate \n_ForwardIterator\n__search_n(_ForwardIterator __first, _ForwardIterator __last,\n _Size __count, const _Tp& __value_, _BinaryPredicate __pred, forward_iterator_tag)\n{\n if (__count <= 0)\n return __first;\n while (true)\n {\n // Find first element in sequence that matchs __value_, with a mininum of loop checks\n while (true)\n {\n if (__first == __last) // return __last if no element matches __value_\n return __last;\n if (__pred(*__first, __value_))\n break;\n ++__first;\n }\n // *__first matches __value_, now match elements after here\n _ForwardIterator __m = __first;\n _Size __c(0);\n while (true)\n {\n if (++__c == __count) // If pattern exhausted, __first is the answer (works for 1 element pattern)\n return __first;\n if (++__m == __last) // Otherwise if source exhaused, pattern not found\n return __last;\n if (!__pred(*__m, __value_)) // if there is a mismatch, restart with a new __first\n {\n __first = __m;\n ++__first;\n break;\n } // else there is a match, check next elements\n }\n }\n}\n\ntemplate \n_RandomAccessIterator\n__search_n(_RandomAccessIterator __first, _RandomAccessIterator __last,\n _Size __count, const _Tp& __value_, _BinaryPredicate __pred, random_access_iterator_tag)\n{\n if (__count <= 0)\n return __first;\n _Size __len = static_cast<_Size>(__last - __first);\n if (__len < __count)\n return __last;\n const _RandomAccessIterator __s = __last - (__count - 1); // Start of pattern match can't go beyond here\n while (true)\n {\n // Find first element in sequence that matchs __value_, with a mininum of loop checks\n while (true)\n {\n if (__first >= __s) // return __last if no element matches __value_\n return __last;\n if (__pred(*__first, __value_))\n break;\n ++__first;\n }\n // *__first matches __value_, now match elements after here\n _RandomAccessIterator __m = __first;\n _Size __c(0);\n while (true)\n {\n if (++__c == __count) // If pattern exhausted, __first is the answer (works for 1 element pattern)\n return __first;\n ++__m; // no need to check range on __m because __s guarantees we have enough source\n if (!__pred(*__m, __value_)) // if there is a mismatch, restart with a new __first\n {\n __first = __m;\n ++__first;\n break;\n } // else there is a match, check next elements\n }\n }\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_ForwardIterator\nsearch_n(_ForwardIterator __first, _ForwardIterator __last,\n _Size __count, const _Tp& __value_, _BinaryPredicate __pred)\n{\n return _VSTD::__search_n::type>\n (__first, __last, __convert_to_integral(__count), __value_, __pred,\n typename iterator_traits<_ForwardIterator>::iterator_category());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_ForwardIterator\nsearch_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_)\n{\n typedef typename iterator_traits<_ForwardIterator>::value_type __v;\n return _VSTD::search_n(__first, __last, __convert_to_integral(__count),\n __value_, __equal_to<__v, _Tp>());\n}\n\n// copy\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_Iter\n__unwrap_iter(_Iter __i)\n{\n return __i;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename enable_if\n<\n is_trivially_copy_assignable<_Tp>::value,\n _Tp*\n>::type\n__unwrap_iter(move_iterator<_Tp*> __i)\n{\n return __i.base();\n}\n\n#if _LIBCPP_DEBUG_LEVEL < 2\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename enable_if\n<\n is_trivially_copy_assignable<_Tp>::value,\n _Tp*\n>::type\n__unwrap_iter(__wrap_iter<_Tp*> __i)\n{\n return __i.base();\n}\n\n#else\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename enable_if\n<\n is_trivially_copy_assignable<_Tp>::value,\n __wrap_iter<_Tp*>\n>::type\n__unwrap_iter(__wrap_iter<_Tp*> __i)\n{\n return __i;\n}\n\n#endif // _LIBCPP_DEBUG_LEVEL < 2\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\n__copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)\n{\n for (; __first != __last; ++__first, (void) ++__result)\n *__result = *__first;\n return __result;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename enable_if\n<\n is_same::type, _Up>::value &&\n is_trivially_copy_assignable<_Up>::value,\n _Up*\n>::type\n__copy(_Tp* __first, _Tp* __last, _Up* __result)\n{\n const size_t __n = static_cast(__last - __first);\n if (__n > 0)\n _VSTD::memmove(__result, __first, __n * sizeof(_Up));\n return __result + __n;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\ncopy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)\n{\n return _VSTD::__copy(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));\n}\n\n// copy_backward\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\n__copy_backward(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result)\n{\n while (__first != __last)\n *--__result = *--__last;\n return __result;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename enable_if\n<\n is_same::type, _Up>::value &&\n is_trivially_copy_assignable<_Up>::value,\n _Up*\n>::type\n__copy_backward(_Tp* __first, _Tp* __last, _Up* __result)\n{\n const size_t __n = static_cast(__last - __first);\n if (__n > 0)\n {\n __result -= __n;\n _VSTD::memmove(__result, __first, __n * sizeof(_Up));\n }\n return __result;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_BidirectionalIterator2\ncopy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,\n _BidirectionalIterator2 __result)\n{\n return _VSTD::__copy_backward(__unwrap_iter(__first),\n __unwrap_iter(__last),\n __unwrap_iter(__result));\n}\n\n// copy_if\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\ncopy_if(_InputIterator __first, _InputIterator __last,\n _OutputIterator __result, _Predicate __pred)\n{\n for (; __first != __last; ++__first)\n {\n if (__pred(*__first))\n {\n *__result = *__first;\n ++__result;\n }\n }\n return __result;\n}\n\n// copy_n\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename enable_if\n<\n __is_input_iterator<_InputIterator>::value &&\n !__is_random_access_iterator<_InputIterator>::value,\n _OutputIterator\n>::type\ncopy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)\n{\n typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize;\n _IntegralSize __n = __orig_n;\n if (__n > 0)\n {\n *__result = *__first;\n ++__result;\n for (--__n; __n > 0; --__n)\n {\n ++__first;\n *__result = *__first;\n ++__result;\n }\n }\n return __result;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\ntypename enable_if\n<\n __is_random_access_iterator<_InputIterator>::value,\n _OutputIterator\n>::type\ncopy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)\n{\n typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize;\n _IntegralSize __n = __orig_n;\n return _VSTD::copy(__first, __first + __n, __result);\n}\n\n// move\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\n__move(_InputIterator __first, _InputIterator __last, _OutputIterator __result)\n{\n for (; __first != __last; ++__first, (void) ++__result)\n *__result = _VSTD::move(*__first);\n return __result;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename enable_if\n<\n is_same::type, _Up>::value &&\n is_trivially_copy_assignable<_Up>::value,\n _Up*\n>::type\n__move(_Tp* __first, _Tp* __last, _Up* __result)\n{\n const size_t __n = static_cast(__last - __first);\n if (__n > 0)\n _VSTD::memmove(__result, __first, __n * sizeof(_Up));\n return __result + __n;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\nmove(_InputIterator __first, _InputIterator __last, _OutputIterator __result)\n{\n return _VSTD::__move(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));\n}\n\n// move_backward\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\n__move_backward(_InputIterator __first, _InputIterator __last, _OutputIterator __result)\n{\n while (__first != __last)\n *--__result = _VSTD::move(*--__last);\n return __result;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename enable_if\n<\n is_same::type, _Up>::value &&\n is_trivially_copy_assignable<_Up>::value,\n _Up*\n>::type\n__move_backward(_Tp* __first, _Tp* __last, _Up* __result)\n{\n const size_t __n = static_cast(__last - __first);\n if (__n > 0)\n {\n __result -= __n;\n _VSTD::memmove(__result, __first, __n * sizeof(_Up));\n }\n return __result;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_BidirectionalIterator2\nmove_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,\n _BidirectionalIterator2 __result)\n{\n return _VSTD::__move_backward(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));\n}\n\n// iter_swap\n\n// moved to for better swap / noexcept support\n\n// transform\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\ntransform(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _UnaryOperation __op)\n{\n for (; __first != __last; ++__first, (void) ++__result)\n *__result = __op(*__first);\n return __result;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\ntransform(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2,\n _OutputIterator __result, _BinaryOperation __binary_op)\n{\n for (; __first1 != __last1; ++__first1, (void) ++__first2, ++__result)\n *__result = __binary_op(*__first1, *__first2);\n return __result;\n}\n\n// replace\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nreplace(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_value, const _Tp& __new_value)\n{\n for (; __first != __last; ++__first)\n if (*__first == __old_value)\n *__first = __new_value;\n}\n\n// replace_if\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nreplace_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, const _Tp& __new_value)\n{\n for (; __first != __last; ++__first)\n if (__pred(*__first))\n *__first = __new_value;\n}\n\n// replace_copy\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\nreplace_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result,\n const _Tp& __old_value, const _Tp& __new_value)\n{\n for (; __first != __last; ++__first, (void) ++__result)\n if (*__first == __old_value)\n *__result = __new_value;\n else\n *__result = *__first;\n return __result;\n}\n\n// replace_copy_if\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\nreplace_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result,\n _Predicate __pred, const _Tp& __new_value)\n{\n for (; __first != __last; ++__first, (void) ++__result)\n if (__pred(*__first))\n *__result = __new_value;\n else\n *__result = *__first;\n return __result;\n}\n\n// fill_n\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\n__fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_)\n{\n for (; __n > 0; ++__first, (void) --__n)\n *__first = __value_;\n return __first;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\ntypename enable_if\n<\n is_integral<_Tp>::value && sizeof(_Tp) == 1 &&\n !is_same<_Tp, bool>::value &&\n is_integral<_Up>::value && sizeof(_Up) == 1,\n _Tp*\n>::type\n__fill_n(_Tp* __first, _Size __n,_Up __value_)\n{\n if (__n > 0)\n _VSTD::memset(__first, (unsigned char)__value_, (size_t)(__n));\n return __first + __n;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\nfill_n(_OutputIterator __first, _Size __n, const _Tp& __value_)\n{\n return _VSTD::__fill_n(__first, __convert_to_integral(__n), __value_);\n}\n\n// fill\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\n__fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, forward_iterator_tag)\n{\n for (; __first != __last; ++__first)\n *__first = __value_;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\n__fill(_RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& __value_, random_access_iterator_tag)\n{\n _VSTD::fill_n(__first, __last - __first, __value_);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nfill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)\n{\n _VSTD::__fill(__first, __last, __value_, typename iterator_traits<_ForwardIterator>::iterator_category());\n}\n\n// generate\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\ngenerate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen)\n{\n for (; __first != __last; ++__first)\n *__first = __gen();\n}\n\n// generate_n\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\ngenerate_n(_OutputIterator __first, _Size __orig_n, _Generator __gen)\n{\n typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize;\n _IntegralSize __n = __orig_n;\n for (; __n > 0; ++__first, (void) --__n)\n *__first = __gen();\n return __first;\n}\n\n// remove\n\ntemplate \n_ForwardIterator\nremove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)\n{\n __first = _VSTD::find(__first, __last, __value_);\n if (__first != __last)\n {\n _ForwardIterator __i = __first;\n while (++__i != __last)\n {\n if (!(*__i == __value_))\n {\n *__first = _VSTD::move(*__i);\n ++__first;\n }\n }\n }\n return __first;\n}\n\n// remove_if\n\ntemplate \n_ForwardIterator\nremove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)\n{\n __first = _VSTD::find_if<_ForwardIterator, typename add_lvalue_reference<_Predicate>::type>\n (__first, __last, __pred);\n if (__first != __last)\n {\n _ForwardIterator __i = __first;\n while (++__i != __last)\n {\n if (!__pred(*__i))\n {\n *__first = _VSTD::move(*__i);\n ++__first;\n }\n }\n }\n return __first;\n}\n\n// remove_copy\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\nremove_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, const _Tp& __value_)\n{\n for (; __first != __last; ++__first)\n {\n if (!(*__first == __value_))\n {\n *__result = *__first;\n ++__result;\n }\n }\n return __result;\n}\n\n// remove_copy_if\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\nremove_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred)\n{\n for (; __first != __last; ++__first)\n {\n if (!__pred(*__first))\n {\n *__result = *__first;\n ++__result;\n }\n }\n return __result;\n}\n\n// unique\n\ntemplate \n_ForwardIterator\nunique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred)\n{\n __first = _VSTD::adjacent_find<_ForwardIterator, typename add_lvalue_reference<_BinaryPredicate>::type>\n (__first, __last, __pred);\n if (__first != __last)\n {\n // ... a a ? ...\n // f i\n _ForwardIterator __i = __first;\n for (++__i; ++__i != __last;)\n if (!__pred(*__first, *__i))\n *++__first = _VSTD::move(*__i);\n ++__first;\n }\n return __first;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_ForwardIterator\nunique(_ForwardIterator __first, _ForwardIterator __last)\n{\n typedef typename iterator_traits<_ForwardIterator>::value_type __v;\n return _VSTD::unique(__first, __last, __equal_to<__v>());\n}\n\n// unique_copy\n\ntemplate \n_OutputIterator\n__unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred,\n input_iterator_tag, output_iterator_tag)\n{\n if (__first != __last)\n {\n typename iterator_traits<_InputIterator>::value_type __t(*__first);\n *__result = __t;\n ++__result;\n while (++__first != __last)\n {\n if (!__pred(__t, *__first))\n {\n __t = *__first;\n *__result = __t;\n ++__result;\n }\n }\n }\n return __result;\n}\n\ntemplate \n_OutputIterator\n__unique_copy(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result, _BinaryPredicate __pred,\n forward_iterator_tag, output_iterator_tag)\n{\n if (__first != __last)\n {\n _ForwardIterator __i = __first;\n *__result = *__i;\n ++__result;\n while (++__first != __last)\n {\n if (!__pred(*__i, *__first))\n {\n *__result = *__first;\n ++__result;\n __i = __first;\n }\n }\n }\n return __result;\n}\n\ntemplate \n_ForwardIterator\n__unique_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, _BinaryPredicate __pred,\n input_iterator_tag, forward_iterator_tag)\n{\n if (__first != __last)\n {\n *__result = *__first;\n while (++__first != __last)\n if (!__pred(*__result, *__first))\n *++__result = *__first;\n ++__result;\n }\n return __result;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\nunique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred)\n{\n return _VSTD::__unique_copy::type>\n (__first, __last, __result, __pred,\n typename iterator_traits<_InputIterator>::iterator_category(),\n typename iterator_traits<_OutputIterator>::iterator_category());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\nunique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)\n{\n typedef typename iterator_traits<_InputIterator>::value_type __v;\n return _VSTD::unique_copy(__first, __last, __result, __equal_to<__v>());\n}\n\n// reverse\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\n__reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, bidirectional_iterator_tag)\n{\n while (__first != __last)\n {\n if (__first == --__last)\n break;\n _VSTD::iter_swap(__first, __last);\n ++__first;\n }\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\n__reverse(_RandomAccessIterator __first, _RandomAccessIterator __last, random_access_iterator_tag)\n{\n if (__first != __last)\n for (; __first < --__last; ++__first)\n _VSTD::iter_swap(__first, __last);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nreverse(_BidirectionalIterator __first, _BidirectionalIterator __last)\n{\n _VSTD::__reverse(__first, __last, typename iterator_traits<_BidirectionalIterator>::iterator_category());\n}\n\n// reverse_copy\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\nreverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result)\n{\n for (; __first != __last; ++__result)\n *__result = *--__last;\n return __result;\n}\n\n// rotate\n\ntemplate \n_ForwardIterator\n__rotate_left(_ForwardIterator __first, _ForwardIterator __last)\n{\n typedef typename iterator_traits<_ForwardIterator>::value_type value_type;\n value_type __tmp = _VSTD::move(*__first);\n _ForwardIterator __lm1 = _VSTD::move(_VSTD::next(__first), __last, __first);\n *__lm1 = _VSTD::move(__tmp);\n return __lm1;\n}\n\ntemplate \n_BidirectionalIterator\n__rotate_right(_BidirectionalIterator __first, _BidirectionalIterator __last)\n{\n typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;\n _BidirectionalIterator __lm1 = _VSTD::prev(__last);\n value_type __tmp = _VSTD::move(*__lm1);\n _BidirectionalIterator __fp1 = _VSTD::move_backward(__first, __lm1, __last);\n *__first = _VSTD::move(__tmp);\n return __fp1;\n}\n\ntemplate \n_ForwardIterator\n__rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)\n{\n _ForwardIterator __i = __middle;\n while (true)\n {\n swap(*__first, *__i);\n ++__first;\n if (++__i == __last)\n break;\n if (__first == __middle)\n __middle = __i;\n }\n _ForwardIterator __r = __first;\n if (__first != __middle)\n {\n __i = __middle;\n while (true)\n {\n swap(*__first, *__i);\n ++__first;\n if (++__i == __last)\n {\n if (__first == __middle)\n break;\n __i = __middle;\n }\n else if (__first == __middle)\n __middle = __i;\n }\n }\n return __r;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\n_Integral\n__algo_gcd(_Integral __x, _Integral __y)\n{\n do\n {\n _Integral __t = __x % __y;\n __x = __y;\n __y = __t;\n } while (__y);\n return __x;\n}\n\ntemplate\n_RandomAccessIterator\n__rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last)\n{\n typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;\n typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;\n\n const difference_type __m1 = __middle - __first;\n const difference_type __m2 = __last - __middle;\n if (__m1 == __m2)\n {\n _VSTD::swap_ranges(__first, __middle, __middle);\n return __middle;\n }\n const difference_type __g = _VSTD::__algo_gcd(__m1, __m2);\n for (_RandomAccessIterator __p = __first + __g; __p != __first;)\n {\n value_type __t(_VSTD::move(*--__p));\n _RandomAccessIterator __p1 = __p;\n _RandomAccessIterator __p2 = __p1 + __m1;\n do\n {\n *__p1 = _VSTD::move(*__p2);\n __p1 = __p2;\n const difference_type __d = __last - __p2;\n if (__m1 < __d)\n __p2 += __m1;\n else\n __p2 = __first + (__m1 - __d);\n } while (__p2 != __p);\n *__p1 = _VSTD::move(__t);\n }\n return __first + __m2;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_ForwardIterator\n__rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,\n _VSTD::forward_iterator_tag)\n{\n typedef typename _VSTD::iterator_traits<_ForwardIterator>::value_type value_type;\n if (_VSTD::is_trivially_move_assignable::value)\n {\n if (_VSTD::next(__first) == __middle)\n return _VSTD::__rotate_left(__first, __last);\n }\n return _VSTD::__rotate_forward(__first, __middle, __last);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_BidirectionalIterator\n__rotate(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,\n _VSTD::bidirectional_iterator_tag)\n{\n typedef typename _VSTD::iterator_traits<_BidirectionalIterator>::value_type value_type;\n if (_VSTD::is_trivially_move_assignable::value)\n {\n if (_VSTD::next(__first) == __middle)\n return _VSTD::__rotate_left(__first, __last);\n if (_VSTD::next(__middle) == __last)\n return _VSTD::__rotate_right(__first, __last);\n }\n return _VSTD::__rotate_forward(__first, __middle, __last);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_RandomAccessIterator\n__rotate(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,\n _VSTD::random_access_iterator_tag)\n{\n typedef typename _VSTD::iterator_traits<_RandomAccessIterator>::value_type value_type;\n if (_VSTD::is_trivially_move_assignable::value)\n {\n if (_VSTD::next(__first) == __middle)\n return _VSTD::__rotate_left(__first, __last);\n if (_VSTD::next(__middle) == __last)\n return _VSTD::__rotate_right(__first, __last);\n return _VSTD::__rotate_gcd(__first, __middle, __last);\n }\n return _VSTD::__rotate_forward(__first, __middle, __last);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_ForwardIterator\nrotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)\n{\n if (__first == __middle)\n return __last;\n if (__middle == __last)\n return __first;\n return _VSTD::__rotate(__first, __middle, __last,\n typename _VSTD::iterator_traits<_ForwardIterator>::iterator_category());\n}\n\n// rotate_copy\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\nrotate_copy(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, _OutputIterator __result)\n{\n return _VSTD::copy(__first, __middle, _VSTD::copy(__middle, __last, __result));\n}\n\n// min_element\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\n_ForwardIterator\nmin_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)\n{\n if (__first != __last)\n {\n _ForwardIterator __i = __first;\n while (++__i != __last)\n if (__comp(*__i, *__first))\n __first = __i;\n }\n return __first;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\n_ForwardIterator\nmin_element(_ForwardIterator __first, _ForwardIterator __last)\n{\n return _VSTD::min_element(__first, __last,\n __less::value_type>());\n}\n\n// min\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\nconst _Tp&\nmin(const _Tp& __a, const _Tp& __b, _Compare __comp)\n{\n return __comp(__b, __a) ? __b : __a;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\nconst _Tp&\nmin(const _Tp& __a, const _Tp& __b)\n{\n return _VSTD::min(__a, __b, __less<_Tp>());\n}\n\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\n_Tp\nmin(initializer_list<_Tp> __t, _Compare __comp)\n{\n return *_VSTD::min_element(__t.begin(), __t.end(), __comp);\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\n_Tp\nmin(initializer_list<_Tp> __t)\n{\n return *_VSTD::min_element(__t.begin(), __t.end(), __less<_Tp>());\n}\n\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\n// max_element\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\n_ForwardIterator\nmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)\n{\n if (__first != __last)\n {\n _ForwardIterator __i = __first;\n while (++__i != __last)\n if (__comp(*__first, *__i))\n __first = __i;\n }\n return __first;\n}\n\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\n_ForwardIterator\nmax_element(_ForwardIterator __first, _ForwardIterator __last)\n{\n return _VSTD::max_element(__first, __last,\n __less::value_type>());\n}\n\n// max\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\nconst _Tp&\nmax(const _Tp& __a, const _Tp& __b, _Compare __comp)\n{\n return __comp(__a, __b) ? __b : __a;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\nconst _Tp&\nmax(const _Tp& __a, const _Tp& __b)\n{\n return _VSTD::max(__a, __b, __less<_Tp>());\n}\n\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\n_Tp\nmax(initializer_list<_Tp> __t, _Compare __comp)\n{\n return *_VSTD::max_element(__t.begin(), __t.end(), __comp);\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\n_Tp\nmax(initializer_list<_Tp> __t)\n{\n return *_VSTD::max_element(__t.begin(), __t.end(), __less<_Tp>());\n}\n\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\n#if _LIBCPP_STD_VER > 14\n// clamp\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR\nconst _Tp&\nclamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi, _Compare __comp)\n{\n _LIBCPP_ASSERT(!__comp(__hi, __lo), \"Bad bounds passed to std::clamp\");\n return __comp(__v, __lo) ? __lo : __comp(__hi, __v) ? __hi : __v;\n\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR\nconst _Tp&\nclamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi)\n{\n return _VSTD::clamp(__v, __lo, __hi, __less<_Tp>());\n}\n#endif\n\n// minmax_element\n\ntemplate \n_LIBCPP_CONSTEXPR_AFTER_CXX11\nstd::pair<_ForwardIterator, _ForwardIterator>\nminmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)\n{\n std::pair<_ForwardIterator, _ForwardIterator> __result(__first, __first);\n if (__first != __last)\n {\n if (++__first != __last)\n {\n if (__comp(*__first, *__result.first))\n __result.first = __first;\n else\n __result.second = __first;\n while (++__first != __last)\n {\n _ForwardIterator __i = __first;\n if (++__first == __last)\n {\n if (__comp(*__i, *__result.first))\n __result.first = __i;\n else if (!__comp(*__i, *__result.second))\n __result.second = __i;\n break;\n }\n else\n {\n if (__comp(*__first, *__i))\n {\n if (__comp(*__first, *__result.first))\n __result.first = __first;\n if (!__comp(*__i, *__result.second))\n __result.second = __i;\n }\n else\n {\n if (__comp(*__i, *__result.first))\n __result.first = __i;\n if (!__comp(*__first, *__result.second))\n __result.second = __first;\n }\n }\n }\n }\n }\n return __result;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\nstd::pair<_ForwardIterator, _ForwardIterator>\nminmax_element(_ForwardIterator __first, _ForwardIterator __last)\n{\n return _VSTD::minmax_element(__first, __last,\n __less::value_type>());\n}\n\n// minmax\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\npair\nminmax(const _Tp& __a, const _Tp& __b, _Compare __comp)\n{\n return __comp(__b, __a) ? pair(__b, __a) :\n pair(__a, __b);\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\npair\nminmax(const _Tp& __a, const _Tp& __b)\n{\n return _VSTD::minmax(__a, __b, __less<_Tp>());\n}\n\n#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\npair<_Tp, _Tp>\nminmax(initializer_list<_Tp> __t, _Compare __comp)\n{\n typedef typename initializer_list<_Tp>::const_iterator _Iter;\n _Iter __first = __t.begin();\n _Iter __last = __t.end();\n std::pair<_Tp, _Tp> __result(*__first, *__first);\n\n ++__first;\n if (__t.size() % 2 == 0)\n {\n if (__comp(*__first, __result.first))\n __result.first = *__first;\n else\n __result.second = *__first;\n ++__first;\n }\n\n while (__first != __last)\n {\n _Tp __prev = *__first++;\n if (__comp(*__first, __prev)) {\n if ( __comp(*__first, __result.first)) __result.first = *__first;\n if (!__comp(__prev, __result.second)) __result.second = __prev;\n }\n else {\n if ( __comp(__prev, __result.first)) __result.first = __prev;\n if (!__comp(*__first, __result.second)) __result.second = *__first;\n }\n\n __first++;\n }\n return __result;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11\npair<_Tp, _Tp>\nminmax(initializer_list<_Tp> __t)\n{\n return _VSTD::minmax(__t, __less<_Tp>());\n}\n\n#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS\n\n// random_shuffle\n\n// __independent_bits_engine\n\ntemplate \nstruct __log2_imp\n{\n static const size_t value = _Xp & ((unsigned long long)(1) << _Rp) ? _Rp\n : __log2_imp<_Xp, _Rp - 1>::value;\n};\n\ntemplate \nstruct __log2_imp<_Xp, 0>\n{\n static const size_t value = 0;\n};\n\ntemplate \nstruct __log2_imp<0, _Rp>\n{\n static const size_t value = _Rp + 1;\n};\n\ntemplate \nstruct __log2\n{\n static const size_t value = __log2_imp<_Xp,\n sizeof(_UI) * __CHAR_BIT__ - 1>::value;\n};\n\ntemplate\nclass __independent_bits_engine\n{\npublic:\n // types\n typedef _UIntType result_type;\n\nprivate:\n typedef typename _Engine::result_type _Engine_result_type;\n typedef typename conditional\n <\n sizeof(_Engine_result_type) <= sizeof(result_type),\n result_type,\n _Engine_result_type\n >::type _Working_result_type;\n\n _Engine& __e_;\n size_t __w_;\n size_t __w0_;\n size_t __n_;\n size_t __n0_;\n _Working_result_type __y0_;\n _Working_result_type __y1_;\n _Engine_result_type __mask0_;\n _Engine_result_type __mask1_;\n\n#ifdef _LIBCPP_HAS_NO_CONSTEXPR\n static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min\n + _Working_result_type(1);\n#else\n static _LIBCPP_CONSTEXPR const _Working_result_type _Rp = _Engine::max() - _Engine::min()\n + _Working_result_type(1);\n#endif\n static _LIBCPP_CONSTEXPR const size_t __m = __log2<_Working_result_type, _Rp>::value;\n static _LIBCPP_CONSTEXPR const size_t _WDt = numeric_limits<_Working_result_type>::digits;\n static _LIBCPP_CONSTEXPR const size_t _EDt = numeric_limits<_Engine_result_type>::digits;\n\npublic:\n // constructors and seeding functions\n __independent_bits_engine(_Engine& __e, size_t __w);\n\n // generating functions\n result_type operator()() {return __eval(integral_constant());}\n\nprivate:\n result_type __eval(false_type);\n result_type __eval(true_type);\n};\n\ntemplate\n__independent_bits_engine<_Engine, _UIntType>\n ::__independent_bits_engine(_Engine& __e, size_t __w)\n : __e_(__e),\n __w_(__w)\n{\n __n_ = __w_ / __m + (__w_ % __m != 0);\n __w0_ = __w_ / __n_;\n if (_Rp == 0)\n __y0_ = _Rp;\n else if (__w0_ < _WDt)\n __y0_ = (_Rp >> __w0_) << __w0_;\n else\n __y0_ = 0;\n if (_Rp - __y0_ > __y0_ / __n_)\n {\n ++__n_;\n __w0_ = __w_ / __n_;\n if (__w0_ < _WDt)\n __y0_ = (_Rp >> __w0_) << __w0_;\n else\n __y0_ = 0;\n }\n __n0_ = __n_ - __w_ % __n_;\n if (__w0_ < _WDt - 1)\n __y1_ = (_Rp >> (__w0_ + 1)) << (__w0_ + 1);\n else\n __y1_ = 0;\n __mask0_ = __w0_ > 0 ? _Engine_result_type(~0) >> (_EDt - __w0_) :\n _Engine_result_type(0);\n __mask1_ = __w0_ < _EDt - 1 ?\n _Engine_result_type(~0) >> (_EDt - (__w0_ + 1)) :\n _Engine_result_type(~0);\n}\n\ntemplate\ninline\n_UIntType\n__independent_bits_engine<_Engine, _UIntType>::__eval(false_type)\n{\n return static_cast(__e_() & __mask0_);\n}\n\ntemplate\n_UIntType\n__independent_bits_engine<_Engine, _UIntType>::__eval(true_type)\n{\n result_type _Sp = 0;\n for (size_t __k = 0; __k < __n0_; ++__k)\n {\n _Engine_result_type __u;\n do\n {\n __u = __e_() - _Engine::min();\n } while (__u >= __y0_);\n if (__w0_ < _WDt)\n _Sp <<= __w0_;\n else\n _Sp = 0;\n _Sp += __u & __mask0_;\n }\n for (size_t __k = __n0_; __k < __n_; ++__k)\n {\n _Engine_result_type __u;\n do\n {\n __u = __e_() - _Engine::min();\n } while (__u >= __y1_);\n if (__w0_ < _WDt - 1)\n _Sp <<= __w0_ + 1;\n else\n _Sp = 0;\n _Sp += __u & __mask1_;\n }\n return _Sp;\n}\n\n// uniform_int_distribution\n\ntemplate\nclass uniform_int_distribution\n{\npublic:\n // types\n typedef _IntType result_type;\n\n class param_type\n {\n result_type __a_;\n result_type __b_;\n public:\n typedef uniform_int_distribution distribution_type;\n\n explicit param_type(result_type __a = 0,\n result_type __b = numeric_limits::max())\n : __a_(__a), __b_(__b) {}\n\n result_type a() const {return __a_;}\n result_type b() const {return __b_;}\n\n friend bool operator==(const param_type& __x, const param_type& __y)\n {return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;}\n friend bool operator!=(const param_type& __x, const param_type& __y)\n {return !(__x == __y);}\n };\n\nprivate:\n param_type __p_;\n\npublic:\n // constructors and reset functions\n explicit uniform_int_distribution(result_type __a = 0,\n result_type __b = numeric_limits::max())\n : __p_(param_type(__a, __b)) {}\n explicit uniform_int_distribution(const param_type& __p) : __p_(__p) {}\n void reset() {}\n\n // generating functions\n template result_type operator()(_URNG& __g)\n {return (*this)(__g, __p_);}\n template result_type operator()(_URNG& __g, const param_type& __p);\n\n // property functions\n result_type a() const {return __p_.a();}\n result_type b() const {return __p_.b();}\n\n param_type param() const {return __p_;}\n void param(const param_type& __p) {__p_ = __p;}\n\n result_type min() const {return a();}\n result_type max() const {return b();}\n\n friend bool operator==(const uniform_int_distribution& __x,\n const uniform_int_distribution& __y)\n {return __x.__p_ == __y.__p_;}\n friend bool operator!=(const uniform_int_distribution& __x,\n const uniform_int_distribution& __y)\n {return !(__x == __y);}\n};\n\ntemplate\ntemplate\ntypename uniform_int_distribution<_IntType>::result_type\nuniform_int_distribution<_IntType>::operator()(_URNG& __g, const param_type& __p)\n{\n typedef typename conditional::type _UIntType;\n const _UIntType _Rp = __p.b() - __p.a() + _UIntType(1);\n if (_Rp == 1)\n return __p.a();\n const size_t _Dt = numeric_limits<_UIntType>::digits;\n typedef __independent_bits_engine<_URNG, _UIntType> _Eng;\n if (_Rp == 0)\n return static_cast(_Eng(__g, _Dt)());\n size_t __w = _Dt - __clz(_Rp) - 1;\n if ((_Rp & (std::numeric_limits<_UIntType>::max() >> (_Dt - __w))) != 0)\n ++__w;\n _Eng __e(__g, __w);\n _UIntType __u;\n do\n {\n __u = __e();\n } while (__u >= _Rp);\n return static_cast(__u + __p.a());\n}\n\nclass _LIBCPP_TYPE_VIS __rs_default;\n\n_LIBCPP_FUNC_VIS __rs_default __rs_get();\n\nclass _LIBCPP_TYPE_VIS __rs_default\n{\n static unsigned __c_;\n\n __rs_default();\npublic:\n typedef uint_fast32_t result_type;\n\n static const result_type _Min = 0;\n static const result_type _Max = 0xFFFFFFFF;\n\n __rs_default(const __rs_default&);\n ~__rs_default();\n\n result_type operator()();\n\n static _LIBCPP_CONSTEXPR result_type min() {return _Min;}\n static _LIBCPP_CONSTEXPR result_type max() {return _Max;}\n\n friend _LIBCPP_FUNC_VIS __rs_default __rs_get();\n};\n\n_LIBCPP_FUNC_VIS __rs_default __rs_get();\n\ntemplate \nvoid\nrandom_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)\n{\n typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;\n typedef uniform_int_distribution _Dp;\n typedef typename _Dp::param_type _Pp;\n difference_type __d = __last - __first;\n if (__d > 1)\n {\n _Dp __uid;\n __rs_default __g = __rs_get();\n for (--__last, --__d; __first < __last; ++__first, --__d)\n {\n difference_type __i = __uid(__g, _Pp(0, __d));\n if (__i != difference_type(0))\n swap(*__first, *(__first + __i));\n }\n }\n}\n\ntemplate \nvoid\nrandom_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _RandomNumberGenerator&& __rand)\n#else\n _RandomNumberGenerator& __rand)\n#endif\n{\n typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;\n difference_type __d = __last - __first;\n if (__d > 1)\n {\n for (--__last; __first < __last; ++__first, --__d)\n {\n difference_type __i = __rand(__d);\n swap(*__first, *(__first + __i));\n }\n }\n}\n\ntemplate \n_LIBCPP_INLINE_VISIBILITY\n_SampleIterator __sample(_PopulationIterator __first,\n _PopulationIterator __last, _SampleIterator __output,\n _Distance __n,\n _UniformRandomNumberGenerator & __g,\n input_iterator_tag) {\n\n _Distance __k = 0;\n for (; __first != __last && __k < __n; ++__first, (void)++__k)\n __output[__k] = *__first;\n _Distance __sz = __k;\n for (; __first != __last; ++__first, (void)++__k) {\n _Distance __r = _VSTD::uniform_int_distribution<_Distance>(0, __k)(__g);\n if (__r < __sz)\n __output[__r] = *__first;\n }\n return __output + _VSTD::min(__n, __k);\n}\n\ntemplate \n_LIBCPP_INLINE_VISIBILITY\n_SampleIterator __sample(_PopulationIterator __first,\n _PopulationIterator __last, _SampleIterator __output,\n _Distance __n,\n _UniformRandomNumberGenerator& __g,\n forward_iterator_tag) {\n _Distance __unsampled_sz = _VSTD::distance(__first, __last);\n for (__n = _VSTD::min(__n, __unsampled_sz); __n != 0; ++__first) {\n _Distance __r =\n _VSTD::uniform_int_distribution<_Distance>(0, --__unsampled_sz)(__g);\n if (__r < __n) {\n *__output++ = *__first;\n --__n;\n }\n }\n return __output;\n}\n\ntemplate \n_LIBCPP_INLINE_VISIBILITY\n_SampleIterator __sample(_PopulationIterator __first,\n _PopulationIterator __last, _SampleIterator __output,\n _Distance __n, _UniformRandomNumberGenerator& __g) {\n typedef typename iterator_traits<_PopulationIterator>::iterator_category\n _PopCategory;\n typedef typename iterator_traits<_PopulationIterator>::difference_type\n _Difference;\n static_assert(__is_forward_iterator<_PopulationIterator>::value ||\n __is_random_access_iterator<_SampleIterator>::value,\n \"SampleIterator must meet the requirements of RandomAccessIterator\");\n typedef typename common_type<_Distance, _Difference>::type _CommonType;\n _LIBCPP_ASSERT(__n >= 0, \"N must be a positive number.\");\n return _VSTD::__sample(\n __first, __last, __output, _CommonType(__n),\n __g, _PopCategory());\n}\n\n#if _LIBCPP_STD_VER > 14\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_SampleIterator sample(_PopulationIterator __first,\n _PopulationIterator __last, _SampleIterator __output,\n _Distance __n, _UniformRandomNumberGenerator&& __g) {\n return _VSTD::__sample(__first, __last, __output, __n, __g);\n}\n#endif // _LIBCPP_STD_VER > 14\n\ntemplate\n void shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,\n#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES\n _UniformRandomNumberGenerator&& __g)\n#else\n _UniformRandomNumberGenerator& __g)\n#endif\n{\n typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;\n typedef uniform_int_distribution _Dp;\n typedef typename _Dp::param_type _Pp;\n difference_type __d = __last - __first;\n if (__d > 1)\n {\n _Dp __uid;\n for (--__last, --__d; __first < __last; ++__first, --__d)\n {\n difference_type __i = __uid(__g, _Pp(0, __d));\n if (__i != difference_type(0))\n swap(*__first, *(__first + __i));\n }\n }\n}\n\ntemplate \nbool\nis_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred)\n{\n for (; __first != __last; ++__first)\n if (!__pred(*__first))\n break;\n if ( __first == __last )\n return true;\n ++__first;\n for (; __first != __last; ++__first)\n if (__pred(*__first))\n return false;\n return true;\n}\n\n// partition\n\ntemplate \n_ForwardIterator\n__partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, forward_iterator_tag)\n{\n while (true)\n {\n if (__first == __last)\n return __first;\n if (!__pred(*__first))\n break;\n ++__first;\n }\n for (_ForwardIterator __p = __first; ++__p != __last;)\n {\n if (__pred(*__p))\n {\n swap(*__first, *__p);\n ++__first;\n }\n }\n return __first;\n}\n\ntemplate \n_BidirectionalIterator\n__partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred,\n bidirectional_iterator_tag)\n{\n while (true)\n {\n while (true)\n {\n if (__first == __last)\n return __first;\n if (!__pred(*__first))\n break;\n ++__first;\n }\n do\n {\n if (__first == --__last)\n return __first;\n } while (!__pred(*__last));\n swap(*__first, *__last);\n ++__first;\n }\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_ForwardIterator\npartition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)\n{\n return _VSTD::__partition::type>\n (__first, __last, __pred, typename iterator_traits<_ForwardIterator>::iterator_category());\n}\n\n// partition_copy\n\ntemplate \npair<_OutputIterator1, _OutputIterator2>\npartition_copy(_InputIterator __first, _InputIterator __last,\n _OutputIterator1 __out_true, _OutputIterator2 __out_false,\n _Predicate __pred)\n{\n for (; __first != __last; ++__first)\n {\n if (__pred(*__first))\n {\n *__out_true = *__first;\n ++__out_true;\n }\n else\n {\n *__out_false = *__first;\n ++__out_false;\n }\n }\n return pair<_OutputIterator1, _OutputIterator2>(__out_true, __out_false);\n}\n\n// partition_point\n\ntemplate\n_ForwardIterator\npartition_point(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)\n{\n typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;\n difference_type __len = _VSTD::distance(__first, __last);\n while (__len != 0)\n {\n difference_type __l2 = __len / 2;\n _ForwardIterator __m = __first;\n _VSTD::advance(__m, __l2);\n if (__pred(*__m))\n {\n __first = ++__m;\n __len -= __l2 + 1;\n }\n else\n __len = __l2;\n }\n return __first;\n}\n\n// stable_partition\n\ntemplate \n_ForwardIterator\n__stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,\n _Distance __len, _Pair __p, forward_iterator_tag __fit)\n{\n // *__first is known to be false\n // __len >= 1\n if (__len == 1)\n return __first;\n if (__len == 2)\n {\n _ForwardIterator __m = __first;\n if (__pred(*++__m))\n {\n swap(*__first, *__m);\n return __m;\n }\n return __first;\n }\n if (__len <= __p.second)\n { // The buffer is big enough to use\n typedef typename iterator_traits<_ForwardIterator>::value_type value_type;\n __destruct_n __d(0);\n unique_ptr __h(__p.first, __d);\n // Move the falses into the temporary buffer, and the trues to the front of the line\n // Update __first to always point to the end of the trues\n value_type* __t = __p.first;\n ::new(__t) value_type(_VSTD::move(*__first));\n __d.__incr((value_type*)0);\n ++__t;\n _ForwardIterator __i = __first;\n while (++__i != __last)\n {\n if (__pred(*__i))\n {\n *__first = _VSTD::move(*__i);\n ++__first;\n }\n else\n {\n ::new(__t) value_type(_VSTD::move(*__i));\n __d.__incr((value_type*)0);\n ++__t;\n }\n }\n // All trues now at start of range, all falses in buffer\n // Move falses back into range, but don't mess up __first which points to first false\n __i = __first;\n for (value_type* __t2 = __p.first; __t2 < __t; ++__t2, ++__i)\n *__i = _VSTD::move(*__t2);\n // __h destructs moved-from values out of the temp buffer, but doesn't deallocate buffer\n return __first;\n }\n // Else not enough buffer, do in place\n // __len >= 3\n _ForwardIterator __m = __first;\n _Distance __len2 = __len / 2; // __len2 >= 2\n _VSTD::advance(__m, __len2);\n // recurse on [__first, __m), *__first know to be false\n // F?????????????????\n // f m l\n typedef typename add_lvalue_reference<_Predicate>::type _PredRef;\n _ForwardIterator __first_false = __stable_partition<_PredRef>(__first, __m, __pred, __len2, __p, __fit);\n // TTTFFFFF??????????\n // f ff m l\n // recurse on [__m, __last], except increase __m until *(__m) is false, *__last know to be true\n _ForwardIterator __m1 = __m;\n _ForwardIterator __second_false = __last;\n _Distance __len_half = __len - __len2;\n while (__pred(*__m1))\n {\n if (++__m1 == __last)\n goto __second_half_done;\n --__len_half;\n }\n // TTTFFFFFTTTF??????\n // f ff m m1 l\n __second_false = __stable_partition<_PredRef>(__m1, __last, __pred, __len_half, __p, __fit);\n__second_half_done:\n // TTTFFFFFTTTTTFFFFF\n // f ff m sf l\n return _VSTD::rotate(__first_false, __m, __second_false);\n // TTTTTTTTFFFFFFFFFF\n // |\n}\n\nstruct __return_temporary_buffer\n{\n template \n _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __p) const {_VSTD::return_temporary_buffer(__p);}\n};\n\ntemplate \n_ForwardIterator\n__stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,\n forward_iterator_tag)\n{\n const unsigned __alloc_limit = 3; // might want to make this a function of trivial assignment\n // Either prove all true and return __first or point to first false\n while (true)\n {\n if (__first == __last)\n return __first;\n if (!__pred(*__first))\n break;\n ++__first;\n }\n // We now have a reduced range [__first, __last)\n // *__first is known to be false\n typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;\n typedef typename iterator_traits<_ForwardIterator>::value_type value_type;\n difference_type __len = _VSTD::distance(__first, __last);\n pair __p(0, 0);\n unique_ptr __h;\n if (__len >= __alloc_limit)\n {\n __p = _VSTD::get_temporary_buffer(__len);\n __h.reset(__p.first);\n }\n return __stable_partition::type>\n (__first, __last, __pred, __len, __p, forward_iterator_tag());\n}\n\ntemplate \n_BidirectionalIterator\n__stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred,\n _Distance __len, _Pair __p, bidirectional_iterator_tag __bit)\n{\n // *__first is known to be false\n // *__last is known to be true\n // __len >= 2\n if (__len == 2)\n {\n swap(*__first, *__last);\n return __last;\n }\n if (__len == 3)\n {\n _BidirectionalIterator __m = __first;\n if (__pred(*++__m))\n {\n swap(*__first, *__m);\n swap(*__m, *__last);\n return __last;\n }\n swap(*__m, *__last);\n swap(*__first, *__m);\n return __m;\n }\n if (__len <= __p.second)\n { // The buffer is big enough to use\n typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;\n __destruct_n __d(0);\n unique_ptr __h(__p.first, __d);\n // Move the falses into the temporary buffer, and the trues to the front of the line\n // Update __first to always point to the end of the trues\n value_type* __t = __p.first;\n ::new(__t) value_type(_VSTD::move(*__first));\n __d.__incr((value_type*)0);\n ++__t;\n _BidirectionalIterator __i = __first;\n while (++__i != __last)\n {\n if (__pred(*__i))\n {\n *__first = _VSTD::move(*__i);\n ++__first;\n }\n else\n {\n ::new(__t) value_type(_VSTD::move(*__i));\n __d.__incr((value_type*)0);\n ++__t;\n }\n }\n // move *__last, known to be true\n *__first = _VSTD::move(*__i);\n __i = ++__first;\n // All trues now at start of range, all falses in buffer\n // Move falses back into range, but don't mess up __first which points to first false\n for (value_type* __t2 = __p.first; __t2 < __t; ++__t2, ++__i)\n *__i = _VSTD::move(*__t2);\n // __h destructs moved-from values out of the temp buffer, but doesn't deallocate buffer\n return __first;\n }\n // Else not enough buffer, do in place\n // __len >= 4\n _BidirectionalIterator __m = __first;\n _Distance __len2 = __len / 2; // __len2 >= 2\n _VSTD::advance(__m, __len2);\n // recurse on [__first, __m-1], except reduce __m-1 until *(__m-1) is true, *__first know to be false\n // F????????????????T\n // f m l\n _BidirectionalIterator __m1 = __m;\n _BidirectionalIterator __first_false = __first;\n _Distance __len_half = __len2;\n while (!__pred(*--__m1))\n {\n if (__m1 == __first)\n goto __first_half_done;\n --__len_half;\n }\n // F???TFFF?????????T\n // f m1 m l\n typedef typename add_lvalue_reference<_Predicate>::type _PredRef;\n __first_false = __stable_partition<_PredRef>(__first, __m1, __pred, __len_half, __p, __bit);\n__first_half_done:\n // TTTFFFFF?????????T\n // f ff m l\n // recurse on [__m, __last], except increase __m until *(__m) is false, *__last know to be true\n __m1 = __m;\n _BidirectionalIterator __second_false = __last;\n ++__second_false;\n __len_half = __len - __len2;\n while (__pred(*__m1))\n {\n if (++__m1 == __last)\n goto __second_half_done;\n --__len_half;\n }\n // TTTFFFFFTTTF?????T\n // f ff m m1 l\n __second_false = __stable_partition<_PredRef>(__m1, __last, __pred, __len_half, __p, __bit);\n__second_half_done:\n // TTTFFFFFTTTTTFFFFF\n // f ff m sf l\n return _VSTD::rotate(__first_false, __m, __second_false);\n // TTTTTTTTFFFFFFFFFF\n // |\n}\n\ntemplate \n_BidirectionalIterator\n__stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred,\n bidirectional_iterator_tag)\n{\n typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type;\n typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;\n const difference_type __alloc_limit = 4; // might want to make this a function of trivial assignment\n // Either prove all true and return __first or point to first false\n while (true)\n {\n if (__first == __last)\n return __first;\n if (!__pred(*__first))\n break;\n ++__first;\n }\n // __first points to first false, everything prior to __first is already set.\n // Either prove [__first, __last) is all false and return __first, or point __last to last true\n do\n {\n if (__first == --__last)\n return __first;\n } while (!__pred(*__last));\n // We now have a reduced range [__first, __last]\n // *__first is known to be false\n // *__last is known to be true\n // __len >= 2\n difference_type __len = _VSTD::distance(__first, __last) + 1;\n pair __p(0, 0);\n unique_ptr __h;\n if (__len >= __alloc_limit)\n {\n __p = _VSTD::get_temporary_buffer(__len);\n __h.reset(__p.first);\n }\n return __stable_partition::type>\n (__first, __last, __pred, __len, __p, bidirectional_iterator_tag());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_ForwardIterator\nstable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)\n{\n return __stable_partition::type>\n (__first, __last, __pred, typename iterator_traits<_ForwardIterator>::iterator_category());\n}\n\n// is_sorted_until\n\ntemplate \n_ForwardIterator\nis_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)\n{\n if (__first != __last)\n {\n _ForwardIterator __i = __first;\n while (++__i != __last)\n {\n if (__comp(*__i, *__first))\n return __i;\n __first = __i;\n }\n }\n return __last;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\n_ForwardIterator\nis_sorted_until(_ForwardIterator __first, _ForwardIterator __last)\n{\n return _VSTD::is_sorted_until(__first, __last, __less::value_type>());\n}\n\n// is_sorted\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\nis_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)\n{\n return _VSTD::is_sorted_until(__first, __last, __comp) == __last;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\nis_sorted(_ForwardIterator __first, _ForwardIterator __last)\n{\n return _VSTD::is_sorted(__first, __last, __less::value_type>());\n}\n\n// sort\n\n// stable, 2-3 compares, 0-2 swaps\n\ntemplate \nunsigned\n__sort3(_ForwardIterator __x, _ForwardIterator __y, _ForwardIterator __z, _Compare __c)\n{\n unsigned __r = 0;\n if (!__c(*__y, *__x)) // if x <= y\n {\n if (!__c(*__z, *__y)) // if y <= z\n return __r; // x <= y && y <= z\n // x <= y && y > z\n swap(*__y, *__z); // x <= z && y < z\n __r = 1;\n if (__c(*__y, *__x)) // if x > y\n {\n swap(*__x, *__y); // x < y && y <= z\n __r = 2;\n }\n return __r; // x <= y && y < z\n }\n if (__c(*__z, *__y)) // x > y, if y > z\n {\n swap(*__x, *__z); // x < y && y < z\n __r = 1;\n return __r;\n }\n swap(*__x, *__y); // x > y && y <= z\n __r = 1; // x < y && x <= z\n if (__c(*__z, *__y)) // if y > z\n {\n swap(*__y, *__z); // x <= y && y < z\n __r = 2;\n }\n return __r;\n} // x <= y && y <= z\n\n// stable, 3-6 compares, 0-5 swaps\n\ntemplate \nunsigned\n__sort4(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,\n _ForwardIterator __x4, _Compare __c)\n{\n unsigned __r = __sort3<_Compare>(__x1, __x2, __x3, __c);\n if (__c(*__x4, *__x3))\n {\n swap(*__x3, *__x4);\n ++__r;\n if (__c(*__x3, *__x2))\n {\n swap(*__x2, *__x3);\n ++__r;\n if (__c(*__x2, *__x1))\n {\n swap(*__x1, *__x2);\n ++__r;\n }\n }\n }\n return __r;\n}\n\n// stable, 4-10 compares, 0-9 swaps\n\ntemplate \nunsigned\n__sort5(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,\n _ForwardIterator __x4, _ForwardIterator __x5, _Compare __c)\n{\n unsigned __r = __sort4<_Compare>(__x1, __x2, __x3, __x4, __c);\n if (__c(*__x5, *__x4))\n {\n swap(*__x4, *__x5);\n ++__r;\n if (__c(*__x4, *__x3))\n {\n swap(*__x3, *__x4);\n ++__r;\n if (__c(*__x3, *__x2))\n {\n swap(*__x2, *__x3);\n ++__r;\n if (__c(*__x2, *__x1))\n {\n swap(*__x1, *__x2);\n ++__r;\n }\n }\n }\n }\n return __r;\n}\n\n// Assumes size > 0\ntemplate \nvoid\n__selection_sort(_BirdirectionalIterator __first, _BirdirectionalIterator __last, _Compare __comp)\n{\n _BirdirectionalIterator __lm1 = __last;\n for (--__lm1; __first != __lm1; ++__first)\n {\n _BirdirectionalIterator __i = _VSTD::min_element<_BirdirectionalIterator,\n typename add_lvalue_reference<_Compare>::type>\n (__first, __last, __comp);\n if (__i != __first)\n swap(*__first, *__i);\n }\n}\n\ntemplate \nvoid\n__insertion_sort(_BirdirectionalIterator __first, _BirdirectionalIterator __last, _Compare __comp)\n{\n typedef typename iterator_traits<_BirdirectionalIterator>::value_type value_type;\n if (__first != __last)\n {\n _BirdirectionalIterator __i = __first;\n for (++__i; __i != __last; ++__i)\n {\n _BirdirectionalIterator __j = __i;\n value_type __t(_VSTD::move(*__j));\n for (_BirdirectionalIterator __k = __i; __k != __first && __comp(__t, *--__k); --__j)\n *__j = _VSTD::move(*__k);\n *__j = _VSTD::move(__t);\n }\n }\n}\n\ntemplate \nvoid\n__insertion_sort_3(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)\n{\n typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;\n _RandomAccessIterator __j = __first+2;\n __sort3<_Compare>(__first, __first+1, __j, __comp);\n for (_RandomAccessIterator __i = __j+1; __i != __last; ++__i)\n {\n if (__comp(*__i, *__j))\n {\n value_type __t(_VSTD::move(*__i));\n _RandomAccessIterator __k = __j;\n __j = __i;\n do\n {\n *__j = _VSTD::move(*__k);\n __j = __k;\n } while (__j != __first && __comp(__t, *--__k));\n *__j = _VSTD::move(__t);\n }\n __j = __i;\n }\n}\n\ntemplate \nbool\n__insertion_sort_incomplete(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)\n{\n switch (__last - __first)\n {\n case 0:\n case 1:\n return true;\n case 2:\n if (__comp(*--__last, *__first))\n swap(*__first, *__last);\n return true;\n case 3:\n _VSTD::__sort3<_Compare>(__first, __first+1, --__last, __comp);\n return true;\n case 4:\n _VSTD::__sort4<_Compare>(__first, __first+1, __first+2, --__last, __comp);\n return true;\n case 5:\n _VSTD::__sort5<_Compare>(__first, __first+1, __first+2, __first+3, --__last, __comp);\n return true;\n }\n typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;\n _RandomAccessIterator __j = __first+2;\n __sort3<_Compare>(__first, __first+1, __j, __comp);\n const unsigned __limit = 8;\n unsigned __count = 0;\n for (_RandomAccessIterator __i = __j+1; __i != __last; ++__i)\n {\n if (__comp(*__i, *__j))\n {\n value_type __t(_VSTD::move(*__i));\n _RandomAccessIterator __k = __j;\n __j = __i;\n do\n {\n *__j = _VSTD::move(*__k);\n __j = __k;\n } while (__j != __first && __comp(__t, *--__k));\n *__j = _VSTD::move(__t);\n if (++__count == __limit)\n return ++__i == __last;\n }\n __j = __i;\n }\n return true;\n}\n\ntemplate \nvoid\n__insertion_sort_move(_BirdirectionalIterator __first1, _BirdirectionalIterator __last1,\n typename iterator_traits<_BirdirectionalIterator>::value_type* __first2, _Compare __comp)\n{\n typedef typename iterator_traits<_BirdirectionalIterator>::value_type value_type;\n if (__first1 != __last1)\n {\n __destruct_n __d(0);\n unique_ptr __h(__first2, __d);\n value_type* __last2 = __first2;\n ::new(__last2) value_type(_VSTD::move(*__first1));\n __d.__incr((value_type*)0);\n for (++__last2; ++__first1 != __last1; ++__last2)\n {\n value_type* __j2 = __last2;\n value_type* __i2 = __j2;\n if (__comp(*__first1, *--__i2))\n {\n ::new(__j2) value_type(_VSTD::move(*__i2));\n __d.__incr((value_type*)0);\n for (--__j2; __i2 != __first2 && __comp(*__first1, *--__i2); --__j2)\n *__j2 = _VSTD::move(*__i2);\n *__j2 = _VSTD::move(*__first1);\n }\n else\n {\n ::new(__j2) value_type(_VSTD::move(*__first1));\n __d.__incr((value_type*)0);\n }\n }\n __h.release();\n }\n}\n\ntemplate \nvoid\n__sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)\n{\n // _Compare is known to be a reference type\n typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;\n typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;\n const difference_type __limit = is_trivially_copy_constructible::value &&\n is_trivially_copy_assignable::value ? 30 : 6;\n while (true)\n {\n __restart:\n difference_type __len = __last - __first;\n switch (__len)\n {\n case 0:\n case 1:\n return;\n case 2:\n if (__comp(*--__last, *__first))\n swap(*__first, *__last);\n return;\n case 3:\n _VSTD::__sort3<_Compare>(__first, __first+1, --__last, __comp);\n return;\n case 4:\n _VSTD::__sort4<_Compare>(__first, __first+1, __first+2, --__last, __comp);\n return;\n case 5:\n _VSTD::__sort5<_Compare>(__first, __first+1, __first+2, __first+3, --__last, __comp);\n return;\n }\n if (__len <= __limit)\n {\n _VSTD::__insertion_sort_3<_Compare>(__first, __last, __comp);\n return;\n }\n // __len > 5\n _RandomAccessIterator __m = __first;\n _RandomAccessIterator __lm1 = __last;\n --__lm1;\n unsigned __n_swaps;\n {\n difference_type __delta;\n if (__len >= 1000)\n {\n __delta = __len/2;\n __m += __delta;\n __delta /= 2;\n __n_swaps = _VSTD::__sort5<_Compare>(__first, __first + __delta, __m, __m+__delta, __lm1, __comp);\n }\n else\n {\n __delta = __len/2;\n __m += __delta;\n __n_swaps = _VSTD::__sort3<_Compare>(__first, __m, __lm1, __comp);\n }\n }\n // *__m is median\n // partition [__first, __m) < *__m and *__m <= [__m, __last)\n // (this inhibits tossing elements equivalent to __m around unnecessarily)\n _RandomAccessIterator __i = __first;\n _RandomAccessIterator __j = __lm1;\n // j points beyond range to be tested, *__m is known to be <= *__lm1\n // The search going up is known to be guarded but the search coming down isn't.\n // Prime the downward search with a guard.\n if (!__comp(*__i, *__m)) // if *__first == *__m\n {\n // *__first == *__m, *__first doesn't go in first part\n // manually guard downward moving __j against __i\n while (true)\n {\n if (__i == --__j)\n {\n // *__first == *__m, *__m <= all other elements\n // Parition instead into [__first, __i) == *__first and *__first < [__i, __last)\n ++__i; // __first + 1\n __j = __last;\n if (!__comp(*__first, *--__j)) // we need a guard if *__first == *(__last-1)\n {\n while (true)\n {\n if (__i == __j)\n return; // [__first, __last) all equivalent elements\n if (__comp(*__first, *__i))\n {\n swap(*__i, *__j);\n ++__n_swaps;\n ++__i;\n break;\n }\n ++__i;\n }\n }\n // [__first, __i) == *__first and *__first < [__j, __last) and __j == __last - 1\n if (__i == __j)\n return;\n while (true)\n {\n while (!__comp(*__first, *__i))\n ++__i;\n while (__comp(*__first, *--__j))\n ;\n if (__i >= __j)\n break;\n swap(*__i, *__j);\n ++__n_swaps;\n ++__i;\n }\n // [__first, __i) == *__first and *__first < [__i, __last)\n // The first part is sorted, sort the secod part\n // _VSTD::__sort<_Compare>(__i, __last, __comp);\n __first = __i;\n goto __restart;\n }\n if (__comp(*__j, *__m))\n {\n swap(*__i, *__j);\n ++__n_swaps;\n break; // found guard for downward moving __j, now use unguarded partition\n }\n }\n }\n // It is known that *__i < *__m\n ++__i;\n // j points beyond range to be tested, *__m is known to be <= *__lm1\n // if not yet partitioned...\n if (__i < __j)\n {\n // known that *(__i - 1) < *__m\n // known that __i <= __m\n while (true)\n {\n // __m still guards upward moving __i\n while (__comp(*__i, *__m))\n ++__i;\n // It is now known that a guard exists for downward moving __j\n while (!__comp(*--__j, *__m))\n ;\n if (__i > __j)\n break;\n swap(*__i, *__j);\n ++__n_swaps;\n // It is known that __m != __j\n // If __m just moved, follow it\n if (__m == __i)\n __m = __j;\n ++__i;\n }\n }\n // [__first, __i) < *__m and *__m <= [__i, __last)\n if (__i != __m && __comp(*__m, *__i))\n {\n swap(*__i, *__m);\n ++__n_swaps;\n }\n // [__first, __i) < *__i and *__i <= [__i+1, __last)\n // If we were given a perfect partition, see if insertion sort is quick...\n if (__n_swaps == 0)\n {\n bool __fs = _VSTD::__insertion_sort_incomplete<_Compare>(__first, __i, __comp);\n if (_VSTD::__insertion_sort_incomplete<_Compare>(__i+1, __last, __comp))\n {\n if (__fs)\n return;\n __last = __i;\n continue;\n }\n else\n {\n if (__fs)\n {\n __first = ++__i;\n continue;\n }\n }\n }\n // sort smaller range with recursive call and larger with tail recursion elimination\n if (__i - __first < __last - __i)\n {\n _VSTD::__sort<_Compare>(__first, __i, __comp);\n // _VSTD::__sort<_Compare>(__i+1, __last, __comp);\n __first = ++__i;\n }\n else\n {\n _VSTD::__sort<_Compare>(__i+1, __last, __comp);\n // _VSTD::__sort<_Compare>(__first, __i, __comp);\n __last = __i;\n }\n }\n}\n\n// This forwarder keeps the top call and the recursive calls using the same instantiation, forcing a reference _Compare\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nsort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n __sort<_Comp_ref>(__first, __last, __c);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n __sort<_Comp_ref>(__first, __last, __comp);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nsort(_RandomAccessIterator __first, _RandomAccessIterator __last)\n{\n _VSTD::sort(__first, __last, __less::value_type>());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nsort(_Tp** __first, _Tp** __last)\n{\n _VSTD::sort((size_t*)__first, (size_t*)__last, __less());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nsort(__wrap_iter<_Tp*> __first, __wrap_iter<_Tp*> __last)\n{\n _VSTD::sort(__first.base(), __last.base());\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nsort(__wrap_iter<_Tp*> __first, __wrap_iter<_Tp*> __last, _Compare __comp)\n{\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n _VSTD::sort<_Tp*, _Comp_ref>(__first.base(), __last.base(), __comp);\n}\n\n#ifdef _LIBCPP_MSVC\n#pragma warning( push )\n#pragma warning( disable: 4231)\n#endif // _LIBCPP_MSVC\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, char*>(char*, char*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, wchar_t*>(wchar_t*, wchar_t*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, signed char*>(signed char*, signed char*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, unsigned char*>(unsigned char*, unsigned char*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, short*>(short*, short*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, unsigned short*>(unsigned short*, unsigned short*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, int*>(int*, int*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, unsigned*>(unsigned*, unsigned*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, long*>(long*, long*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, unsigned long*>(unsigned long*, unsigned long*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, long long*>(long long*, long long*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, unsigned long long*>(unsigned long long*, unsigned long long*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, float*>(float*, float*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, double*>(double*, double*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS void __sort<__less&, long double*>(long double*, long double*, __less&))\n\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, char*>(char*, char*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, wchar_t*>(wchar_t*, wchar_t*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, signed char*>(signed char*, signed char*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, unsigned char*>(unsigned char*, unsigned char*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, short*>(short*, short*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, unsigned short*>(unsigned short*, unsigned short*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, int*>(int*, int*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, unsigned*>(unsigned*, unsigned*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, long*>(long*, long*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, unsigned long*>(unsigned long*, unsigned long*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, long long*>(long long*, long long*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, unsigned long long*>(unsigned long long*, unsigned long long*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, float*>(float*, float*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, double*>(double*, double*, __less&))\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS bool __insertion_sort_incomplete<__less&, long double*>(long double*, long double*, __less&))\n\n_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS unsigned __sort5<__less&, long double*>(long double*, long double*, long double*, long double*, long double*, __less&))\n#ifdef _LIBCPP_MSVC\n#pragma warning( pop )\n#endif // _LIBCPP_MSVC\n\n// lower_bound\n\ntemplate \n_ForwardIterator\n__lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)\n{\n typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;\n difference_type __len = _VSTD::distance(__first, __last);\n while (__len != 0)\n {\n difference_type __l2 = __len / 2;\n _ForwardIterator __m = __first;\n _VSTD::advance(__m, __l2);\n if (__comp(*__m, __value_))\n {\n __first = ++__m;\n __len -= __l2 + 1;\n }\n else\n __len = __l2;\n }\n return __first;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_ForwardIterator\nlower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n return __lower_bound<_Comp_ref>(__first, __last, __value_, __c);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n return __lower_bound<_Comp_ref>(__first, __last, __value_, __comp);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_ForwardIterator\nlower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)\n{\n return _VSTD::lower_bound(__first, __last, __value_,\n __less::value_type, _Tp>());\n}\n\n// upper_bound\n\ntemplate \n_ForwardIterator\n__upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)\n{\n typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;\n difference_type __len = _VSTD::distance(__first, __last);\n while (__len != 0)\n {\n difference_type __l2 = __len / 2;\n _ForwardIterator __m = __first;\n _VSTD::advance(__m, __l2);\n if (__comp(__value_, *__m))\n __len = __l2;\n else\n {\n __first = ++__m;\n __len -= __l2 + 1;\n }\n }\n return __first;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_ForwardIterator\nupper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n return __upper_bound<_Comp_ref>(__first, __last, __value_, __c);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n return __upper_bound<_Comp_ref>(__first, __last, __value_, __comp);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_ForwardIterator\nupper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)\n{\n return _VSTD::upper_bound(__first, __last, __value_,\n __less<_Tp, typename iterator_traits<_ForwardIterator>::value_type>());\n}\n\n// equal_range\n\ntemplate \npair<_ForwardIterator, _ForwardIterator>\n__equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)\n{\n typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;\n difference_type __len = _VSTD::distance(__first, __last);\n while (__len != 0)\n {\n difference_type __l2 = __len / 2;\n _ForwardIterator __m = __first;\n _VSTD::advance(__m, __l2);\n if (__comp(*__m, __value_))\n {\n __first = ++__m;\n __len -= __l2 + 1;\n }\n else if (__comp(__value_, *__m))\n {\n __last = __m;\n __len = __l2;\n }\n else\n {\n _ForwardIterator __mp1 = __m;\n return pair<_ForwardIterator, _ForwardIterator>\n (\n __lower_bound<_Compare>(__first, __m, __value_, __comp),\n __upper_bound<_Compare>(++__mp1, __last, __value_, __comp)\n );\n }\n }\n return pair<_ForwardIterator, _ForwardIterator>(__first, __first);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\npair<_ForwardIterator, _ForwardIterator>\nequal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n return __equal_range<_Comp_ref>(__first, __last, __value_, __c);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n return __equal_range<_Comp_ref>(__first, __last, __value_, __comp);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\npair<_ForwardIterator, _ForwardIterator>\nequal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)\n{\n return _VSTD::equal_range(__first, __last, __value_,\n __less::value_type, _Tp>());\n}\n\n// binary_search\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\n__binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)\n{\n __first = __lower_bound<_Compare>(__first, __last, __value_, __comp);\n return __first != __last && !__comp(__value_, *__first);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\nbinary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n return __binary_search<_Comp_ref>(__first, __last, __value_, __c);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n return __binary_search<_Comp_ref>(__first, __last, __value_, __comp);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\nbinary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)\n{\n return _VSTD::binary_search(__first, __last, __value_,\n __less::value_type, _Tp>());\n}\n\n// merge\n\ntemplate \n_OutputIterator\n__merge(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)\n{\n for (; __first1 != __last1; ++__result)\n {\n if (__first2 == __last2)\n return _VSTD::copy(__first1, __last1, __result);\n if (__comp(*__first2, *__first1))\n {\n *__result = *__first2;\n ++__first2;\n }\n else\n {\n *__result = *__first1;\n ++__first1;\n }\n }\n return _VSTD::copy(__first2, __last2, __result);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\nmerge(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n return _VSTD::__merge<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __c);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n return _VSTD::__merge<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\nmerge(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)\n{\n typedef typename iterator_traits<_InputIterator1>::value_type __v1;\n typedef typename iterator_traits<_InputIterator2>::value_type __v2;\n return merge(__first1, __last1, __first2, __last2, __result, __less<__v1, __v2>());\n}\n\n// inplace_merge\n\ntemplate \nvoid __half_inplace_merge(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2,\n _OutputIterator __result, _Compare __comp)\n{\n for (; __first1 != __last1; ++__result)\n {\n if (__first2 == __last2)\n {\n _VSTD::move(__first1, __last1, __result);\n return;\n }\n\n if (__comp(*__first2, *__first1))\n {\n *__result = _VSTD::move(*__first2);\n ++__first2;\n }\n else\n {\n *__result = _VSTD::move(*__first1);\n ++__first1;\n }\n }\n // __first2 through __last2 are already in the right spot.\n}\n\ntemplate \nvoid\n__buffered_inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,\n _Compare __comp, typename iterator_traits<_BidirectionalIterator>::difference_type __len1,\n typename iterator_traits<_BidirectionalIterator>::difference_type __len2,\n typename iterator_traits<_BidirectionalIterator>::value_type* __buff)\n{\n typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;\n __destruct_n __d(0);\n unique_ptr __h2(__buff, __d);\n if (__len1 <= __len2)\n {\n value_type* __p = __buff;\n for (_BidirectionalIterator __i = __first; __i != __middle; __d.__incr((value_type*)0), (void) ++__i, ++__p)\n ::new(__p) value_type(_VSTD::move(*__i));\n __half_inplace_merge(__buff, __p, __middle, __last, __first, __comp);\n }\n else\n {\n value_type* __p = __buff;\n for (_BidirectionalIterator __i = __middle; __i != __last; __d.__incr((value_type*)0), (void) ++__i, ++__p)\n ::new(__p) value_type(_VSTD::move(*__i));\n typedef reverse_iterator<_BidirectionalIterator> _RBi;\n typedef reverse_iterator _Rv;\n __half_inplace_merge(_Rv(__p), _Rv(__buff),\n _RBi(__middle), _RBi(__first),\n _RBi(__last), __negate<_Compare>(__comp));\n }\n}\n\ntemplate \nvoid\n__inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,\n _Compare __comp, typename iterator_traits<_BidirectionalIterator>::difference_type __len1,\n typename iterator_traits<_BidirectionalIterator>::difference_type __len2,\n typename iterator_traits<_BidirectionalIterator>::value_type* __buff, ptrdiff_t __buff_size)\n{\n typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type;\n while (true)\n {\n // if __middle == __last, we're done\n if (__len2 == 0)\n return;\n if (__len1 <= __buff_size || __len2 <= __buff_size)\n return __buffered_inplace_merge<_Compare>\n (__first, __middle, __last, __comp, __len1, __len2, __buff);\n // shrink [__first, __middle) as much as possible (with no moves), returning if it shrinks to 0\n for (; true; ++__first, (void) --__len1)\n {\n if (__len1 == 0)\n return;\n if (__comp(*__middle, *__first))\n break;\n }\n // __first < __middle < __last\n // *__first > *__middle\n // partition [__first, __m1) [__m1, __middle) [__middle, __m2) [__m2, __last) such that\n // all elements in:\n // [__first, __m1) <= [__middle, __m2)\n // [__middle, __m2) < [__m1, __middle)\n // [__m1, __middle) <= [__m2, __last)\n // and __m1 or __m2 is in the middle of its range\n _BidirectionalIterator __m1; // \"median\" of [__first, __middle)\n _BidirectionalIterator __m2; // \"median\" of [__middle, __last)\n difference_type __len11; // distance(__first, __m1)\n difference_type __len21; // distance(__middle, __m2)\n // binary search smaller range\n if (__len1 < __len2)\n { // __len >= 1, __len2 >= 2\n __len21 = __len2 / 2;\n __m2 = __middle;\n _VSTD::advance(__m2, __len21);\n __m1 = __upper_bound<_Compare>(__first, __middle, *__m2, __comp);\n __len11 = _VSTD::distance(__first, __m1);\n }\n else\n {\n if (__len1 == 1)\n { // __len1 >= __len2 && __len2 > 0, therefore __len2 == 1\n // It is known *__first > *__middle\n swap(*__first, *__middle);\n return;\n }\n // __len1 >= 2, __len2 >= 1\n __len11 = __len1 / 2;\n __m1 = __first;\n _VSTD::advance(__m1, __len11);\n __m2 = __lower_bound<_Compare>(__middle, __last, *__m1, __comp);\n __len21 = _VSTD::distance(__middle, __m2);\n }\n difference_type __len12 = __len1 - __len11; // distance(__m1, __middle)\n difference_type __len22 = __len2 - __len21; // distance(__m2, __last)\n // [__first, __m1) [__m1, __middle) [__middle, __m2) [__m2, __last)\n // swap middle two partitions\n __middle = _VSTD::rotate(__m1, __middle, __m2);\n // __len12 and __len21 now have swapped meanings\n // merge smaller range with recurisve call and larger with tail recursion elimination\n if (__len11 + __len21 < __len12 + __len22)\n {\n __inplace_merge<_Compare>(__first, __m1, __middle, __comp, __len11, __len21, __buff, __buff_size);\n// __inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __buff_size);\n __first = __middle;\n __middle = __m2;\n __len1 = __len12;\n __len2 = __len22;\n }\n else\n {\n __inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __buff_size);\n// __inplace_merge<_Compare>(__first, __m1, __middle, __comp, __len11, __len21, __buff, __buff_size);\n __last = __middle;\n __middle = __m1;\n __len1 = __len11;\n __len2 = __len21;\n }\n }\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\ninplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,\n _Compare __comp)\n{\n typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;\n typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type;\n difference_type __len1 = _VSTD::distance(__first, __middle);\n difference_type __len2 = _VSTD::distance(__middle, __last);\n difference_type __buf_size = _VSTD::min(__len1, __len2);\n pair __buf = _VSTD::get_temporary_buffer(__buf_size);\n unique_ptr __h(__buf.first);\n\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n return _VSTD::__inplace_merge<_Comp_ref>(__first, __middle, __last, __c, __len1, __len2,\n __buf.first, __buf.second);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n return _VSTD::__inplace_merge<_Comp_ref>(__first, __middle, __last, __comp, __len1, __len2,\n __buf.first, __buf.second);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\ninplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last)\n{\n _VSTD::inplace_merge(__first, __middle, __last,\n __less::value_type>());\n}\n\n// stable_sort\n\ntemplate \nvoid\n__merge_move_construct(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2,\n typename iterator_traits<_InputIterator1>::value_type* __result, _Compare __comp)\n{\n typedef typename iterator_traits<_InputIterator1>::value_type value_type;\n __destruct_n __d(0);\n unique_ptr __h(__result, __d);\n for (; true; ++__result)\n {\n if (__first1 == __last1)\n {\n for (; __first2 != __last2; ++__first2, ++__result, __d.__incr((value_type*)0))\n ::new (__result) value_type(_VSTD::move(*__first2));\n __h.release();\n return;\n }\n if (__first2 == __last2)\n {\n for (; __first1 != __last1; ++__first1, ++__result, __d.__incr((value_type*)0))\n ::new (__result) value_type(_VSTD::move(*__first1));\n __h.release();\n return;\n }\n if (__comp(*__first2, *__first1))\n {\n ::new (__result) value_type(_VSTD::move(*__first2));\n __d.__incr((value_type*)0);\n ++__first2;\n }\n else\n {\n ::new (__result) value_type(_VSTD::move(*__first1));\n __d.__incr((value_type*)0);\n ++__first1;\n }\n }\n}\n\ntemplate \nvoid\n__merge_move_assign(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2,\n _OutputIterator __result, _Compare __comp)\n{\n for (; __first1 != __last1; ++__result)\n {\n if (__first2 == __last2)\n {\n for (; __first1 != __last1; ++__first1, ++__result)\n *__result = _VSTD::move(*__first1);\n return;\n }\n if (__comp(*__first2, *__first1))\n {\n *__result = _VSTD::move(*__first2);\n ++__first2;\n }\n else\n {\n *__result = _VSTD::move(*__first1);\n ++__first1;\n }\n }\n for (; __first2 != __last2; ++__first2, ++__result)\n *__result = _VSTD::move(*__first2);\n}\n\ntemplate \nvoid\n__stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,\n typename iterator_traits<_RandomAccessIterator>::difference_type __len,\n typename iterator_traits<_RandomAccessIterator>::value_type* __buff, ptrdiff_t __buff_size);\n\ntemplate \nvoid\n__stable_sort_move(_RandomAccessIterator __first1, _RandomAccessIterator __last1, _Compare __comp,\n typename iterator_traits<_RandomAccessIterator>::difference_type __len,\n typename iterator_traits<_RandomAccessIterator>::value_type* __first2)\n{\n typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;\n switch (__len)\n {\n case 0:\n return;\n case 1:\n ::new(__first2) value_type(_VSTD::move(*__first1));\n return;\n case 2:\n __destruct_n __d(0);\n unique_ptr __h2(__first2, __d);\n if (__comp(*--__last1, *__first1))\n {\n ::new(__first2) value_type(_VSTD::move(*__last1));\n __d.__incr((value_type*)0);\n ++__first2;\n ::new(__first2) value_type(_VSTD::move(*__first1));\n }\n else\n {\n ::new(__first2) value_type(_VSTD::move(*__first1));\n __d.__incr((value_type*)0);\n ++__first2;\n ::new(__first2) value_type(_VSTD::move(*__last1));\n }\n __h2.release();\n return;\n }\n if (__len <= 8)\n {\n __insertion_sort_move<_Compare>(__first1, __last1, __first2, __comp);\n return;\n }\n typename iterator_traits<_RandomAccessIterator>::difference_type __l2 = __len / 2;\n _RandomAccessIterator __m = __first1 + __l2;\n __stable_sort<_Compare>(__first1, __m, __comp, __l2, __first2, __l2);\n __stable_sort<_Compare>(__m, __last1, __comp, __len - __l2, __first2 + __l2, __len - __l2);\n __merge_move_construct<_Compare>(__first1, __m, __m, __last1, __first2, __comp);\n}\n\ntemplate \nstruct __stable_sort_switch\n{\n static const unsigned value = 128*is_trivially_copy_assignable<_Tp>::value;\n};\n\ntemplate \nvoid\n__stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,\n typename iterator_traits<_RandomAccessIterator>::difference_type __len,\n typename iterator_traits<_RandomAccessIterator>::value_type* __buff, ptrdiff_t __buff_size)\n{\n typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;\n typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;\n switch (__len)\n {\n case 0:\n case 1:\n return;\n case 2:\n if (__comp(*--__last, *__first))\n swap(*__first, *__last);\n return;\n }\n if (__len <= static_cast(__stable_sort_switch::value))\n {\n __insertion_sort<_Compare>(__first, __last, __comp);\n return;\n }\n typename iterator_traits<_RandomAccessIterator>::difference_type __l2 = __len / 2;\n _RandomAccessIterator __m = __first + __l2;\n if (__len <= __buff_size)\n {\n __destruct_n __d(0);\n unique_ptr __h2(__buff, __d);\n __stable_sort_move<_Compare>(__first, __m, __comp, __l2, __buff);\n __d.__set(__l2, (value_type*)0);\n __stable_sort_move<_Compare>(__m, __last, __comp, __len - __l2, __buff + __l2);\n __d.__set(__len, (value_type*)0);\n __merge_move_assign<_Compare>(__buff, __buff + __l2, __buff + __l2, __buff + __len, __first, __comp);\n// __merge<_Compare>(move_iterator(__buff),\n// move_iterator(__buff + __l2),\n// move_iterator<_RandomAccessIterator>(__buff + __l2),\n// move_iterator<_RandomAccessIterator>(__buff + __len),\n// __first, __comp);\n return;\n }\n __stable_sort<_Compare>(__first, __m, __comp, __l2, __buff, __buff_size);\n __stable_sort<_Compare>(__m, __last, __comp, __len - __l2, __buff, __buff_size);\n __inplace_merge<_Compare>(__first, __m, __last, __comp, __l2, __len - __l2, __buff, __buff_size);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nstable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)\n{\n typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;\n typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;\n difference_type __len = __last - __first;\n pair __buf(0, 0);\n unique_ptr __h;\n if (__len > static_cast(__stable_sort_switch::value))\n {\n __buf = _VSTD::get_temporary_buffer(__len);\n __h.reset(__buf.first);\n }\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n __stable_sort<_Comp_ref>(__first, __last, __c, __len, __buf.first, __buf.second);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n __stable_sort<_Comp_ref>(__first, __last, __comp, __len, __buf.first, __buf.second);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nstable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last)\n{\n _VSTD::stable_sort(__first, __last, __less::value_type>());\n}\n\n// is_heap_until\n\ntemplate \n_RandomAccessIterator\nis_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)\n{\n typedef typename _VSTD::iterator_traits<_RandomAccessIterator>::difference_type difference_type;\n difference_type __len = __last - __first;\n difference_type __p = 0;\n difference_type __c = 1;\n _RandomAccessIterator __pp = __first;\n while (__c < __len)\n {\n _RandomAccessIterator __cp = __first + __c;\n if (__comp(*__pp, *__cp))\n return __cp;\n ++__c;\n ++__cp;\n if (__c == __len)\n return __last;\n if (__comp(*__pp, *__cp))\n return __cp;\n ++__p;\n ++__pp;\n __c = 2 * __p + 1;\n }\n return __last;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\n_RandomAccessIterator\nis_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last)\n{\n return _VSTD::is_heap_until(__first, __last, __less::value_type>());\n}\n\n// is_heap\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\nis_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)\n{\n return _VSTD::is_heap_until(__first, __last, __comp) == __last;\n}\n\ntemplate\ninline _LIBCPP_INLINE_VISIBILITY\nbool\nis_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)\n{\n return _VSTD::is_heap(__first, __last, __less::value_type>());\n}\n\n// push_heap\n\ntemplate \nvoid\n__sift_up(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,\n typename iterator_traits<_RandomAccessIterator>::difference_type __len)\n{\n typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;\n if (__len > 1)\n {\n __len = (__len - 2) / 2;\n _RandomAccessIterator __ptr = __first + __len;\n if (__comp(*__ptr, *--__last))\n {\n value_type __t(_VSTD::move(*__last));\n do\n {\n *__last = _VSTD::move(*__ptr);\n __last = __ptr;\n if (__len == 0)\n break;\n __len = (__len - 1) / 2;\n __ptr = __first + __len;\n } while (__comp(*__ptr, __t));\n *__last = _VSTD::move(__t);\n }\n }\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\npush_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n __sift_up<_Comp_ref>(__first, __last, __c, __last - __first);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n __sift_up<_Comp_ref>(__first, __last, __comp, __last - __first);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\npush_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)\n{\n _VSTD::push_heap(__first, __last, __less::value_type>());\n}\n\n// pop_heap\n\ntemplate \nvoid\n__sift_down(_RandomAccessIterator __first, _RandomAccessIterator /*__last*/,\n _Compare __comp,\n typename iterator_traits<_RandomAccessIterator>::difference_type __len,\n _RandomAccessIterator __start)\n{\n typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;\n typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;\n // left-child of __start is at 2 * __start + 1\n // right-child of __start is at 2 * __start + 2\n difference_type __child = __start - __first;\n\n if (__len < 2 || (__len - 2) / 2 < __child)\n return;\n\n __child = 2 * __child + 1;\n _RandomAccessIterator __child_i = __first + __child;\n\n if ((__child + 1) < __len && __comp(*__child_i, *(__child_i + 1))) {\n // right-child exists and is greater than left-child\n ++__child_i;\n ++__child;\n }\n\n // check if we are in heap-order\n if (__comp(*__child_i, *__start))\n // we are, __start is larger than it's largest child\n return;\n\n value_type __top(_VSTD::move(*__start));\n do\n {\n // we are not in heap-order, swap the parent with it's largest child\n *__start = _VSTD::move(*__child_i);\n __start = __child_i;\n\n if ((__len - 2) / 2 < __child)\n break;\n\n // recompute the child based off of the updated parent\n __child = 2 * __child + 1;\n __child_i = __first + __child;\n\n if ((__child + 1) < __len && __comp(*__child_i, *(__child_i + 1))) {\n // right-child exists and is greater than left-child\n ++__child_i;\n ++__child;\n }\n\n // check if we are in heap-order\n } while (!__comp(*__child_i, __top));\n *__start = _VSTD::move(__top);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\n__pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,\n typename iterator_traits<_RandomAccessIterator>::difference_type __len)\n{\n if (__len > 1)\n {\n swap(*__first, *--__last);\n __sift_down<_Compare>(__first, __last, __comp, __len - 1, __first);\n }\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\npop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n __pop_heap<_Comp_ref>(__first, __last, __c, __last - __first);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n __pop_heap<_Comp_ref>(__first, __last, __comp, __last - __first);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\npop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)\n{\n _VSTD::pop_heap(__first, __last, __less::value_type>());\n}\n\n// make_heap\n\ntemplate \nvoid\n__make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)\n{\n typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;\n difference_type __n = __last - __first;\n if (__n > 1)\n {\n // start from the first parent, there is no need to consider children\n for (difference_type __start = (__n - 2) / 2; __start >= 0; --__start)\n {\n __sift_down<_Compare>(__first, __last, __comp, __n, __first + __start);\n }\n }\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nmake_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n __make_heap<_Comp_ref>(__first, __last, __c);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n __make_heap<_Comp_ref>(__first, __last, __comp);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nmake_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)\n{\n _VSTD::make_heap(__first, __last, __less::value_type>());\n}\n\n// sort_heap\n\ntemplate \nvoid\n__sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)\n{\n typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;\n for (difference_type __n = __last - __first; __n > 1; --__last, --__n)\n __pop_heap<_Compare>(__first, __last, __comp, __n);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nsort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n __sort_heap<_Comp_ref>(__first, __last, __c);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n __sort_heap<_Comp_ref>(__first, __last, __comp);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nsort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)\n{\n _VSTD::sort_heap(__first, __last, __less::value_type>());\n}\n\n// partial_sort\n\ntemplate \nvoid\n__partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,\n _Compare __comp)\n{\n __make_heap<_Compare>(__first, __middle, __comp);\n typename iterator_traits<_RandomAccessIterator>::difference_type __len = __middle - __first;\n for (_RandomAccessIterator __i = __middle; __i != __last; ++__i)\n {\n if (__comp(*__i, *__first))\n {\n swap(*__i, *__first);\n __sift_down<_Compare>(__first, __middle, __comp, __len, __first);\n }\n }\n __sort_heap<_Compare>(__first, __middle, __comp);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\npartial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,\n _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n __partial_sort<_Comp_ref>(__first, __middle, __last, __c);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n __partial_sort<_Comp_ref>(__first, __middle, __last, __comp);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\npartial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last)\n{\n _VSTD::partial_sort(__first, __middle, __last,\n __less::value_type>());\n}\n\n// partial_sort_copy\n\ntemplate \n_RandomAccessIterator\n__partial_sort_copy(_InputIterator __first, _InputIterator __last,\n _RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp)\n{\n _RandomAccessIterator __r = __result_first;\n if (__r != __result_last)\n {\n for (; __first != __last && __r != __result_last; (void) ++__first, ++__r)\n *__r = *__first;\n __make_heap<_Compare>(__result_first, __r, __comp);\n typename iterator_traits<_RandomAccessIterator>::difference_type __len = __r - __result_first;\n for (; __first != __last; ++__first)\n if (__comp(*__first, *__result_first))\n {\n *__result_first = *__first;\n __sift_down<_Compare>(__result_first, __r, __comp, __len, __result_first);\n }\n __sort_heap<_Compare>(__result_first, __r, __comp);\n }\n return __r;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_RandomAccessIterator\npartial_sort_copy(_InputIterator __first, _InputIterator __last,\n _RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n return __partial_sort_copy<_Comp_ref>(__first, __last, __result_first, __result_last, __c);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n return __partial_sort_copy<_Comp_ref>(__first, __last, __result_first, __result_last, __comp);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_RandomAccessIterator\npartial_sort_copy(_InputIterator __first, _InputIterator __last,\n _RandomAccessIterator __result_first, _RandomAccessIterator __result_last)\n{\n return _VSTD::partial_sort_copy(__first, __last, __result_first, __result_last,\n __less::value_type>());\n}\n\n// nth_element\n\ntemplate \nvoid\n__nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp)\n{\n // _Compare is known to be a reference type\n typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;\n const difference_type __limit = 7;\n while (true)\n {\n __restart:\n if (__nth == __last)\n return;\n difference_type __len = __last - __first;\n switch (__len)\n {\n case 0:\n case 1:\n return;\n case 2:\n if (__comp(*--__last, *__first))\n swap(*__first, *__last);\n return;\n case 3:\n {\n _RandomAccessIterator __m = __first;\n _VSTD::__sort3<_Compare>(__first, ++__m, --__last, __comp);\n return;\n }\n }\n if (__len <= __limit)\n {\n __selection_sort<_Compare>(__first, __last, __comp);\n return;\n }\n // __len > __limit >= 3\n _RandomAccessIterator __m = __first + __len/2;\n _RandomAccessIterator __lm1 = __last;\n unsigned __n_swaps = _VSTD::__sort3<_Compare>(__first, __m, --__lm1, __comp);\n // *__m is median\n // partition [__first, __m) < *__m and *__m <= [__m, __last)\n // (this inhibits tossing elements equivalent to __m around unnecessarily)\n _RandomAccessIterator __i = __first;\n _RandomAccessIterator __j = __lm1;\n // j points beyond range to be tested, *__lm1 is known to be <= *__m\n // The search going up is known to be guarded but the search coming down isn't.\n // Prime the downward search with a guard.\n if (!__comp(*__i, *__m)) // if *__first == *__m\n {\n // *__first == *__m, *__first doesn't go in first part\n // manually guard downward moving __j against __i\n while (true)\n {\n if (__i == --__j)\n {\n // *__first == *__m, *__m <= all other elements\n // Parition instead into [__first, __i) == *__first and *__first < [__i, __last)\n ++__i; // __first + 1\n __j = __last;\n if (!__comp(*__first, *--__j)) // we need a guard if *__first == *(__last-1)\n {\n while (true)\n {\n if (__i == __j)\n return; // [__first, __last) all equivalent elements\n if (__comp(*__first, *__i))\n {\n swap(*__i, *__j);\n ++__n_swaps;\n ++__i;\n break;\n }\n ++__i;\n }\n }\n // [__first, __i) == *__first and *__first < [__j, __last) and __j == __last - 1\n if (__i == __j)\n return;\n while (true)\n {\n while (!__comp(*__first, *__i))\n ++__i;\n while (__comp(*__first, *--__j))\n ;\n if (__i >= __j)\n break;\n swap(*__i, *__j);\n ++__n_swaps;\n ++__i;\n }\n // [__first, __i) == *__first and *__first < [__i, __last)\n // The first part is sorted,\n if (__nth < __i)\n return;\n // __nth_element the secod part\n // __nth_element<_Compare>(__i, __nth, __last, __comp);\n __first = __i;\n goto __restart;\n }\n if (__comp(*__j, *__m))\n {\n swap(*__i, *__j);\n ++__n_swaps;\n break; // found guard for downward moving __j, now use unguarded partition\n }\n }\n }\n ++__i;\n // j points beyond range to be tested, *__lm1 is known to be <= *__m\n // if not yet partitioned...\n if (__i < __j)\n {\n // known that *(__i - 1) < *__m\n while (true)\n {\n // __m still guards upward moving __i\n while (__comp(*__i, *__m))\n ++__i;\n // It is now known that a guard exists for downward moving __j\n while (!__comp(*--__j, *__m))\n ;\n if (__i >= __j)\n break;\n swap(*__i, *__j);\n ++__n_swaps;\n // It is known that __m != __j\n // If __m just moved, follow it\n if (__m == __i)\n __m = __j;\n ++__i;\n }\n }\n // [__first, __i) < *__m and *__m <= [__i, __last)\n if (__i != __m && __comp(*__m, *__i))\n {\n swap(*__i, *__m);\n ++__n_swaps;\n }\n // [__first, __i) < *__i and *__i <= [__i+1, __last)\n if (__nth == __i)\n return;\n if (__n_swaps == 0)\n {\n // We were given a perfectly partitioned sequence. Coincidence?\n if (__nth < __i)\n {\n // Check for [__first, __i) already sorted\n __j = __m = __first;\n while (++__j != __i)\n {\n if (__comp(*__j, *__m))\n // not yet sorted, so sort\n goto not_sorted;\n __m = __j;\n }\n // [__first, __i) sorted\n return;\n }\n else\n {\n // Check for [__i, __last) already sorted\n __j = __m = __i;\n while (++__j != __last)\n {\n if (__comp(*__j, *__m))\n // not yet sorted, so sort\n goto not_sorted;\n __m = __j;\n }\n // [__i, __last) sorted\n return;\n }\n }\nnot_sorted:\n // __nth_element on range containing __nth\n if (__nth < __i)\n {\n // __nth_element<_Compare>(__first, __nth, __i, __comp);\n __last = __i;\n }\n else\n {\n // __nth_element<_Compare>(__i+1, __nth, __last, __comp);\n __first = ++__i;\n }\n }\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nnth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n __nth_element<_Comp_ref>(__first, __nth, __last, __c);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n __nth_element<_Comp_ref>(__first, __nth, __last, __comp);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nvoid\nnth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last)\n{\n _VSTD::nth_element(__first, __nth, __last, __less::value_type>());\n}\n\n// includes\n\ntemplate \nbool\n__includes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2,\n _Compare __comp)\n{\n for (; __first2 != __last2; ++__first1)\n {\n if (__first1 == __last1 || __comp(*__first2, *__first1))\n return false;\n if (!__comp(*__first1, *__first2))\n ++__first2;\n }\n return true;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\nincludes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2,\n _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n return __includes<_Comp_ref>(__first1, __last1, __first2, __last2, __c);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n return __includes<_Comp_ref>(__first1, __last1, __first2, __last2, __comp);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\nincludes(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2)\n{\n return _VSTD::includes(__first1, __last1, __first2, __last2,\n __less::value_type,\n typename iterator_traits<_InputIterator2>::value_type>());\n}\n\n// set_union\n\ntemplate \n_OutputIterator\n__set_union(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)\n{\n for (; __first1 != __last1; ++__result)\n {\n if (__first2 == __last2)\n return _VSTD::copy(__first1, __last1, __result);\n if (__comp(*__first2, *__first1))\n {\n *__result = *__first2;\n ++__first2;\n }\n else\n {\n *__result = *__first1;\n if (!__comp(*__first1, *__first2))\n ++__first2;\n ++__first1;\n }\n }\n return _VSTD::copy(__first2, __last2, __result);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\nset_union(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n return __set_union<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __c);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n return __set_union<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\nset_union(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)\n{\n return _VSTD::set_union(__first1, __last1, __first2, __last2, __result,\n __less::value_type,\n typename iterator_traits<_InputIterator2>::value_type>());\n}\n\n// set_intersection\n\ntemplate \n_OutputIterator\n__set_intersection(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)\n{\n while (__first1 != __last1 && __first2 != __last2)\n {\n if (__comp(*__first1, *__first2))\n ++__first1;\n else\n {\n if (!__comp(*__first2, *__first1))\n {\n *__result = *__first1;\n ++__result;\n ++__first1;\n }\n ++__first2;\n }\n }\n return __result;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\nset_intersection(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n return __set_intersection<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __c);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n return __set_intersection<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\nset_intersection(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)\n{\n return _VSTD::set_intersection(__first1, __last1, __first2, __last2, __result,\n __less::value_type,\n typename iterator_traits<_InputIterator2>::value_type>());\n}\n\n// set_difference\n\ntemplate \n_OutputIterator\n__set_difference(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)\n{\n while (__first1 != __last1)\n {\n if (__first2 == __last2)\n return _VSTD::copy(__first1, __last1, __result);\n if (__comp(*__first1, *__first2))\n {\n *__result = *__first1;\n ++__result;\n ++__first1;\n }\n else\n {\n if (!__comp(*__first2, *__first1))\n ++__first1;\n ++__first2;\n }\n }\n return __result;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\nset_difference(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n return __set_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __c);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n return __set_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\nset_difference(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)\n{\n return _VSTD::set_difference(__first1, __last1, __first2, __last2, __result,\n __less::value_type,\n typename iterator_traits<_InputIterator2>::value_type>());\n}\n\n// set_symmetric_difference\n\ntemplate \n_OutputIterator\n__set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)\n{\n while (__first1 != __last1)\n {\n if (__first2 == __last2)\n return _VSTD::copy(__first1, __last1, __result);\n if (__comp(*__first1, *__first2))\n {\n *__result = *__first1;\n ++__result;\n ++__first1;\n }\n else\n {\n if (__comp(*__first2, *__first1))\n {\n *__result = *__first2;\n ++__result;\n }\n else\n ++__first1;\n ++__first2;\n }\n }\n return _VSTD::copy(__first2, __last2, __result);\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\nset_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n return __set_symmetric_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __c);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n return __set_symmetric_difference<_Comp_ref>(__first1, __last1, __first2, __last2, __result, __comp);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\n_OutputIterator\nset_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result)\n{\n return _VSTD::set_symmetric_difference(__first1, __last1, __first2, __last2, __result,\n __less::value_type,\n typename iterator_traits<_InputIterator2>::value_type>());\n}\n\n// lexicographical_compare\n\ntemplate \nbool\n__lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)\n{\n for (; __first2 != __last2; ++__first1, (void) ++__first2)\n {\n if (__first1 == __last1 || __comp(*__first1, *__first2))\n return true;\n if (__comp(*__first2, *__first1))\n return false;\n }\n return false;\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\nlexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n return __lexicographical_compare<_Comp_ref>(__first1, __last1, __first2, __last2, __c);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n return __lexicographical_compare<_Comp_ref>(__first1, __last1, __first2, __last2, __comp);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\nlexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,\n _InputIterator2 __first2, _InputIterator2 __last2)\n{\n return _VSTD::lexicographical_compare(__first1, __last1, __first2, __last2,\n __less::value_type,\n typename iterator_traits<_InputIterator2>::value_type>());\n}\n\n// next_permutation\n\ntemplate \nbool\n__next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)\n{\n _BidirectionalIterator __i = __last;\n if (__first == __last || __first == --__i)\n return false;\n while (true)\n {\n _BidirectionalIterator __ip1 = __i;\n if (__comp(*--__i, *__ip1))\n {\n _BidirectionalIterator __j = __last;\n while (!__comp(*__i, *--__j))\n ;\n swap(*__i, *__j);\n _VSTD::reverse(__ip1, __last);\n return true;\n }\n if (__i == __first)\n {\n _VSTD::reverse(__first, __last);\n return false;\n }\n }\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\nnext_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n return __next_permutation<_Comp_ref>(__first, __last, __c);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n return __next_permutation<_Comp_ref>(__first, __last, __comp);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\nnext_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)\n{\n return _VSTD::next_permutation(__first, __last,\n __less::value_type>());\n}\n\n// prev_permutation\n\ntemplate \nbool\n__prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)\n{\n _BidirectionalIterator __i = __last;\n if (__first == __last || __first == --__i)\n return false;\n while (true)\n {\n _BidirectionalIterator __ip1 = __i;\n if (__comp(*__ip1, *--__i))\n {\n _BidirectionalIterator __j = __last;\n while (!__comp(*--__j, *__i))\n ;\n swap(*__i, *__j);\n _VSTD::reverse(__ip1, __last);\n return true;\n }\n if (__i == __first)\n {\n _VSTD::reverse(__first, __last);\n return false;\n }\n }\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\nprev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)\n{\n#ifdef _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;\n __debug_less<_Compare> __c(__comp);\n return __prev_permutation<_Comp_ref>(__first, __last, __c);\n#else // _LIBCPP_DEBUG\n typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;\n return __prev_permutation<_Comp_ref>(__first, __last, __comp);\n#endif // _LIBCPP_DEBUG\n}\n\ntemplate \ninline _LIBCPP_INLINE_VISIBILITY\nbool\nprev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)\n{\n return _VSTD::prev_permutation(__first, __last,\n __less::value_type>());\n}\n\n_LIBCPP_END_NAMESPACE_STD\n\n#endif // _LIBCPP_ALGORITHM\n","// -*- C++ -*-\n//===-------------------------- memory ------------------------------------===//\n//\n// The LLVM Compiler Infrastructure\n//\n// This file is dual licensed under the MIT and the University of Illinois Open\n// Source Licenses. See LICENSE.TXT for details.\n//\n//===----------------------------------------------------------------------===//\n\n#ifndef _LIBCPP_MEMORY\n#define _LIBCPP_MEMORY\n\n/*\n memory synopsis\n\nnamespace std\n{\n\nstruct allocator_arg_t { };\nconstexpr allocator_arg_t allocator_arg = allocator_arg_t();\n\ntemplate struct uses_allocator;\n\ntemplate \nstruct pointer_traits\n{\n typedef Ptr pointer;\n typedef
element_type;\n typedef
difference_type;\n\n template using rebind =
;\n\n static pointer pointer_to(
);\n};\n\ntemplate \nstruct pointer_traits\n{\n typedef T* pointer;\n typedef T element_type;\n typedef ptrdiff_t difference_type;\n\n template using rebind = U*;\n\n static pointer pointer_to(
) noexcept;\n};\n\ntemplate \nstruct allocator_traits\n{\n typedef Alloc allocator_type;\n typedef typename allocator_type::value_type\n value_type;\n\n typedef Alloc::pointer | value_type* pointer;\n typedef Alloc::const_pointer\n | pointer_traits::rebind\n const_pointer;\n typedef Alloc::void_pointer\n | pointer_traits::rebind\n void_pointer;\n typedef Alloc::const_void_pointer\n | pointer_traits::rebind\n const_void_pointer;\n typedef Alloc::difference_type\n | pointer_traits::difference_type\n difference_type;\n typedef Alloc::size_type\n | make_unsigned::type\n size_type;\n typedef Alloc::propagate_on_container_copy_assignment\n | false_type propagate_on_container_copy_assignment;\n typedef Alloc::propagate_on_container_move_assignment\n | false_type propagate_on_container_move_assignment;\n typedef Alloc::propagate_on_container_swap\n | false_type propagate_on_container_swap;\n typedef Alloc::is_always_equal\n | is_empty is_always_equal;\n\n template using rebind_alloc = Alloc::rebind::other | Alloc;\n template using rebind_traits = allocator_traits>;\n\n static pointer allocate(allocator_type& a, size_type n);\n static pointer allocate(allocator_type& a, size_type n, const_void_pointer hint);\n\n static void deallocate(allocator_type& a, pointer p, size_type n) noexcept;\n\n template \n static void construct(allocator_type& a, T* p, Args&&... args);\n\n template \n static void destroy(allocator_type& a, T* p);\n\n static size_type max_size(const allocator_type& a); // noexcept in C++14\n\n static allocator_type\n select_on_container_copy_construction(const allocator_type& a);\n};\n\ntemplate <>\nclass allocator\n{\npublic:\n typedef void* pointer;\n typedef const void* const_pointer;\n typedef void value_type;\n\n template struct rebind {typedef allocator<_Up> other;};\n};\n\ntemplate \nclass allocator\n{\npublic:\n typedef size_t size_type;\n typedef ptrdiff_t difference_type;\n typedef T* pointer;\n typedef const T* const_pointer;\n typedef typename add_lvalue_reference::type reference;\n typedef typename add_lvalue_reference::type const_reference;\n typedef T value_type;\n\n template struct rebind {typedef allocator other;};\n\n allocator() noexcept;\n allocator(const allocator&) noexcept;\n template allocator(const allocator&) noexcept;\n ~allocator();\n pointer address(reference x) const noexcept;\n const_pointer address(const_reference x) const noexcept;\n pointer allocate(size_type, allocator::const_pointer hint = 0);\n void deallocate(pointer p, size_type n) noexcept;\n size_type max_size() const noexcept;\n template\n void construct(U* p, Args&&... args);\n template \n void destroy(U* p);\n};\n\ntemplate \nbool operator==(const allocator&, const allocator&) noexcept;\n\ntemplate \nbool operator!=(const allocator&, const allocator&) noexcept;\n\ntemplate \nclass raw_storage_iterator\n : public iterator // purposefully not C++03\n{\npublic:\n explicit raw_storage_iterator(OutputIterator x);\n raw_storage_iterator& operator*();\n raw_storage_iterator& operator=(const T& element);\n raw_storage_iterator& operator++();\n raw_storage_iterator operator++(int);\n};\n\ntemplate pair get_temporary_buffer(ptrdiff_t n) noexcept;\ntemplate void return_temporary_buffer(T* p) noexcept;\n\ntemplate T* addressof(T& r) noexcept;\ntemplate T* addressof(const T&& r) noexcept = delete;\n\ntemplate \nForwardIterator\nuninitialized_copy(InputIterator first, InputIterator last, ForwardIterator result);\n\ntemplate \nForwardIterator\nuninitialized_copy_n(InputIterator first, Size n, ForwardIterator result);\n\ntemplate \nvoid uninitialized_fill(ForwardIterator first, ForwardIterator last, const T& x);\n\ntemplate \nForwardIterator\nuninitialized_fill_n(ForwardIterator first, Size n, const T& x);\n\ntemplate \nvoid destroy_at(T* location);\n\ntemplate \n void destroy(ForwardIterator first, ForwardIterator last);\n\ntemplate \n ForwardIterator destroy_n(ForwardIterator first, Size n);\n\ntemplate \n ForwardIterator uninitialized_move(InputIterator first, InputIterator last, ForwardIterator result);\n\ntemplate \n pair uninitialized_move_n(InputIterator first, Size n, ForwardIterator result);\n\ntemplate \n void uninitialized_value_construct(ForwardIterator first, ForwardIterator last);\n\ntemplate \n ForwardIterator uninitialized_value_construct_n(ForwardIterator first, Size n);\n\ntemplate \n void uninitialized_default_construct(ForwardIterator first, ForwardIterator last);\n\ntemplate \n ForwardIterator uninitialized_default_construct_n(ForwardIterator first, Size n);\n\ntemplate struct auto_ptr_ref {};\n\ntemplate\nclass auto_ptr\n{\npublic:\n typedef X element_type;\n\n explicit auto_ptr(X* p =0) throw();\n auto_ptr(auto_ptr&) throw();\n template auto_ptr(auto_ptr&) throw();\n auto_ptr& operator=(auto_ptr&) throw();\n template auto_ptr& operator=(auto_ptr&) throw();\n auto_ptr& operator=(auto_ptr_ref r) throw();\n ~auto_ptr() throw();\n\n typename add_lvalue_reference::type operator*() const throw();\n X* operator->() const throw();\n X* get() const throw();\n X* release() throw();\n void reset(X* p =0) throw();\n\n auto_ptr(auto_ptr_ref) throw();\n template operator auto_ptr_ref() throw();\n template operator auto_ptr() throw();\n};\n\ntemplate \nstruct default_delete\n{\n constexpr default_delete() noexcept = default;\n template default_delete(const default_delete&) noexcept;\n\n void operator()(T*) const noexcept;\n};\n\ntemplate \nstruct default_delete\n{\n constexpr default_delete() noexcept = default;\n void operator()(T*) const noexcept;\n template void operator()(U*) const = delete;\n};\n\ntemplate >\nclass unique_ptr\n{\npublic:\n typedef see below pointer;\n typedef T element_type;\n typedef D deleter_type;\n\n // constructors\n constexpr unique_ptr() noexcept;\n explicit unique_ptr(pointer p) noexcept;\n unique_ptr(pointer p, see below d1) noexcept;\n unique_ptr(pointer p, see below d2) noexcept;\n unique_ptr(unique_ptr&& u) noexcept;\n unique_ptr(nullptr_t) noexcept : unique_ptr() { }\n template \n unique_ptr(unique_ptr&& u) noexcept;\n template \n unique_ptr(auto_ptr&& u) noexcept;\n\n // destructor\n ~unique_ptr();\n\n // assignment\n unique_ptr& operator=(unique_ptr&& u) noexcept;\n template unique_ptr& operator=(unique_ptr&& u) noexcept;\n unique_ptr& operator=(nullptr_t) noexcept;\n\n // observers\n typename add_lvalue_reference::type operator*() const;\n pointer operator->() const noexcept;\n pointer get() const noexcept;\n deleter_type& get_deleter() noexcept;\n const deleter_type& get_deleter() const noexcept;\n explicit operator bool() const noexcept;\n\n // modifiers\n pointer release() noexcept;\n void reset(pointer p = pointer()) noexcept;\n void swap(unique_ptr& u) noexcept;\n};\n\ntemplate \nclass unique_ptr\n{\npublic:\n typedef implementation-defined pointer;\n typedef T element_type;\n typedef D deleter_type;\n\n // constructors\n constexpr unique_ptr() noexcept;\n explicit unique_ptr(pointer p) noexcept;\n unique_ptr(pointer p, see below d) noexcept;\n unique_ptr(pointer p, see below d) noexcept;\n unique_ptr(unique_ptr&& u) noexcept;\n unique_ptr(nullptr_t) noexcept : unique_ptr() { }\n\n // destructor\n ~unique_ptr();\n\n // assignment\n unique_ptr& operator=(unique_ptr&& u) noexcept;\n unique_ptr& operator=(nullptr_t) noexcept;\n\n // observers\n T& operator[](size_t i) const;\n pointer get() const noexcept;\n deleter_type& get_deleter() noexcept;\n const deleter_type& get_deleter() const noexcept;\n explicit operator bool() const noexcept;\n\n // modifiers\n pointer release() noexcept;\n void reset(pointer p = pointer()) noexcept;\n void reset(nullptr_t) noexcept;\n template void reset(U) = delete;\n void swap(unique_ptr& u) noexcept;\n};\n\ntemplate \n void swap(unique_ptr& x, unique_ptr& y) noexcept;\n\ntemplate \n bool operator==(const unique_ptr& x, const unique_ptr& y);\ntemplate \n bool operator!=(const unique_ptr& x, const unique_ptr& y);\ntemplate \n bool operator<(const unique_ptr& x, const unique_ptr& y);\ntemplate \n bool operator<=(const unique_ptr& x, const unique_ptr& y);\ntemplate \n bool operator>(const unique_ptr& x, const unique_ptr& y);\ntemplate \n bool operator>=(const unique_ptr& x, const unique_ptr& y);\n\ntemplate \n bool operator==(const unique_ptr& x, nullptr_t) noexcept;\ntemplate \n bool operator==(nullptr_t, const unique_ptr& y) noexcept;\ntemplate \n bool operator!=(const unique_ptr& x, nullptr_t) noexcept;\ntemplate \n bool operator!=(nullptr_t, const unique_ptr& y) noexcept;\n\ntemplate \n bool operator<(const unique_ptr& x, nullptr_t);\ntemplate \n bool operator<(nullptr_t, const unique_ptr& y);\ntemplate \n bool operator<=(const unique_ptr& x, nullptr_t);\ntemplate \n bool operator<=(nullptr_t, const unique_ptr& y);\ntemplate \n bool operator>(const unique_ptr& x, nullptr_t);\ntemplate \n bool operator>(nullptr_t, const unique_ptr& y);\ntemplate \n bool operator>=(const unique_ptr& x, nullptr_t);\ntemplate \n bool operator>=(nullptr_t, const unique_ptr& y);\n\nclass bad_weak_ptr\n : public std::exception\n{\n bad_weak_ptr() noexcept;\n};\n\ntemplate unique_ptr make_unique(Args&&... args); // C++14\ntemplate unique_ptr make_unique(size_t n); // C++14\ntemplate unspecified make_unique(Args&&...) = delete; // C++14, T == U[N]\n\ntemplate\nclass shared_ptr\n{\npublic:\n typedef T element_type;\n typedef weak_ptr weak_type; // C++17\n\n // constructors:\n constexpr shared_ptr() noexcept;\n template explicit shared_ptr(Y* p);\n template shared_ptr(Y* p, D d);\n template shared_ptr(Y* p, D d, A a);\n template shared_ptr(nullptr_t p, D d);\n template shared_ptr(nullptr_t p, D d, A a);\n template shared_ptr(const shared_ptr& r, T *p) noexcept;\n shared_ptr(const shared_ptr& r) noexcept;\n template shared_ptr(const shared_ptr& r) noexcept;\n shared_ptr(shared_ptr&& r) noexcept;\n template shared_ptr(shared_ptr&& r) noexcept;\n template explicit shared_ptr(const weak_ptr& r);\n template shared_ptr(auto_ptr&& r);\n template shared_ptr(unique_ptr&& r);\n shared_ptr(nullptr_t) : shared_ptr() { }\n\n // destructor:\n ~shared_ptr();\n\n // assignment:\n shared_ptr& operator=(const shared_ptr& r) noexcept;\n template shared_ptr& operator=(const shared_ptr& r) noexcept;\n shared_ptr& operator=(shared_ptr&& r) noexcept;\n template shared_ptr& operator=(shared_ptr&& r);\n template shared_ptr& operator=(auto_ptr&& r);\n template shared_ptr& operator=(unique_ptr&& r);\n\n // modifiers:\n void swap(shared_ptr& r) noexcept;\n void reset() noexcept;\n template void reset(Y* p);\n template void reset(Y* p, D d);\n template void reset(Y* p, D d, A a);\n\n // observers:\n T* get() const noexcept;\n T& operator*() const noexcept;\n T* operator->() const noexcept;\n long use_count() const noexcept;\n bool unique() const noexcept;\n explicit operator bool() const noexcept;\n template bool owner_before(shared_ptr const& b) const;\n template bool owner_before(weak_ptr const& b) const;\n};\n\n// shared_ptr comparisons:\ntemplate\n bool operator==(shared_ptr const& a, shared_ptr const& b) noexcept;\ntemplate\n bool operator!=(shared_ptr const& a, shared_ptr const& b) noexcept;\ntemplate\n bool operator<(shared_ptr const& a, shared_ptr const& b) noexcept;\ntemplate\n bool operator>(shared_ptr const& a, shared_ptr const& b) noexcept;\ntemplate\n bool operator<=(shared_ptr const& a, shared_ptr const& b) noexcept;\ntemplate\n bool operator>=(shared_ptr const& a, shared_ptr const& b) noexcept;\n\ntemplate \n bool operator==(const shared_ptr& x, nullptr_t) noexcept;\ntemplate \n bool operator==(nullptr_t, const shared_ptr& y) noexcept;\ntemplate \n bool operator!=(const shared_ptr& x, nullptr_t) noexcept;\ntemplate \n bool operator!=(nullptr_t, const shared_ptr& y) noexcept;\ntemplate \n bool operator<(const shared_ptr& x, nullptr_t) noexcept;\ntemplate \nbool operator<(nullptr_t, const shared_ptr& y) noexcept;\ntemplate \n bool operator<=(const shared_ptr& x, nullptr_t) noexcept;\ntemplate \n bool operator<=(nullptr_t, const shared_ptr& y) noexcept;\ntemplate \n bool operator>(const shared_ptr& x, nullptr_t) noexcept;\ntemplate \n bool operator>(nullptr_t, const shared_ptr& y) noexcept;\ntemplate \n bool operator>=(const shared_ptr& x, nullptr_t) noexcept;\ntemplate \n bool operator>=(nullptr_t, const shared_ptr& y) noexcept;\n\n// shared_ptr specialized algorithms:\ntemplate void swap(shared_ptr& a, shared_ptr& b) noexcept;\n\n// shared_ptr casts:\ntemplate\n shared_ptr static_pointer_cast(shared_ptr const& r) noexcept;\ntemplate\n shared_ptr dynamic_pointer_cast(shared_ptr const& r) noexcept;\ntemplate\n shared_ptr const_pointer_cast(shared_ptr const& r) noexcept;\n\n// shared_ptr I/O:\ntemplate\n basic_ostream& operator<< (basic_ostream& os, shared_ptr const& p);\n\n// shared_ptr get_deleter:\ntemplate D* get_deleter(shared_ptr const& p) noexcept;\n\ntemplate\n shared_ptr make_shared(Args&&... args);\ntemplate\n shared_ptr allocate_shared(const A& a, Args&&... args);\n\ntemplate\nclass weak_ptr\n{\npublic:\n typedef T element_type;\n\n // constructors\n constexpr weak_ptr() noexcept;\n template weak_ptr(shared_ptr const& r) noexcept;\n weak_ptr(weak_ptr const& r) noexcept;\n template weak_ptr(weak_ptr const& r) noexcept;\n weak_ptr(weak_ptr&& r) noexcept; // C++14\n template weak_ptr(weak_ptr&& r) noexcept; // C++14\n\n // destructor\n ~weak_ptr();\n\n // assignment\n weak_ptr& operator=(weak_ptr const& r) noexcept;\n template weak_ptr& operator=(weak_ptr const& r) noexcept;\n template weak_ptr& operator=(shared_ptr const& r) noexcept;\n weak_ptr& operator=(weak_ptr&& r) noexcept; // C++14\n template weak_ptr& operator=(weak_ptr&& r) noexcept; // C++14\n\n // modifiers\n void swap(weak_ptr& r) noexcept;\n void reset() noexcept;\n\n // observers\n long use_count() const noexcept;\n bool expired() const noexcept;\n shared_ptr lock() const noexcept;\n template bool owner_before(shared_ptr const& b) const;\n template bool owner_before(weak_ptr const& b) const;\n};\n\n// weak_ptr specialized algorithms:\ntemplate void swap(weak_ptr& a, weak_ptr& b) noexcept;\n\n// class owner_less:\ntemplate struct owner_less;\n\ntemplate\nstruct owner_less>\n : binary_function, shared_ptr, bool>\n{\n typedef bool result_type;\n bool operator()(shared_ptr const&, shared_ptr const&) const;\n bool operator()(shared_ptr const&, weak_ptr const&) const;\n bool operator()(weak_ptr const&, shared_ptr const&) const;\n};\n\ntemplate\nstruct owner_less>\n : binary_function, weak_ptr, bool>\n{\n typedef bool result_type;\n bool operator()(weak_ptr const&, weak_ptr const&) const;\n bool operator()(shared_ptr const&, weak_ptr const&) const;\n bool operator()(weak_ptr const&, shared_ptr const&) const;\n};\n\ntemplate\nclass enable_shared_from_this\n{\nprotected:\n constexpr enable_shared_from_this() noexcept;\n enable_shared_from_this(enable_shared_from_this const&) noexcept;\n enable_shared_from_this& operator=(enable_shared_from_this const&) noexcept;\n ~enable_shared_from_this();\npublic:\n shared_ptr shared_from_this();\n shared_ptr shared_from_this() const;\n};\n\ntemplate\n bool atomic_is_lock_free(const shared_ptr* p);\ntemplate\n shared_ptr atomic_load(const shared_ptr* p);\ntemplate\n shared_ptr atomic_load_explicit(const shared_ptr* p, memory_order mo);\ntemplate\n void atomic_store(shared_ptr* p, shared_ptr r);\ntemplate\n void atomic_store_explicit(shared_ptr* p, shared_ptr r, memory_order mo);\ntemplate\n shared_ptr atomic_exchange(shared_ptr* p, shared_ptr r);\ntemplate\n shared_ptr\n atomic_exchange_explicit(shared_ptr* p, shared_ptr r, memory_order mo);\ntemplate\n bool\n atomic_compare_exchange_weak(shared_ptr* p, shared_ptr* v, shared_ptr w);\ntemplate\n bool\n atomic_compare_exchange_strong( shared_ptr* p, shared_ptr* v, shared_ptr w);\ntemplate\n bool\n atomic_compare_exchange_weak_explicit(shared_ptr* p, shared_ptr* v,\n shared_ptr w, memory_order success,\n memory_order failure);\ntemplate\n bool\n atomic_compare_exchange_strong_explicit(shared_ptr* p, shared_ptr* v,\n shared_ptr w, memory_order success,\n memory_order failure);\n// Hash support\ntemplate struct hash;\ntemplate struct hash >;\ntemplate struct hash >;\n\n// Pointer safety\nenum class pointer_safety { relaxed, preferred, strict };\nvoid declare_reachable(void *p);\ntemplate T *undeclare_reachable(T *p);\nvoid declare_no_pointers(char *p, size_t n);\nvoid undeclare_no_pointers(char *p, size_t n);\npointer_safety get_pointer_safety() noexcept;\n\nvoid* align(size_t alignment, size_t size, void*& ptr, size_t& space);\n\n} // std\n\n*/\n\n#include <__config>\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include <__functional_base>\n#include \n#include \n#include \n#include \n\n#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)\n# include \n#endif\n\n#include <__undef_min_max>\n\n#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)\n#pragma GCC system_header\n#endif\n\n_LIBCPP_BEGIN_NAMESPACE_STD\n\ntemplate \ninline _LIBCPP_ALWAYS_INLINE\n_ValueType __libcpp_relaxed_load(_ValueType const* __value) {\n#if !defined(_LIBCPP_HAS_NO_THREADS) && \\\n defined(__ATOMIC_RELAXED) && \\\n (__has_builtin(__atomic_load_n) || _GNUC_VER >= 407)\n return __atomic_load_n(__value, __ATOMIC_RELAXED);\n#else\n return *__value;\n#endif\n}\n\ntemplate \ninline _LIBCPP_ALWAYS_INLINE\n_ValueType __libcpp_acquire_load(_ValueType const* __value) {\n#if !defined(_LIBCPP_HAS_NO_THREADS) && \\\n defined(__ATOMIC_ACQUIRE) && \\\n (__has_builtin(__atomic_load_n) || _GNUC_VER >= 407)\n return __atomic_load_n(__value, __ATOMIC_ACQUIRE);\n#else\n return *__value;\n#endif\n}\n\n// addressof moved to \n\ntemplate class allocator;\n\ntemplate <>\nclass _LIBCPP_TEMPLATE_VIS allocator\n{\npublic:\n typedef void* pointer;\n typedef const void* const_pointer;\n typedef void value_type;\n\n template struct rebind {typedef allocator<_Up> other;};\n};\n\ntemplate <>\nclass _LIBCPP_TEMPLATE_VIS allocator\n{\npublic:\n typedef const void* pointer;\n typedef const void* const_pointer;\n typedef const void value_type;\n\n template struct rebind {typedef allocator<_Up> other;};\n};\n\n// pointer_traits\n\ntemplate \nstruct __has_element_type\n{\nprivate:\n struct __two {char __lx; char __lxx;};\n template static __two __test(...);\n template static char __test(typename _Up::element_type* = 0);\npublic:\n static const bool value = sizeof(__test<_Tp>(0)) == 1;\n};\n\ntemplate ::value>\nstruct __pointer_traits_element_type;\n\ntemplate \nstruct __pointer_traits_element_type<_Ptr, true>\n{\n typedef typename _Ptr::element_type type;\n};\n\n#ifndef _LIBCPP_HAS_NO_VARIADICS\n\ntemplate